aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/include/sc_creature.h11
-rw-r--r--src/bindings/scripts/sql/Updates/r57_trinity.sql2
-rw-r--r--src/game/CreatureAI.h9
-rw-r--r--src/game/Spell.cpp3
-rw-r--r--src/game/Unit.cpp3
5 files changed, 11 insertions, 17 deletions
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h
index 802c118c1d5..6b3d731d256 100644
--- a/src/bindings/scripts/include/sc_creature.h
+++ b/src/bindings/scripts/include/sc_creature.h
@@ -29,12 +29,6 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
//Called at stoping attack by any attacker
void EnterEvadeMode();
- //Called at any heal cast/item used (call non implemented in Trinity)
- void HealBy(Unit *healer, uint32 amount_healed) {}
-
- // Called at any Damage to any victim (before damage apply)
- void DamageDeal(Unit *done_to, uint32 &damage) {}
-
// Called at any Damage from any attacker (before damage apply)
void DamageTaken(Unit *done_by, uint32 &damage) {}
@@ -57,7 +51,10 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
void SummonedCreatureDespawn(Creature* /*unit*/) {}
// Called when hit by a spell
- void SpellHit(Unit*, const SpellEntry*) {}
+ void SpellHit(Unit* caster, const SpellEntry*) {}
+
+ // Called when spell hits a target
+ void SpellHitTarget(Unit* target, const SpellEntry*) {}
// Called when creature is spawned or respawned (for reseting variables)
void JustRespawned();
diff --git a/src/bindings/scripts/sql/Updates/r57_trinity.sql b/src/bindings/scripts/sql/Updates/r57_trinity.sql
index bbdb29af158..b7f61b9edae 100644
--- a/src/bindings/scripts/sql/Updates/r57_trinity.sql
+++ b/src/bindings/scripts/sql/Updates/r57_trinity.sql
@@ -36,4 +36,4 @@ INSERT INTO `spell_proc_event` VALUES ('43983', '0', '0', '0', '0', '0', '16384'
DELETE FROM `spell_script_target` WHERE `entry` = 42577;
INSERT INTO `spell_script_target` VALUES ('42577', '1', '24136');
-UPDATE `creature_template` SET `lootid` = `entry`, `ScriptName` = 'npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001); \ No newline at end of file
+UPDATE `creature_template` SET `ScriptName` = 'npc_zulaman_hostage' WHERE `entry` IN (23790, 23999, 24024, 24001); \ No newline at end of file
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);