mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-17 01:04:34 +00:00
fix(Core/Misc): bunch of crashfixes (#7307)
This commit is contained in:
@@ -252,7 +252,7 @@ public:
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
if (Unit* midnight = summon->GetSummonerUnit())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
if (Unit* midnight = summon->GetSummonerUnit())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
Player* player = nullptr;
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit * summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit * summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
player = summoner->ToPlayer();
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
return;
|
||||
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* creature = summon->GetSummoner())
|
||||
if (Unit* creature = summon->GetSummonerUnit())
|
||||
creature->GetAI()->DoAction(1);
|
||||
|
||||
me->DespawnOrUnsummon(1);
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* creature = summon->GetSummoner())
|
||||
if (Unit* creature = summon->GetSummonerUnit())
|
||||
creature->GetAI()->DoAction(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
if (summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAlive() && !summoner->IsInCombat())
|
||||
summoner->ToCreature()->AI()->AttackStart(who);
|
||||
@@ -313,7 +313,7 @@ public:
|
||||
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
if (summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAlive())
|
||||
summoner->ToCreature()->DisappearAndDie();
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
|
||||
if (me->IsSummon())
|
||||
{
|
||||
Unit* summoner = me->ToTempSummon()->GetSummoner();
|
||||
Unit* summoner = me->ToTempSummon()->GetSummonerUnit();
|
||||
if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled)
|
||||
{
|
||||
npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai =
|
||||
|
||||
@@ -281,7 +281,7 @@ public:
|
||||
Creature* GetSummoner()
|
||||
{
|
||||
if (me->IsSummon())
|
||||
if (Unit* coren = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* coren = me->ToTempSummon()->GetSummonerUnit())
|
||||
return coren->ToCreature();
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -1274,7 +1274,7 @@ public:
|
||||
Unit* GetOwner()
|
||||
{
|
||||
if (me->ToTempSummon())
|
||||
return me->ToTempSummon()->GetSummoner();
|
||||
return me->ToTempSummon()->GetSummonerUnit();
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
if (Talk(actionCounter))
|
||||
{
|
||||
if (me->ToTempSummon())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
me->CastSpell(owner, SPELL_SNIVEL_GUN, true);
|
||||
|
||||
me->DespawnOrUnsummon(1000);
|
||||
|
||||
@@ -296,7 +296,7 @@ public:
|
||||
case SPELL_VISUAL_THROW_CRANBERRY:
|
||||
case SPELL_VISUAL_THROW_SWEET_POTATO:
|
||||
if (TempSummon* ts = me->ToTempSummon())
|
||||
if (Unit* owner = ts->GetSummoner())
|
||||
if (Unit* owner = ts->GetSummonerUnit())
|
||||
owner->ToCreature()->AI()->DoAction(spellInfo->Id);
|
||||
break;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
else
|
||||
{
|
||||
if (TempSummon* ts = target->ToTempSummon())
|
||||
if (Unit* owner = ts->GetSummoner())
|
||||
if (Unit* owner = ts->GetSummonerUnit())
|
||||
if (owner->GetEntry() == GetCaster()->GetEntry())
|
||||
return;
|
||||
|
||||
|
||||
@@ -1286,7 +1286,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* summoner = summon->GetSummoner())
|
||||
if (Unit* summoner = summon->GetSummonerUnit())
|
||||
if (summoner->IsAIEnabled)
|
||||
summoner->GetAI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
if (!(*itr)->IsSummon())
|
||||
continue;
|
||||
|
||||
if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = (*itr)->ToTempSummon()->GetSummonerUnit())
|
||||
if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER)
|
||||
&& !summoner->IsInCombat())
|
||||
{
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
if (victim->GetTypeId() != TYPEID_UNIT || !victim->IsSummon())
|
||||
return;
|
||||
|
||||
if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner())
|
||||
if (Unit* vehSummoner = victim->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA);
|
||||
vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS);
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
{
|
||||
damage = 0;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner())
|
||||
if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner);
|
||||
vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true);
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid))
|
||||
{
|
||||
if (tiger->IsSummon())
|
||||
if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner())
|
||||
if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummonerUnit())
|
||||
me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner);
|
||||
}
|
||||
_events.ScheduleEvent(EVENT_NOSUMMON, 50000);
|
||||
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
events.Reset();
|
||||
|
||||
if (me->ToTempSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (summoner->GetEntry() == me->GetEntry())
|
||||
{
|
||||
me->CastSpell(me, RAND(SPELL_SUMMON_ANUBAR_CHAMPION, SPELL_SUMMON_ANUBAR_CRYPT_FIEND, SPELL_SUMMON_ANUBAR_NECROMANCER), true);
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
void EnterCombat(Unit*) override
|
||||
{
|
||||
if (me->ToTempSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (summoner->GetEntry() != me->GetEntry())
|
||||
{
|
||||
summoner->GetAI()->DoAction(ACTION_START_EVENT);
|
||||
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
summon->CastSpell(summon, SPELL_METEOR_STRIKE_FIRE_AURA_2, true);
|
||||
if (summons.GetEntryCount(NPC_METEOR_STRIKE_FLAME) <= 16)
|
||||
summon->CastSpell(summon, SPELL_METEOR_STRIKE_SPREAD, true);
|
||||
if (Unit* summoner = summon->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = summon->ToTempSummon()->GetSummonerUnit())
|
||||
summon->SetOrientation(summoner->GetAngle(summon));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ public:
|
||||
if (me->ToTempSummon())
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER || who->GetOwnerGUID().IsPlayer())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
summoner->GetAI()->DoAction(ACTION_INFORM);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ public:
|
||||
return;
|
||||
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
if (Unit* trapped = summ->GetSummoner())
|
||||
if (Unit* trapped = summ->GetSummonerUnit())
|
||||
{
|
||||
Position exitPos = {me->GetPositionX(), me->GetPositionY(), 60.0f, me->GetOrientation()};
|
||||
trapped->UpdateAllowedPositionZ(exitPos.GetPositionX(), exitPos.GetPositionY(), exitPos.m_positionZ);
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
if (Unit* trapped = summ->GetSummoner())
|
||||
if (Unit* trapped = summ->GetSummonerUnit())
|
||||
{
|
||||
if (!trapped->IsOnVehicle(me) || !trapped->IsAlive() || !me->GetInstanceScript() || me->GetInstanceScript()->GetBossState(DATA_LORD_MARROWGAR) != IN_PROGRESS || trapped->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
|
||||
{
|
||||
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
DoResetThreat();
|
||||
me->SetInCombatWithZone();
|
||||
if (TempSummon* ts = me->ToTempSummon())
|
||||
if (Unit* summoner = ts->GetSummoner())
|
||||
if (Unit* summoner = ts->GetSummonerUnit())
|
||||
{
|
||||
me->AddThreat(summoner, 500000.0f);
|
||||
AttackStart(summoner);
|
||||
|
||||
@@ -2312,7 +2312,7 @@ public:
|
||||
bool valid = false;
|
||||
me->CastSpell(me, SPELL_RAGING_SPIRIT_VISUAL, true);
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* summoner = summon->GetSummoner())
|
||||
if (Unit* summoner = summon->GetSummonerUnit())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER && summoner->IsAlive() && !summoner->ToPlayer()->IsBeingTeleported() && summoner->FindMap() == me->GetMap())
|
||||
{
|
||||
valid = true;
|
||||
@@ -2373,7 +2373,7 @@ public:
|
||||
{
|
||||
bool valid = false;
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* summoner = summon->GetSummoner())
|
||||
if (Unit* summoner = summon->GetSummonerUnit())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER && summoner->IsAlive() && !summoner->ToPlayer()->IsBeingTeleported() && summoner->FindMap() == me->GetMap())
|
||||
{
|
||||
valid = true;
|
||||
@@ -3038,7 +3038,7 @@ public:
|
||||
return;
|
||||
|
||||
if (TempSummon* summon = GetCaster()->ToTempSummon())
|
||||
if (Unit* summoner = summon->GetSummoner())
|
||||
if (Unit* summoner = summon->GetSummonerUnit())
|
||||
summoner->GetAI()->SetData(DATA_VILE, 1);
|
||||
|
||||
if (Creature* c = GetCaster()->ToCreature())
|
||||
@@ -3154,7 +3154,7 @@ public:
|
||||
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
if (Unit* summoner = summ->GetSummoner())
|
||||
if (Unit* summoner = summ->GetSummonerUnit())
|
||||
{
|
||||
bool buff = _instance->GetBossState(DATA_THE_LICH_KING) == IN_PROGRESS && summoner->GetTypeId() == TYPEID_PLAYER && (!summoner->IsAlive() || summoner->ToPlayer()->IsBeingTeleported() || summoner->FindMap() != me->GetMap());
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER && !summoner->ToPlayer()->IsBeingTeleported() && summoner->FindMap() == me->GetMap())
|
||||
@@ -3191,7 +3191,7 @@ public:
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
if (Unit* summoner = summ->GetSummoner())
|
||||
if (Unit* summoner = summ->GetSummonerUnit())
|
||||
{
|
||||
if (summoner->IsAlive() && summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -663,7 +663,7 @@ public:
|
||||
timer = 2500;
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit* s = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* s = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
if ((s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || (s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC)))
|
||||
me->DespawnOrUnsummon(2000);
|
||||
|
||||
@@ -2405,7 +2405,7 @@ public:
|
||||
case SPELL_WATER_SPRAY:
|
||||
{
|
||||
if (me->IsSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (Creature* c = summoner->ToCreature())
|
||||
if (c->AI())
|
||||
CAST_AI(npc_ulduar_flames_initial::npc_ulduar_flames_initialAI, c->AI())->RemoveFlame(me->GetGUID());
|
||||
|
||||
@@ -1769,7 +1769,7 @@ public:
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
if (me->IsSummon())
|
||||
if (Unit* sara = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* sara = me->ToTempSummon()->GetSummonerUnit())
|
||||
sara->GetAI()->DoAction(ACTION_INFLUENCE_TENTACLE_DIED);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
npc_frost_tombAI(Creature* c) : NullCreatureAI(c)
|
||||
{
|
||||
if (TempSummon* t = c->ToTempSummon())
|
||||
if (Unit* s = t->GetSummoner())
|
||||
if (Unit* s = t->GetSummonerUnit())
|
||||
{
|
||||
PrisonerGUID = s->GetGUID();
|
||||
if( me->GetInstanceScript() && me->GetInstanceScript()->instance->IsHeroic() )
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
checkTimer = 5000;
|
||||
bool good = false;
|
||||
if (me->IsSummon())
|
||||
if (Unit* s = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* s = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (s->IsAlive())
|
||||
good = true;
|
||||
if (!good)
|
||||
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
void InitializeAI() override
|
||||
{
|
||||
if (me->ToTempSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
summonerGUID = summoner->GetGUID();
|
||||
float x, y, z;
|
||||
@@ -478,8 +478,8 @@ public:
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
if (me->ToTempSummon() && me->ToTempSummon()->GetSummoner())
|
||||
me->setFaction(me->ToTempSummon()->GetSummoner()->getFaction());
|
||||
if (me->ToTempSummon() && me->ToTempSummon()->GetSummonerUnit())
|
||||
me->setFaction(me->ToTempSummon()->GetSummonerUnit()->getFaction());
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
@@ -568,7 +568,7 @@ public:
|
||||
me->RemoveAllAuras();
|
||||
me->DespawnOrUnsummon(1000);
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* owner = summon->GetSummoner())
|
||||
if (Unit* owner = summon->GetSummonerUnit())
|
||||
if (Player* player = owner->ToPlayer())
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
{
|
||||
me->SetDisableGravity(true);
|
||||
if (me->IsSummon())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
me->GetMotionMaster()->MovePoint(0, *owner);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
cow->CastSpell(cow, 44460, true);
|
||||
cow->DespawnOrUnsummon(10000);
|
||||
if (me->IsSummon())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
owner->CastSpell(owner, 44463, true);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
void setphase(short newPhase)
|
||||
{
|
||||
Unit* summoner = me->ToTempSummon() ? me->ToTempSummon()->GetSummoner() : nullptr;
|
||||
Unit* summoner = me->ToTempSummon() ? me->ToTempSummon()->GetSummonerUnit() : nullptr;
|
||||
if (!summoner || summoner->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
{
|
||||
ObjectGuid summonerGUID;
|
||||
if (me->IsSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (summoner->GetTypeId() == TYPEID_PLAYER)
|
||||
summonerGUID = summoner->GetGUID();
|
||||
|
||||
|
||||
@@ -1258,7 +1258,7 @@ public:
|
||||
Unit* GetSummoner()
|
||||
{
|
||||
if (TempSummon* tempSummon = me->ToTempSummon())
|
||||
return tempSummon->GetSummoner();
|
||||
return tempSummon->GetSummonerUnit();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2072,7 +2072,7 @@ public:
|
||||
|
||||
if (id == POINT_GRAB_DECOY)
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* summoner = summon->GetSummoner())
|
||||
if (Unit* summoner = summon->GetSummonerUnit())
|
||||
DoCast(summoner, SPELL_GRAB);
|
||||
}
|
||||
|
||||
|
||||
@@ -680,7 +680,7 @@ public:
|
||||
return;
|
||||
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
if (Unit* summoner = summ->GetSummoner())
|
||||
if (Unit* summoner = summ->GetSummonerUnit())
|
||||
me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ());
|
||||
|
||||
Reset();
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
break;
|
||||
case 19:
|
||||
me->MonsterTextEmote("The frosthound has located the thief's hiding place. Confront him!", 0, true);
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
summoner->ToPlayer()->KilledMonsterCredit(29677);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
ghoul->GetMotionMaster()->MoveTargetedHome();
|
||||
}
|
||||
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (Player* player = owner->ToPlayer())
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
if (_owner.IsSummon())
|
||||
if (Unit* summoner = _owner.ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = _owner.ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
summoner->GetAI()->DoAction(_action);
|
||||
_owner.SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
@@ -514,7 +514,7 @@ public:
|
||||
{
|
||||
Talk(ANGER_SAY_DEATH);
|
||||
if (me->IsSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
Unit::Kill(summoner, summoner);
|
||||
}
|
||||
|
||||
|
||||
@@ -648,7 +648,7 @@ public:
|
||||
NullCreatureAI::InitializeAI();
|
||||
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* owner = summon->GetSummoner())
|
||||
if (Unit* owner = summon->GetSummonerUnit())
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
_ownerGUID = owner->GetGUID();
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
uint32 hp = uint32(owner->GetMaxHealth() * 0.3f);
|
||||
me->SetMaxHealth(hp);
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (me->IsSummon())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
|
||||
owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
|
||||
}
|
||||
|
||||
@@ -851,7 +851,7 @@ public:
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
GetUnitOwner()->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, owner->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID));
|
||||
GetUnitOwner()->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, owner->GetUInt32Value(PLAYER_VISIBLE_ITEM_17_ENTRYID));
|
||||
|
||||
@@ -224,7 +224,7 @@ public:
|
||||
// xinef: chance of success stores proper amount of damage increase
|
||||
// xinef: little hack because GetSpellModOwner will return nullptr pointer at this point (early summoning stage)
|
||||
if (GetUnitOwner()->IsSummon())
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = GetUnitOwner()->ToTempSummon()->GetSummonerUnit())
|
||||
if (Player* player = owner->GetSpellModOwner())
|
||||
player->ApplySpellMod(SPELL_DRUID_BARKSKIN, SPELLMOD_CHANCE_OF_SUCCESS, amount);
|
||||
}
|
||||
|
||||
@@ -3847,7 +3847,7 @@ public:
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (TempSummon* vehicle = caster->ToTempSummon())
|
||||
if (Unit* rider = vehicle->GetSummoner())
|
||||
if (Unit* rider = vehicle->GetSummonerUnit())
|
||||
rider->RemoveAurasDueToSpell(GetId());
|
||||
}
|
||||
|
||||
|
||||
@@ -580,7 +580,7 @@ public:
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetCaster()->GetGUID()))
|
||||
{
|
||||
aur->GetBase()->RefreshTimersWithMods();
|
||||
aur->GetBase()->RefreshTimers();
|
||||
aur->ChangeAmount(aur->CalculateAmount(aur->GetCaster()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* owner = target->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = target->ToTempSummon()->GetSummonerUnit())
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
owner->ToPlayer()->KilledMonsterCredit(23327); // Some trigger, just count
|
||||
}
|
||||
|
||||
@@ -764,7 +764,7 @@ public:
|
||||
// Refresh corruption on target
|
||||
if (AuraEffect* aur = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, GetCaster()->GetGUID()))
|
||||
{
|
||||
aur->GetBase()->RefreshTimersWithMods();
|
||||
aur->GetBase()->RefreshTimers();
|
||||
aur->ChangeAmount(aur->CalculateAmount(aur->GetCaster()), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1707,7 +1707,7 @@ public:
|
||||
{
|
||||
if (creature->IsSummon())
|
||||
{
|
||||
if (player == creature->ToTempSummon()->GetSummoner())
|
||||
if (player == creature->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
|
||||
Reference in New Issue
Block a user