[svn] Remove unused script event functions HealBy and DamageDeal. Add new function SpellHitTarget.
Fix a bug in r57_trinity.sql. --HG-- branch : trunk
This commit is contained in:
@@ -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; }
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user