Core/CreatureAI: Implement an OnSpellClick hook instead of the ugly way that uses DoAction with EVENT_SPELLCLICK.

Core/SmartAI: Implement SMART_EVENT_ON_SPELLCLICK. Parameter is the clicker.

If someone could update the wiki accordingly for SAI I would appreciate that. Thanks to @Shauren for some help!
This commit is contained in:
Discover- committed 2012-06-19 00:07:20 +02:00
1 parent 29f1ab2438
commit e190a202ca
11 files changed
+26 -27

No files matched your search

@@ -826,6 +826,11 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId)
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
}
void SmartAI::OnSpellClick(Unit* clicker)
{
GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);
}
int SmartGameObjectAI::Permissible(const GameObject* g)
{
if (g->GetAIName() == "SmartGameObjectAI")