Core/SmartAI: Implement SMART_EVENT_SUMMONED_UNIT and SMART_EVENT_SUMMON_DESPAWNED for GameObject owners

This commit is contained in:
jackpoz
2019-05-24 20:52:54 +02:00
parent 45887846b6
commit 507a56d627
2 changed files with 16 additions and 0 deletions

View File

@@ -1081,6 +1081,16 @@ void SmartGameObjectAI::SpellHit(Unit* unit, SpellInfo const* spellInfo)
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT, unit, 0, 0, false, spellInfo);
}
void SmartGameObjectAI::JustSummoned(Creature* creature)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SUMMONED_UNIT, creature);
}
void SmartGameObjectAI::SummonedCreatureDespawn(Creature* unit)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SUMMON_DESPAWNED, unit, unit->GetEntry());
}
class SmartTrigger : public AreaTriggerScript
{
public:

View File

@@ -266,6 +266,12 @@ class TC_GAME_API SmartGameObjectAI : public GameObjectAI
void EventInform(uint32 eventId) override;
void SpellHit(Unit* unit, SpellInfo const* spellInfo) override;
// Called when the gameobject summon successfully other creature
void JustSummoned(Creature* creature) override;
// Called when a summoned creature dissapears (UnSommoned)
void SummonedCreatureDespawn(Creature* unit) override;
void SetGossipReturn(bool val) { _gossipReturn = val; }
private: