Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 18:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Mini-Guide] Fixing AOE attack calculations in 4267 source

Discussion on [Mini-Guide] Fixing AOE attack calculations in 4267 source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
[Mini-Guide] Fixing AOE attack calculations in 4267 source

Ok so not a huge release but figured I'd explain how to fix the magic aoe attacks. Best viewed as a way to fix voids yourself but w/e, I know no one will really pay that much attention to it.


Problem in source: Area attacks do not have any damage type in their attack void (by default they are all physical damage). because of this slight oversight, fire circle/pervade and other area attacks all calculate as PH dmg and therefor are vastly wrong (although using pervade on a tro is rather funny xD)

Steps to fix it:

Modify the attack void:

The original AreaTargets attack void will start something like this...
Code:
static void AreaTargets(COClient Client, int Distance, ref Dictionary<uint, int> Targets, Struct.CharSkill Spell)
This is all well and good but notice there is no attack type used. We want to change it to look something like...


Code:
static void AreaTargets(COClient Client, int Distance, ref Dictionary<uint, int> Targets, Struct.CharSkill Spell, int Type)
Notice at the very end we have added int Type. This name is arbitrary and could be anything you want but type kinda makes sense so we'll go with that.

Look further down in that code and simply change it to have damage type.

Code:
int Damage = Calculation.Damage(Client.Char, AClient.Char, 2, Spell.ID, Spell.Level);
This simply needs to be replaced so that it's not hard coded to be physical damage (the 2)

with...
Code:
int Damage = Calculation.Damage(Client.Char, AClient.Char, Type, Spell.ID, Spell.Level);
This means we are using the Type input into the attack void and putting it into the damage calculation.


Modify the individual skills to conform to the new void:
Handler>Attack.cs contains the data for attack calculations.

In this case

Code:
case 3090:
                case 1120:
                    {
                        #region FireCircle n Pervade
                        Dictionary<uint, int> Targets = new Dictionary<uint, int>();
                        AreaTargets(Client, Spell.Level + 10, ref Targets, Spell);
                        ConquerPacket.ToLocal(ConquerPacket.MagicAttack(Client.Char.ID, Spell.ID, Spell.Level, Targets, Client.Char.X, Client.Char.Y), Client.Char.X, Client.Char.Y, (int)Client.Char.Map, 0, 0);
                        break;
                        #endregion
                    }
This is the original code for pervade and fire circle (3090 and 1120)

In the end it will look something like this (yay copypaste?!)

Code:
case 3090:
                case 1120:
                    {
                        #region FireCircle n Pervade
                        Dictionary<uint, int> Targets = new Dictionary<uint, int>();
                        AreaTargets(Client, Spell.Level + 10, ref Targets, Spell, 21);
                        ConquerPacket.ToLocal(ConquerPacket.MagicAttack(Client.Char.ID, Spell.ID, Spell.Level, Targets, Client.Char.X, Client.Char.Y), Client.Char.X, Client.Char.Y, (int)Client.Char.Map, 0, 0);
                        break;
                        #endregion

                    }
The only real difference here is AreaTargets(Client, Spell.Level + 10, ref Targets, Spell, 21);. That simply means it is using the AreaTargets void to calculate damage. In this case it is using attack type 21 (magic attack) this can be changed to physical damage or archer damage depending on how you want the skill to be calculated.



And that's really all there is to it. you will need to modify every AreaTargets attack in the source by adding attack type to the end of the string (exactly like we did for fire circle/pervade)


Hope that helps some people. Not super complicated and not a ton of people using the 1.0 source but still somewhat useful to know how to do.


[Minor Note]

Attack types: 2 = Physical, 21 = Magical, 25 = bow.

Mana cost for spells are stored in Calculation.cs

Eg for fire circle

Code:
case 1120://FireCircle - MP Check
                    {
                        int ManaCost = 0;
                        if (MagicLevel == 0)
                            ManaCost = 150;
                        else if (MagicLevel == 1)
                            ManaCost = 170;
                        else if (MagicLevel == 2)
                            ManaCost = 190;
                        else if (MagicLevel == 3)
                            ManaCost = 210;
                        if (Client.Char.CurrentMP < ManaCost)
                        {

                            return false;
                        }
                        else
                        {
                            Client.Char.CurrentMP -= ManaCost;
                            Client.SendData(ConquerPacket.Status(Client, Client.Char.CurrentMP, Struct.StatusTypes.Mp));
                            return true;
                        }
                    }

Also in calculation.cs is the code controlling magic dmg boost from spells. (higher lvl nado does more dmg etc)

Eg: Fire circle
Code:
case 1120: //Fire Circle
                    {
                        if (Level == 0)
                            return 540;
                        if (Level == 1)
                            return 650;
                        if (Level == 2)
                            return 720;
                        if (Level == 3)
                            return 770;
                        break;
                    }

Again, hope it helps some.
pro4never is offline  
Thanks
3 Users
Old 12/11/2009, 09:12   #2
 
Sp!!ke's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
nice pro ! good work
Sp!!ke is offline  
Old 12/11/2009, 09:58   #3
 
L1nk1n*P4rK's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 303
Received Thanks: 39
Good Work
L1nk1n*P4rK is offline  
Reply


Similar Threads Similar Threads
Fixing Attack/Run Speed!
06/07/2010 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 1 Replies
Hello everybody,sorry for wrong sector. I want to ask a question.I made a hack that changes my attack and run speed.But attack speed logouts me.. and run speed teleports me back while running. I think it needs a fix.. In UG 8.0, there is a Attack/Run Fix,, if we disable it , it logouts and teleports back , too. Can anybody tell me how can i fix it? Please answer. i need an answer too much.Please help me.. Thanks
[Request] a Simple Connection/setup Guide for 4267 Source
03/05/2010 - CO2 Private Server - 3 Replies
Okay, So I'm asking if someone could post a simple guide how to get 4267 running. I used search button, and didn't see any guides. Well, I saw one, but I'm having some errors while i'm trying to Pu that dot sql file in Navicat or phpMyAdmin.. some errors about Classes like mm 'Archer', '1', 0'. 5', <--- something like that, but gives me a plenty of errors for some reason. But Yeah, If someone could post a easy and simple guide, I'd appreciate.
Where can I get a version 4267 source?
03/02/2010 - CO2 Private Server - 4 Replies
^^^^^^TITLE^^^^^^
Map Problem with the 4267 Source
12/12/2009 - CO2 Private Server - 11 Replies
Hey! I need help =\ I downloaded the 4267 source and found out that the map had quadrant lines all over it. This is the download location for the source and for the client. The database connection is located in the code: DatabaseConnection = new MySqlConnection("Server=localhost;Database='c onquer_server';Username='root';Password='root'&quo t;); The database sql file is below in the attachment. Please help me, i know a bit of coding but I couldn't find anything wrong =[ PS: I need the 4268...
[HELP] ATTACK CALCULATIONS
02/10/2009 - CO2 Private Server - 10 Replies
hi im pete, yeah im too lazy to do this so can someone just give me some pretty good calculations.. you dont need to if you dont want to just dont post anything, but dont flame =]



All times are GMT +1. The time now is 18:59.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.