mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
Implemented SPA 503 , 505
SE_Melee_Damage_Position_Mod 503 define SE_Damage_Taken_Position_Mod 505 SPA 503 increase/decreases melee damage by percent base1 based on your position base2 0=back 1=front SPA 504 increase/decreases melee damage taken by percent base1 based on your position base2 0=back 1=front
This commit is contained in:
@@ -3816,6 +3816,33 @@ int16 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackO
|
||||
return skilldmg_mod;
|
||||
}
|
||||
|
||||
int16 Mob::GetPositionalDmgTaken(Mob *attacker)
|
||||
{
|
||||
if (!attacker)
|
||||
return 0;
|
||||
|
||||
int front_arc = 0;
|
||||
int back_arc = 0;
|
||||
int total_mod = 0;
|
||||
|
||||
back_arc += itembonuses.Damage_Taken_Position_Mod[0] + aabonuses.Damage_Taken_Position_Mod[0] + spellbonuses.Damage_Taken_Position_Mod[0];
|
||||
front_arc += itembonuses.Damage_Taken_Position_Mod[1] + aabonuses.Damage_Taken_Position_Mod[1] + spellbonuses.Damage_Taken_Position_Mod[1];
|
||||
|
||||
if (back_arc || front_arc) { //Do they have this bonus?
|
||||
if (attacker->BehindMob(this, attacker->GetX(), attacker->GetY()))//Check if attacker is striking from behind
|
||||
total_mod = back_arc; //If so, apply the back arc modifier only
|
||||
else
|
||||
total_mod = front_arc;//If not, apply the front arc modifer only
|
||||
}
|
||||
|
||||
total_mod = round(static_cast<double>(total_mod) * 0.1);
|
||||
|
||||
if (total_mod < -100)
|
||||
total_mod = -100;
|
||||
|
||||
return total_mod;
|
||||
}
|
||||
|
||||
int16 Mob::GetHealRate(uint16 spell_id, Mob* caster) {
|
||||
|
||||
int16 heal_rate = 0;
|
||||
@@ -4721,6 +4748,35 @@ int16 Mob::GetCrippBlowChance()
|
||||
return crip_chance;
|
||||
}
|
||||
|
||||
|
||||
int16 Mob::GetMeleeDmgPositionMod(Mob* defender)
|
||||
{
|
||||
if (!defender)
|
||||
return 0;
|
||||
|
||||
int front_arc = 0;
|
||||
int back_arc = 0;
|
||||
int total_mod = 0;
|
||||
|
||||
back_arc += itembonuses.Melee_Damage_Position_Mod[0] + aabonuses.Melee_Damage_Position_Mod[0] + spellbonuses.Melee_Damage_Position_Mod[0];
|
||||
front_arc += itembonuses.Melee_Damage_Position_Mod[1] + aabonuses.Melee_Damage_Position_Mod[1] + spellbonuses.Melee_Damage_Position_Mod[1];
|
||||
|
||||
if (back_arc || front_arc) { //Do they have this bonus?
|
||||
if (BehindMob(defender, GetX(), GetY()))//Check if attacker is striking from behind
|
||||
total_mod = back_arc; //If so, apply the back arc modifier only
|
||||
else
|
||||
total_mod = front_arc;//If not, apply the front arc modifer only
|
||||
}
|
||||
|
||||
total_mod = round(static_cast<double>(total_mod) * 0.1);
|
||||
|
||||
if (total_mod < -100)
|
||||
total_mod = -100;
|
||||
|
||||
return total_mod;
|
||||
|
||||
}
|
||||
|
||||
int16 Mob::GetSkillReuseTime(uint16 skill)
|
||||
{
|
||||
int skill_reduction = this->itembonuses.SkillReuseTime[skill] + this->spellbonuses.SkillReuseTime[skill] + this->aabonuses.SkillReuseTime[skill];
|
||||
|
||||
Reference in New Issue
Block a user