*Integrate Script system to Core
-added ScriptMgr for loading scripts -removed bindings -moved script system to src/game -moved scripts to src/scripts -VC project files updated -cmakes updated (not 100% done yet) NOTE to Devs: -file locations changed -precompiled renamed to ScriptedPch -ecsort_ai renamed to ScriptedEscortAI -follower_ai renamed to ScriptedFollowerAI -guard_ai renamed to ScriptedGuardAI -simple_ai renamed to ScriptedSimpleAI -sc_creature renamed to ScriptedCreature -sc_gossip renamed to ScriptedGossip -sc_instance renamed to ScriptedInstance *use the new headers in scripts, thank you NOTE to ALL: cmake not fully tested, please report any errors with it could make creashes, incompability USE AT YOUR OWN RISK before further tests!! --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,156 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss cyanigosa
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCANE_VACUUM = 58694,
|
||||
SPELL_BLIZZARD = 58693,
|
||||
H_SPELL_BLIZZARD = 59369,
|
||||
SPELL_MANA_DESTRUCTION = 59374,
|
||||
SPELL_TAIL_SWEEP = 58690,
|
||||
H_SPELL_TAIL_SWEEP = 59283,
|
||||
SPELL_UNCONTROLLABLE_ENERGY = 58688,
|
||||
H_SPELL_UNCONTROLLABLE_ENERGY = 59281,
|
||||
SPELL_TRANSFORM = 58668
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1608000,
|
||||
SAY_SLAY_1 = -1608001,
|
||||
SAY_SLAY_2 = -1608002,
|
||||
SAY_SLAY_3 = -1608003,
|
||||
SAY_DEATH = -1608004,
|
||||
SAY_SPAWN = -1608005,
|
||||
SAY_DISRUPTION = -1608006,
|
||||
SAY_BREATH_ATTACK = -1608007,
|
||||
SAY_SPECIAL_ATTACK_1 = -1608008,
|
||||
SAY_SPECIAL_ATTACK_2 = -1608009
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI
|
||||
{
|
||||
boss_cyanigosaAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiArcaneVacuumTimer;
|
||||
uint32 uiBlizzardTimer;
|
||||
uint32 uiManaDestructionTimer;
|
||||
uint32 uiTailSweepTimer;
|
||||
uint32 uiUncontrollableEnergyTimer;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiArcaneVacuumTimer = 10000;
|
||||
uiBlizzardTimer = 15000;
|
||||
uiManaDestructionTimer = 30000;
|
||||
uiTailSweepTimer = 20000;
|
||||
uiUncontrollableEnergyTimer = 25000;
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_CYANIGOSA_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoCast(m_creature, SPELL_TRANSFORM);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_CYANIGOSA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
{
|
||||
m_creature->ForcedDespawn();
|
||||
pInstance->SetData(DATA_REMOVE_NPC, 0);
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiArcaneVacuumTimer <= diff)
|
||||
{
|
||||
DoCast(SPELL_ARCANE_VACUUM);
|
||||
uiArcaneVacuumTimer = 10000;
|
||||
} else uiArcaneVacuumTimer -= diff;
|
||||
|
||||
if (uiBlizzardTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_BLIZZARD, H_SPELL_BLIZZARD));
|
||||
uiBlizzardTimer = 15000;
|
||||
} else uiBlizzardTimer -= diff;
|
||||
|
||||
if (uiTailSweepTimer <= diff)
|
||||
{
|
||||
DoCast(DUNGEON_MODE(SPELL_TAIL_SWEEP, H_SPELL_TAIL_SWEEP));
|
||||
uiTailSweepTimer = 20000;
|
||||
} else uiTailSweepTimer -= diff;
|
||||
|
||||
if (uiUncontrollableEnergyTimer <= diff)
|
||||
{
|
||||
DoCastVictim(DUNGEON_MODE(SPELL_UNCONTROLLABLE_ENERGY,H_SPELL_UNCONTROLLABLE_ENERGY));
|
||||
uiUncontrollableEnergyTimer = 25000;
|
||||
} else uiUncontrollableEnergyTimer -= diff;
|
||||
|
||||
if (IsHeroic())
|
||||
if (uiManaDestructionTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_MANA_DESTRUCTION);
|
||||
uiManaDestructionTimer = 30000;
|
||||
} else uiManaDestructionTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_CYANIGOSA_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_cyanigosa(Creature* pCreature)
|
||||
{
|
||||
return new boss_cyanigosaAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_cyanigosa()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_cyanigosa";
|
||||
newscript->GetAI = &GetAI_boss_cyanigosa;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss erekem
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.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
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1608010,
|
||||
SAY_SLAY_1 = -1608011,
|
||||
SAY_SLAY_2 = -1608012,
|
||||
SAY_SLAY_3 = -1608013,
|
||||
SAY_DEATH = -1608014,
|
||||
SAY_SPAWN = -1608015,
|
||||
SAY_ADD_KILLED = -1608016,
|
||||
SAY_BOTH_ADDS_KILLED = -1608017
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI
|
||||
{
|
||||
boss_erekemAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiBloodlustTimer;
|
||||
uint32 uiChainHealTimer;
|
||||
uint32 uiEarthShockTimer;
|
||||
uint32 uiLightningBoltTimer;
|
||||
uint32 uiEarthShieldTimer;
|
||||
|
||||
Creature* pGuard1;
|
||||
Creature* pGuard2;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiBloodlustTimer = 15000;
|
||||
uiChainHealTimer = 0;
|
||||
uiEarthShockTimer = urand(2000,8000);
|
||||
uiLightningBoltTimer = urand(5000,10000);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_EARTH_SHIELD, H_SPELL_EARTH_SHIELD));
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//spam stormstrike in hc mode if spawns are dead
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (pGuard1 && !pGuard1->isAlive() && pGuard2 && !pGuard2->isAlive())
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STORMSTRIKE);
|
||||
}
|
||||
}
|
||||
|
||||
if (uiEarthShieldTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_EARTH_SHIELD, H_SPELL_EARTH_SHIELD));
|
||||
uiEarthShieldTimer = 20000;
|
||||
} else uiEarthShieldTimer -= diff;
|
||||
|
||||
if (uiChainHealTimer <= diff)
|
||||
{
|
||||
if (Creature *pTarget = GetChainHealTarget())
|
||||
{
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_CHAIN_HEAL, H_SPELL_CHAIN_HEAL));
|
||||
//If one of the adds is dead spawn heals faster
|
||||
uiChainHealTimer = ((pGuard1 && !pGuard1->isAlive()) || (pGuard2 && !pGuard2->isAlive()) ? 3000 : 8000) + rand()%3000;
|
||||
}
|
||||
} else uiChainHealTimer -= diff;
|
||||
|
||||
if (uiBloodlustTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_BLOODLUST);
|
||||
uiBloodlustTimer = urand(35000,45000);
|
||||
} else uiBloodlustTimer -= diff;
|
||||
|
||||
if (uiEarthShockTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_EARTH_SHOCK);
|
||||
uiEarthShockTimer = urand(8000,13000);
|
||||
} else uiEarthShockTimer -= diff;
|
||||
|
||||
if (uiLightningBoltTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_LIGHTNING_BOLT);
|
||||
uiLightningBoltTimer = urand(18000,24000);
|
||||
} else uiLightningBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 7);
|
||||
}
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
{
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 13);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
|
||||
Creature* GetChainHealTarget()
|
||||
{
|
||||
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 85)
|
||||
return m_creature;
|
||||
if (pGuard1 && pGuard1->isAlive() && (pGuard1->GetHealth()*100 / pGuard1->GetMaxHealth() <= 75))
|
||||
return pGuard1;
|
||||
if (pGuard2 && pGuard2->isAlive() && (pGuard2->GetHealth()*100 / pGuard2->GetMaxHealth() <= 75))
|
||||
return pGuard2;
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_erekem(Creature* pCreature)
|
||||
{
|
||||
return new boss_erekemAI (pCreature);
|
||||
}
|
||||
|
||||
enum GuardSpells
|
||||
{
|
||||
SPELL_GUSHING_WOUND = 39215,
|
||||
SPELL_HOWLING_SCREECH = 54462,
|
||||
SPELL_STRIKE = 14516
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_erekem_guardAI : public ScriptedAI
|
||||
{
|
||||
mob_erekem_guardAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiGushingWoundTimer;
|
||||
uint32 uiHowlingScreechTimer;
|
||||
uint32 uiStrikeTimer;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiStrikeTimer = urand(4000,8000);
|
||||
uiHowlingScreechTimer = urand(8000,13000);
|
||||
uiGushingWoundTimer = urand(1000,3000);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
if (uiStrikeTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STRIKE);
|
||||
uiStrikeTimer = urand(4000,8000);
|
||||
} else uiStrikeTimer -= diff;
|
||||
|
||||
if (uiHowlingScreechTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_HOWLING_SCREECH);
|
||||
uiHowlingScreechTimer = urand(8000,13000);
|
||||
} else uiHowlingScreechTimer -= diff;
|
||||
|
||||
if (uiGushingWoundTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_GUSHING_WOUND);
|
||||
uiGushingWoundTimer = urand(7000,12000);
|
||||
} else uiGushingWoundTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_erekem_guard(Creature* pCreature)
|
||||
{
|
||||
return new mob_erekem_guardAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_erekem()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_erekem";
|
||||
newscript->GetAI = &GetAI_boss_erekem;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_erekem_guard";
|
||||
newscript->GetAI = &GetAI_mob_erekem_guard;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,354 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Script Data Start
|
||||
SDName: Boss ichoron
|
||||
SDAuthor: ckegg
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_DRAINED = 59820,
|
||||
SPELL_FRENZY = 54312,
|
||||
SPELL_FRENZY_H = 59522,
|
||||
SPELL_PROTECTIVE_BUBBLE = 54306,
|
||||
SPELL_WATER_BLAST = 54237,
|
||||
SPELL_WATER_BLAST_H = 59520,
|
||||
SPELL_WATER_BOLT_VOLLEY = 54241,
|
||||
SPELL_WATER_BOLT_VOLLEY_H = 59521,
|
||||
SPELL_SPLASH = 59516,
|
||||
};
|
||||
|
||||
enum IchoronCreatures
|
||||
{
|
||||
NPC_ICHOR_GLOBULE = 29321,
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1608018,
|
||||
SAY_SLAY_1 = -1608019,
|
||||
SAY_SLAY_2 = -1608020,
|
||||
SAY_SLAY_3 = -1608021,
|
||||
SAY_DEATH = -1608022,
|
||||
SAY_SPAWN = -1608023,
|
||||
SAY_ENRAGE = -1608024,
|
||||
SAY_SHATTER = -1608025,
|
||||
SAY_BUBBLE = -1608026
|
||||
};
|
||||
|
||||
struct Locations
|
||||
{
|
||||
float x, y, z;
|
||||
uint32 id;
|
||||
};
|
||||
|
||||
static Locations PortalLoc[]=
|
||||
{
|
||||
{1857.125, 763.295, 38.654},
|
||||
{1925.480, 849.981, 47.174},
|
||||
{1892.737, 744.589, 47.666},
|
||||
{1878.198, 850.005, 43.333},
|
||||
{1909.381, 806.796, 38.645},
|
||||
{1936.101, 802.950, 52.417},
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI
|
||||
{
|
||||
boss_ichoronAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
bool bIsExploded;
|
||||
bool bIsFrenzy;
|
||||
|
||||
uint32 uiBuubleChecker_Timer;
|
||||
uint32 uiWaterBoltVolley_Timer;
|
||||
uint32 uiShowup_Counter;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
std::list<uint64> m_lWaterElementsGUIDList;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
bIsExploded = false;
|
||||
bIsFrenzy = false;
|
||||
uiBuubleChecker_Timer = 1000;
|
||||
uiWaterBoltVolley_Timer = urand(10000, 15000);
|
||||
uiShowup_Counter = 0;
|
||||
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
DespawnWaterElements();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
DoCast(m_creature, SPELL_PROTECTIVE_BUBBLE);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void WaterElementHit()
|
||||
{
|
||||
m_creature->SetHealth(m_creature->GetHealth() + m_creature->GetMaxHealth() * 0.01);
|
||||
if (bIsExploded)
|
||||
{
|
||||
DoCast(m_creature, SPELL_PROTECTIVE_BUBBLE);
|
||||
bIsExploded = false;
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
}
|
||||
}
|
||||
|
||||
void DespawnWaterElements()
|
||||
{
|
||||
if (m_lWaterElementsGUIDList.empty())
|
||||
return;
|
||||
|
||||
for(std::list<uint64>::iterator itr = m_lWaterElementsGUIDList.begin(); itr != m_lWaterElementsGUIDList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, *itr))
|
||||
{
|
||||
if (pTemp->isAlive())
|
||||
pTemp->Kill(pTemp, false);
|
||||
}
|
||||
}
|
||||
m_lWaterElementsGUIDList.clear();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* pWho) {}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!bIsFrenzy)
|
||||
{
|
||||
if (uiBuubleChecker_Timer < uiDiff)
|
||||
{
|
||||
if (!bIsExploded)
|
||||
{
|
||||
if (!m_creature->HasAura(SPELL_PROTECTIVE_BUBBLE, 0))
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_WATER_BLAST, SPELL_WATER_BLAST_H));
|
||||
//DoCast(m_creature, SPELL_DRAINED);
|
||||
bIsExploded = true;
|
||||
uiShowup_Counter = 0;
|
||||
m_creature->AttackStop();
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
for(uint8 i = 0; i < 10; i++)
|
||||
{
|
||||
//int tmp = urand(0, 5);
|
||||
//m_creature->SummonCreature(NPC_ICHOR_GLOBULE, PortalLoc[tmp].x, PortalLoc[tmp].y, PortalLoc[tmp].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
m_creature->SummonCreature(NPC_ICHOR_GLOBULE, m_creature->GetPositionX()-10+rand()%20, m_creature->GetPositionY()-10+rand()%20, m_creature->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
uiBuubleChecker_Timer = 3000;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool bIsWaterElementsAlive = false;
|
||||
++uiShowup_Counter;
|
||||
if (!m_lWaterElementsGUIDList.empty())
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = m_lWaterElementsGUIDList.begin(); itr != m_lWaterElementsGUIDList.end(); ++itr)
|
||||
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, *itr))
|
||||
if (pTemp->isAlive())
|
||||
bIsWaterElementsAlive = true;
|
||||
}
|
||||
if (!bIsWaterElementsAlive || uiShowup_Counter > 20)
|
||||
{
|
||||
DoCast(m_creature, SPELL_PROTECTIVE_BUBBLE);
|
||||
bIsExploded = false;
|
||||
uiShowup_Counter = 0;
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
}
|
||||
uiBuubleChecker_Timer = 1000;
|
||||
}
|
||||
}
|
||||
else uiBuubleChecker_Timer -= uiDiff;
|
||||
}
|
||||
|
||||
if (!bIsExploded)
|
||||
{
|
||||
if (uiWaterBoltVolley_Timer < uiDiff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_WATER_BOLT_VOLLEY, SPELL_WATER_BOLT_VOLLEY_H));
|
||||
uiWaterBoltVolley_Timer = urand(10000, 15000);
|
||||
}
|
||||
else uiWaterBoltVolley_Timer -= uiDiff;
|
||||
|
||||
if (!bIsFrenzy && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_FRENZY, SPELL_FRENZY_H));
|
||||
bIsFrenzy = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
DespawnWaterElements();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 7);
|
||||
}
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
{
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 13);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
pSummoned->SetSpeed(MOVE_RUN, 0.2f);
|
||||
pSummoned->GetMotionMaster()->MoveFollow(m_creature, 0, 0);
|
||||
m_lWaterElementsGUIDList.push_back(pSummoned->GetGUID());
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_ichoron(Creature* pCreature)
|
||||
{
|
||||
return new boss_ichoronAI (pCreature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ichor_globuleAI : public ScriptedAI
|
||||
{
|
||||
mob_ichor_globuleAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiRangeCheck_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiRangeCheck_Timer = 1000;
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (uiRangeCheck_Timer < uiDiff)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (Creature* pIchoron = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ICHORON))))
|
||||
{
|
||||
//maybe 12.0f is not offlike, maybe 2.00f ?
|
||||
float fDistance = m_creature->GetDistance(pIchoron);
|
||||
if (m_creature->IsWithinDist(pIchoron, fDistance <= 12.0f , false))
|
||||
{
|
||||
((boss_ichoronAI*)pIchoron->AI())->WaterElementHit();
|
||||
m_creature->Kill(m_creature, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
uiRangeCheck_Timer = 1000;
|
||||
}
|
||||
else uiRangeCheck_Timer -= uiDiff;
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SPLASH);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_ichor_globule(Creature* pCreature)
|
||||
{
|
||||
return new mob_ichor_globuleAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ichoron()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ichoron";
|
||||
newscript->GetAI = &GetAI_boss_ichoron;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ichor_globule";
|
||||
newscript->GetAI = &GetAI_mob_ichor_globule;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss lavanthor
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CAUTERIZING_FLAMES = 59466, //Only in heroic
|
||||
SPELL_FIREBOLT = 54235,
|
||||
H_SPELL_FIREBOLT = 59468,
|
||||
SPELL_FLAME_BREATH = 54282,
|
||||
H_SPELL_FLAME_BREATH = 59469,
|
||||
SPELL_LAVA_BURN = 54249,
|
||||
H_SPELL_LAVA_BURN = 59594
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI
|
||||
{
|
||||
boss_lavanthorAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiFireboltTimer;
|
||||
uint32 uiFlameBreathTimer;
|
||||
uint32 uiLavaBurnTimer;
|
||||
uint32 uiCauterizingFlamesTimer;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiFireboltTimer = 1000;
|
||||
uiFlameBreathTimer = 5000;
|
||||
uiLavaBurnTimer = 10000;
|
||||
uiCauterizingFlamesTimer = 3000;
|
||||
if (pInstance)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiFireboltTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_FIREBOLT, H_SPELL_FIREBOLT));
|
||||
uiFireboltTimer = urand(5000,13000);
|
||||
} else uiFireboltTimer -= diff;
|
||||
|
||||
if (uiFlameBreathTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_FLAME_BREATH, H_SPELL_FLAME_BREATH));
|
||||
uiFlameBreathTimer = urand(10000,15000);
|
||||
} else uiFlameBreathTimer -= diff;
|
||||
|
||||
if (uiLavaBurnTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_LAVA_BURN, H_SPELL_LAVA_BURN));
|
||||
uiLavaBurnTimer = urand(15000,23000);
|
||||
}
|
||||
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (uiCauterizingFlamesTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_CAUTERIZING_FLAMES);
|
||||
uiCauterizingFlamesTimer = urand(10000,16000);
|
||||
} else uiCauterizingFlamesTimer -= diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 7);
|
||||
}
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
{
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 13);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_lavanthor(Creature* pCreature)
|
||||
{
|
||||
return new boss_lavanthorAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_lavanthor()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_lavanthor";
|
||||
newscript->GetAI = &GetAI_boss_lavanthor;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss moragg
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
//Spells
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CORROSIVE_SALIVA = 54527,
|
||||
SPELL_OPTIC_LINK = 54396
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI
|
||||
{
|
||||
boss_moraggAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiOpticLinkTimer;
|
||||
uint32 uiCorrosiveSalivaTimer;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiOpticLinkTimer = 10000;
|
||||
uiCorrosiveSalivaTimer = 5000;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiOpticLinkTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_OPTIC_LINK);
|
||||
uiOpticLinkTimer = 15000;
|
||||
} else uiOpticLinkTimer -= diff;
|
||||
|
||||
if (uiCorrosiveSalivaTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_CORROSIVE_SALIVA);
|
||||
uiCorrosiveSalivaTimer = 10000;
|
||||
} else uiCorrosiveSalivaTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 7);
|
||||
}
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
{
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT,13);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_moragg(Creature* pCreature)
|
||||
{
|
||||
return new boss_moraggAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_moragg()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_moragg";
|
||||
newscript->GetAI = &GetAI_boss_moragg;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Script Data Start
|
||||
SDName: Boss xevozz
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCANE_BARRAGE_VOLLEY = 54202,
|
||||
SPELL_ARCANE_BARRAGE_VOLLEY_H = 59483,
|
||||
SPELL_ARCANE_BUFFET = 54226,
|
||||
SPELL_ARCANE_BUFFET_H = 59485,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_1 = 54102,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_2 = 54137,
|
||||
SPELL_SUMMON_ETHEREAL_SPHERE_3 = 54138,
|
||||
};
|
||||
|
||||
enum NPCs
|
||||
{
|
||||
NPC_ETHEREAL_SPHERE = 29271,
|
||||
//NPC_ETHEREAL_SPHERE2 = 32582, // heroic only?
|
||||
};
|
||||
|
||||
enum CreatureSpells
|
||||
{
|
||||
SPELL_ARCANE_POWER = 54160,
|
||||
H_SPELL_ARCANE_POWER = 59474,
|
||||
SPELL_SUMMON_PLAYERS = 54164,
|
||||
SPELL_POWER_BALL_VISUAL = 54141,
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1608027,
|
||||
SAY_SLAY_1 = -1608028,
|
||||
SAY_SLAY_2 = -1608029,
|
||||
SAY_SLAY_3 = -1608030,
|
||||
SAY_DEATH = -1608031,
|
||||
SAY_SPAWN = -1608032,
|
||||
SAY_CHARGED = -1608033,
|
||||
SAY_REPEAT_SUMMON_1 = -1608034,
|
||||
SAY_REPEAT_SUMMON_2 = -1608035,
|
||||
SAY_SUMMON_ENERGY = -1608036
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI
|
||||
{
|
||||
boss_xevozzAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiSummonEtherealSphere_Timer;
|
||||
uint32 uiArcaneBarrageVolley_Timer;
|
||||
uint32 uiArcaneBuffet_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
uiSummonEtherealSphere_Timer = urand(10000, 12000);
|
||||
uiArcaneBarrageVolley_Timer = urand(20000, 22000);
|
||||
uiArcaneBuffet_Timer = uiSummonEtherealSphere_Timer + urand(5000, 6000);
|
||||
DespawnSphere();
|
||||
}
|
||||
|
||||
void DespawnSphere()
|
||||
{
|
||||
std::list<Creature*> assistList;
|
||||
GetCreatureListWithEntryInGrid(assistList,m_creature, NPC_ETHEREAL_SPHERE ,150.0f);
|
||||
|
||||
if (assistList.empty())
|
||||
return;
|
||||
|
||||
for(std::list<Creature*>::iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
|
||||
{
|
||||
if (Creature* pSphere = *iter)
|
||||
pSphere->Kill(pSphere, false);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
pSummoned->SetSpeed(MOVE_RUN, 0.5f);
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
pSummoned->AddThreat(pTarget, 0.00f);
|
||||
pSummoned->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* pWho) {}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiArcaneBarrageVolley_Timer < uiDiff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_ARCANE_BARRAGE_VOLLEY, SPELL_ARCANE_BARRAGE_VOLLEY_H));
|
||||
uiArcaneBarrageVolley_Timer = urand(20000, 22000);
|
||||
}
|
||||
else uiArcaneBarrageVolley_Timer -= uiDiff;
|
||||
|
||||
if (uiArcaneBuffet_Timer)
|
||||
if (uiArcaneBuffet_Timer < uiDiff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_ARCANE_BUFFET, SPELL_ARCANE_BUFFET_H));
|
||||
uiArcaneBuffet_Timer = 0;
|
||||
}
|
||||
else uiArcaneBuffet_Timer -= uiDiff;
|
||||
|
||||
if (uiSummonEtherealSphere_Timer < uiDiff)
|
||||
{
|
||||
DoScriptText(SAY_SPAWN, m_creature);
|
||||
DoCast(m_creature, SPELL_SUMMON_ETHEREAL_SPHERE_1);
|
||||
if (IsHeroic()) // extra one for heroic
|
||||
m_creature->SummonCreature(NPC_ETHEREAL_SPHERE, m_creature->GetPositionX()-5+rand()%10, m_creature->GetPositionY()-5+rand()%10, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 40000);
|
||||
|
||||
uiSummonEtherealSphere_Timer = urand(45000, 47000);
|
||||
uiArcaneBuffet_Timer = urand(5000, 6000);
|
||||
}
|
||||
else uiSummonEtherealSphere_Timer -= uiDiff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
DespawnSphere();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 7);
|
||||
}
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
{
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, NOT_STARTED);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 13);
|
||||
}
|
||||
}
|
||||
}
|
||||
void KilledUnit(Unit* pVictim)
|
||||
{
|
||||
if (pVictim == m_creature)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_xevozz(Creature* pCreature)
|
||||
{
|
||||
return new boss_xevozzAI (pCreature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ethereal_sphereAI : public ScriptedAI
|
||||
{
|
||||
mob_ethereal_sphereAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiSummonPlayers_Timer;
|
||||
uint32 uiRangeCheck_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiSummonPlayers_Timer = urand(33000, 35000);
|
||||
uiRangeCheck_Timer = 1000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!m_creature->HasAura(SPELL_POWER_BALL_VISUAL))
|
||||
DoCast(m_creature, SPELL_POWER_BALL_VISUAL);
|
||||
|
||||
if (uiRangeCheck_Timer < uiDiff)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (Creature* pXevozz = ((Creature*)Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_XEVOZZ))))
|
||||
{
|
||||
float fDistance = m_creature->GetDistance2d(pXevozz);
|
||||
if (fDistance <= 3)
|
||||
DoCast(pXevozz, DUNGEON_MODE(SPELL_ARCANE_POWER, H_SPELL_ARCANE_POWER));
|
||||
else
|
||||
DoCast(m_creature, 35845); //Is it blizzlike?
|
||||
}
|
||||
}
|
||||
uiRangeCheck_Timer = 1000;
|
||||
}
|
||||
else uiRangeCheck_Timer -= uiDiff;
|
||||
|
||||
if (uiSummonPlayers_Timer < uiDiff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SUMMON_PLAYERS); // not working right
|
||||
|
||||
Map* pMap = m_creature->GetMap();
|
||||
if (pMap && pMap->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (i->getSource()->isAlive())
|
||||
DoTeleportPlayer(i->getSource(), m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), i->getSource()->GetOrientation());
|
||||
}
|
||||
|
||||
uiSummonPlayers_Timer = urand(33000, 35000);
|
||||
}
|
||||
else uiSummonPlayers_Timer -= uiDiff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_ethereal_sphere(Creature* pCreature)
|
||||
{
|
||||
return new mob_ethereal_sphereAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_xevozz()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_xevozz";
|
||||
newscript->GetAI = &GetAI_boss_xevozz;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ethereal_sphere";
|
||||
newscript->GetAI = &GetAI_mob_ethereal_sphere;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss zuramat
|
||||
SD%Complete:
|
||||
SDComment: The phasemask for the voids dosen't work.
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHROUD_OF_DARKNESS = 54524,
|
||||
H_SPELL_SHROUD_OF_DARKNESS = 59745,
|
||||
SPELL_SUMMON_VOID_SENTRY = 54369,
|
||||
SPELL_VOID_SHIFT = 54361,
|
||||
H_SPELL_VOID_SHIFT = 59743,
|
||||
|
||||
SPELL_ZUMARAT_ADD_2 = 59747,
|
||||
H_SPELL_ZUMARAT_ADD_2 = 59747
|
||||
};
|
||||
|
||||
enum ZuramatCreatures
|
||||
{
|
||||
CREATURE_VOID_SENTRY = 29364
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1608037,
|
||||
SAY_SLAY_1 = -1608038,
|
||||
SAY_SLAY_2 = -1608039,
|
||||
SAY_SLAY_3 = -1608040,
|
||||
SAY_DEATH = -1608041,
|
||||
SAY_SPAWN = -1608042,
|
||||
SAY_SHIELD = -1608043,
|
||||
SAY_WHISPER = -1608044
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI
|
||||
{
|
||||
boss_zuramatAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 SpellVoidShiftTimer;
|
||||
uint32 SpellSummonVoidTimer;
|
||||
uint32 SpellShroudOfDarknessTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
SpellShroudOfDarknessTimer = 22000;
|
||||
SpellVoidShiftTimer = 15000;
|
||||
SpellSummonVoidTimer = 12000;
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(pWho, true))
|
||||
{
|
||||
m_creature->AddThreat(pWho, 0.0f);
|
||||
m_creature->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(m_creature);
|
||||
DoStartMovement(pWho);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, IN_PROGRESS);
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (SpellSummonVoidTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_SUMMON_VOID_SENTRY, false);
|
||||
SpellSummonVoidTimer = 20000;
|
||||
} else SpellSummonVoidTimer -=diff;
|
||||
|
||||
if (SpellVoidShiftTimer <= diff)
|
||||
{
|
||||
if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pUnit, DUNGEON_MODE(SPELL_VOID_SHIFT, H_SPELL_VOID_SHIFT));
|
||||
SpellVoidShiftTimer = 20000;
|
||||
} else SpellVoidShiftTimer -=diff;
|
||||
|
||||
if (SpellShroudOfDarknessTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SHROUD_OF_DARKNESS, H_SPELL_SHROUD_OF_DARKNESS));
|
||||
SpellShroudOfDarknessTimer = 20000;
|
||||
} else SpellShroudOfDarknessTimer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_WAVE_COUNT) == 6)
|
||||
{
|
||||
pInstance->SetData(DATA_1ST_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 7);
|
||||
}
|
||||
else if (pInstance->GetData(DATA_WAVE_COUNT) == 12)
|
||||
{
|
||||
pInstance->SetData(DATA_2ND_BOSS_EVENT, DONE);
|
||||
pInstance->SetData(DATA_WAVE_COUNT, 13);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->AI()->AttackStart(m_creature->getVictim());
|
||||
summon->AI()->DoCastAOE(DUNGEON_MODE(SPELL_ZUMARAT_ADD_2, H_SPELL_ZUMARAT_ADD_2));
|
||||
summon->SetPhaseMask(17,true);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_zuramat(Creature* pCreature)
|
||||
{
|
||||
return new boss_zuramatAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_zuramat()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_zuramat";
|
||||
newscript->GetAI = &GetAI_boss_zuramat;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,544 @@
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
#define MAX_ENCOUNTER 3
|
||||
|
||||
/* Violet Hold encounters:
|
||||
0 - First boss
|
||||
1 - Second boss
|
||||
2 - Cyanigosa*/
|
||||
|
||||
/* Violet hold bosses:
|
||||
0 - Moragg
|
||||
1 - Erekem
|
||||
2 - Ichoron
|
||||
3 - Lavanthor
|
||||
4 - Xevozz
|
||||
5 - Zuramat
|
||||
6 - Cyanigosa */
|
||||
enum GameObjects
|
||||
{
|
||||
GO_MAIN_DOOR = 191723,
|
||||
GO_XEVOZZ_DOOR = 191556,
|
||||
GO_LAVANTHOR_DOOR = 191566,
|
||||
GO_ICHORON_DOOR = 191722,
|
||||
GO_ZURAMAT_DOOR = 191565,
|
||||
GO_EREKEM_DOOR = 191564,
|
||||
GO_EREKEM_GUARD_1_DOOR = 191563,
|
||||
GO_EREKEM_GUARD_2_DOOR = 191562,
|
||||
GO_MORAGG_DOOR = 191606,
|
||||
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[] =
|
||||
{
|
||||
{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();};
|
||||
|
||||
uint64 uiMoragg;
|
||||
uint64 uiErekem;
|
||||
uint64 uiErekemGuard[2];
|
||||
uint64 uiIchoron;
|
||||
uint64 uiLavanthor;
|
||||
uint64 uiXevozz;
|
||||
uint64 uiZuramat;
|
||||
uint64 uiCyanigosa;
|
||||
uint64 uiSinclari;
|
||||
|
||||
uint64 uiMoraggCell;
|
||||
uint64 uiErekemCell;
|
||||
uint64 uiErekemLeftGuardCell;
|
||||
uint64 uiErekemRightGuardCell;
|
||||
uint64 uiIchoronCell;
|
||||
uint64 uiLavanthorCell;
|
||||
uint64 uiXevozzCell;
|
||||
uint64 uiZuramatCell;
|
||||
uint64 uiMainDoor;
|
||||
|
||||
uint64 uiActivationCrystal[3];
|
||||
|
||||
uint32 uiActivationTimer;
|
||||
|
||||
uint8 uiWaveCount;
|
||||
uint8 uiLocation;
|
||||
uint8 uiFirstBoss;
|
||||
uint8 uiSecondBoss;
|
||||
uint8 uiRemoveNpc;
|
||||
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint8 uiCountErekemGuards;
|
||||
uint8 uiCountActivationCrystals;
|
||||
uint8 uiPlayersDead;
|
||||
uint8 uiMaxPlayerCount;
|
||||
|
||||
bool bActive;
|
||||
bool bWiped;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiMoragg = 0;
|
||||
uiErekem = 0;
|
||||
uiIchoron = 0;
|
||||
uiLavanthor = 0;
|
||||
uiXevozz = 0;
|
||||
uiZuramat = 0;
|
||||
uiCyanigosa = 0;
|
||||
uiSinclari = 0;
|
||||
|
||||
uiMoraggCell = 0;
|
||||
uiErekemCell = 0;
|
||||
uiErekemGuard[0] = 0;
|
||||
uiErekemGuard[1] = 0;
|
||||
uiIchoronCell = 0;
|
||||
uiLavanthorCell = 0;
|
||||
uiXevozzCell = 0;
|
||||
uiZuramatCell = 0;
|
||||
uiMainDoor = 0;
|
||||
uiRemoveNpc = 0;
|
||||
|
||||
uiWaveCount = 0;
|
||||
uiLocation = 0;
|
||||
uiFirstBoss = 0;
|
||||
uiSecondBoss = 0;
|
||||
uiCountErekemGuards = 0;
|
||||
uiCountActivationCrystals = 0;
|
||||
uiPlayersDead = 0;
|
||||
uiMaxPlayerCount = 0;
|
||||
|
||||
uiActivationTimer = 5000;
|
||||
|
||||
bActive = false;
|
||||
bWiped = false;
|
||||
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool add)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case CREATURE_XEVOZZ:
|
||||
uiXevozz = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_LAVANTHOR:
|
||||
uiLavanthor = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_ICHORON:
|
||||
uiIchoron = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_ZURAMAT:
|
||||
uiZuramat = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_EREKEM:
|
||||
uiErekem = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_EREKEM_GUARD:
|
||||
if (uiCountErekemGuards < 2)
|
||||
uiErekemGuard[uiCountErekemGuards++] = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_MORAGG:
|
||||
uiMoragg = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_CYANIGOSA:
|
||||
uiCyanigosa = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_SINCLARI:
|
||||
uiSinclari = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_EREKEM_GUARD_1_DOOR:
|
||||
uiErekemLeftGuardCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_EREKEM_GUARD_2_DOOR:
|
||||
uiErekemRightGuardCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_EREKEM_DOOR:
|
||||
uiErekemCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_ZURAMAT_DOOR:
|
||||
uiZuramatCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_LAVANTHOR_DOOR:
|
||||
uiLavanthorCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_MORAGG_DOOR:
|
||||
uiMoraggCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_ICHORON_DOOR:
|
||||
uiIchoronCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_XEVOZZ_DOOR:
|
||||
uiXevozzCell = pGo->GetGUID();
|
||||
break;
|
||||
case GO_MAIN_DOOR:
|
||||
uiMainDoor = pGo->GetGUID();
|
||||
break;
|
||||
case GO_ACTIVATION_CRYSTAL:
|
||||
if (uiCountActivationCrystals < 3)
|
||||
uiActivationCrystal[uiCountActivationCrystals++] = pGo->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_1ST_BOSS_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_2ND_BOSS_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
break;
|
||||
case DATA_CYANIGOSA_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||
pMainDoor->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
break;
|
||||
case DATA_WAVE_COUNT:
|
||||
uiWaveCount = data;
|
||||
bActive = true;
|
||||
break;
|
||||
case DATA_REMOVE_NPC:
|
||||
uiRemoveNpc = data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_1ST_BOSS_EVENT: return m_auiEncounter[0];
|
||||
case DATA_2ND_BOSS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_CYANIGOSA_EVENT: return m_auiEncounter[2];
|
||||
case DATA_WAVE_COUNT: return uiWaveCount;
|
||||
case DATA_REMOVE_NPC: return uiRemoveNpc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StartBossEncounter(uint8 uiBoss, bool bForceRespawn = true)
|
||||
{
|
||||
Creature* pBoss = NULL;
|
||||
switch(uiBoss)
|
||||
{
|
||||
case 0: //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);
|
||||
|
||||
}
|
||||
break;
|
||||
case 1: //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);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
if (pBoss = instance->GetCreature(uiErekemGuard[0]))
|
||||
{
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 2: //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);
|
||||
}
|
||||
break;
|
||||
case 3: //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);
|
||||
}
|
||||
break;
|
||||
case 4: //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);
|
||||
}
|
||||
break;
|
||||
case 5: //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);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!bForceRespawn && pBoss)
|
||||
{
|
||||
pBoss->AllLootRemovedFromCorpse();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void AddWave()
|
||||
{
|
||||
DoUpdateWorldState(WORLD_STATE_VH, uiWaveCount);
|
||||
switch(uiWaveCount)
|
||||
{
|
||||
case 6:
|
||||
uiFirstBoss = rand()%6;
|
||||
StartBossEncounter(uiFirstBoss);
|
||||
break;
|
||||
case 12:
|
||||
uiSecondBoss = rand()%6;
|
||||
while (uiSecondBoss == uiFirstBoss)
|
||||
uiSecondBoss = rand()%6;
|
||||
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;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||
pMainDoor->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
default:
|
||||
if (!bWiped)
|
||||
SpawnPortal();
|
||||
bWiped = false;
|
||||
}
|
||||
bActive = true;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_MORAGG: return uiMoragg;
|
||||
case DATA_EREKEM: return uiErekem;
|
||||
case DATA_EREKEM_GUARD_1: return uiErekemGuard[0];
|
||||
case DATA_EREKEM_GUARD_2: return uiErekemGuard[1];
|
||||
case DATA_ICHORON: return uiIchoron;
|
||||
case DATA_LAVANTHOR: return uiLavanthor;
|
||||
case DATA_XEVOZZ: return uiXevozz;
|
||||
case DATA_ZURAMAT: return uiZuramat;
|
||||
case DATA_CYANIGOSA: return uiCyanigosa;
|
||||
case DATA_MORAGG_CELL: return uiMoraggCell;
|
||||
case DATA_EREKEM_CELL: return uiErekemCell;
|
||||
case DATA_EREKEM_RIGHT_GUARD_CELL: return uiErekemRightGuardCell;
|
||||
case DATA_EREKEM_LEFT_GUARD_CELL: return uiErekemLeftGuardCell;
|
||||
case DATA_ICHORON_CELL: return uiIchoronCell;
|
||||
case DATA_LAVANTHOR_CELL: return uiLavanthorCell;
|
||||
case DATA_XEVOZZ_CELL: return uiXevozzCell;
|
||||
case DATA_ZURAMAT_CELL: return uiZuramatCell;
|
||||
case DATA_MAIN_DOOR: return uiMainDoor;
|
||||
case DATA_SINCLARI: return uiSinclari;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "V H " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << uiFirstBoss << " " << uiSecondBoss;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3, data4;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4;
|
||||
|
||||
if (dataHead1 == 'V' && dataHead2 == 'H')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
uiFirstBoss = data3;
|
||||
uiSecondBoss = data4;
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void CountPlayers(bool bCheckState = false)
|
||||
{
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (!instance->HavePlayers())
|
||||
return;
|
||||
|
||||
if (bActive)
|
||||
{
|
||||
if (uiActivationTimer < diff)
|
||||
{
|
||||
AddWave();
|
||||
bActive = false;
|
||||
uiActivationTimer = 5000;
|
||||
} else uiActivationTimer -= diff;
|
||||
}
|
||||
|
||||
CountPlayers(true);
|
||||
CountPlayers(false);
|
||||
|
||||
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||
if (pMainDoor->GetGoState() != GO_STATE_ACTIVE && uiPlayersDead >= uiMaxPlayerCount)
|
||||
{
|
||||
SetData(DATA_REMOVE_NPC, 1);
|
||||
StartBossEncounter(uiFirstBoss, false);
|
||||
StartBossEncounter(uiSecondBoss, false);
|
||||
bWiped = true;
|
||||
if (Creature* pSinclari = instance->GetCreature(uiSinclari))
|
||||
{
|
||||
pSinclari->DisappearAndDie();
|
||||
pSinclari->Respawn(true);
|
||||
}
|
||||
|
||||
if (GameObject* pMainDoor = instance->GetGameObject(uiMainDoor))
|
||||
pMainDoor->SetGoState(GO_STATE_ACTIVE);
|
||||
SetData(DATA_WAVE_COUNT, 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_violet_hold(Map* pMap)
|
||||
{
|
||||
return new instance_violet_hold(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_violet_hold()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_violet_hold";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_violet_hold;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
#include "ScriptedPch.h"
|
||||
#include "violet_hold.h"
|
||||
|
||||
#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
|
||||
|
||||
enum PortalCreatures
|
||||
{
|
||||
CREATURE_AZURE_INVADER = 30661,
|
||||
CREATURE_AZURE_SPELLBREAKER = 30662,
|
||||
CREATURE_AZURE_BINDER = 30663,
|
||||
CREATURE_AZURE_MAGE_SLAYER = 30664,
|
||||
CREATURE_AZURE_CAPTAIN = 30666,
|
||||
CREATURE_AZURE_SORCEROR = 30667,
|
||||
CREATURE_AZURE_RAIDER = 30668,
|
||||
CREATURE_AZURE_STALKER = 32191
|
||||
};
|
||||
|
||||
enum eSinclari
|
||||
{
|
||||
NPC_VIOLET_HOLD_GUARD = 30659,
|
||||
|
||||
SAY_SINCLARI_1 = -1608000,
|
||||
};
|
||||
|
||||
const Position DoorPosition = { 1828.300049, 797.309021, 46.135502, 1.48353};
|
||||
const Position MovePosition = { 1806.955566, 803.851807, 44.363323};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_sinclariAI : public ScriptedAI
|
||||
{
|
||||
npc_sinclariAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint8 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
std::list<Creature*> GuardList;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiPhase = 0;
|
||||
uiTimer = 0;
|
||||
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
m_creature->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
|
||||
if (!GuardList.empty())
|
||||
for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pGuard = *itr)
|
||||
{
|
||||
pGuard->DisappearAndDie();
|
||||
pGuard->Respawn();
|
||||
pGuard->SetVisibility(VISIBILITY_ON);
|
||||
pGuard->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiId)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_WAVE_COUNT,1);
|
||||
|
||||
//She should not be despawned, she will be used by the instance to summon some npcs
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
ScriptedAI::UpdateAI(uiDiff);
|
||||
|
||||
if (uiPhase)
|
||||
{
|
||||
if (uiTimer <= uiDiff)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
DoScriptText(SAY_SINCLARI_1, m_creature);
|
||||
uiTimer = 4000;
|
||||
uiPhase = 2;
|
||||
break;
|
||||
case 2:
|
||||
m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
|
||||
if (!GuardList.empty())
|
||||
for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pGuard = *itr)
|
||||
{
|
||||
pGuard->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
pGuard->GetMotionMaster()->MovePoint(0, MovePosition);
|
||||
}
|
||||
}
|
||||
uiTimer = 6000;
|
||||
uiPhase = 3;
|
||||
break;
|
||||
case 3:
|
||||
m_creature->GetCreatureListWithEntryInGrid(GuardList, NPC_VIOLET_HOLD_GUARD, 40.0f);
|
||||
if (!GuardList.empty())
|
||||
for (std::list<Creature*>::iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pGuard = *itr)
|
||||
{
|
||||
pGuard->SetVisibility(VISIBILITY_OFF);
|
||||
pGuard->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
uiTimer = 2000;
|
||||
uiPhase = 4;
|
||||
break;
|
||||
case 4:
|
||||
m_creature->GetMotionMaster()->MovePoint(0, MovePosition);
|
||||
uiTimer = 0;
|
||||
uiPhase = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else uiTimer -= uiDiff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_sinclari(Creature* pCreature)
|
||||
{
|
||||
return new npc_sinclariAI(pCreature);
|
||||
}
|
||||
|
||||
bool GossipHello_npc_sinclari(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_sinclari(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
if (pPlayer)
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(npc_sinclariAI, (pCreature->AI()))->uiPhase = 1;
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
pPlayer->SEND_GOSSIP_MENU(13854, pCreature->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL npc_teleportation_portalAI : public ScriptedAI
|
||||
{
|
||||
npc_teleportation_portalAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiSpawnTimer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiSpawnTimer = 3000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who) {}
|
||||
void MoveInLineOfSight(Unit *who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
{
|
||||
m_creature->ForcedDespawn();
|
||||
pInstance->SetData(DATA_REMOVE_NPC, 0);
|
||||
}
|
||||
|
||||
if (uiSpawnTimer <= diff)
|
||||
{
|
||||
uint8 k = pInstance->GetData(DATA_WAVE_COUNT) < 12 ? 3 : 4;
|
||||
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),
|
||||
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);
|
||||
}
|
||||
uiSpawnTimer = SPAWN_TIME;
|
||||
} else uiSpawnTimer -= diff;
|
||||
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
m_creature->Kill(m_creature, false);
|
||||
m_creature->RemoveCorpse();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_WAVE_COUNT,pInstance->GetData(DATA_WAVE_COUNT)+1);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_teleportation_portal(Creature *pCreature)
|
||||
{
|
||||
return new npc_teleportation_portalAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_violet_hold()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_sinclari_vh";
|
||||
newscript->GetAI = &GetAI_npc_sinclari;
|
||||
newscript->pGossipHello = &GossipHello_npc_sinclari;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_sinclari;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_teleportation_portal_vh";
|
||||
newscript->GetAI = &GetAI_npc_teleportation_portal;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
#ifndef DEF_VIOLET_HOLD_H
|
||||
#define DEF_VIOLET_HOLD_H
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
CREATURE_TELEPORTATION_PORTAL = 31011,
|
||||
CREATURE_PORTAL_GUARDIAN = 30660,
|
||||
CREATURE_PORTAL_KEEPER = 30695,
|
||||
CREATURE_XEVOZZ = 29266,
|
||||
CREATURE_LAVANTHOR = 29312,
|
||||
CREATURE_ICHORON = 29313,
|
||||
CREATURE_ZURAMAT = 29314,
|
||||
CREATURE_EREKEM = 29315,
|
||||
CREATURE_EREKEM_GUARD = 29395,
|
||||
CREATURE_MORAGG = 29316,
|
||||
CREATURE_CYANIGOSA = 31134,
|
||||
CREATURE_SINCLARI = 30658
|
||||
};
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_1ST_BOSS_EVENT,
|
||||
DATA_2ND_BOSS_EVENT,
|
||||
DATA_CYANIGOSA_EVENT,
|
||||
DATA_WAVE_COUNT,
|
||||
DATA_REMOVE_NPC
|
||||
};
|
||||
|
||||
enum Data64
|
||||
{
|
||||
DATA_MORAGG,
|
||||
DATA_EREKEM,
|
||||
DATA_EREKEM_GUARD_1,
|
||||
DATA_EREKEM_GUARD_2,
|
||||
DATA_ICHORON,
|
||||
DATA_LAVANTHOR,
|
||||
DATA_XEVOZZ,
|
||||
DATA_ZURAMAT,
|
||||
DATA_CYANIGOSA,
|
||||
DATA_MORAGG_CELL,
|
||||
DATA_EREKEM_CELL,
|
||||
DATA_EREKEM_LEFT_GUARD_CELL,
|
||||
DATA_EREKEM_RIGHT_GUARD_CELL,
|
||||
DATA_ICHORON_CELL,
|
||||
DATA_LAVANTHOR_CELL,
|
||||
DATA_XEVOZZ_CELL,
|
||||
DATA_ZURAMAT_CELL,
|
||||
DATA_MAIN_DOOR,
|
||||
DATA_SINCLARI
|
||||
};
|
||||
|
||||
enum WorldStates
|
||||
{
|
||||
WORLD_STATE_VH = 3816
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user