requested changes

This commit is contained in:
KayenEQ
2021-08-12 22:08:16 -04:00
parent 34a4116b14
commit aca19533e0
6 changed files with 37 additions and 45 deletions
+6 -6
View File
@@ -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
+5 -5
View File
@@ -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<float>(max_shlder_distance)) {
if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast<float>(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);
+5 -5
View File
@@ -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<float>(max_shlder_distance)) {
if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast<float>(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);
}
+1 -1
View File
@@ -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();
+17 -25
View File
@@ -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;
}
+3 -3
View File
@@ -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;
}
}