Core/SmartAI: Implement SMART_EVENT_SUMMONED_UNIT and SMART_EVENT_SUMMON_DESPAWNED for GameObject owners

(cherry picked from commit 507a56d627)
This commit is contained in:
jackpoz
2019-05-24 20:52:54 +02:00
committed by Shauren
parent 5d6ea73276
commit 6034992dff
2 changed files with 16 additions and 0 deletions

View File

@@ -1083,6 +1083,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

@@ -267,6 +267,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: