diff options
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Scripting/ScriptMgr.h | 12 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 30 |
2 files changed, 17 insertions, 25 deletions
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index e31a8ec1328..ee95759c72e 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -781,22 +781,22 @@ class AccountScript : public ScriptObject public: // Called when an account logged in succesfully - virtual void OnAccountLogin(uint32 accountId) {} + virtual void OnAccountLogin(uint32 /*accountId*/) {} // Called when an account login failed - virtual void OnFailedAccountLogin(uint32 accountId) {} + virtual void OnFailedAccountLogin(uint32 /*accountId*/) {} // Called when Email is successfully changed for Account - virtual void OnEmailChange(uint32 accountId) {} + virtual void OnEmailChange(uint32 /*accountId*/) {} // Called when Email failed to change for Account - virtual void OnFailedEmailChange(uint32 accountId) {} + virtual void OnFailedEmailChange(uint32 /*accountId*/) {} // Called when Password is successfully changed for Account - virtual void OnPasswordChange(uint32 accountId) {} + virtual void OnPasswordChange(uint32 /*accountId*/) {} // Called when Password failed to change for Account - virtual void OnFailedPasswordChange(uint32 accountId) {} + virtual void OnFailedPasswordChange(uint32 /*accountId*/) {} }; class GuildScript : public ScriptObject diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 3e4786df870..75dbd457b91 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -694,21 +694,12 @@ void Aura::Update(uint32 diff, Unit* caster) if (int32(caster->GetHealth()) > manaPerSecond) caster->ModifyHealth(-manaPerSecond); else - { Remove(); - return; - } } + else if (int32(caster->GetPower(powertype)) >= manaPerSecond) + caster->ModifyPower(powertype, -manaPerSecond); else - { - if (int32(caster->GetPower(powertype)) >= manaPerSecond) - caster->ModifyPower(powertype, -manaPerSecond); - else - { - Remove(); - return; - } - } + Remove(); } } } @@ -734,17 +725,17 @@ int32 Aura::CalcMaxDuration(Unit* caster) const // IsPermanent() checks max duration (which we are supposed to calculate here) if (maxDuration != -1 && modOwner) modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration); + return maxDuration; } void Aura::SetDuration(int32 duration, bool withMods) { if (withMods) - { if (Unit* caster = GetCaster()) if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, duration); - } + m_duration = duration; SetNeedClientUpdateForTargets(); } @@ -782,6 +773,7 @@ void Aura::SetCharges(uint8 charges) { if (m_procCharges == charges) return; + m_procCharges = charges; m_isUsingCharges = m_procCharges != 0; SetNeedClientUpdateForTargets(); @@ -796,6 +788,7 @@ uint8 Aura::CalcMaxCharges(Unit* caster) const if (caster) if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, maxProcCharges); + return maxProcCharges; } @@ -818,6 +811,7 @@ bool Aura::ModCharges(int32 num, AuraRemoveMode removeMode) SetCharges(charges); } + return false; } @@ -886,6 +880,7 @@ bool Aura::ModStackAmount(int32 num, AuraRemoveMode removeMode) if (SpellModifier* mod = aurEff->GetSpellModifier()) mod->charges = GetCharges(); } + SetNeedClientUpdateForTargets(); return false; } @@ -901,10 +896,8 @@ bool Aura::HasMoreThanOneEffectForType(AuraType auraType) const { uint32 count = 0; for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (HasEffect(i) && GetSpellInfo()->Effects[i].ApplyAuraName == auraType) + if (HasEffect(i) && AuraType(GetSpellInfo()->Effects[i].ApplyAuraName) == auraType) ++count; - } return count > 1; } @@ -912,10 +905,9 @@ bool Aura::HasMoreThanOneEffectForType(AuraType auraType) const bool Aura::IsArea() const { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { if (HasEffect(i) && GetSpellInfo()->Effects[i].IsAreaAuraEffect()) return true; - } + return false; } |
