Core/Scripts: remove OnDummyEffect hook/sOnDummyEffect ai hook

- Duplicated logic never used, sometimes only ScriptMgr version was called, sometimes only AI
- They only encourage bad scripting practices
- You can still use OnSpellHit or a SpellScript
This commit is contained in:
ariel-
2017-04-28 17:58:39 -03:00
committed by Aokromes
parent c015a5cf10
commit f3246f835c
10 changed files with 10 additions and 76 deletions

View File

@@ -1510,15 +1510,6 @@ InstanceScript* ScriptMgr::CreateInstanceData(InstanceMap* map)
return tmpscript->GetInstanceScript(map);
}
bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Item* target)
{
ASSERT(caster);
ASSERT(target);
GET_SCRIPT_RET(ItemScript, target->GetScriptId(), tmpscript, false);
return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
}
bool ScriptMgr::OnQuestAccept(Player* player, Item* item, Quest const* quest)
{
ASSERT(player);
@@ -1557,13 +1548,15 @@ bool ScriptMgr::OnItemRemove(Player* player, Item* item)
return tmpscript->OnRemove(player, item);
}
bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Creature* target)
bool ScriptMgr::OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo const* spellInfo, Item* item)
{
ASSERT(caster);
ASSERT(target);
ASSERT(player);
ASSERT(victim);
ASSERT(spellInfo);
ASSERT(item);
GET_SCRIPT_RET(CreatureScript, target->GetScriptId(), tmpscript, false);
return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
GET_SCRIPT_RET(ItemScript, item->GetScriptId(), tmpscript, true);
return tmpscript->OnCastItemCombatSpell(player, victim, spellInfo, item);
}
bool ScriptMgr::OnGossipHello(Player* player, Creature* creature)
@@ -1774,15 +1767,6 @@ void ScriptMgr::OnGameObjectUpdate(GameObject* go, uint32 diff)
tmpscript->OnUpdate(go, diff);
}
bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, GameObject* target)
{
ASSERT(caster);
ASSERT(target);
GET_SCRIPT_RET(GameObjectScript, target->GetScriptId(), tmpscript, false);
return tmpscript->OnDummyEffect(caster, spellId, effIndex, target);
}
bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger)
{
ASSERT(player);