diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 81ee35ab4..30e513fff 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -3559,10 +3559,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne } else if (effect_value < 0 && new_bonus->ExtendedShielding > effect_value){ new_bonus->ExtendedShielding = effect_value; - } + } else if (effect_value > 0 && new_bonus->ExtendedShielding < effect_value){ new_bonus->ExtendedShielding = effect_value; - } + } break; } @@ -3573,12 +3573,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne } else if (effect_value < 0 && new_bonus->ShieldDuration > effect_value){ new_bonus->ShieldDuration = effect_value; - } + } else if (effect_value > 0 && new_bonus->ShieldDuration < effect_value){ new_bonus->ShieldDuration = effect_value; - } - break; - } + } + break; + } case SE_Weapon_Stance: { if (IsValidSpell(effect_value)) { //base1 is the spell_id of buff diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index df124009f..67702974b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -12876,11 +12876,11 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) } //AA to increase SPA 230 extended shielding - int max_shlder_distance = 15; - max_shlder_distance += aabonuses.ExtendedShielding + itembonuses.ExtendedShielding + spellbonuses.ExtendedShielding; - max_shlder_distance = std::max(max_shlder_distance, 0); + int m_shielder_max_distance = 15; + m_shielder_max_distance += aabonuses.ExtendedShielding + itembonuses.ExtendedShielding + spellbonuses.ExtendedShielding; + m_shielder_max_distance = std::max(m_shielder_max_distance, 0); - if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast(max_shlder_distance)) { + if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast(m_shielder_max_distance)) { return; //Too far away, no message is given thoughh. } @@ -12888,7 +12888,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app) SetShieldTargetID(shield_target->GetID()); SetShielderMitigation(25); - SetShielerMaxDistance(max_shlder_distance); + SetShielerMaxDistance(m_shielder_max_distance); shield_target->SetShielderID(GetID()); shield_target->SetShieldTargetMitigation(50); diff --git a/zone/mob.cpp b/zone/mob.cpp index 5ab8ad863..a9b97a10b 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -6177,7 +6177,7 @@ float Mob::GetDefaultRaceSize() const { return GetRaceGenderDefaultHeight(race, gender); } -void Mob::ShieldAbility(uint32 target_id, int max_shlder_distance, int shield_duration, int shld_target_mitigation, int shlder_mitigation) +void Mob::ShieldAbility(uint32 target_id, int m_max_shielder_distance, int shield_duration, int m_shield_target_mitigation, int m_shielder_mitigation) { Mob* shield_target = entity_list.GetMob(target_id); @@ -6208,7 +6208,7 @@ void Mob::ShieldAbility(uint32 target_id, int max_shlder_distance, int shield_du } } - if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast(max_shlder_distance)) { + if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast(m_max_shielder_distance)) { if (IsClient()) { MessageString(Chat::White, TARGET_TOO_FAR); //Live doesn't give any message for failure, for the quest ability lets allow it. } @@ -6218,11 +6218,11 @@ void Mob::ShieldAbility(uint32 target_id, int max_shlder_distance, int shield_du entity_list.MessageCloseString(this, false, 100, 0, START_SHIELDING, GetCleanName(), shield_target->GetCleanName()); SetShieldTargetID(shield_target->GetID()); - SetShielderMitigation(shlder_mitigation); - SetShielerMaxDistance(max_shlder_distance); + SetShielderMitigation(m_shield_target_mitigation); + SetShielerMaxDistance(m_max_shielder_distance); shield_target->SetShielderID(GetID()); - shield_target->SetShieldTargetMitigation(shld_target_mitigation); + shield_target->SetShieldTargetMitigation(m_shield_target_mitigation); shield_timer.Start(shield_duration); } diff --git a/zone/mob.h b/zone/mob.h index 46be51d2c..0c3e2c57f 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1129,7 +1129,7 @@ public: Trade* trade; - void ShieldAbility(uint32 target_id, int max_shlder_distance = 15, int shield_duration = 12000, int shld_target_mitigation = 50, int shlder_mitigation = 75); + void ShieldAbility(uint32 target_id, int m_shielder_max_distance = 15, int shield_duration = 12000, int m_shielld_target_mitigation = 50, int m_shielder_mitigation = 75); void DoShieldDamageOnShielder(Mob* shield_target, int hit_damage_done, EQ::skills::SkillType skillInUse); void ShieldAbilityFinish(); void ShieldAbilityClearVariables(); diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index be57dbe6e..d9cc806cc 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -6267,42 +6267,34 @@ XS(XS_Mob_ShieldAbility); /* prototype to pass -Wmissing-prototypes */ XS(XS_Mob_ShieldAbility) { dXSARGS; if (items < 2 || items > 6) - Perl_croak(aTHX_ "Usage: Mob::ShieldAbility(THIS, uint32 target_id, [int32 max_shielder_distance = 15], [int32 shield_duration = 12000], [int32 shield_target_mitigation= 50], [int32 shielder_mitigation = 50]"); // @categories Spells and Disciplines + Perl_croak(aTHX_ "Usage: Mob::ShieldAbility(THIS, uint32 target_id, [int32 shielder__max_distance = 15], [int32 shield_duration = 12000], [int32 shield_target_mitigation= 50], [int32 shielder_mitigation = 50]"); // @categories Spells and Disciplines { - Mob *THIS; - uint32 target_id = (uint32)SvUV(ST(1)); - int32 max_shlder_distance; - int32 shld_duration; - int32 shld_target_mitigation; - int32 shlder_mitigation; + Mob *THIS; + uint32 target_id = (uint32)SvUV(ST(1)); + int32 shielder_max_distance = (int32)SvUV(ST(2)); + int32 shield_duration = (int32)SvUV(ST(3)); + int32 shield_target_mitigation = (int32)SvUV(ST(4)); + int32 shielder_mitigation = (int32)SvUV(ST(5)); VALIDATE_THIS_IS_MOB; - if (items < 3) - max_shlder_distance = 15; - else { - max_shlder_distance = max_shlder_distance = (int32)SvUV(ST(2)); + if (items < 3) { + shielder_max_distance = 15; } - if (items < 4) - shld_duration = 12000; - else { - shld_duration = (int32)SvUV(ST(3)); + if (items < 4) { + shield_duration = 12000; } - if (items < 5) - shld_target_mitigation = 50; - else { - shld_target_mitigation = (int32)SvUV(ST(4)); + if (items < 5) { + shield_target_mitigation = 50; } - if (items < 6) - shlder_mitigation = 50; - else { - shlder_mitigation = (int32)SvUV(ST(5)); + if (items < 6) { + shielder_mitigation = 50; } - THIS->ShieldAbility(target_id, max_shlder_distance, shld_duration, shld_target_mitigation, shlder_mitigation); - + THIS->ShieldAbility(target_id, shielder_max_distance, shield_duration, shield_duration, shield_duration); + } XSRETURN_EMPTY; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 6afa84c0b..956f561af 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2956,9 +2956,9 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove if (petowner) { int shield_duration = spells[spell_id].base[i] * 12 * 1000; - int shld_target_mitigation = spells[spell_id].base2[i] ? spells[spell_id].base2[i] : 50; - int shlder_mitigation = spells[spell_id].max[i] ? spells[spell_id].base2[i] : 50; - ShieldAbility(petowner->GetID(), 25, shield_duration, shld_target_mitigation, shlder_mitigation); + int m_shield_target_mitigation = spells[spell_id].base2[i] ? spells[spell_id].base2[i] : 50; + int m_shielder_mitigation = spells[spell_id].max[i] ? spells[spell_id].base2[i] : 50; + ShieldAbility(petowner->GetID(), 25, shield_duration, m_shield_target_mitigation, m_shielder_mitigation); break; } }