|
You last visited: Today at 04:34
Advertisement
[Help] CoEmu 2 TwoFolds Blade Calculation
Discussion on [Help] CoEmu 2 TwoFolds Blade Calculation within the CO2 Private Server forum part of the Conquer Online 2 category.
06/14/2009, 12:32
|
#1
|
elite*gold: 0
Join Date: Jun 2007
Posts: 69
Received Thanks: 2
|
[Help] CoEmu 2 TwoFolds Blade Calculation
Hi,
Any one knows or guide me on how and what .cs for the TwoFolds Blade calculation damage, cause i tried having +12's and SDGs and it only damages "1" on players but works on mobs...
Thanks
|
|
|
06/14/2009, 12:37
|
#2
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
This works...sort off.
Code:
case 6000: //TwoFoldBlades
{
Dictionary<int, int> Targets = new Dictionary<int, int>();
int RemainingHP = AttackedMob.CurrentHP;
int Level = AttackSkill.Level;
double ExtPCT = 0;
if (Level == 0)
ExtPCT = 1.10;
if (Level == 1)
ExtPCT = 1.15;
if (Level == 2)
ExtPCT = 1.20;
if (Level == 3)
ExtPCT = 1.25;
if (Level == 4)
ExtPCT = 1.30;
Damage = (int)Math.Floor((Calculation.Damage(Attacker, AttackedMob, 2, 0, 0) * 1.725) * ExtPCT);
bool killed = Calculation.doMonster(AttackedMob, Damage, AType, CSocket);
Targets.Add(AttackedMob.UID, Damage);
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, AttackSkill.ID, AttackSkill.Level, Targets, AttackedMob.X, AttackedMob.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
Targets.Clear();
break;
}
|
|
|
06/14/2009, 12:43
|
#3
|
elite*gold: 0
Join Date: Jun 2007
Posts: 69
Received Thanks: 2
|
this gonna go under Calculation\Attack.cs
Right?
Quote:
Originally Posted by Kiyono
This works...sort off.
Code:
case 6000: //TwoFoldBlades
{
Dictionary<int, int> Targets = new Dictionary<int, int>();
int RemainingHP = AttackedMob.CurrentHP;
int Level = AttackSkill.Level;
double ExtPCT = 0;
if (Level == 0)
ExtPCT = 1.10;
if (Level == 1)
ExtPCT = 1.15;
if (Level == 2)
ExtPCT = 1.20;
if (Level == 3)
ExtPCT = 1.25;
if (Level == 4)
ExtPCT = 1.30;
Damage = (int)Math.Floor((Calculation.Damage(Attacker, AttackedMob, 2, 0, 0) * 1.725) * ExtPCT);
bool killed = Calculation.doMonster(AttackedMob, Damage, AType, CSocket);
Targets.Add(AttackedMob.UID, Damage);
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, AttackSkill.ID, AttackSkill.Level, Targets, AttackedMob.X, AttackedMob.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
Targets.Clear();
break;
}
|
|
|
|
06/14/2009, 12:47
|
#4
|
elite*gold: 0
Join Date: Jun 2007
Posts: 69
Received Thanks: 2
|
got the error below...
Error 9 'CoEmu_v2_GameServer.Entities.Character' does not contain a definition for 'PlusDamage' and no extension method 'PlusDamage' accepting a first argument of type 'CoEmu_v2_GameServer.Entities.Character' could be found (are you missing a using directive or an assembly reference?) E:\CoEmu v2\CoEmu v2\CoEmu v2 GameServer\Calculations\Damage.cs 223 41 CoEmu v2 GameServer
|
|
|
06/14/2009, 12:51
|
#5
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
Handlers/Attack.cs
Place it below this:
Code:
else if(Target > 0 && MagicID != 0 && AttackedMob != null)
{
if(AttackSkill != null)
{
bool OK = Calculation.MagicCost(AttackSkill.ID, AttackSkill.Level, CSocket);
if(!OK)
{
if(CSocket.Client.Attack != null)
{
if(CSocket.Client.Attack.Enabled)
{
CSocket.Client.Attack.Stop();
CSocket.Client.Attack.Dispose();
}
}
return;
}
switch(AttackSkill.ID)
{
//TODO: Special effects for spells like FireOfHell, Revive, etc here
|
|
|
06/14/2009, 13:02
|
#6
|
elite*gold: 0
Join Date: Jun 2007
Posts: 69
Received Thanks: 2
|
thanks... lemme see if i can figure out...
the error above... i figure it out... i'm learning C# hard... heheehe and fast...
|
|
|
06/14/2009, 13:06
|
#7
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
I don't know C# at all lol
I just copy & paste pre-coded stuff and change a bit xD
|
|
|
06/14/2009, 13:14
|
#8
|
elite*gold: 0
Join Date: Jun 2007
Posts: 69
Received Thanks: 2
|
i added the code below and with the next code... seems like TWoFolds is now working.. it wont sway the katanas... if i took of the below code and leave the next code... it works but the damage is only 100 somethin...
Am i missing somethin here?
Quote:
Originally Posted by Kiyono
This works...sort off.
Code:
case 6000: //TwoFoldBlades
{
Dictionary<int, int> Targets = new Dictionary<int, int>();
int RemainingHP = AttackedMob.CurrentHP;
int Level = AttackSkill.Level;
double ExtPCT = 0;
if (Level == 0)
ExtPCT = 1.10;
if (Level == 1)
ExtPCT = 1.15;
if (Level == 2)
ExtPCT = 1.20;
if (Level == 3)
ExtPCT = 1.25;
if (Level == 4)
ExtPCT = 1.30;
Damage = (int)Math.Floor((Calculation.Damage(Attacker, AttackedMob, 2, 0, 0) * 1.725) * ExtPCT);
bool killed = Calculation.doMonster(AttackedMob, Damage, AType, CSocket);
Targets.Add(AttackedMob.UID, Damage);
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, AttackSkill.ID, AttackSkill.Level, Targets, AttackedMob.X, AttackedMob.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
Targets.Clear();
break;
}
|
this the code i add up...
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Entities;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
namespace CoEmu_v2_GameServer.Calculations
{
/// <summary>
/// Calculates damage to a character or monster.
/// </summary>
public partial class Calculation
{
public static int Damage(Character Attacker, Character Attacked, int AType, int SkillID, int SkillLevel)
{
if(Attacker.MinAttack > Attacker.MaxAttack)
{
return 0;
}
if(AType == 2)
{
int Damage = Nano.Rand.Next(Attacker.MinAttack, Attacker.MaxAttack);
Damage -= Attacked.Defense;
if(Attacked.Reborn == 1)
{
Damage = (int)Math.Floor(Damage*.7);
}
else if(Attacked.Reborn == 2)
{
Damage = (int)Math.Floor(Damage*.7);
if(Attacker.Reborn < 2)
Damage = (int)Math.Floor(Damage*.5);
}
double Tort = 0;
Tort += Attacked.NTG*0.02;
Tort += Attacked.RTG*0.04;
Tort += Attacked.STG*0.06;
Damage = (int)Math.Floor(Damage*(1-Tort));
if(Attacked.Bless > 0)
{
Damage = (int)Math.Floor(Damage * (1 - (Attacked.Bless*0.01)));
}
//TODO: Superman
if(Damage < 0)
Damage = 1;
if((Attacked.isGM || Attacked.isPM) && Attacked.Invincible)
Damage = 0;
Damage += (int)Attacker.PlusDamage;
Damage -= (int)Attacked.MinusDamage;
if (Damage < 2) Damage = 1;
return Damage;
}
else if(AType == 21)
{
int Damage = AddedMagicDamage(SkillID, SkillLevel);
if (SkillID <= 6011 && SkillID >= 6000)
Damage += Nano.Rand.Next(Attacker.MinAttack, Attacker.MaxAttack);
else
Damage += Attacker.MagicAttack;
if(Attacked.MagicDefense > 0)
{
double MDef = 1;
if(Attacked.MagicDefense < 90)
{
MDef = (Attacked.MagicDefense * 0.01);
}
else
{
MDef = (90 * 0.01);
}
Damage = (int)Math.Floor(Damage - (Damage*MDef));
}
Damage = Convert.ToInt32(Damage*0.75);
if(Attacked.Reborn == 1)
{
Damage = (int)Math.Floor(Damage*.7);
}
else if(Attacked.Reborn == 2)
{
Damage = (int)Math.Floor(Damage*.7);
if(Attacker.Reborn < 2)
Damage = (int)Math.Floor(Damage*.5);
}
Damage += Attacker.BonusMagicAttack;
Damage -= Attacked.BonusMagicDefense;
double Tort = 0;
Tort += Attacked.NTG*0.02;
Tort += Attacked.RTG*0.04;
Tort += Attacked.STG*0.06;
Damage = (int)Math.Floor(Damage*(1-Tort));
if(Attacked.Bless > 0)
{
Damage = (int)Math.Floor(Damage * (1 - (Attacked.Bless*0.01)));
}
if(Damage < 0)
Damage = 1;
if((Attacked.isGM || Attacked.isPM) && Attacked.Invincible)
Damage = 0;
Damage += (int)Attacker.PlusMagicDamage;
Damage -= (int)Attacked.MinusMagicDamage;
if (Damage < 2) Damage = 1;
return Damage;
}
else if(AType == 25)
{
int Damage = Nano.Rand.Next(Attacker.MinAttack, Attacker.MaxAttack);
if(Attacked.Dodge > 0)
{
double Dodge = 0;
if(Attacked.Dodge <= 94)
Dodge = Attacked.Dodge*0.01;
else
Dodge = 94*0.01;
Damage = (int)Math.Floor(Damage - (Damage*Dodge));
}
if(Attacked.Reborn == 1)
{
Damage = (int)Math.Floor(Damage*.7);
}
else if(Attacked.Reborn == 2)
{
Damage = (int)Math.Floor(Damage*.7);
if(Attacker.Reborn < 2)
Damage = (int)Math.Floor(Damage*.5);
}
Damage += Attacker.BonusMagicAttack;
Damage -= Attacked.BonusMagicDefense;
double Tort = 0;
Tort += Attacked.NTG*0.02;
Tort += Attacked.RTG*0.04;
Tort += Attacked.STG*0.06;
Damage = (int)Math.Floor(Damage*(1-Tort));
if(Attacked.Bless > 0)
{
Damage = (int)Math.Floor(Damage * (1 - (Attacked.Bless*0.01)));
}
if(Damage < 0)
Damage = 1;
if((Attacked.isGM || Attacked.isPM) && Attacked.Invincible)
Damage = 0;
Damage += (int)Attacker.PlusDamage;
Damage -= (int)Attacked.MinusDamage;
if (Damage < 2) Damage = 1;
return Damage;
}
return 0;
}
public static int Damage(Character Attacker, Monster Attacked, int AType, int MagicID, int MagicLevel)
{
if(Attacker.MinAttack > Attacker.MaxAttack)
{
return 0;
}
//TODO: Magic, Archer
if(AType == 2)
{
int Damage = Nano.Rand.Next(Attacker.MinAttack, Attacker.MaxAttack);
if(Attacked.Info.Name != "CoEmuGuard" && Attacked.Info.Name != "CoEmuPatrol" && Attacked.Info.Name != "GuildPatrol" && Attacked.Info.Name != "GuardReviver")
{
int Leveldiff = (Attacker.Level+2) - Attacked.Level;
int Damageadd = (int)Math.Floor(1 + (Leveldiff/5)*0.8);
if(Damageadd > 1)
Damage = Damageadd * Damage;
}
Damage -= Attacked.Info.Defense;
if(Damage < 0)
Damage = 1;
Damage += (int)Attacker.PlusDamage;
//TODO: Superman
return Damage;
}
else if (AType == 21)
{
int Damage = AddedMagicDamage(MagicID, MagicLevel); ;
if (MagicID <= 6011 && MagicID >= 6000)
Damage += Nano.Rand.Next(Attacker.MinAttack, Attacker.MaxAttack);
else
Damage += Attacker.MagicAttack;
if (Attacked.Info.MDefense > 0)
{
double MDef = (Attacked.Info.MDefense * 0.01);
Damage = (int)Math.Floor(Damage - (Damage * MDef));
}
if (Attacked.Info.Name != "CoEmuGuard" && Attacked.Info.Name != "CoEmuPatrol" && Attacked.Info.Name != "GuildPatrol" && Attacked.Info.Name != "GuardReviver")
{
int Leveldiff = (Attacker.Level + 2) - Attacked.Level;
int Damageadd = (int)Math.Floor(1 + (Leveldiff / 5) * 0.8);
if (Damageadd > 1)
Damage = Damageadd * Damage;
}
if (Damage < 0)
Damage = 1;
Damage += (int)Attacker.PlusDamage;
return Damage;
}
else if (AType == 25)
{
int Damage = Nano.Rand.Next(Attacker.MinAttack, Attacker.MaxAttack);
if (Attacked.Info.Dodge > 0)
{
double Dodge = Attacked.Info.Dodge * 0.01;
Damage = (int)Math.Floor(Damage - (Damage * Dodge));
}
if (Attacked.Info.Name != "CoEmuGuard" && Attacked.Info.Name != "CoEmuPatrol" && Attacked.Info.Name != "GuildPatrol" && Attacked.Info.Name != "GuardReviver")
{
int Leveldiff = (Attacker.Level + 2) - Attacked.Level;
int Damageadd = (int)Math.Floor(1 + (Leveldiff / 5) * 0.8);
if (Damageadd > 1)
Damage = Damageadd * Damage;
}
if (Damage < 0)
Damage = 1;
Damage += (int)Attacker.PlusDamage;
return Damage;
}
return 0;
}
}
}
|
|
|
06/14/2009, 13:23
|
#9
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
Uhm, you didn't need to edit the calculations at all.
|
|
|
|
Similar Threads
|
Exp calculation?
01/09/2011 - CO2 Programming - 3 Replies
Hey,
Does anyone has a decent exp calculation, or show me atleast how it is calculated? I really have no idea when it comes to conquer.
Thanks in advance,
ImmuneOne.
|
[EDITS] Frozen Blade, Hunter Blade, Poison Blade
06/08/2010 - CO2 Weapon, Armor, Effects & Interface edits - 2 Replies
Okay, heres my edits and i only started to edits yesterday lol now look at these sexy ones
FrozenBlade
http://img571.imageshack.us/img571/584/4140838.jp g
For More:
http://img36.imageshack.us/img36/1953/4144178.jpg
http://img297.imageshack.us/img297/4226/4146602.j pg
http://img6.imageshack.us/img6/3825/4149236.jpg
http://img197.imageshack.us/img197/2571/4151720.j pg
|
Repair Calculation
06/04/2010 - CO2 Private Server - 0 Replies
Here is the correct gold calculation for repairing an item:
int nRecoverDurability = Math.Max(0, Item.Stats.Durability - Item.CurDurability);
if (nRecoverDurability == 0)
return;
byte Quality = ItemManipulation.GetQuality((int)Item.Stats.ID);
double QualityMultipier = 0;
|
wts blade 81 ff 900k sp blade 85+10 and nova blade 101 +3
05/31/2010 - Silkroad Online Trading - 0 Replies
hi all i sell my acont blader 81 ff with 900 k sp devil avatar and witch avatar have blade 85+10 and son blade 101 +3 <IT NOT MAGIC POP>
heare i post a pic Imageshack - sro2010053017212362.jpg
mail me if you wtb on [email protected]
i don't made the first step so don't try scham me i have some experience on sro
thx
|
AL Damage Calculation
07/15/2007 - Archlord - 0 Replies
Does anyone know how AL computes damage? I have been playing with combinations of weapons and stones and can't find the magic equation. Here is what I have been doing:
Ab = Base Attack (without weapon)
Aw = Attack with Weapon
Ae = Attack bonus due to Elemental Stones (e.g. 4 level 3 stones is 5+5+1+5+1+5+1 = 23)
Sb = Skill bonus for Basic Attack (%)
Se = Skill bonus for Elemental Attack (%)
a = attenuation factor based on mob level and player level
b = boolean for elemental damage...
|
All times are GMT +2. The time now is 04:34.
|
|