Scripts: A lots of changes here and there (maybe useless?!?)
This commit is contained in:
+1
-1
@@ -191,7 +191,7 @@ public:
|
||||
|
||||
void SetData(uint32 type, uint32 data) OVERRIDE
|
||||
{
|
||||
if (instance && type == AREATRIGGER && data == AREATRIGGER_BLACKROCK_STADIUM)
|
||||
if (type == AREATRIGGER && data == AREATRIGGER_BLACKROCK_STADIUM)
|
||||
{
|
||||
if (!gythEvent)
|
||||
{
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetBossState(BOSS_FLAMEGOR) != DONE)
|
||||
if (instance->GetBossState(BOSS_FLAMEGOR) != DONE)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE)
|
||||
if (instance->GetBossState(BOSS_BROODLORD) != DONE)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE)
|
||||
if (instance->GetBossState(BOSS_BROODLORD) != DONE)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetBossState(BOSS_BROODLORD) != DONE)
|
||||
if (instance->GetBossState(BOSS_BROODLORD) != DONE)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
+2
-4
@@ -223,16 +223,14 @@ public:
|
||||
|
||||
void SetData(uint32 type, uint32 data) OVERRIDE
|
||||
{
|
||||
if (instance && type == 1 && data == 1)
|
||||
if ( type == 1 && data == 1)
|
||||
{
|
||||
me->StopMoving();
|
||||
events.ScheduleEvent(EVENT_PATH_2, 9000);
|
||||
}
|
||||
|
||||
if (instance && type == 1 && data == 2)
|
||||
{
|
||||
if (type == 1 && data == 2)
|
||||
events.ScheduleEvent(EVENT_SUCCESS_1, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ class boss_majordomo : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
if (instance->GetBossState(BOSS_MAJORDOMO_EXECUTUS) != DONE)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -233,7 +233,7 @@ class boss_ragnaros : public CreatureScript
|
||||
break;
|
||||
case EVENT_SUBMERGE:
|
||||
{
|
||||
if (instance && !_isBanished)
|
||||
if (!_isBanished)
|
||||
{
|
||||
//Creature spawning and ragnaros becomming unattackable
|
||||
//is not very well supported in the core //no it really isnt
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
|
||||
if (instance && instance->GetData(TYPE_EVENT) == NOT_STARTED)
|
||||
if (instance->GetData(TYPE_EVENT) == NOT_STARTED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, creature->GetGUID());
|
||||
@@ -193,15 +193,10 @@ public:
|
||||
instance->HandleGameObject(0, false, go);
|
||||
}
|
||||
|
||||
void SetInFace(bool bBool)
|
||||
void SetInFace(bool isRight)
|
||||
{
|
||||
if (bBool)
|
||||
{
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
|
||||
me->SetFacingToObject(go);
|
||||
}else
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT)))
|
||||
me->SetFacingToObject(go);
|
||||
if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(isRight ? DATA_GO_CAVE_IN_RIGHT : DATA_GO_CAVE_IN_LEFT)))
|
||||
me->SetFacingToObject(go);
|
||||
}
|
||||
|
||||
void RestoreAll()
|
||||
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (instance && !instance->GetData(TYPE_MOROES))
|
||||
if (!instance->GetData(TYPE_MOROES))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -371,7 +371,7 @@ struct boss_moroes_guestAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE
|
||||
{
|
||||
if (instance && !instance->GetData(TYPE_MOROES))
|
||||
if (!instance->GetData(TYPE_MOROES))
|
||||
EnterEvadeMode();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -496,12 +496,13 @@ public:
|
||||
EventStarted = false;
|
||||
YellTimer = 0;
|
||||
|
||||
if (instance && instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
if (instance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
|
||||
{
|
||||
instance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
|
||||
(*me).GetMotionMaster()->MovePoint(1, MedivPos[0], MedivPos[1], MedivPos[2]);
|
||||
Step = 0;
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
me->RemoveCorpse();
|
||||
|
||||
@@ -515,7 +515,7 @@ public:
|
||||
return;
|
||||
}
|
||||
//Don't really die in all phases of Kael'Thas
|
||||
if (instance && instance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
if (instance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
{
|
||||
//prevent death
|
||||
damage = 0;
|
||||
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
|
||||
if (_bHasDied && !_bHeal && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
|
||||
{
|
||||
//On ressurection, stop fake death and heal whitemane and resume fight
|
||||
if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE)))
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
|
||||
void AttackStart(Unit* who) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
|
||||
if (instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED)
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
@@ -289,11 +289,11 @@ public:
|
||||
if (_bCanResurrect)
|
||||
{
|
||||
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
|
||||
if (instance && Wait_Timer <= diff)
|
||||
if (Wait_Timer <= diff)
|
||||
{
|
||||
if (Unit* Mograine = Unit::GetUnit(*me, instance->GetData64(DATA_MOGRAINE)))
|
||||
if (Creature* mograine = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOGRAINE)))
|
||||
{
|
||||
DoCast(Mograine, SPELL_SCARLETRESURRECTION);
|
||||
DoCast(mograine, SPELL_SCARLETRESURRECTION);
|
||||
Talk(SAY_WH_RESSURECT);
|
||||
_bCanResurrect = false;
|
||||
}
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
if (!HealthAbovePct(75))
|
||||
target = me;
|
||||
|
||||
if (Creature* mograine = Unit::GetCreature((*me), instance->GetData64(DATA_MOGRAINE)))
|
||||
if (Creature* mograine = Unit::GetCreature(*me, instance->GetData64(DATA_MOGRAINE)))
|
||||
{
|
||||
// checking _bCanResurrectCheck prevents her healing Mograine while he is "faking death"
|
||||
if (_bCanResurrectCheck && mograine->IsAlive() && !mograine->HealthAbovePct(75))
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
|
||||
if (instance && instance->GetData(TYPE_FREE_NPC) != DONE && instance->GetData(TYPE_RETHILGORE) == DONE)
|
||||
if (instance->GetData(TYPE_FREE_NPC) != DONE && instance->GetData(TYPE_RETHILGORE) == DONE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
MortalStrike_Timer = 12000;
|
||||
// RaiseDead_Timer = 30000;
|
||||
SummonSkeletons_Timer = 34000;
|
||||
if (instance && instance->GetData(TYPE_RAMSTEIN) == DONE)
|
||||
if (instance->GetData(TYPE_RAMSTEIN) == DONE)
|
||||
instance->SetData(TYPE_BARON, NOT_STARTED);
|
||||
}
|
||||
|
||||
|
||||
@@ -454,7 +454,7 @@ public:
|
||||
{
|
||||
if (uiRandomSayTimer < diff)
|
||||
{
|
||||
if (instance && instance->GetBossState(DATA_MURU) != DONE && instance->GetBossState(DATA_KILJAEDEN) == NOT_STARTED)
|
||||
if (instance->GetBossState(DATA_MURU) != DONE && instance->GetBossState(DATA_KILJAEDEN) == NOT_STARTED)
|
||||
Talk(SAY_KJ_OFFCOMBAT);
|
||||
uiRandomSayTimer = 30000;
|
||||
} else uiRandomSayTimer -= diff;
|
||||
|
||||
@@ -433,10 +433,11 @@ public:
|
||||
{
|
||||
if (!SummonSentinel)
|
||||
{
|
||||
if (InAction && instance && instance->GetBossState(DATA_MURU) == NOT_STARTED)
|
||||
if (InAction && instance->GetBossState(DATA_MURU) == NOT_STARTED)
|
||||
Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
if (SummonTimer <= diff)
|
||||
{
|
||||
DoCastAOE(SPELL_SUMMON_VOID_SENTINEL, false);
|
||||
|
||||
@@ -231,7 +231,7 @@ struct boss_hexlord_addAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
|
||||
if (instance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
@@ -344,9 +344,8 @@ class npc_zulian_prowler : public CreatureScript
|
||||
DoCast(me, SPELL_SNEAK_RANK_1_1);
|
||||
DoCast(me, SPELL_SNEAK_RANK_1_2);
|
||||
|
||||
if (_instance)
|
||||
if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK)))
|
||||
me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ());
|
||||
if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK)))
|
||||
me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ());
|
||||
_events.ScheduleEvent(EVENT_ATTACK, 6000);
|
||||
}
|
||||
|
||||
@@ -365,13 +364,10 @@ class npc_zulian_prowler : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (_instance)
|
||||
if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK)))
|
||||
{
|
||||
if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK)))
|
||||
{
|
||||
if (arlokk->IsAlive())
|
||||
arlokk->GetAI()->SetData(_sideData, 0);
|
||||
}
|
||||
if (arlokk->IsAlive())
|
||||
arlokk->GetAI()->SetData(_sideData, 0);
|
||||
}
|
||||
me->DespawnOrUnsummon(4000);
|
||||
}
|
||||
|
||||
@@ -72,14 +72,15 @@ public:
|
||||
AuraTimer = 5000;
|
||||
InfernoTimer = 45000;
|
||||
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_ANETHERONEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS);
|
||||
|
||||
Talk(SAY_ONAGGRO);
|
||||
}
|
||||
|
||||
@@ -91,7 +92,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance)
|
||||
if (waypointId == 7)
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE));
|
||||
if (target && target->IsAlive())
|
||||
|
||||
@@ -78,14 +78,15 @@ public:
|
||||
EnrageTimer = 600000;
|
||||
enraged = false;
|
||||
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_AZGALOREVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_AZGALOREVENT, IN_PROGRESS);
|
||||
|
||||
Talk(SAY_ONAGGRO);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,13 +74,13 @@ public:
|
||||
MarkTimer = 45000;
|
||||
MarkTimerBase = 45000;
|
||||
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_KAZROGALEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
|
||||
Talk(SAY_ONAGGRO);
|
||||
}
|
||||
|
||||
+2
-2
@@ -69,13 +69,13 @@ public:
|
||||
NovaTimer = 15000;
|
||||
IceboltTimer = 10000;
|
||||
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
|
||||
Talk(SAY_ONAGGRO);
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
case JAINA:
|
||||
if (instance && instance->GetData(DATA_ALLIANCE_RETREAT))
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))
|
||||
{
|
||||
me->SetVisible(false);
|
||||
HideNearPos(me->GetPositionX(), me->GetPositionY());
|
||||
@@ -717,7 +717,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
else me->SetVisible(true);
|
||||
break;
|
||||
case THRALL: //thrall
|
||||
if (instance && instance->GetData(DATA_HORDE_RETREAT))
|
||||
if (instance->GetData(DATA_HORDE_RETREAT))
|
||||
{
|
||||
me->SetVisible(false);
|
||||
HideNearPos(me->GetPositionX(), me->GetPositionY());
|
||||
@@ -781,7 +781,7 @@ void hyjalAI::UpdateAI(uint32 diff)
|
||||
|
||||
if (Summon)
|
||||
{
|
||||
if (instance && EnemyCount)
|
||||
if (EnemyCount)
|
||||
{
|
||||
EnemyCount = instance->GetData(DATA_TRASH);
|
||||
if (!EnemyCount)
|
||||
|
||||
@@ -443,7 +443,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 0 && instance && !IsOverrun)
|
||||
if (waypointId == 0 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -559,7 +559,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance && !IsOverrun)
|
||||
if (waypointId == 7 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -658,7 +658,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance && !IsOverrun)
|
||||
if (waypointId == 7 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -769,7 +769,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance && !IsOverrun)
|
||||
if (waypointId == 7 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -882,7 +882,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance && !IsOverrun)
|
||||
if (waypointId == 7 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -978,7 +978,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance && !IsOverrun)
|
||||
if (waypointId == 7 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -1064,7 +1064,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 7 && instance && !IsOverrun)
|
||||
if (waypointId == 7 && !IsOverrun)
|
||||
{
|
||||
if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
|
||||
{
|
||||
@@ -1153,7 +1153,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 2 && instance && !IsOverrun)
|
||||
if (waypointId == 2 && !IsOverrun)
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
@@ -1166,7 +1166,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance && IsEvent)
|
||||
if (IsEvent)
|
||||
instance->SetData(DATA_TRASH, 0);//signal trash is dead
|
||||
|
||||
float x, y, z;
|
||||
@@ -1181,11 +1181,13 @@ public:
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
hyjal_trashAI::UpdateAI(diff);
|
||||
|
||||
if (IsEvent || IsOverrun)
|
||||
{
|
||||
CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false);
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
if (IsEvent)
|
||||
{
|
||||
if (!go)
|
||||
@@ -1197,7 +1199,9 @@ public:
|
||||
AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]);
|
||||
Start(false, true);
|
||||
SetDespawnAtEnd(false);
|
||||
}else{//fly path FlyPathWPs
|
||||
}
|
||||
else
|
||||
{//fly path FlyPathWPs
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
AddWaypoint(i, FlyPathWPs[i][0]+irand(-10, 10), FlyPathWPs[i][1]+irand(-10, 10), FlyPathWPs[i][2]);
|
||||
Start(false, true);
|
||||
@@ -1205,9 +1209,12 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
if (!me->IsWithinDist(me->GetVictim(), 25)){
|
||||
|
||||
if (!me->IsWithinDist(me->GetVictim(), 25))
|
||||
{
|
||||
if (MoveTimer <= diff)
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
@@ -1227,7 +1234,6 @@ public:
|
||||
} else FrostBreathTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_gargoyle : public CreatureScript
|
||||
@@ -1246,7 +1252,8 @@ public:
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
go = false;
|
||||
DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
DummyTarget[i] = 0;
|
||||
Reset();
|
||||
}
|
||||
|
||||
@@ -1267,7 +1274,7 @@ public:
|
||||
|
||||
void WaypointReached(uint32 waypointId) OVERRIDE
|
||||
{
|
||||
if (waypointId == 2 && instance && !IsOverrun)
|
||||
if (waypointId == 2 && !IsOverrun)
|
||||
{
|
||||
Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL));
|
||||
if (target && target->IsAlive())
|
||||
@@ -1291,11 +1298,13 @@ public:
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
hyjal_trashAI::UpdateAI(diff);
|
||||
|
||||
if (IsEvent || IsOverrun)
|
||||
{
|
||||
CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false);
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
if (IsEvent)
|
||||
{
|
||||
if (!go)
|
||||
@@ -1315,6 +1324,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IsOverrun && !UpdateVictim())
|
||||
{
|
||||
if (faction == 0)//alliance
|
||||
@@ -1326,8 +1336,10 @@ public:
|
||||
} else StrikeTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!me->IsWithinDist(me->GetVictim(), 20) || forcemove)
|
||||
{
|
||||
forcemove = false;
|
||||
@@ -1347,6 +1359,7 @@ public:
|
||||
MoveTimer = 2000;
|
||||
} else MoveTimer-=diff;
|
||||
}
|
||||
|
||||
if (StrikeTimer <= diff)
|
||||
{
|
||||
if (me->IsWithinDist(me->GetVictim(), 20))
|
||||
@@ -1359,7 +1372,6 @@ public:
|
||||
} else StrikeTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class alliance_rifleman : public CreatureScript
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_THRALL_PART1, DONE);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ public:
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_THRALL_PART4, DONE);
|
||||
}
|
||||
|
||||
|
||||
+5
-10
@@ -82,7 +82,7 @@ public:
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS))
|
||||
if (instance->GetData(TYPE_BARREL_DIVERSION) != DONE && !player->HasItemCount(ITEM_ENTRY_BOMBS))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_EROZION1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
if (player->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE)
|
||||
@@ -92,7 +92,6 @@ public:
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*######
|
||||
@@ -585,18 +584,14 @@ public:
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
|
||||
if (instance->GetData64(DATA_EPOCH) == 0)
|
||||
creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
|
||||
|
||||
if (uint64 ThrallGUID = instance->GetData64(DATA_THRALL))
|
||||
{
|
||||
Creature* Thrall = (Unit::GetCreature((*creature), ThrallGUID));
|
||||
if (Thrall)
|
||||
CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP();
|
||||
}
|
||||
if (Creature* thrall = (Unit::GetCreature(*creature, instance->GetData64(DATA_THRALL))))
|
||||
CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, thrall->AI())->StartWP();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -605,7 +600,7 @@ public:
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetData(TYPE_THRALL_PART3) == DONE && instance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
|
||||
if (instance->GetData(TYPE_THRALL_PART3) == DONE && instance->GetData(TYPE_THRALL_PART4) == NOT_STARTED)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, creature->GetGUID());
|
||||
|
||||
@@ -138,8 +138,8 @@ public:
|
||||
|
||||
void AttackStart(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
//if (instance && instance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
||||
//return;
|
||||
//if (instance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
|
||||
// return;
|
||||
|
||||
//ScriptedAI::AttackStart(who);
|
||||
}
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
if (!creature_entry)
|
||||
return;
|
||||
|
||||
if (instance && instance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
|
||||
if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->RemoveAllAuras();
|
||||
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15);
|
||||
Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, Floor, check);
|
||||
me->VisitNearbyGridObject(30, searcher);
|
||||
if (instance && Floor)
|
||||
if (Floor)
|
||||
instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID());
|
||||
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000);
|
||||
break;
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
//Checking if Vem is dead. If yes we will enrage.
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
if (instance && instance->GetData(DATA_VEMISDEAD))
|
||||
if (instance->GetData(DATA_VEMISDEAD))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
VemDead = true;
|
||||
|
||||
@@ -394,7 +394,7 @@ public:
|
||||
|
||||
void AttackStart(Unit* victim) OVERRIDE
|
||||
{
|
||||
if ((instance && instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !victim)
|
||||
if ((instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !victim)
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(victim);
|
||||
@@ -403,7 +403,7 @@ public:
|
||||
void MoveInLineOfSight(Unit* who) OVERRIDE
|
||||
|
||||
{
|
||||
if ((instance && instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !who)
|
||||
if ((instance->GetBossState(DATA_JEDOGA_SHADOWSEEKER) == IN_PROGRESS) || !who)
|
||||
return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
@@ -432,7 +432,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (instance && bCheckTimer <= diff)
|
||||
if (bCheckTimer <= diff)
|
||||
{
|
||||
if (me->GetGUID() == instance->GetData64(DATA_ADD_JEDOGA_OPFER) && !bWalking)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
uiDoorsTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS);
|
||||
uiCheckDistanceTimer = 2*IN_MILLISECONDS;
|
||||
|
||||
if (instance && (instance->GetBossState(DATA_HADRONOX) != DONE && !bFirstTime))
|
||||
if (instance->GetBossState(DATA_HADRONOX) != DONE && !bFirstTime)
|
||||
instance->SetBossState(DATA_HADRONOX, FAIL);
|
||||
|
||||
bFirstTime = false;
|
||||
|
||||
@@ -253,7 +253,7 @@ struct dummy_dragonAI : public ScriptedAI
|
||||
{
|
||||
case NPC_TENEBRON:
|
||||
{
|
||||
if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
|
||||
if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
|
||||
{
|
||||
for (uint32 i = 0; i < 6; ++i)
|
||||
me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
|
||||
@@ -267,7 +267,7 @@ struct dummy_dragonAI : public ScriptedAI
|
||||
}
|
||||
case NPC_SHADRON:
|
||||
{
|
||||
if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
|
||||
if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
|
||||
me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000);
|
||||
else
|
||||
me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000);
|
||||
@@ -276,7 +276,7 @@ struct dummy_dragonAI : public ScriptedAI
|
||||
}
|
||||
case NPC_VESPERON:
|
||||
{
|
||||
if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
|
||||
if (!instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS)
|
||||
{
|
||||
if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
@@ -328,19 +328,19 @@ struct dummy_dragonAI : public ScriptedAI
|
||||
{
|
||||
case NPC_TENEBRON:
|
||||
spellId = SPELL_POWER_OF_TENEBRON;
|
||||
if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
|
||||
if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
|
||||
instance->SetBossState(DATA_TENEBRON, DONE);
|
||||
break;
|
||||
case NPC_SHADRON:
|
||||
spellId = SPELL_POWER_OF_SHADRON;
|
||||
if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
|
||||
if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
|
||||
instance->SetBossState(DATA_SHADRON, DONE);
|
||||
if (Creature* acolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f))
|
||||
acolyte->Kill(acolyte);
|
||||
break;
|
||||
case NPC_VESPERON:
|
||||
spellId = SPELL_POWER_OF_VESPERON;
|
||||
if (instance && instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
|
||||
if (instance->GetBossState(DATA_SARTHARION) != IN_PROGRESS)
|
||||
instance->SetBossState(DATA_VESPERON, DONE);
|
||||
if (Creature* acolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f))
|
||||
acolyte->Kill(acolyte);
|
||||
|
||||
+3
-5
@@ -252,9 +252,8 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
|
||||
void JustDied(Unit* killer) OVERRIDE
|
||||
{
|
||||
// This is here because DamageTaken wont trigger if the damage is deadly.
|
||||
if (_instance)
|
||||
if (Creature* baltharus = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_BALTHARUS_THE_WARBORN)))
|
||||
killer->Kill(baltharus);
|
||||
if (Creature* baltharus = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_BALTHARUS_THE_WARBORN)))
|
||||
killer->Kill(baltharus);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -262,8 +261,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (_instance)
|
||||
me->SetHealth(_instance->GetData(DATA_BALTHARUS_SHARED_HEALTH));
|
||||
me->SetHealth(_instance->GetData(DATA_BALTHARUS_SHARED_HEALTH));
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
|
||||
+14
-14
@@ -363,11 +363,11 @@ public:
|
||||
{
|
||||
bDone = true;
|
||||
|
||||
if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
|
||||
|
||||
EnterEvadeMode();
|
||||
@@ -496,11 +496,11 @@ public:
|
||||
{
|
||||
bDone = true;
|
||||
|
||||
if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
|
||||
|
||||
instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
|
||||
@@ -641,9 +641,9 @@ public:
|
||||
|
||||
if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
|
||||
|
||||
instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
|
||||
@@ -783,11 +783,11 @@ public:
|
||||
{
|
||||
bDone = true;
|
||||
|
||||
if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
|
||||
|
||||
instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
|
||||
@@ -929,11 +929,11 @@ public:
|
||||
{
|
||||
bDone = true;
|
||||
|
||||
if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
|
||||
me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
|
||||
me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
|
||||
else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
else if (me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
|
||||
me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
|
||||
|
||||
instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
|
||||
|
||||
+1
-1
@@ -431,7 +431,7 @@ public:
|
||||
|
||||
void JustSummoned(Creature* summon) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
|
||||
if (instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
|
||||
{
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
|
||||
+2
-2
@@ -470,7 +470,7 @@ class npc_swarm_scarab : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (_instance && _instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS)
|
||||
if (_instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
|
||||
if (!UpdateVictim())
|
||||
@@ -540,7 +540,7 @@ class npc_nerubian_burrower : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (_instance && _instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS)
|
||||
if (_instance->GetBossState(BOSS_ANUBARAK) != IN_PROGRESS)
|
||||
me->DisappearAndDie();
|
||||
|
||||
if (!UpdateVictim() && !me->HasAura(SPELL_SUBMERGE_EFFECT))
|
||||
|
||||
+5
-7
@@ -239,7 +239,7 @@ class npc_legion_flame : public CreatureScript
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE
|
||||
{
|
||||
UpdateVictim();
|
||||
if (_instance && _instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS)
|
||||
if (_instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
private:
|
||||
@@ -326,7 +326,7 @@ class npc_fel_infernal : public CreatureScript
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (_instance && _instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS)
|
||||
if (_instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
@@ -420,8 +420,7 @@ class npc_mistress_of_pain : public CreatureScript
|
||||
npc_mistress_of_painAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_instance = creature->GetInstanceScript();
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE);
|
||||
_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE);
|
||||
}
|
||||
|
||||
void Reset() OVERRIDE
|
||||
@@ -435,13 +434,12 @@ class npc_mistress_of_pain : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE);
|
||||
_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (_instance && _instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS)
|
||||
if (_instance->GetBossState(BOSS_JARAXXUS) != IN_PROGRESS)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
|
||||
+20
-25
@@ -295,8 +295,7 @@ class npc_snobold_vassal : public CreatureScript
|
||||
npc_snobold_vassalAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_instance = creature->GetInstanceScript();
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_SNOBOLD_COUNT, INCREASE);
|
||||
_instance->SetData(DATA_SNOBOLD_COUNT, INCREASE);
|
||||
}
|
||||
|
||||
void Reset() OVERRIDE
|
||||
@@ -350,8 +349,7 @@ class npc_snobold_vassal : public CreatureScript
|
||||
if (Unit* target = ObjectAccessor::GetPlayer(*me, _targetGUID))
|
||||
if (target->IsAlive())
|
||||
target->RemoveAurasDueToSpell(SPELL_SNOBOLLED);
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_SNOBOLD_COUNT, DECREASE);
|
||||
_instance->SetData(DATA_SNOBOLD_COUNT, DECREASE);
|
||||
}
|
||||
|
||||
void DoAction(int32 action) OVERRIDE
|
||||
@@ -378,30 +376,27 @@ class npc_snobold_vassal : public CreatureScript
|
||||
{
|
||||
if (!target->IsAlive())
|
||||
{
|
||||
if (_instance)
|
||||
Unit* gormok = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_GORMOK));
|
||||
if (gormok && gormok->IsAlive())
|
||||
{
|
||||
Unit* gormok = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_GORMOK));
|
||||
if (gormok && gormok->IsAlive())
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
_targetDied = true;
|
||||
SetCombatMovement(false);
|
||||
_targetDied = true;
|
||||
|
||||
// looping through Gormoks seats
|
||||
for (uint8 i = 0; i < MAX_SNOBOLDS; i++)
|
||||
// looping through Gormoks seats
|
||||
for (uint8 i = 0; i < MAX_SNOBOLDS; i++)
|
||||
{
|
||||
if (!gormok->GetVehicleKit()->GetPassenger(i))
|
||||
{
|
||||
if (!gormok->GetVehicleKit()->GetPassenger(i))
|
||||
{
|
||||
me->EnterVehicle(gormok, i);
|
||||
DoAction(ACTION_ENABLE_FIRE_BOMB);
|
||||
break;
|
||||
}
|
||||
me->EnterVehicle(gormok, i);
|
||||
DoAction(ACTION_ENABLE_FIRE_BOMB);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
_targetGUID = target2->GetGUID();
|
||||
me->GetMotionMaster()->MoveJump(target2->GetPositionX(), target2->GetPositionY(), target2->GetPositionZ(), 15.0f, 15.0f);
|
||||
}
|
||||
}
|
||||
else if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
_targetGUID = target2->GetGUID();
|
||||
me->GetMotionMaster()->MoveJump(target2->GetPositionX(), target2->GetPositionY(), target2->GetPositionZ(), 15.0f, 15.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -528,7 +523,7 @@ struct boss_jormungarAI : public BossAI
|
||||
void JustReachedHome() OVERRIDE
|
||||
{
|
||||
// prevent losing 2 attempts at once on heroics
|
||||
if (instance && instance->GetData(TYPE_NORTHREND_BEASTS) != FAIL)
|
||||
if (instance->GetData(TYPE_NORTHREND_BEASTS) != FAIL)
|
||||
instance->SetData(TYPE_NORTHREND_BEASTS, FAIL);
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
@@ -552,7 +547,7 @@ struct boss_jormungarAI : public BossAI
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!Enraged && instance && instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL)
|
||||
if (!Enraged && instance->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL)
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SUBMERGE_0);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
+5
-8
@@ -247,8 +247,8 @@ class boss_lich_king_toc : public CreatureScript
|
||||
summoned->CastSpell(summoned, 51807, false);
|
||||
summoned->SetDisplayId(summoned->GetCreatureTemplate()->Modelid2);
|
||||
}
|
||||
if (_instance)
|
||||
_instance->SetBossState(BOSS_LICH_KING, IN_PROGRESS);
|
||||
|
||||
_instance->SetBossState(BOSS_LICH_KING, IN_PROGRESS);
|
||||
me->SetWalk(true);
|
||||
}
|
||||
|
||||
@@ -401,12 +401,9 @@ class npc_fizzlebang_toc : public CreatureScript
|
||||
{
|
||||
case 1:
|
||||
me->SetWalk(false);
|
||||
if (_instance)
|
||||
{
|
||||
_instance->DoUseDoorOrButton(_instance->GetData64(GO_MAIN_GATE_DOOR));
|
||||
_instance->SetData(TYPE_EVENT, 1120);
|
||||
_instance->SetData(TYPE_EVENT_TIMER, 1*IN_MILLISECONDS);
|
||||
}
|
||||
_instance->DoUseDoorOrButton(_instance->GetData64(GO_MAIN_GATE_DOOR));
|
||||
_instance->SetData(TYPE_EVENT, 1120);
|
||||
_instance->SetData(TYPE_EVENT_TIMER, 1*IN_MILLISECONDS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -664,8 +664,7 @@ class npc_jaina_or_sylvanas_hor : public CreatureScript
|
||||
_events.ScheduleEvent(EVENT_INTRO_END, 5000);
|
||||
break;
|
||||
case EVENT_INTRO_END:
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_INTRO_EVENT, DONE);
|
||||
_instance->SetData(DATA_INTRO_EVENT, DONE);
|
||||
// Loralen or Koreln disappearAndDie()
|
||||
if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID))
|
||||
{
|
||||
@@ -1830,7 +1829,7 @@ public:
|
||||
_emergeTimer = 4000;
|
||||
_doEmerge = false;
|
||||
_doJump = false;
|
||||
if (_instance && _instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
_instance->SetData(DATA_SUMMONS, 1);
|
||||
|
||||
}
|
||||
@@ -1843,8 +1842,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_SUMMONS, 0);
|
||||
_instance->SetData(DATA_SUMMONS, 0);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) OVERRIDE
|
||||
@@ -1932,9 +1930,8 @@ public:
|
||||
_boltVolleyTimer = 15000;
|
||||
_curseTimer = 7000;
|
||||
_doEmerge = false;
|
||||
if (_instance)
|
||||
if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
_instance->SetData(DATA_SUMMONS, 1);
|
||||
if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
_instance->SetData(DATA_SUMMONS, 1);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit*) OVERRIDE
|
||||
@@ -1945,9 +1942,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_SUMMONS, 0);
|
||||
|
||||
_instance->SetData(DATA_SUMMONS, 0);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) OVERRIDE
|
||||
@@ -2049,9 +2044,8 @@ public:
|
||||
_doWalk = false;
|
||||
_vomitTimer = 15000;
|
||||
_strikeTimer = 6000;
|
||||
if (_instance)
|
||||
if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
_instance->SetData(DATA_SUMMONS, 1);
|
||||
if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
_instance->SetData(DATA_SUMMONS, 1);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit*) OVERRIDE
|
||||
@@ -2062,9 +2056,6 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!_instance)
|
||||
return;
|
||||
|
||||
if (_instance->GetData(DATA_ESCAPE_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
if (_doWalk != true)
|
||||
@@ -2103,8 +2094,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_SUMMONS, 0);
|
||||
_instance->SetData(DATA_SUMMONS, 0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -147,9 +147,9 @@ struct boss_horAI : ScriptedAI
|
||||
{
|
||||
events.Reset();
|
||||
me->SetVisible(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
if (instance && instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED)
|
||||
if (instance->GetData(DATA_WAVE_COUNT) != NOT_STARTED)
|
||||
instance->ProcessEvent(0, EVENT_DO_WIPE);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ struct boss_horAI : ScriptedAI
|
||||
switch (actionID)
|
||||
{
|
||||
case ACTION_ENTER_COMBAT: // called by InstanceScript when boss shall enter in combat.
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
if (Unit* unit = me->SelectNearestTarget())
|
||||
|
||||
@@ -773,7 +773,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE)
|
||||
if (instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "We are ready to go, High Overlord. The Lich King must fall!", 631, -ACTION_START_EVENT);
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
@@ -921,7 +921,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE)
|
||||
if (instance->GetBossState(DATA_DEATHBRINGER_SAURFANG) != DONE)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(0, "Let it begin...", 631, -ACTION_START_EVENT + 1);
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
|
||||
@@ -757,8 +757,7 @@ class npc_kelthuzad_abomination : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (_instance)
|
||||
_instance->SetData(DATA_ABOMINATION_KILLED, _instance->GetData(DATA_ABOMINATION_KILLED) + 1);
|
||||
_instance->SetData(DATA_ABOMINATION_KILLED, _instance->GetData(DATA_ABOMINATION_KILLED) + 1);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
{
|
||||
case ACTION_LAND_ENCOUNTER_START:
|
||||
events.CancelEventGroup(1);
|
||||
if (Creature* alexstraszaBunny = me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
{
|
||||
Position pos;
|
||||
pos.m_positionZ = alexstraszaBunny->GetPositionZ();
|
||||
@@ -713,7 +713,8 @@ public:
|
||||
{
|
||||
_firstCyclicMovementStarted = true;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFacingToObject(me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)));
|
||||
if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
me->SetFacingToObject(alexstraszaBunny);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ARCANE_BOMB, 1*IN_MILLISECONDS, 0, PHASE_TWO);
|
||||
}
|
||||
_flyingOutOfPlatform = false;
|
||||
@@ -722,7 +723,8 @@ public:
|
||||
break;
|
||||
case POINT_PHASE_ONE_TO_TWO_TRANSITION:
|
||||
me->SetDisableGravity(true);
|
||||
me->SetFacingToObject(me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)));
|
||||
if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
me->SetFacingToObject(alexstraszaBunny);
|
||||
SendLightOverride(LIGHT_ARCANE_RUNES, 5*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_FLY_OUT_OF_PLATFORM, 18*IN_MILLISECONDS, 0, PHASE_TWO);
|
||||
break;
|
||||
@@ -780,7 +782,7 @@ public:
|
||||
me->CastCustomSpell(SPELL_RANDOM_PORTAL, SPELLVALUE_MAX_TARGETS, 1);
|
||||
break;
|
||||
case EVENT_LAND_START_ENCOUNTER:
|
||||
if (GameObject* iris = me->GetMap()->GetGameObject(instance->GetData64(DATA_FOCUSING_IRIS_GUID)))
|
||||
if (GameObject* iris = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_FOCUSING_IRIS_GUID)))
|
||||
{
|
||||
me->SetFacingToObject(iris);
|
||||
iris->Delete(); // this is not the best way.
|
||||
@@ -837,7 +839,7 @@ public:
|
||||
case EVENT_FLY_OUT_OF_PLATFORM:
|
||||
if (!_performingDestroyPlatform)
|
||||
{
|
||||
if (Creature* alexstraszaBunny = me->GetMap()->GetCreature(instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
if (Creature* alexstraszaBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ALEXSTRASZA_BUNNY_GUID)))
|
||||
{
|
||||
Position randomPosOnRadius;
|
||||
// Hardcodded retail value, reason is Z getters can fail... (TO DO: Change to getter when height calculation works on 100%!)
|
||||
@@ -908,7 +910,7 @@ public:
|
||||
if (!_flyingOutOfPlatform)
|
||||
{
|
||||
DoCast(me, SPELL_SUMMON_ARCANE_BOMB, true);
|
||||
if (Creature* lastArcaneOverloadBunny = me->GetMap()->GetCreature(_arcaneOverloadGUID))
|
||||
if (Creature* lastArcaneOverloadBunny = ObjectAccessor::GetCreature(*me, _arcaneOverloadGUID))
|
||||
DoCast(lastArcaneOverloadBunny, SPELL_ARCANE_BOMB_TRIGGER, true);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SUMMON_ARCANE_BOMB, urand(15, 16)*IN_MILLISECONDS, 2, PHASE_TWO);
|
||||
@@ -993,7 +995,7 @@ public:
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
if (Creature* alexstraszaGiftBoxBunny = me->GetMap()->GetCreature(instance->GetData64(DATA_GIFT_BOX_BUNNY_GUID)))
|
||||
if (Creature* alexstraszaGiftBoxBunny = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GIFT_BOX_BUNNY_GUID)))
|
||||
{
|
||||
if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
|
||||
alexstraszaGiftBoxBunny->SummonGameObject(GO_HEART_OF_MAGIC_10, HeartOfMagicSpawnPos.GetPositionX(), HeartOfMagicSpawnPos.GetPositionY(),
|
||||
@@ -1087,7 +1089,7 @@ public:
|
||||
{
|
||||
if (spell->Id == SPELL_PORTAL_OPENED)
|
||||
{
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
{
|
||||
if (malygos->AI()->GetData(DATA_PHASE) == PHASE_ONE)
|
||||
DoCast(me, SPELL_SUMMON_POWER_PARK, true);
|
||||
@@ -1101,15 +1103,12 @@ public:
|
||||
if (!me->HasAura(SPELL_PORTAL_VISUAL_CLOSED) && !me->HasAura(SPELL_PORTAL_OPENED))
|
||||
DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true);
|
||||
|
||||
if (_instance)
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
{
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE && me->HasAura(SPELL_PORTAL_OPENED))
|
||||
{
|
||||
if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE && me->HasAura(SPELL_PORTAL_OPENED))
|
||||
{
|
||||
me->RemoveAura(SPELL_PORTAL_OPENED);
|
||||
DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true);
|
||||
}
|
||||
me->RemoveAura(SPELL_PORTAL_OPENED);
|
||||
DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1143,9 +1142,8 @@ public:
|
||||
{
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
if (_instance)
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f);
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
me->GetMotionMaster()->MoveFollow(malygos, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE
|
||||
@@ -1153,7 +1151,7 @@ public:
|
||||
if (!_instance)
|
||||
return;
|
||||
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
{
|
||||
if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE || _instance->GetBossState(DATA_MALYGOS_EVENT) == FAIL)
|
||||
{
|
||||
@@ -1432,7 +1430,7 @@ class npc_nexus_lord : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
malygos->AI()->SetData(DATA_SUMMON_DEATHS, malygos->AI()->GetData(DATA_SUMMON_DEATHS) + 1);
|
||||
}
|
||||
|
||||
@@ -1499,7 +1497,7 @@ class npc_scion_of_eternity : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
malygos->AI()->SetData(DATA_SUMMON_DEATHS, malygos->AI()->GetData(DATA_SUMMON_DEATHS) + 1);
|
||||
}
|
||||
|
||||
@@ -1542,7 +1540,7 @@ public:
|
||||
|
||||
void DoAction(int32 /*action*/) OVERRIDE
|
||||
{
|
||||
if (Creature* malygos = me->GetMap()->GetCreature(_instance->GetData64(DATA_MALYGOS)))
|
||||
if (Creature* malygos = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MALYGOS)))
|
||||
{
|
||||
if (malygos->AI()->GetData(DATA_PHASE) == PHASE_TWO)
|
||||
me->DespawnOrUnsummon(6*IN_MILLISECONDS);
|
||||
@@ -2047,7 +2045,7 @@ class spell_scion_of_eternity_arcane_barrage : public SpellScriptLoader
|
||||
|
||||
Creature* caster = GetCaster()->ToCreature();
|
||||
InstanceScript* instance = caster->GetInstanceScript();
|
||||
Creature* malygos = caster->GetMap()->GetCreature(instance->GetData64(DATA_MALYGOS));
|
||||
Creature* malygos = ObjectAccessor::GetCreature(*caster, instance->GetData64(DATA_MALYGOS));
|
||||
|
||||
// If max possible targets are more than 1 then Scions wouldn't select previosly selected target,
|
||||
// in longer terms this means if spell picks target X then 2nd cast of this spell will pick smth else
|
||||
|
||||
@@ -1192,7 +1192,7 @@ class npc_lorekeeper : public CreatureScript
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetData(BOSS_LEVIATHAN) !=DONE && player)
|
||||
if (instance->GetData(BOSS_LEVIATHAN) != DONE && player)
|
||||
{
|
||||
player->PrepareGossipMenu(creature);
|
||||
|
||||
@@ -1245,7 +1245,7 @@ public:
|
||||
//bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
//{
|
||||
// InstanceScript* instance = creature->GetInstanceScript();
|
||||
// if (instance && instance->GetData(BOSS_LEVIATHAN) !=DONE)
|
||||
// if (instance->GetData(BOSS_LEVIATHAN) !=DONE)
|
||||
// {
|
||||
// player->PrepareGossipMenu(creature);
|
||||
//
|
||||
|
||||
@@ -720,7 +720,7 @@ class npc_expedition_commander : public CreatureScript
|
||||
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance && instance->GetBossState(BOSS_RAZORSCALE) == NOT_STARTED)
|
||||
if (instance->GetBossState(BOSS_RAZORSCALE) == NOT_STARTED)
|
||||
{
|
||||
player->PrepareGossipMenu(creature);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
if (instance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
instance->SetData(DATA_REMOVE_NPC, 0);
|
||||
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
if (instance && !uiBoss)
|
||||
if (!uiBoss)
|
||||
uiBoss = instance->GetData(DATA_WAVE_COUNT) == 6 ? instance->GetData(DATA_FIRST_BOSS) : instance->GetData(DATA_SECOND_BOSS);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -486,7 +486,7 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
|
||||
if (instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
|
||||
me->CastStop();
|
||||
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
@@ -723,7 +723,7 @@ struct violet_hold_trashAI : public npc_escortAI
|
||||
|
||||
void UpdateAI(uint32) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
|
||||
if (instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
|
||||
me->CastStop();
|
||||
|
||||
if (!bHasGotMovingPoints)
|
||||
|
||||
@@ -1672,7 +1672,7 @@ public:
|
||||
{
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
if (instance && instance->GetBossState(DATA_ILLIDARI_COUNCIL) == DONE)
|
||||
if (instance->GetBossState(DATA_ILLIDARI_COUNCIL) == DONE)
|
||||
me->SetVisible(true);
|
||||
|
||||
Check_Timer = 5000;
|
||||
|
||||
+7
-7
@@ -214,7 +214,7 @@ public:
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
return;
|
||||
|
||||
//someone evaded!
|
||||
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -355,7 +355,7 @@ public:
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
|
||||
AttackStart(target);
|
||||
@@ -366,7 +366,7 @@ public:
|
||||
return;
|
||||
|
||||
//someone evaded!
|
||||
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -482,7 +482,7 @@ public:
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
|
||||
AttackStart(target);
|
||||
@@ -493,7 +493,7 @@ public:
|
||||
return;
|
||||
|
||||
//someone evaded!
|
||||
if (instance && !instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -597,7 +597,7 @@ public:
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
//Only if not incombat check if the event is started
|
||||
if (!me->IsInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
if (!me->IsInCombat() && instance->GetData(DATA_KARATHRESSEVENT))
|
||||
{
|
||||
if (Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)))
|
||||
AttackStart(target);
|
||||
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
// Start Phase 3
|
||||
if (instance && instance->GetData(DATA_CANSTARTPHASE3))
|
||||
if (instance->GetData(DATA_CANSTARTPHASE3))
|
||||
{
|
||||
// set life 50%
|
||||
me->SetHealth(me->CountPctFromMaxHealth(50));
|
||||
|
||||
+3
-3
@@ -317,10 +317,10 @@ public:
|
||||
// and reseting equipment
|
||||
me->LoadEquipment();
|
||||
|
||||
if (instance && instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
|
||||
if (instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
|
||||
{
|
||||
Unit* victim = NULL;
|
||||
victim = Unit::GetUnit(*me, instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
|
||||
victim = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
|
||||
if (victim)
|
||||
me->getThreatManager().addThreat(victim, 1);
|
||||
StartEvent();
|
||||
@@ -750,7 +750,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance && !instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
|
||||
if (!instance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
|
||||
@@ -112,10 +112,11 @@ public:
|
||||
|
||||
bool CheckCanStart()//check if players fished
|
||||
{
|
||||
if (instance && instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
|
||||
if (instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
me->SetSwim(true);
|
||||
|
||||
+3
-3
@@ -224,11 +224,11 @@ public:
|
||||
{
|
||||
if (Repair_Timer <= diff)
|
||||
{
|
||||
if (instance && instance->GetBossState(DATA_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
|
||||
if (instance->GetBossState(DATA_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
|
||||
{
|
||||
if (Unit* pMekgineer = Unit::GetUnit(*me, instance->GetData64(DATA_MEKGINEER_STEAMRIGGER)))
|
||||
if (Creature* mekgineer = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MEKGINEER_STEAMRIGGER)))
|
||||
{
|
||||
if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE))
|
||||
if (me->IsWithinDistInMap(mekgineer, MAX_REPAIR_RANGE))
|
||||
{
|
||||
//are we already channeling? Doesn't work very well, find better check?
|
||||
if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL))
|
||||
|
||||
@@ -484,7 +484,7 @@ class npc_ember_of_alar : public CreatureScript
|
||||
me->setDeathState(JUST_DIED);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* killer, uint32 &damage) OVERRIDE
|
||||
void DamageTaken(Unit* killer, uint32& damage) OVERRIDE
|
||||
{
|
||||
if (damage >= me->GetHealth() && killer != me && !toDie)
|
||||
{
|
||||
@@ -492,7 +492,7 @@ class npc_ember_of_alar : public CreatureScript
|
||||
DoCast(me, SPELL_EMBER_BLAST, true);
|
||||
me->SetDisplayId(11686);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (instance && instance->GetData(DATA_ALAREVENT) == 2)
|
||||
if (instance->GetData(DATA_ALAREVENT) == 2)
|
||||
{
|
||||
if (Unit* Alar = Unit::GetUnit(*me, instance->GetData64(DATA_ALAR)))
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ struct advisorbase_ai : public ScriptedAI
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
//reset encounter
|
||||
if (instance && (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3))
|
||||
if (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
if (Creature* Kaelthas = Unit::GetCreature(*me, instance->GetData64(DATA_KAELTHAS)))
|
||||
Kaelthas->AI()->EnterEvadeMode();
|
||||
}
|
||||
@@ -223,14 +223,14 @@ struct advisorbase_ai : public ScriptedAI
|
||||
return;
|
||||
|
||||
//Prevent glitch if in fake death
|
||||
if (FakeDeath && instance && instance->GetData(DATA_KAELTHASEVENT) != 0)
|
||||
if (FakeDeath && instance->GetData(DATA_KAELTHASEVENT) != 0)
|
||||
{
|
||||
damage = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
//Don't really die in phase 1 & 3, only die after that
|
||||
if (instance && instance->GetData(DATA_KAELTHASEVENT) != 0)
|
||||
if (instance->GetData(DATA_KAELTHASEVENT) != 0)
|
||||
{
|
||||
//prevent death
|
||||
damage = 0;
|
||||
@@ -417,7 +417,7 @@ class boss_kaelthas : public CreatureScript
|
||||
}
|
||||
else if (me->GetMap()->IsDungeon())
|
||||
{
|
||||
if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase)
|
||||
if (!instance->GetData(DATA_KAELTHASEVENT) && !Phase)
|
||||
StartEvent();
|
||||
|
||||
who->SetInCombatWith(me);
|
||||
@@ -429,7 +429,7 @@ class boss_kaelthas : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase)
|
||||
if (!instance->GetData(DATA_KAELTHASEVENT) && !Phase)
|
||||
StartEvent();
|
||||
}
|
||||
|
||||
@@ -1046,7 +1046,7 @@ class boss_thaladred_the_darkener : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
if (instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
Talk(SAY_THALADRED_DEATH);
|
||||
}
|
||||
|
||||
@@ -1138,7 +1138,7 @@ class boss_lord_sanguinar : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
if (instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
Talk(SAY_SANGUINAR_DEATH);
|
||||
}
|
||||
|
||||
@@ -1203,7 +1203,7 @@ class boss_grand_astromancer_capernian : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
if (instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
Talk(SAY_CAPERNIAN_DEATH);
|
||||
}
|
||||
|
||||
@@ -1342,7 +1342,7 @@ class boss_master_engineer_telonicus : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
if (instance->GetData(DATA_KAELTHASEVENT) == 3)
|
||||
Talk(SAY_TELONICUS_DEATH);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class boss_void_reaver : public CreatureScript
|
||||
|
||||
Enraged = false;
|
||||
|
||||
if (instance && me->IsAlive())
|
||||
if (me->IsAlive())
|
||||
instance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user