Fix Script Violet Hold
- fix event reset if wipe at a boss - fix boss not random again after a wipe - fix erekem guard handling - fix portal random location - fix save and load data - fix world state display for wave count - fix some timers - fix mob_erekem_guard set on correct creature_template entry Still WIP. --HG-- branch : trunk
This commit is contained in:
@@ -1318,7 +1318,7 @@ UPDATE `creature_template` SET `ScriptName`='boss_ichoron' WHERE `entry`=29313;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_ichor_globule' WHERE `entry`=29321;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_zuramat' WHERE `entry`=29314;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_erekem' WHERE `entry`=29315;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_erekem_guard' WHERE `entry`=32226;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_erekem_guard' WHERE `entry`=29395;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_moragg' WHERE `entry`=29316;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_xevozz' WHERE `entry`=29266;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_ethereal_sphere' WHERE `entry`=29271;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_erekem_guard' WHERE `entry`=29395;
|
||||
@@ -11,18 +11,19 @@ update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
#include "SpellId.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BLOODLUST = 54516,
|
||||
SPELL_BREAK_BONDS = 59463,
|
||||
SPELL_CHAIN_HEAL = 54481,
|
||||
H_SPELL_CHAIN_HEAL = 59473,
|
||||
SPELL_EARTH_SHIELD = 54479,
|
||||
H_SPELL_EARTH_SHIELD = 59471,
|
||||
SPELL_EARTH_SHOCK = 54511,
|
||||
SPELL_LIGHTNING_BOLT = 53044,
|
||||
SPELL_STORMSTRIKE = 51876
|
||||
SPELL_BLOODLUST = SPELL_BLOODLUST_54516,
|
||||
SPELL_BREAK_BONDS = SPELL_BREAK_BONDS_59463,
|
||||
SPELL_CHAIN_HEAL = SPELL_CHAIN_HEAL_54481,
|
||||
H_SPELL_CHAIN_HEAL = SPELL_CHAIN_HEAL_59473,
|
||||
SPELL_EARTH_SHIELD = SPELL_EARTH_SHIELD_54479,
|
||||
H_SPELL_EARTH_SHIELD = SPELL_EARTH_SHIELD_59471,
|
||||
SPELL_EARTH_SHOCK = SPELL_EARTH_SHOCK_54511,
|
||||
SPELL_LIGHTNING_BOLT = SPELL_LIGHTNING_BOLT_53044,
|
||||
SPELL_STORMSTRIKE = SPELL_STORMSTRIKE_51876
|
||||
};
|
||||
|
||||
//not in db
|
||||
@@ -65,13 +66,19 @@ struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
|
||||
uiEarthShieldTimer = 20000;
|
||||
if (pInstance)
|
||||
{
|
||||
pGuard1 = pInstance->instance->GetCreature(pInstance->GetData(DATA_EREKEM_GUARD_1));
|
||||
pGuard2 = pInstance->instance->GetCreature(pInstance->GetData(DATA_EREKEM_GUARD_2));
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, NOT_STARTED);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
pGuard1 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_1));
|
||||
if (pGuard1 && !pGuard1->isAlive())
|
||||
pGuard1->Respawn();
|
||||
|
||||
pGuard2 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_2));
|
||||
if (pGuard2 && !pGuard2->isAlive())
|
||||
pGuard2->Respawn();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
@@ -85,16 +92,36 @@ struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pGuard1)
|
||||
{
|
||||
pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (!pGuard1->getVictim() && pGuard1->AI())
|
||||
pGuard1->AI()->AttackStart(pWho);
|
||||
}
|
||||
|
||||
if (pGuard2)
|
||||
{
|
||||
pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (!pGuard2->getVictim() && pGuard2->AI())
|
||||
pGuard2->AI()->AttackStart(pWho);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_EARTH_SHIELD, H_SPELL_EARTH_SHIELD));
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pGuard1 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_1));
|
||||
pGuard2 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_2));
|
||||
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
@@ -185,11 +212,11 @@ struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
|
||||
|
||||
Creature* GetChainHealTarget()
|
||||
{
|
||||
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 85)
|
||||
if (HealthBelowPct(85))
|
||||
return m_creature;
|
||||
if (pGuard1 && pGuard1->isAlive() && (pGuard1->GetHealth()*100 / pGuard1->GetMaxHealth() <= 75))
|
||||
if (pGuard1 && pGuard1->isAlive() && (pGuard1->GetHealth()*100 <= pGuard1->GetMaxHealth() * 75))
|
||||
return pGuard1;
|
||||
if (pGuard2 && pGuard2->isAlive() && (pGuard2->GetHealth()*100 / pGuard2->GetMaxHealth() <= 75))
|
||||
if (pGuard2 && pGuard2->isAlive() && (pGuard2->GetHealth()*100 <= pGuard2->GetMaxHealth() * 75))
|
||||
return pGuard2;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
2 - Cyanigosa*/
|
||||
|
||||
/* Violet hold bosses:
|
||||
0 - Moragg
|
||||
1 - Erekem
|
||||
2 - Ichoron
|
||||
3 - Lavanthor
|
||||
4 - Xevozz
|
||||
5 - Zuramat
|
||||
6 - Cyanigosa */
|
||||
1 - Moragg
|
||||
2 - Erekem
|
||||
3 - Ichoron
|
||||
4 - Lavanthor
|
||||
5 - Xevozz
|
||||
6 - Zuramat
|
||||
7 - Cyanigosa */
|
||||
|
||||
enum GameObjects
|
||||
{
|
||||
GO_MAIN_DOOR = 191723,
|
||||
@@ -30,20 +31,14 @@ enum GameObjects
|
||||
GO_INTRO_ACTIVATION_CRYSTAL = 193615,
|
||||
GO_ACTIVATION_CRYSTAL = 193611
|
||||
};
|
||||
enum Spells
|
||||
{
|
||||
SPELL_PORTAL_CHANNEL = 58012
|
||||
};
|
||||
struct Location
|
||||
{
|
||||
float x,y,z,orientation;
|
||||
};
|
||||
const Location PortalLocation[] =
|
||||
|
||||
const Position PortalLocation[] =
|
||||
{
|
||||
{1936.07, 803.198, 53.3749, 3.12414},
|
||||
{1877.51, 850.104, 44.6599, 4.7822 },
|
||||
{1890.64, 753.471, 48.7224, 1.71042}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
{
|
||||
instance_violet_hold(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
@@ -81,8 +76,6 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint8 uiCountErekemGuards;
|
||||
uint8 uiCountActivationCrystals;
|
||||
uint8 uiPlayersDead;
|
||||
uint8 uiMaxPlayerCount;
|
||||
|
||||
bool bActive;
|
||||
bool bWiped;
|
||||
@@ -112,13 +105,11 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
uiRemoveNpc = 0;
|
||||
|
||||
uiWaveCount = 0;
|
||||
uiLocation = 0;
|
||||
uiLocation = urand(0,2);
|
||||
uiFirstBoss = 0;
|
||||
uiSecondBoss = 0;
|
||||
uiCountErekemGuards = 0;
|
||||
uiCountActivationCrystals = 0;
|
||||
uiPlayersDead = 0;
|
||||
uiMaxPlayerCount = 0;
|
||||
|
||||
uiActivationTimer = 5000;
|
||||
|
||||
@@ -157,7 +148,10 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
break;
|
||||
case CREATURE_EREKEM_GUARD:
|
||||
if (uiCountErekemGuards < 2)
|
||||
{
|
||||
uiErekemGuard[uiCountErekemGuards++] = pCreature->GetGUID();
|
||||
pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
break;
|
||||
case CREATURE_MORAGG:
|
||||
uiMoragg = pCreature->GetGUID();
|
||||
@@ -169,6 +163,12 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
uiSinclari = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
|
||||
if (add && (pCreature->GetGUID() == uiFirstBoss || pCreature->GetGUID() == uiSecondBoss))
|
||||
{
|
||||
pCreature->AllLootRemovedFromCorpse();
|
||||
pCreature->RemoveLootMode(1);
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
@@ -258,126 +258,109 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
|
||||
void SpawnPortal()
|
||||
{
|
||||
Creature *pSinclari = instance->GetCreature(uiSinclari);
|
||||
if (pSinclari)
|
||||
{
|
||||
if (Creature *pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL,PortalLocation[uiLocation].x,PortalLocation[uiLocation].y,
|
||||
PortalLocation[uiLocation].z,PortalLocation[uiLocation].orientation,
|
||||
TEMPSUMMON_CORPSE_DESPAWN,900000))
|
||||
{
|
||||
uint32 entry = urand(0, 1) ? CREATURE_PORTAL_GUARDIAN : CREATURE_PORTAL_KEEPER;
|
||||
if (Creature *pPortalKeeper = pPortal->SummonCreature(entry,PortalLocation[uiLocation].x, PortalLocation[uiLocation].y,
|
||||
PortalLocation[uiLocation].z, PortalLocation[uiLocation].orientation,
|
||||
TEMPSUMMON_DEAD_DESPAWN,900000))
|
||||
pPortal->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL,false);
|
||||
uiLocation = (++uiLocation)%3;
|
||||
}
|
||||
}
|
||||
if (Creature *pSinclari = instance->GetCreature(uiSinclari))
|
||||
if (Creature *pPortal = pSinclari->SummonCreature(CREATURE_TELEPORTATION_PORTAL,PortalLocation[uiLocation],TEMPSUMMON_CORPSE_DESPAWN))
|
||||
uiLocation = (uiLocation+urand(1,2))%3;
|
||||
}
|
||||
|
||||
void StartBossEncounter(uint8 uiBoss, bool bForceRespawn = true)
|
||||
{
|
||||
Creature* pBoss = NULL;
|
||||
|
||||
switch(uiBoss)
|
||||
{
|
||||
case 0: //Moragg
|
||||
case BOSS_MORAGG:
|
||||
HandleGameObject(uiMoraggCell,bForceRespawn);
|
||||
|
||||
if (pBoss = instance->GetCreature(uiMoragg))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
}
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
break;
|
||||
case 1: //Erekem
|
||||
HandleGameObject(uiErekemCell,bForceRespawn);
|
||||
HandleGameObject(uiErekemRightGuardCell,bForceRespawn);
|
||||
HandleGameObject(uiErekemLeftGuardCell,bForceRespawn);
|
||||
case BOSS_EREKEM:
|
||||
HandleGameObject(uiErekemCell, bForceRespawn);
|
||||
HandleGameObject(uiErekemRightGuardCell, bForceRespawn);
|
||||
HandleGameObject(uiErekemLeftGuardCell, bForceRespawn);
|
||||
|
||||
if (pBoss = instance->GetCreature(uiErekem))
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (Creature* pGuard1 = instance->GetCreature(uiErekemGuard[0]))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (bForceRespawn)
|
||||
pGuard1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
else
|
||||
pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
if (pBoss = instance->GetCreature(uiErekemGuard[0]))
|
||||
|
||||
if (Creature* pGuard2 = instance->GetCreature(uiErekemGuard[1]))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
if (pBoss = instance->GetCreature(uiErekemGuard[1]))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (bForceRespawn)
|
||||
pGuard2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
else
|
||||
pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
break;
|
||||
case 2: //Ichoron
|
||||
case BOSS_ICHORON:
|
||||
HandleGameObject(uiIchoronCell,bForceRespawn);
|
||||
if (pBoss = instance->GetCreature(uiIchoron))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
break;
|
||||
case 3: //Lavanthor
|
||||
case BOSS_LAVANTHOR:
|
||||
HandleGameObject(uiLavanthorCell,bForceRespawn);
|
||||
if (pBoss = instance->GetCreature(uiLavanthor))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
break;
|
||||
case 4: //Xevozz
|
||||
case BOSS_XEVOZZ:
|
||||
HandleGameObject(uiXevozzCell,bForceRespawn);
|
||||
if (pBoss = instance->GetCreature(uiXevozz))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
break;
|
||||
case 5: //Zuramat
|
||||
case BOSS_ZURAMAT:
|
||||
HandleGameObject(uiZuramatCell,bForceRespawn);
|
||||
if (pBoss = instance->GetCreature(uiZuramat))
|
||||
{
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
break;
|
||||
}
|
||||
if (!bForceRespawn && pBoss)
|
||||
|
||||
if (!bForceRespawn && pBoss)
|
||||
{
|
||||
if (pBoss->isDead())
|
||||
{
|
||||
pBoss->AllLootRemovedFromCorpse();
|
||||
// respawn but avoid to be looted again
|
||||
pBoss->Respawn();
|
||||
pBoss->RemoveLootMode(1);
|
||||
pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
SetData(DATA_WAVE_COUNT,0);
|
||||
uiWaveCount = 0;
|
||||
}
|
||||
pBoss->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
SetData(DATA_WAVE_COUNT,0);
|
||||
uiWaveCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void AddWave()
|
||||
{
|
||||
DoUpdateWorldState(WORLD_STATE_VH, uiWaveCount);
|
||||
DoUpdateWorldState(WORLD_STATE_VH, 1);
|
||||
DoUpdateWorldState(WORLD_STATE_VH_WAVE_COUNT, uiWaveCount);
|
||||
DoUpdateWorldState(WORLD_STATE_VH_PRISON_STATE, 100); // TODO
|
||||
|
||||
switch(uiWaveCount)
|
||||
{
|
||||
case 6:
|
||||
uiFirstBoss = rand()%6;
|
||||
if (uiFirstBoss == 0)
|
||||
uiFirstBoss = urand(1,6);
|
||||
StartBossEncounter(uiFirstBoss);
|
||||
break;
|
||||
case 12:
|
||||
uiSecondBoss = rand()%6;
|
||||
while (uiSecondBoss == uiFirstBoss)
|
||||
uiSecondBoss = rand()%6;
|
||||
if (uiSecondBoss == 0)
|
||||
do
|
||||
{
|
||||
uiSecondBoss = urand(1,6);
|
||||
} while (uiSecondBoss == uiFirstBoss);
|
||||
StartBossEncounter(uiSecondBoss);
|
||||
break;
|
||||
case 18:
|
||||
{
|
||||
Creature *pSinclari = instance->GetCreature(uiSinclari);
|
||||
if (pSinclari)
|
||||
pSinclari->SummonCreature(CREATURE_CYANIGOSA,PortalLocation[0].x,PortalLocation[0].y,
|
||||
PortalLocation[0].z,PortalLocation[0].orientation,TEMPSUMMON_DEAD_DESPAWN,0);
|
||||
break;
|
||||
pSinclari->SummonCreature(CREATURE_CYANIGOSA,PortalLocation[0],TEMPSUMMON_DEAD_DESPAWN);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
@@ -388,8 +371,8 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
if (!bWiped)
|
||||
SpawnPortal();
|
||||
bWiped = false;
|
||||
break;
|
||||
}
|
||||
bActive = true;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
@@ -425,8 +408,11 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "V H " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << uiFirstBoss << " " << uiSecondBoss;
|
||||
saveStream << "V H " << (uint16)m_auiEncounter[0]
|
||||
<< " " << (uint16)m_auiEncounter[1]
|
||||
<< " " << (uint16)m_auiEncounter[2]
|
||||
<< " " << (uint16)uiFirstBoss
|
||||
<< " " << (uint16)uiSecondBoss;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
@@ -467,28 +453,20 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void CountPlayers(bool bCheckState = false)
|
||||
bool CheckWipe()
|
||||
{
|
||||
if (!bCheckState)
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
uiMaxPlayerCount = 0;
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
++uiMaxPlayerCount;
|
||||
}else
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
Player* pPlayer = itr->getSource();
|
||||
|
||||
if (pPlayer->isDead() && !pPlayer->isGameMaster())
|
||||
++uiPlayersDead;
|
||||
else if (pPlayer->isAlive() && !pPlayer->isGameMaster())
|
||||
uiPlayersDead = 0;
|
||||
}
|
||||
Player* pPlayer = itr->getSource();
|
||||
if (pPlayer->isGameMaster())
|
||||
continue;
|
||||
|
||||
if (pPlayer->isAlive())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
@@ -506,11 +484,8 @@ struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance
|
||||
} else uiActivationTimer -= diff;
|
||||
}
|
||||
|
||||
CountPlayers(true);
|
||||
CountPlayers(false);
|
||||
|
||||
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||
if (pMainDoor->GetGoState() != GO_STATE_ACTIVE && uiPlayersDead >= uiMaxPlayerCount)
|
||||
if (pMainDoor->GetGoState() != GO_STATE_ACTIVE && CheckWipe())
|
||||
{
|
||||
SetData(DATA_REMOVE_NPC, 1);
|
||||
StartBossEncounter(uiFirstBoss, false);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#define GOSSIP_START_EVENT "Get your people to safety, we'll keep the Blue Dragonflight's forces at bay."
|
||||
#define GOSSIP_ITEM_1 "Activate the crystals when we get in trouble, right"
|
||||
#define SPAWN_TIME 15000
|
||||
#define SPAWN_TIME 20000
|
||||
|
||||
enum PortalCreatures
|
||||
{
|
||||
@@ -17,6 +17,11 @@ enum PortalCreatures
|
||||
CREATURE_AZURE_STALKER = 32191
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_PORTAL_CHANNEL = 58012
|
||||
};
|
||||
|
||||
enum eSinclari
|
||||
{
|
||||
NPC_VIOLET_HOLD_GUARD = 30659,
|
||||
@@ -69,7 +74,10 @@ struct TRINITY_DLL_DECL npc_sinclariAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_WAVE_COUNT,1);
|
||||
pInstance->SetData(DATA_REMOVE_NPC,0); // might not have been reset after a wipe on a boss.
|
||||
}
|
||||
|
||||
//She should not be despawned, she will be used by the instance to summon some npcs
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
@@ -178,12 +186,14 @@ struct TRINITY_DLL_DECL npc_teleportation_portalAI : public ScriptedAI
|
||||
}
|
||||
|
||||
uint32 uiSpawnTimer;
|
||||
bool bPortalGuardianOrKeeperSpawn;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiSpawnTimer = 3000;
|
||||
uiSpawnTimer = 10000;
|
||||
bPortalGuardianOrKeeperSpawn = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who) {}
|
||||
@@ -199,19 +209,27 @@ struct TRINITY_DLL_DECL npc_teleportation_portalAI : public ScriptedAI
|
||||
|
||||
if (uiSpawnTimer <= diff)
|
||||
{
|
||||
uint8 k = pInstance->GetData(DATA_WAVE_COUNT) < 12 ? 3 : 4;
|
||||
for (uint8 i = 0; i < k; ++i)
|
||||
if (bPortalGuardianOrKeeperSpawn)
|
||||
{
|
||||
if (Creature* pSummon = m_creature->SummonCreature(RAND(CREATURE_AZURE_CAPTAIN,CREATURE_AZURE_RAIDER,CREATURE_AZURE_STALKER,CREATURE_AZURE_SORCEROR),
|
||||
m_creature->GetPositionX()+urand(0,2), m_creature->GetPositionY()+urand(0,2),
|
||||
m_creature->GetPositionZ(),m_creature->GetOrientation(),
|
||||
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
pSummon->GetMotionMaster()->MovePoint(0, DoorPosition);
|
||||
uint8 k = pInstance->GetData(DATA_WAVE_COUNT) < 12 ? 2 : 3;
|
||||
for (uint8 i = 0; i < k; ++i)
|
||||
{
|
||||
uint32 entry = RAND(CREATURE_AZURE_CAPTAIN,CREATURE_AZURE_RAIDER,CREATURE_AZURE_STALKER,CREATURE_AZURE_SORCEROR);
|
||||
if (Creature* pSummon = DoSummon(entry, m_creature, 2.0f, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
|
||||
pSummon->GetMotionMaster()->MovePoint(0, DoorPosition);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bPortalGuardianOrKeeperSpawn = true;
|
||||
uint32 entry = RAND(CREATURE_PORTAL_GUARDIAN, CREATURE_PORTAL_KEEPER);
|
||||
if (Creature *pPortalKeeper = DoSummon(entry, m_creature, 2.0f, 0, TEMPSUMMON_DEAD_DESPAWN))
|
||||
m_creature->CastSpell(pPortalKeeper, SPELL_PORTAL_CHANNEL, false);
|
||||
}
|
||||
uiSpawnTimer = SPAWN_TIME;
|
||||
} else uiSpawnTimer -= diff;
|
||||
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
if (bPortalGuardianOrKeeperSpawn && !m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
m_creature->Kill(m_creature, false);
|
||||
m_creature->RemoveCorpse();
|
||||
|
||||
@@ -49,9 +49,23 @@ enum Data64
|
||||
DATA_SINCLARI
|
||||
};
|
||||
|
||||
enum Bosses
|
||||
{
|
||||
BOSS_NONE, // 0 used as marker for not yet randomized
|
||||
BOSS_MORAGG,
|
||||
BOSS_EREKEM,
|
||||
BOSS_ICHORON,
|
||||
BOSS_LAVANTHOR,
|
||||
BOSS_XEVOZZ,
|
||||
BOSS_ZURAMAT,
|
||||
BOSS_CYANIGOSA
|
||||
};
|
||||
|
||||
enum WorldStates
|
||||
{
|
||||
WORLD_STATE_VH = 3816
|
||||
WORLD_STATE_VH = 3816,
|
||||
WORLD_STATE_VH_PRISON_STATE = 3815,
|
||||
WORLD_STATE_VH_WAVE_COUNT = 3810,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user