aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2008-10-18 11:50:02 -0500
committermegamage <none@none>2008-10-18 11:50:02 -0500
commita3e03f62d04b45aa2e75040ed3b582cdc8da61a9 (patch)
tree161a87ab83a4655e9df5bcc3fb078ca09db6cb7d /src/game
parentf141b156d51a3b8fe4cc7906eaae15b3f2864d84 (diff)
[svn] Remove unused script event functions HealBy and DamageDeal. Add new function SpellHitTarget.
Fix a bug in r57_trinity.sql. --HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/CreatureAI.h9
-rw-r--r--src/game/Spell.cpp3
-rw-r--r--src/game/Unit.cpp3
3 files changed, 6 insertions, 9 deletions
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index f3dcb66c39d..9926e4431f2 100644
--- a/src/game/CreatureAI.h
+++ b/src/game/CreatureAI.h
@@ -82,12 +82,6 @@ class TRINITY_DLL_SPEC CreatureAI
// Called at stopping attack by any attacker
virtual void EnterEvadeMode() = 0;
- // Called at any heal cast/item used (call non implemented)
- virtual void HealBy(Unit * /*healer*/, uint32 /*amount_healed*/) {}
-
- // Called at any Damage to any victim (before damage apply)
- virtual void DamageDeal(Unit * /*done_to*/, uint32 & /*damage*/) {}
-
// Called at any Damage from any attacker (before damage apply)
virtual void DamageTaken(Unit *done_by, uint32 & /*damage*/) { AttackedBy(done_by); }
@@ -111,6 +105,9 @@ class TRINITY_DLL_SPEC CreatureAI
// Called when hit by a spell
virtual void SpellHit(Unit*, const SpellEntry*) {}
+ // Called when spell hits a target
+ virtual void SpellHitTarget(Unit* target, const SpellEntry*) {}
+
// Called when vitim entered water and creature can not enter water
virtual bool canReachByRangeAttack(Unit*) { return false; }
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 1b4dbd20894..f82f2bd29bf 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -944,6 +944,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
if(((Creature*)unit)->AI())
((Creature*)unit)->AI()->SpellHit(m_caster ,m_spellInfo);
}
+
+ if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI())
+ ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
}
void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 763ae5daf4c..472afbcba4a 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -477,9 +477,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
pVictim->SetStandState(PLAYER_STATE_NONE);
}
- //Script Event damage Deal
- if( GetTypeId()== TYPEID_UNIT && ((Creature *)this)->AI())
- ((Creature *)this)->AI()->DamageDeal(pVictim, damage);
//Script Event damage taken
if( pVictim->GetTypeId()== TYPEID_UNIT && ((Creature *)pVictim)->AI() )
((Creature *)pVictim)->AI()->DamageTaken(this, damage);