mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Scripts/Icecrown Citadel:
Prevented spawning Rotting Frost Giant if the related weekly quest is not active Added more strict checks for Sindragosa event
This commit is contained in:
@@ -233,13 +233,15 @@ class boss_sindragosa : public CreatureScript
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void DoAction(const int32 action)
|
||||
void DoAction(int32 const action)
|
||||
{
|
||||
if (action == ACTION_START_FROSTWYRM)
|
||||
{
|
||||
instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 255);
|
||||
if (me->isDead())
|
||||
return;
|
||||
|
||||
me->setActive(true);
|
||||
me->SetSpeed(MOVE_FLIGHT, 4.0f);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
float moveTime = me->GetExactDist(&SindragosaFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f);
|
||||
@@ -361,7 +363,7 @@ class boss_sindragosa : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
@@ -492,7 +494,7 @@ class npc_ice_tomb : public CreatureScript
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void SetGUID(const uint64& guid, int32 type/* = 0 */)
|
||||
void SetGUID(uint64 const& guid, int32 type/* = 0 */)
|
||||
{
|
||||
if (type == DATA_TRAPPED_PLAYER)
|
||||
{
|
||||
@@ -501,7 +503,7 @@ class npc_ice_tomb : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(const int32 action)
|
||||
void DoAction(int32 const action)
|
||||
{
|
||||
if (action == ACTION_TRIGGER_ASPHYXIATION)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, trappedPlayer))
|
||||
@@ -520,7 +522,7 @@ class npc_ice_tomb : public CreatureScript
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!trappedPlayer)
|
||||
return;
|
||||
@@ -590,13 +592,15 @@ class npc_spinestalker : public CreatureScript
|
||||
instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 0);
|
||||
}
|
||||
|
||||
void DoAction(const int32 action)
|
||||
void DoAction(int32 const action)
|
||||
{
|
||||
if (action == ACTION_START_FROSTWYRM)
|
||||
{
|
||||
instance->SetData(DATA_SPINESTALKER, 255);
|
||||
if (me->isDead())
|
||||
return;
|
||||
|
||||
me->setActive(true);
|
||||
me->SetSpeed(MOVE_FLIGHT, 2.0f);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
float moveTime = me->GetExactDist(&SpinestalkerFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f);
|
||||
@@ -613,13 +617,14 @@ class npc_spinestalker : public CreatureScript
|
||||
if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
|
||||
return;
|
||||
|
||||
me->setActive(false);
|
||||
me->SetFlying(false);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->SetHomePosition(SpinestalkerLandPos);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -702,13 +707,15 @@ class npc_rimefang : public CreatureScript
|
||||
instance->SetData(DATA_SINDRAGOSA_FROSTWYRMS, 0);
|
||||
}
|
||||
|
||||
void DoAction(const int32 action)
|
||||
void DoAction(int32 const action)
|
||||
{
|
||||
if (action == ACTION_START_FROSTWYRM)
|
||||
{
|
||||
instance->SetData(DATA_RIMEFANG, 255);
|
||||
if (me->isDead())
|
||||
return;
|
||||
|
||||
me->setActive(true);
|
||||
me->SetSpeed(MOVE_FLIGHT, 2.0f);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
float moveTime = me->GetExactDist(&RimefangFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f);
|
||||
@@ -725,6 +732,7 @@ class npc_rimefang : public CreatureScript
|
||||
if (type != POINT_MOTION_TYPE || point != POINT_FROSTWYRM_LAND)
|
||||
return;
|
||||
|
||||
me->setActive(false);
|
||||
me->SetFlying(false);
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->SetHomePosition(RimefangLandPos);
|
||||
@@ -736,7 +744,7 @@ class npc_rimefang : public CreatureScript
|
||||
DoCast(me, SPELL_FROST_AURA_RIMEFANG, true);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -866,7 +874,7 @@ class npc_sindragosa_trash : public CreatureScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void UpdateAI(uint32 const diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -1417,10 +1425,7 @@ class at_sindragosa_lair : public AreaTriggerScript
|
||||
|
||||
player->GetMap()->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY());
|
||||
if (Creature* sindragosa = player->GetMap()->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos))
|
||||
{
|
||||
sindragosa->setActive(true);
|
||||
sindragosa->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define ICCScriptName "instance_icecrown_citadel"
|
||||
|
||||
uint32 const EncounterCount = 12;
|
||||
uint32 const WeeklyNPCs = 7;
|
||||
uint32 const WeeklyNPCs = 9;
|
||||
uint32 const MaxHeroicAttempts = 50;
|
||||
// Defined in boss_sindragosa.cpp
|
||||
extern Position const SindragosaSpawnPos;
|
||||
@@ -115,6 +115,8 @@ enum CreaturesIds
|
||||
NPC_INFILTRATOR_MINCHAR = 38471,
|
||||
NPC_KOR_KRON_LIEUTENANT = 38491,
|
||||
NPC_SKYBREAKER_LIEUTENANT = 38492,
|
||||
NPC_ROTTING_FROST_GIANT_10 = 38490,
|
||||
NPC_ROTTING_FROST_GIANT_25 = 38494,
|
||||
NPC_ALCHEMIST_ADRIANNA = 38501,
|
||||
NPC_ALRIN_THE_AGILE = 38551,
|
||||
NPC_INFILTRATOR_MINCHAR_BQ = 38558,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "PoolMgr.h"
|
||||
#include "icecrown_citadel.h"
|
||||
|
||||
static const DoorData doorData[] =
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{GO_LORD_MARROWGAR_S_ENTRANCE, DATA_LORD_MARROWGAR, DOOR_TYPE_ROOM, BOUNDARY_N },
|
||||
{GO_ICEWALL, DATA_LORD_MARROWGAR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE},
|
||||
@@ -53,10 +53,15 @@ struct WeeklyQuest
|
||||
{
|
||||
uint32 creatureEntry;
|
||||
uint32 questId[2]; // 10 and 25 man versions
|
||||
} WeeklyQuestData[WeeklyNPCs] =
|
||||
};
|
||||
|
||||
// when changing the content, remember to update SetData, DATA_BLOOD_QUICKENING_STATE case for NPC_ALRIN_THE_AGILE index
|
||||
WeeklyQuest const WeeklyQuestData[WeeklyNPCs] =
|
||||
{
|
||||
{NPC_INFILTRATOR_MINCHAR, {QUEST_DEPROGRAMMING_10, QUEST_DEPROGRAMMING_25 }}, // Deprogramming
|
||||
{NPC_KOR_KRON_LIEUTENANT, {QUEST_SECURING_THE_RAMPARTS_10, QUEST_SECURING_THE_RAMPARTS_25 }}, // Securing the Ramparts
|
||||
{NPC_ROTTING_FROST_GIANT_10, {QUEST_SECURING_THE_RAMPARTS_10, QUEST_SECURING_THE_RAMPARTS_25 }}, // Securing the Ramparts
|
||||
{NPC_ROTTING_FROST_GIANT_25, {QUEST_SECURING_THE_RAMPARTS_10, QUEST_SECURING_THE_RAMPARTS_25 }}, // Securing the Ramparts
|
||||
{NPC_ALCHEMIST_ADRIANNA, {QUEST_RESIDUE_RENDEZVOUS_10, QUEST_RESIDUE_RENDEZVOUS_25 }}, // Residue Rendezvous
|
||||
{NPC_ALRIN_THE_AGILE, {QUEST_BLOOD_QUICKENING_10, QUEST_BLOOD_QUICKENING_25 }}, // Blood Quickening
|
||||
{NPC_INFILTRATOR_MINCHAR_BQ, {QUEST_BLOOD_QUICKENING_10, QUEST_BLOOD_QUICKENING_25 }}, // Blood Quickening
|
||||
@@ -478,11 +483,13 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case DATA_LADY_DEATHWHISPER:
|
||||
SetBossState(DATA_GUNSHIP_EVENT, state); // TEMP HACK UNTIL GUNSHIP SCRIPTED
|
||||
if (state == DONE)
|
||||
{
|
||||
if (GameObject* elevator = instance->GetGameObject(ladyDeathwisperElevator))
|
||||
{
|
||||
elevator->SetUInt32Value(GAMEOBJECT_LEVEL, 0);
|
||||
elevator->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DATA_DEATHBRINGER_SAURFANG:
|
||||
switch (state)
|
||||
@@ -602,40 +609,89 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
isOrbWhispererEligible = data ? true : false;
|
||||
break;
|
||||
case DATA_SINDRAGOSA_FROSTWYRMS:
|
||||
{
|
||||
if (frostwyrms == 255)
|
||||
return;
|
||||
|
||||
if (instance->IsHeroic() && !heroicAttempts)
|
||||
return;
|
||||
if (data > 1)
|
||||
frostwyrms = data;
|
||||
else if (data == 1)
|
||||
++frostwyrms;
|
||||
else if (!data && !--frostwyrms && GetBossState(DATA_SINDRAGOSA) != DONE)
|
||||
|
||||
if (GetBossState(DATA_SINDRAGOSA) != DONE)
|
||||
return;
|
||||
|
||||
switch (data)
|
||||
{
|
||||
instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY());
|
||||
if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos))
|
||||
{
|
||||
boss->setActive(true);
|
||||
boss->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
}
|
||||
case 0:
|
||||
if (frostwyrms)
|
||||
{
|
||||
--frostwyrms;
|
||||
if (!frostwyrms)
|
||||
{
|
||||
instance->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY());
|
||||
if (Creature* boss = instance->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos))
|
||||
boss->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
++frostwyrms;
|
||||
break;
|
||||
default:
|
||||
frostwyrms = data;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DATA_SPINESTALKER:
|
||||
if (data > 1)
|
||||
spinestalkerTrash = data;
|
||||
else if (data == 1)
|
||||
++spinestalkerTrash;
|
||||
else if (!data && !--spinestalkerTrash)
|
||||
if (Creature* spinestalk = instance->GetCreature(spinestalker))
|
||||
spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
{
|
||||
if (spinestalkerTrash == 255)
|
||||
return;
|
||||
|
||||
switch (data)
|
||||
{
|
||||
case 0:
|
||||
if (spinestalkerTrash)
|
||||
{
|
||||
--spinestalkerTrash;
|
||||
if (!spinestalkerTrash)
|
||||
if (Creature* spinestalk = instance->GetCreature(spinestalker))
|
||||
spinestalk->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
++spinestalkerTrash;
|
||||
break;
|
||||
default:
|
||||
spinestalkerTrash = data;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DATA_RIMEFANG:
|
||||
if (data > 1)
|
||||
rimefangTrash = data;
|
||||
else if (data == 1)
|
||||
++rimefangTrash;
|
||||
else if (!data && !--rimefangTrash)
|
||||
if (Creature* rime = instance->GetCreature(rimefang))
|
||||
rime->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
{
|
||||
if (rimefangTrash == 255)
|
||||
return;
|
||||
|
||||
switch (data)
|
||||
{
|
||||
case 0:
|
||||
if (rimefangTrash)
|
||||
{
|
||||
--rimefangTrash;
|
||||
if (!rimefangTrash)
|
||||
if (Creature* rime = instance->GetCreature(rimefang))
|
||||
rime->AI()->DoAction(ACTION_START_FROSTWYRM);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
++rimefangTrash;
|
||||
break;
|
||||
default:
|
||||
rimefangTrash = data;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DATA_COLDFLAME_JETS:
|
||||
coldflameJetsState = data;
|
||||
if (coldflameJetsState == DONE)
|
||||
@@ -648,12 +704,14 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
break;
|
||||
case DATA_BLOOD_QUICKENING_STATE:
|
||||
{
|
||||
// 3 is the index of Blood Quickening
|
||||
if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[3].questId[instance->GetSpawnMode() & 1]))
|
||||
break;
|
||||
// skip if nothing changes
|
||||
if (bloodQuickeningState == data)
|
||||
break;
|
||||
|
||||
// 5 is the index of Blood Quickening
|
||||
if (!sPoolMgr->IsSpawnedObject<Quest>(WeeklyQuestData[5].questId[instance->GetSpawnMode() & 1]))
|
||||
break;
|
||||
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
@@ -667,7 +725,10 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
bloodQuickeningMinutes = 0;
|
||||
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
bloodQuickeningState = data;
|
||||
SaveToDB();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user