From 0583b4bd047dba91d8fcdd221a1411658d733d3e Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 13 Apr 2009 21:59:44 +0200 Subject: *Prevent item trade exploit - by Iskander. *Do not set cooldown for triggered spells. *Do not allow to kill unit twice. --HG-- branch : trunk --- src/game/Unit.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6f57b27d567..fa9f1840a6c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5206,7 +5206,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (dummySpell->SpellIconID == 2999) { if (effIndex!=0) - return true; + return false; AuraEffect *counter = GetAuraEffect(triggeredByAura->GetId(), 1); if (!counter) return true; @@ -5708,7 +5708,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger return false; // Only 0 aura can proc if (effIndex!=0) - return true; + return false; // Wrath crit if (procSpell->SpellFamilyFlags[0] & 0x1) { @@ -5836,8 +5836,10 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger case SPELLFAMILY_PALADIN: { // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage) - if (dummySpell->SpellFamilyFlags[0]&0x8000000 && effIndex==0) + if (dummySpell->SpellFamilyFlags[0]&0x8000000) { + if (effIndex!=0) + return false; triggered_spell_id = 25742; float ap = GetTotalAttackPowerValue(BASE_ATTACK); int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) + @@ -12523,6 +12525,9 @@ void Unit::SetToNotify() void Unit::Kill(Unit *pVictim, bool durabilityLoss) { + // Prevent killing unit twice (and giving reward from kill twice) + if (!pVictim->isAlive()) + return; pVictim->SetHealth(0); // find player: owner of controlled `this` or `this` itself maybe -- cgit v1.2.3