mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Fix out of bounds in Mob::ResourceTap
This commit is contained in:
parent
390681e0d0
commit
e0602efca2
@ -6570,31 +6570,30 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed){
|
||||
return true;
|
||||
}
|
||||
|
||||
void Mob::ResourceTap(int32 damage, uint16 spellid){
|
||||
void Mob::ResourceTap(int32 damage, uint16 spellid)
|
||||
{
|
||||
//'this' = caster
|
||||
if (!IsValidSpell(spellid))
|
||||
return;
|
||||
|
||||
for (int i = 0; i <= EFFECT_COUNT; i++)
|
||||
{
|
||||
if (spells[spellid].effectid[i] == SE_ResourceTap){
|
||||
|
||||
damage += (damage * spells[spellid].base[i])/100;
|
||||
for (int i = 0; i < EFFECT_COUNT; i++) {
|
||||
if (spells[spellid].effectid[i] == SE_ResourceTap) {
|
||||
damage += (damage * spells[spellid].base[i]) / 100;
|
||||
|
||||
if (spells[spellid].max[i] && (damage > spells[spellid].max[i]))
|
||||
damage = spells[spellid].max[i];
|
||||
|
||||
if (spells[spellid].base2[i] == 0){ //HP Tap
|
||||
if (spells[spellid].base2[i] == 0) { // HP Tap
|
||||
if (damage > 0)
|
||||
HealDamage(damage);
|
||||
else
|
||||
Damage(this, -damage,0, SkillEvocation,false);
|
||||
Damage(this, -damage, 0, SkillEvocation, false);
|
||||
}
|
||||
|
||||
if (spells[spellid].base2[i] == 1) //Mana Tap
|
||||
if (spells[spellid].base2[i] == 1) // Mana Tap
|
||||
SetMana(GetMana() + damage);
|
||||
|
||||
if (spells[spellid].base2[i] == 2 && IsClient()) //Endurance Tap
|
||||
if (spells[spellid].base2[i] == 2 && IsClient()) // Endurance Tap
|
||||
CastToClient()->SetEndurance(CastToClient()->GetEndurance() + damage);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user