mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
This commit is contained in:
@@ -138,7 +138,7 @@ public:
|
||||
break;
|
||||
case EVENT_CONFLAGRATION:
|
||||
DoCastVictim(SPELL_CONFLAGRATION);
|
||||
if (me->GetVictim() && me->GetVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (me->GetVictim() && me->EnsureVictim()->HasAura(SPELL_CONFLAGRATION))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
|
||||
me->TauntApply(target);
|
||||
events.ScheduleEvent(EVENT_CONFLAGRATION, 30000);
|
||||
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
break;
|
||||
case EVENT_BURNINGADRENALINE_TANK:
|
||||
// have the victim cast the spell on himself otherwise the third effect aura will be applied to Vael instead of the player
|
||||
me->GetVictim()->CastSpell(me->GetVictim(), SPELL_BURNINGADRENALINE, true);
|
||||
me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_BURNINGADRENALINE, true);
|
||||
events.ScheduleEvent(EVENT_BURNINGADRENALINE_TANK, 45000);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
if (pAttumen->GetVictim())
|
||||
{
|
||||
pAttumen->GetMotionMaster()->MoveChase(pAttumen->GetVictim());
|
||||
pAttumen->SetTarget(pAttumen->GetVictim()->GetGUID());
|
||||
pAttumen->SetTarget(pAttumen->EnsureVictim()->GetGUID());
|
||||
}
|
||||
pAttumen->SetObjectScale(1);
|
||||
}
|
||||
|
||||
@@ -391,8 +391,8 @@ public:
|
||||
if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
|
||||
return;
|
||||
|
||||
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->GetVictim()->GetGUID())
|
||||
me->SetTarget(me->GetVictim()->GetGUID());
|
||||
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->EnsureVictim()->GetGUID())
|
||||
me->SetTarget(me->EnsureVictim()->GetGUID());
|
||||
|
||||
if (phase == 1)
|
||||
{
|
||||
|
||||
@@ -484,10 +484,10 @@ public:
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
else if (me->GetVictim()->GetTypeId() == TYPEID_PLAYER && me->GetVictim()->HealthBelowPct(10))
|
||||
else if (me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER && me->EnsureVictim()->HealthBelowPct(10))
|
||||
{
|
||||
me->GetVictim()->CastSpell(me->GetVictim(), 7267, true); // beg
|
||||
me->GetVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true);
|
||||
me->EnsureVictim()->CastSpell(me->GetVictim(), 7267, true); // beg
|
||||
me->EnsureVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true);
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
@@ -837,7 +837,7 @@ public:
|
||||
|
||||
//ScriptedAI::UpdateAI(diff);
|
||||
//Check if we have a current target
|
||||
if (me->GetVictim()->GetEntry() == NPC_GHOSTS)
|
||||
if (me->EnsureVictim()->GetEntry() == NPC_GHOSTS)
|
||||
{
|
||||
if (me->isAttackReady())
|
||||
{
|
||||
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
Unit* target = (*itr)->getTarget();
|
||||
if (target
|
||||
&& target->GetTypeId() == TYPEID_PLAYER
|
||||
&& target->GetGUID() != me->GetVictim()->GetGUID()
|
||||
&& target->GetGUID() != me->EnsureVictim()->GetGUID()
|
||||
&& target->GetPositionZ() > me->GetPositionZ() - 5
|
||||
&& !target->HasAura(AURA_SPECTRAL_EXHAUSTION))
|
||||
{
|
||||
|
||||
@@ -1255,7 +1255,7 @@ public:
|
||||
|
||||
if ((victimClass == 0) && me->GetVictim())
|
||||
{
|
||||
victimClass = me->GetVictim()->getClass();
|
||||
victimClass = me->EnsureVictim()->getClass();
|
||||
switch (victimClass)
|
||||
{
|
||||
case CLASS_DRUID:
|
||||
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
|
||||
if (me->IsInCombat() && me->GetVictim())
|
||||
{
|
||||
if (Player* player = me->GetVictim()->ToPlayer())
|
||||
if (Player* player = me->EnsureVictim()->ToPlayer())
|
||||
{
|
||||
if (player->GetTeam() == HORDE)
|
||||
{
|
||||
|
||||
@@ -1351,7 +1351,7 @@ public:
|
||||
if (MoveTimer <= diff)
|
||||
{
|
||||
float x, y, z;
|
||||
me->GetVictim()->GetPosition(x, y, z);
|
||||
me->EnsureVictim()->GetPosition(x, y, z);
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z+Zpos);
|
||||
Zpos -= 1.0f;
|
||||
if (Zpos <= 0)
|
||||
|
||||
@@ -157,7 +157,7 @@ class boss_ayamiss : public CreatureScript
|
||||
SetCombatMovement(true);
|
||||
me->SetCanFly(false);
|
||||
Position VictimPos;
|
||||
me->GetVictim()->GetPosition(&VictimPos);
|
||||
me->EnsureVictim()->GetPosition(&VictimPos);
|
||||
me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
|
||||
DoResetThreat();
|
||||
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
|
||||
|
||||
@@ -272,7 +272,7 @@ class npc_glob_of_viscidus : public CreatureScript
|
||||
if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f)
|
||||
{
|
||||
Viscidus->SetVisible(true);
|
||||
Viscidus->GetVictim()->Kill(Viscidus);
|
||||
Viscidus->EnsureVictim()->Kill(Viscidus);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
{
|
||||
if (SendItemTimer <= diff)
|
||||
{
|
||||
if (me->GetVictim()->GetTypeId() == TYPEID_PLAYER)
|
||||
if (me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER)
|
||||
SendItem(me->GetVictim());
|
||||
SendItemTimer = 5000;
|
||||
} else SendItemTimer -= diff;
|
||||
|
||||
@@ -198,8 +198,8 @@ uint8 const MAX_CORPOREALITY_STATE = 11;
|
||||
|
||||
struct CorporealityEntry
|
||||
{
|
||||
uint32 materialRealmSpell;
|
||||
uint32 twilightRealmSpell;
|
||||
uint32 materialRealmSpell;
|
||||
};
|
||||
|
||||
CorporealityEntry const _corporealityReference[MAX_CORPOREALITY_STATE] = {
|
||||
|
||||
@@ -374,7 +374,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
|
||||
|
||||
// both spells have SPELL_ATTR5_SINGLE_TARGET_SPELL, no manual removal needed
|
||||
newOfftank->CastSpell(me->GetVictim(), SPELL_BLOOD_MIRROR_DAMAGE, true);
|
||||
me->GetVictim()->CastSpell(newOfftank, SPELL_BLOOD_MIRROR_DUMMY, true);
|
||||
me->EnsureVictim()->CastSpell(newOfftank, SPELL_BLOOD_MIRROR_DUMMY, true);
|
||||
DoCastVictim(SPELL_BLOOD_MIRROR_VISUAL);
|
||||
if (Is25ManRaid() && newOfftank->GetQuestStatus(QUEST_BLOOD_INFUSION) == QUEST_STATUS_INCOMPLETE &&
|
||||
newOfftank->HasAura(SPELL_UNSATED_CRAVING) && !newOfftank->HasAura(SPELL_THIRST_QUENCHED) &&
|
||||
|
||||
@@ -890,7 +890,7 @@ class npc_darnavan : public CreatureScript
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (_canShatter && me->GetVictim() && me->GetVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL))
|
||||
if (_canShatter && me->GetVictim() && me->EnsureVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL))
|
||||
{
|
||||
DoCastVictim(SPELL_SHATTERING_THROW);
|
||||
_canShatter = false;
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (me->GetVictim() && me->GetVictim()->GetEntry() == NPC_ZOMBIE)
|
||||
if (me->GetVictim() && me->EnsureVictim()->GetEntry() == NPC_ZOMBIE)
|
||||
{
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
|
||||
@@ -231,7 +231,7 @@ class boss_urom : public CreatureScript
|
||||
if (arcaneExplosionTimer <= diff)
|
||||
{
|
||||
Position pos;
|
||||
me->GetVictim()->GetPosition(&pos);
|
||||
me->EnsureVictim()->GetPosition(&pos);
|
||||
|
||||
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
|
||||
@@ -199,10 +199,10 @@ class npc_flash_freeze : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!UpdateVictim() || me->GetVictim()->HasAura(SPELL_BLOCK_OF_ICE) || me->GetVictim()->HasAura(SPELL_FLASH_FREEZE_HELPER))
|
||||
if (!UpdateVictim() || me->EnsureVictim()->HasAura(SPELL_BLOCK_OF_ICE) || me->EnsureVictim()->HasAura(SPELL_FLASH_FREEZE_HELPER))
|
||||
return;
|
||||
|
||||
if (me->GetVictim()->GetGUID() != targetGUID || instance->GetBossState(BOSS_HODIR) != IN_PROGRESS)
|
||||
if (me->EnsureVictim()->GetGUID() != targetGUID || instance->GetBossState(BOSS_HODIR) != IN_PROGRESS)
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
if (checkDespawnTimer <= diff)
|
||||
|
||||
@@ -2077,12 +2077,12 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->GetVictim()->GetTypeId() != TYPEID_PLAYER)
|
||||
if (me->EnsureVictim()->GetTypeId() != TYPEID_PLAYER)
|
||||
return; // Only cast the below on players.
|
||||
|
||||
if (!me->GetVictim()->HasAura(SPELL_PARALYZE))
|
||||
if (!me->EnsureVictim()->HasAura(SPELL_PARALYZE))
|
||||
{
|
||||
TargetGUID = me->GetVictim()->GetGUID();
|
||||
TargetGUID = me->EnsureVictim()->GetGUID();
|
||||
me->AddThreat(me->GetVictim(), 10000000.0f);
|
||||
DoCastVictim(SPELL_PURPLE_BEAM, true);
|
||||
DoCastVictim(SPELL_PARALYZE, true);
|
||||
@@ -2154,8 +2154,8 @@ public:
|
||||
{
|
||||
if (me->isAttackReady() && me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
if (!me->GetVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
|
||||
&& !me->GetVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
|
||||
if (!me->EnsureVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
|
||||
&& !me->EnsureVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
|
||||
{
|
||||
if (Creature* illidan = Unit::GetCreature((*me), IllidanGUID))// summon only in 1. phase
|
||||
if (CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL)
|
||||
|
||||
@@ -673,17 +673,17 @@ public:
|
||||
|
||||
if (!CheckedAggro)
|
||||
{
|
||||
AggroTargetGUID = me->GetVictim()->GetGUID();
|
||||
AggroTargetGUID = me->EnsureVictim()->GetGUID();
|
||||
CheckedAggro = true;
|
||||
}
|
||||
|
||||
if (CheckTankTimer <= diff)
|
||||
{
|
||||
if (me->GetVictim()->GetGUID() != AggroTargetGUID)
|
||||
if (me->EnsureVictim()->GetGUID() != AggroTargetGUID)
|
||||
{
|
||||
Talk(ANGER_SAY_BEFORE);
|
||||
DoCast(me, SPELL_SELF_SEETHE, true);
|
||||
AggroTargetGUID = me->GetVictim()->GetGUID();
|
||||
AggroTargetGUID = me->EnsureVictim()->GetGUID();
|
||||
}
|
||||
CheckTankTimer = 2000;
|
||||
} else CheckTankTimer -= diff;
|
||||
|
||||
@@ -626,7 +626,7 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_TIDAL_SURGE);
|
||||
// Hacky way to do it - won't trigger elseways
|
||||
me->GetVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
|
||||
me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
|
||||
TidalSurge_Timer = 15000+rand()%5000;
|
||||
} else TidalSurge_Timer -= diff;
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->GetVictim()->GetGUID() != victimGUID)
|
||||
if (me->EnsureVictim()->GetGUID() != victimGUID)
|
||||
{
|
||||
DoModifyThreatPercent(me->GetVictim(), -100);
|
||||
Unit* owner = Unit::GetUnit(*me, victimGUID);
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
for (ThreatContainer::StorageType::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
|
||||
{
|
||||
Unit* tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->GetVictim()->GetGUID() && TargetList.size()<5)
|
||||
if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->EnsureVictim()->GetGUID() && TargetList.size()<5)
|
||||
TargetList.push_back(tempTarget);
|
||||
}
|
||||
//SpellInfo* spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER);
|
||||
|
||||
@@ -115,7 +115,7 @@ class npc_warp_splinter_treant : public CreatureScript
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->GetVictim()->GetGUID() != WarpGuid)
|
||||
if (me->EnsureVictim()->GetGUID() != WarpGuid)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me))
|
||||
if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user