feat(Core/GameObject): Expand IsSummonedBy() to GameObjects (#14789)

Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
Skjalf
2023-01-29 09:44:33 -03:00
committed by GitHub
parent 4ecf96c379
commit bf30c66ba4
44 changed files with 191 additions and 95 deletions

View File

@@ -219,10 +219,15 @@ public:
{
npc_burning_spiritAI(Creature* creature) : ScriptedAI(creature) {}
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
if (summoner->GetTypeId() != TYPEID_UNIT)
{
return;
}
_flamelasherGUID = summoner->GetGUID();
me->GetMotionMaster()->MoveFollow(summoner, 0.f, 0.f);
me->GetMotionMaster()->MoveFollow(summoner->ToCreature(), 0.f, 0.f);
}
void EnterEvadeMode(EvadeReason /*why*/) override

View File

@@ -86,7 +86,7 @@ public:
BossAI::EnterEvadeMode(why);
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
events.ScheduleEvent(EVENT_SUMMONED_1, 1000);
}

View File

@@ -69,7 +69,7 @@ public:
frenzy15 = false;
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
StartTalking(TALK_SUMMON, 8 * IN_MILLISECONDS);
}

View File

@@ -174,7 +174,7 @@ public:
me->DespawnOrUnsummon();
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
Talk(EMOTE_BLACKHAND_DISMOUNT);
}

View File

@@ -981,7 +981,7 @@ public:
{
npc_vaelastrasz_the_redAI(Creature* creature) : CreatureAI(creature) { }
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
if (!summoner)
{

View File

@@ -871,7 +871,7 @@ struct npc_corrupted_totem : public ScriptedAI
}
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
me->SetInCombatWithZone();
@@ -942,7 +942,7 @@ struct npc_drakonid_spawner : public ScriptedAI
}
}
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
DoCastSelf(SPELL_SPAWN_DRAKONID_GEN);
_scheduler.Schedule(10s, 60s, [this](TaskContext /*context*/)

View File

@@ -387,9 +387,14 @@ public:
int room;
Unit* Gandling;
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
Gandling = summoner;
if (summoner->GetTypeId() != TYPEID_UNIT)
{
return;
}
Gandling = summoner->ToCreature();
if (instance)
{
room = Gandling->GetAI()->GetData(GANDLING_ROOM_TO_USE); // it's set just before my spawn

View File

@@ -106,7 +106,7 @@ public:
me->DespawnOrUnsummon(1);
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
events2.Reset();
events2.ScheduleEvent(INTRO_1, 1000);

View File

@@ -72,7 +72,7 @@ struct boss_kormok : public ScriptedAI
_summons.DespawnAll();
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
Talk(TALK_SUMMON);

View File

@@ -132,7 +132,7 @@ struct boss_jarien : public BossAI
_Reset();
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
Talk(SAY_JARIEN_ON_SUMMON_0);
@@ -257,7 +257,7 @@ struct boss_sothos : public BossAI
_Reset();
}
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
_scheduler.Schedule(12s, [this](TaskContext /*context*/)
{

View File

@@ -57,7 +57,7 @@ public:
{
boss_gahzrankaAI(Creature* creature) : BossAI(creature, DATA_GAHZRANKA) { }
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false);
}

View File

@@ -217,7 +217,7 @@ struct npc_shade_of_jindo : public ScriptedAI
{
npc_shade_of_jindo(Creature* creature) : ScriptedAI(creature) { }
void IsSummonedBy(Unit* /*summoner*/) override
void IsSummonedBy(WorldObject* /*summoner*/) override
{
DoZoneInCombat();
DoCastSelf(SPELL_SHADE_OF_JINDO_PASSIVE, true);