Violet Hold: Restructuration: Add an EventPhase var instead of using door's
status to handle main event. Needed for next commits and cleansing --HG-- branch : trunk
This commit is contained in:
@@ -134,6 +134,7 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
|
|
||||||
uint32 uiActivationTimer;
|
uint32 uiActivationTimer;
|
||||||
uint32 uiCyanigosaEventTimer;
|
uint32 uiCyanigosaEventTimer;
|
||||||
|
uint32 uiDoorSpellTimer;
|
||||||
|
|
||||||
std::set<uint64> trashMobs; // to kill with crystal
|
std::set<uint64> trashMobs; // to kill with crystal
|
||||||
|
|
||||||
@@ -142,15 +143,14 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
uint8 uiFirstBoss;
|
uint8 uiFirstBoss;
|
||||||
uint8 uiSecondBoss;
|
uint8 uiSecondBoss;
|
||||||
uint8 uiRemoveNpc;
|
uint8 uiRemoveNpc;
|
||||||
uint32 uiDoorSpellTimer;
|
|
||||||
|
|
||||||
uint8 uiMainDoorState;
|
|
||||||
uint8 uiDoorIntegrity;
|
uint8 uiDoorIntegrity;
|
||||||
|
|
||||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||||
uint8 uiCountErekemGuards;
|
uint8 uiCountErekemGuards;
|
||||||
uint8 uiCountActivationCrystals;
|
uint8 uiCountActivationCrystals;
|
||||||
uint8 uiCyanigosaEventPhase;
|
uint8 uiCyanigosaEventPhase;
|
||||||
|
uint8 uiMainEventPhase; // SPECIAL: pre event animations, IN_PROGRESS: event itself
|
||||||
|
|
||||||
bool bActive;
|
bool bActive;
|
||||||
bool bWiped;
|
bool bWiped;
|
||||||
@@ -188,7 +188,6 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
|
|
||||||
uiRemoveNpc = 0;
|
uiRemoveNpc = 0;
|
||||||
|
|
||||||
uiMainDoorState = GO_STATE_ACTIVE;
|
|
||||||
uiDoorIntegrity = 100;
|
uiDoorIntegrity = 100;
|
||||||
|
|
||||||
uiWaveCount = 0;
|
uiWaveCount = 0;
|
||||||
@@ -320,6 +319,7 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
if (data == DONE)
|
if (data == DONE)
|
||||||
{
|
{
|
||||||
SaveToDB();
|
SaveToDB();
|
||||||
|
uiMainEventPhase = DONE;
|
||||||
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||||
pMainDoor->SetGoState(GO_STATE_ACTIVE);
|
pMainDoor->SetGoState(GO_STATE_ACTIVE);
|
||||||
if (!bCrystalActivated && uiDoorIntegrity == 100)
|
if (!bCrystalActivated && uiDoorIntegrity == 100)
|
||||||
@@ -348,7 +348,7 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
NpcAtDoorCastingList.pop_back();
|
NpcAtDoorCastingList.pop_back();
|
||||||
break;
|
break;
|
||||||
case DATA_MAIN_DOOR:
|
case DATA_MAIN_DOOR:
|
||||||
if(GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||||
{
|
{
|
||||||
switch(data)
|
switch(data)
|
||||||
{
|
{
|
||||||
@@ -363,7 +363,6 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uiMainDoorState = data;
|
|
||||||
break;
|
break;
|
||||||
case DATA_START_BOSS_ENCOUNTER:
|
case DATA_START_BOSS_ENCOUNTER:
|
||||||
switch(uiWaveCount)
|
switch(uiWaveCount)
|
||||||
@@ -379,6 +378,17 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
case DATA_ACTIVATE_CRYSTAL:
|
case DATA_ACTIVATE_CRYSTAL:
|
||||||
ActivateCrystal();
|
ActivateCrystal();
|
||||||
break;
|
break;
|
||||||
|
case DATA_MAIN_EVENT_PHASE:
|
||||||
|
uiMainEventPhase = data;
|
||||||
|
if (data == IN_PROGRESS) // Start event
|
||||||
|
{
|
||||||
|
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||||
|
pMainDoor->SetGoState(GO_STATE_READY);
|
||||||
|
uiWaveCount = 1;
|
||||||
|
bActive = true;
|
||||||
|
uiRemoveNpc = 0; // might not have been reset after a wipe on a boss.
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,9 +417,9 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
case DATA_PORTAL_LOCATION: return uiLocation;
|
case DATA_PORTAL_LOCATION: return uiLocation;
|
||||||
case DATA_DOOR_INTEGRITY: return uiDoorIntegrity;
|
case DATA_DOOR_INTEGRITY: return uiDoorIntegrity;
|
||||||
case DATA_NPC_PRESENCE_AT_DOOR: return NpcAtDoorCastingList.size();
|
case DATA_NPC_PRESENCE_AT_DOOR: return NpcAtDoorCastingList.size();
|
||||||
case DATA_MAIN_DOOR: return uiMainDoorState;
|
|
||||||
case DATA_FIRST_BOSS: return uiFirstBoss;
|
case DATA_FIRST_BOSS: return uiFirstBoss;
|
||||||
case DATA_SECOND_BOSS: return uiSecondBoss;
|
case DATA_SECOND_BOSS: return uiSecondBoss;
|
||||||
|
case DATA_MAIN_EVENT_PHASE: return uiMainEventPhase;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -662,7 +672,7 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// portals should spawn if other portal is dead and doors are closed
|
// portals should spawn if other portal is dead and doors are closed
|
||||||
if (bActive && GetData(DATA_MAIN_DOOR) == GO_STATE_READY)
|
if (bActive && uiMainEventPhase == IN_PROGRESS)
|
||||||
{
|
{
|
||||||
if (uiActivationTimer < diff)
|
if (uiActivationTimer < diff)
|
||||||
{
|
{
|
||||||
@@ -672,8 +682,8 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
} else uiActivationTimer -= diff;
|
} else uiActivationTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if doors are closed (means event is in progres) and players have wiped then reset instance
|
// if main event is in progress and players have wiped then reset instance
|
||||||
if (GetData(DATA_MAIN_DOOR) != GO_STATE_ACTIVE && CheckWipe())
|
if ( uiMainEventPhase == IN_PROGRESS && CheckWipe())
|
||||||
{
|
{
|
||||||
SetData(DATA_REMOVE_NPC, 1);
|
SetData(DATA_REMOVE_NPC, 1);
|
||||||
StartBossEncounter(uiFirstBoss, false);
|
StartBossEncounter(uiFirstBoss, false);
|
||||||
@@ -681,6 +691,7 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
|
|
||||||
SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE);
|
SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE);
|
||||||
SetData(DATA_WAVE_COUNT, 0);
|
SetData(DATA_WAVE_COUNT, 0);
|
||||||
|
uiMainEventPhase = NOT_STARTED;
|
||||||
|
|
||||||
if (Creature* pSinclari = instance->GetCreature(uiSinclari))
|
if (Creature* pSinclari = instance->GetCreature(uiSinclari))
|
||||||
{
|
{
|
||||||
@@ -741,7 +752,7 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if there are NPCs in front of the prison door, which are casting the door seal spell and doors are active
|
// if there are NPCs in front of the prison door, which are casting the door seal spell and doors are active
|
||||||
if(GetData(DATA_NPC_PRESENCE_AT_DOOR) && (GetData(DATA_MAIN_DOOR) == GO_STATE_READY))
|
if (GetData(DATA_NPC_PRESENCE_AT_DOOR) && uiMainEventPhase == IN_PROGRESS)
|
||||||
{
|
{
|
||||||
// if door integrity is > 0 then decrase it's integrity state
|
// if door integrity is > 0 then decrase it's integrity state
|
||||||
if(GetData(DATA_DOOR_INTEGRITY))
|
if(GetData(DATA_DOOR_INTEGRITY))
|
||||||
@@ -754,7 +765,10 @@ struct instance_violet_hold : public ScriptedInstance
|
|||||||
}
|
}
|
||||||
// else set door state to active (means door will open and group have failed to sustain mob invasion on the door)
|
// else set door state to active (means door will open and group have failed to sustain mob invasion on the door)
|
||||||
else
|
else
|
||||||
|
{
|
||||||
SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE);
|
SetData(DATA_MAIN_DOOR,GO_STATE_ACTIVE);
|
||||||
|
uiMainEventPhase = FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -340,11 +340,7 @@ struct npc_sinclariAI : public ScriptedAI
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (pInstance)
|
if (pInstance)
|
||||||
{
|
pInstance->SetData(DATA_MAIN_EVENT_PHASE,IN_PROGRESS);
|
||||||
pInstance->SetData(DATA_MAIN_DOOR,GO_STATE_READY);
|
|
||||||
pInstance->SetData(DATA_WAVE_COUNT,1);
|
|
||||||
pInstance->SetData(DATA_REMOVE_NPC,0); // might not have been reset after a wipe on a boss.
|
|
||||||
}
|
|
||||||
me->SetVisibility(VISIBILITY_OFF);
|
me->SetVisibility(VISIBILITY_OFF);
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
uiTimer = 0;
|
uiTimer = 0;
|
||||||
@@ -420,7 +416,7 @@ struct mob_azure_saboteurAI : public npc_escortAI
|
|||||||
|
|
||||||
void UpdateAI(const uint32 diff)
|
void UpdateAI(const uint32 diff)
|
||||||
{
|
{
|
||||||
if(pInstance->GetData(DATA_MAIN_DOOR) != GO_STATE_READY)
|
if (pInstance && pInstance->GetData(DATA_MAIN_EVENT_PHASE != IN_PROGRESS))
|
||||||
me->CastStop();
|
me->CastStop();
|
||||||
|
|
||||||
npc_escortAI::UpdateAI(diff);
|
npc_escortAI::UpdateAI(diff);
|
||||||
@@ -483,14 +479,17 @@ CreatureAI* GetAI_mob_azure_saboteur(Creature* pCreature)
|
|||||||
|
|
||||||
bool GossipHello_npc_sinclari(Player* pPlayer, Creature* pCreature)
|
bool GossipHello_npc_sinclari(Player* pPlayer, Creature* pCreature)
|
||||||
{
|
{
|
||||||
ScriptedInstance* pInstance = pCreature->GetInstanceData();
|
if (ScriptedInstance* pInstance = pCreature->GetInstanceData())
|
||||||
if (pInstance && pInstance->GetData(DATA_CYANIGOSA_EVENT) != DONE && pInstance->GetData(DATA_WAVE_COUNT) == 0 && pPlayer)
|
|
||||||
{
|
{
|
||||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2);
|
uint8 uiInstancePhase = pInstance->GetData(DATA_MAIN_EVENT_PHASE);
|
||||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_START_EVENT,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
|
if (uiInstancePhase == NOT_STARTED || uiInstancePhase == FAIL) // Allow to start event if not started or wiped
|
||||||
pPlayer->SEND_GOSSIP_MENU(13853, pCreature->GetGUID());
|
{
|
||||||
} else
|
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_1,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+2);
|
||||||
pPlayer->SEND_GOSSIP_MENU(13910, pCreature->GetGUID());
|
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_START_EVENT,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1);
|
||||||
|
pPlayer->SEND_GOSSIP_MENU(13853, pCreature->GetGUID());
|
||||||
|
} else
|
||||||
|
pPlayer->SEND_GOSSIP_MENU(13910, pCreature->GetGUID());
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,6 +501,8 @@ bool GossipSelect_npc_sinclari(Player* pPlayer, Creature* pCreature, uint32 /*ui
|
|||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
pPlayer->CLOSE_GOSSIP_MENU();
|
pPlayer->CLOSE_GOSSIP_MENU();
|
||||||
CAST_AI(npc_sinclariAI, (pCreature->AI()))->uiPhase = 1;
|
CAST_AI(npc_sinclariAI, (pCreature->AI()))->uiPhase = 1;
|
||||||
|
if (ScriptedInstance *pInstance = pCreature->GetInstanceData())
|
||||||
|
pInstance->SetData(DATA_MAIN_EVENT_PHASE,SPECIAL);
|
||||||
break;
|
break;
|
||||||
case GOSSIP_ACTION_INFO_DEF+2:
|
case GOSSIP_ACTION_INFO_DEF+2:
|
||||||
pPlayer->SEND_GOSSIP_MENU(13854, pCreature->GetGUID());
|
pPlayer->SEND_GOSSIP_MENU(13854, pCreature->GetGUID());
|
||||||
@@ -688,7 +689,7 @@ struct violet_hold_trashAI : public npc_escortAI
|
|||||||
|
|
||||||
void UpdateAI(const uint32)
|
void UpdateAI(const uint32)
|
||||||
{
|
{
|
||||||
if (pInstance->GetData(DATA_MAIN_DOOR) != GO_STATE_READY)
|
if (pInstance && pInstance->GetData(DATA_MAIN_EVENT_PHASE != IN_PROGRESS))
|
||||||
me->CastStop();
|
me->CastStop();
|
||||||
|
|
||||||
if (!bHasGotMovingPoints)
|
if (!bHasGotMovingPoints)
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ enum Data
|
|||||||
DATA_START_BOSS_ENCOUNTER,
|
DATA_START_BOSS_ENCOUNTER,
|
||||||
DATA_FIRST_BOSS,
|
DATA_FIRST_BOSS,
|
||||||
DATA_SECOND_BOSS,
|
DATA_SECOND_BOSS,
|
||||||
DATA_ACTIVATE_CRYSTAL
|
DATA_ACTIVATE_CRYSTAL,
|
||||||
|
DATA_MAIN_EVENT_PHASE
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Data64
|
enum Data64
|
||||||
|
|||||||
Reference in New Issue
Block a user