Sure.
Melee:
Code:
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;
return Damage;
}
Magic:
Code:
else if(AType == 21)
{
int Damage = AddedMagicDamage(SkillID, SkillLevel);
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;
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;
return Damage;
}
Archer:
Code:
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;
return Damage;
}
All found inside Calculations\Damage.cs