mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user