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