*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,452 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Ingvar_The_Plunderer
|
||||
SD%Complete: 95
|
||||
SDComment: Some Problems with Annhylde Movement, Blizzlike Timers
|
||||
SDCategory: Udgarde Keep
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_keep.h"
|
||||
|
||||
enum eEnums
|
||||
{
|
||||
//Yells Ingvar
|
||||
YELL_AGGRO_1 = -1574005,
|
||||
YELL_AGGRO_2 = -1574006,
|
||||
|
||||
YELL_DEAD_1 = -1574007,
|
||||
YELL_DEAD_2 = -1574008,
|
||||
|
||||
YELL_KILL_1 = -1574009,
|
||||
YELL_KILL_2 = -1574010,
|
||||
|
||||
//Ingvar Spells human form
|
||||
MOB_INGVAR_HUMAN = 23954,
|
||||
SPELL_CLEAVE = 42724,
|
||||
SPELL_SMASH = 42669,
|
||||
H_SPELL_SMASH = 59706,
|
||||
SPELL_STAGGERING_ROAR = 42708,
|
||||
H_SPELL_STAGGERING_ROAR = 59708,
|
||||
SPELL_ENRAGE = 42705,
|
||||
H_SPELL_ENRAGE = 59707,
|
||||
|
||||
MOB_ANNHYLDE_THE_CALLER = 24068,
|
||||
SPELL_INGVAR_FEIGN_DEATH = 42795,
|
||||
SPELL_SUMMON_BANSHEE = 42912,
|
||||
SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN = 42863, //Spawn resurrecteffekt around Ingvar
|
||||
|
||||
MODEL_INGVAR_UNDEAD = 26351,
|
||||
MODEL_INGVAR_HUMAN = 21953,
|
||||
|
||||
//Ingvar Spells undead form
|
||||
MOB_INGVAR_UNDEAD = 23980,
|
||||
SPELL_DARK_SMASH = 42723,
|
||||
SPELL_DREADFUL_ROAR = 42729,
|
||||
H_SPELL_DREADFUL_ROAR = 59734,
|
||||
SPELL_WOE_STRIKE = 42730,
|
||||
H_SPELL_WOE_STRIKE = 59735,
|
||||
|
||||
ENTRY_THROW_TARGET = 23996,
|
||||
SPELL_SHADOW_AXE_SUMMON = 42749
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI
|
||||
{
|
||||
boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
bool undead;
|
||||
bool event_inProgress;
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 Smash_Timer;
|
||||
uint32 Enrage_Timer;
|
||||
uint32 Roar_Timer;
|
||||
uint32 SpawnResTimer;
|
||||
uint32 wait_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (undead) // Visual Hack
|
||||
m_creature->SetDisplayId(MODEL_INGVAR_HUMAN);
|
||||
|
||||
undead = false;
|
||||
event_inProgress = false;
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
Cleave_Timer = 2000;
|
||||
Smash_Timer = 5000;
|
||||
Enrage_Timer = 10000;
|
||||
Roar_Timer = 15000;
|
||||
|
||||
SpawnResTimer = 3000;
|
||||
|
||||
wait_Timer = 0;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if (damage >= m_creature->GetHealth() && !undead)
|
||||
{
|
||||
//DoCast(m_creature, SPELL_INGVAR_FEIGN_DEATH, true); // Dont work ???
|
||||
// visuel hack
|
||||
m_creature->SetHealth(0);
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->SetDisplayId(MODEL_INGVAR_UNDEAD);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->GetMotionMaster()->MovementExpired(false);
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
// visuel hack end
|
||||
|
||||
event_inProgress = true;
|
||||
undead = true;
|
||||
|
||||
DoScriptText(YELL_DEAD_1,m_creature);
|
||||
}
|
||||
|
||||
if (event_inProgress)
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void StartZombiePhase()
|
||||
{
|
||||
undead = true;
|
||||
event_inProgress = false;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
m_creature->AI()->AttackStart(m_creature->getVictim());
|
||||
|
||||
DoScriptText(YELL_AGGRO_2,m_creature);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO_1,m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(YELL_DEAD_2,m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_INGVAR_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (undead) { DoScriptText(YELL_KILL_1,m_creature); }
|
||||
else { DoScriptText(YELL_KILL_2,m_creature); }
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (event_inProgress)
|
||||
{
|
||||
if (SpawnResTimer)
|
||||
if (SpawnResTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_SUMMON_BANSHEE); // Summons direktly on caster position
|
||||
//DoCast(m_creature, SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ?
|
||||
SpawnResTimer = 0;
|
||||
} else SpawnResTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// This is used for a spell queue ... the spells should not castet if one spell is already casting
|
||||
if (wait_Timer)
|
||||
if (wait_Timer <= diff)
|
||||
{
|
||||
wait_Timer = 0;
|
||||
} else wait_Timer -= diff;
|
||||
|
||||
if (Cleave_Timer <= diff)
|
||||
{
|
||||
if (!wait_Timer)
|
||||
{
|
||||
if (undead)
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_WOE_STRIKE, H_SPELL_WOE_STRIKE));
|
||||
else
|
||||
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
|
||||
Cleave_Timer = rand()%5000 + 2000;
|
||||
|
||||
wait_Timer = 1000;
|
||||
}
|
||||
} else Cleave_Timer -= diff;
|
||||
|
||||
if (Smash_Timer <= diff)
|
||||
{
|
||||
if (!wait_Timer)
|
||||
{
|
||||
if (undead)
|
||||
DoCast(m_creature->getVictim(), SPELL_DARK_SMASH);
|
||||
else
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SMASH, H_SPELL_SMASH));
|
||||
Smash_Timer = 10000;
|
||||
|
||||
wait_Timer = 5000;
|
||||
}
|
||||
} else Smash_Timer -= diff;
|
||||
|
||||
if (!undead)
|
||||
{
|
||||
if (Enrage_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_ENRAGE, H_SPELL_ENRAGE));
|
||||
Enrage_Timer = 10000;
|
||||
} else Enrage_Timer -= diff;
|
||||
} else // In Undead form used to summon weapon
|
||||
{
|
||||
if (Enrage_Timer <= diff)
|
||||
{
|
||||
if (!wait_Timer)
|
||||
{
|
||||
// Spawn target for Axe
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
|
||||
if (pTarget)
|
||||
{
|
||||
Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000);
|
||||
|
||||
DoCast(m_creature, SPELL_SHADOW_AXE_SUMMON);
|
||||
}
|
||||
Enrage_Timer = 30000;
|
||||
}
|
||||
} else Enrage_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Roar_Timer <= diff)
|
||||
{
|
||||
if (!wait_Timer)
|
||||
{
|
||||
if (undead)
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_DREADFUL_ROAR, H_SPELL_DREADFUL_ROAR));
|
||||
else
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_STAGGERING_ROAR, H_SPELL_STAGGERING_ROAR));
|
||||
Roar_Timer = 10000;
|
||||
|
||||
wait_Timer = 5000;
|
||||
}
|
||||
} else Roar_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature* pCreature)
|
||||
{
|
||||
return new boss_ingvar_the_plundererAI (pCreature);
|
||||
}
|
||||
|
||||
enum eSpells
|
||||
{
|
||||
//we don't have that text in db so comment it until we get this text
|
||||
// YELL_RESSURECT = -1574025,
|
||||
|
||||
//Spells for Annhylde
|
||||
SPELL_SCOURG_RESURRECTION_HEAL = 42704, //Heal Max + DummyAura
|
||||
SPELL_SCOURG_RESURRECTION_BEAM = 42857, //Channeling Beam of Annhylde
|
||||
SPELL_SCOURG_RESURRECTION_DUMMY = 42862, //Some Emote Dummy?
|
||||
SPELL_INGVAR_TRANSFORM = 42796
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI
|
||||
{
|
||||
mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
float x,y,z;
|
||||
ScriptedInstance* pInstance;
|
||||
uint32 Resurect_Timer;
|
||||
uint32 Resurect_Phase;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_HOVER);
|
||||
m_creature->SetSpeed(MOVE_SWIM , 1.0f);
|
||||
m_creature->SetSpeed(MOVE_RUN , 1.0f);
|
||||
m_creature->SetSpeed(MOVE_WALK , 1.0f);
|
||||
//m_creature->SetSpeed(MOVE_FLIGHT , 1.0f);
|
||||
|
||||
m_creature->GetPosition(x,y,z);
|
||||
DoTeleportTo(x+1,y,z+30);
|
||||
|
||||
Unit* ingvar = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
|
||||
if (ingvar)
|
||||
{
|
||||
m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15);
|
||||
|
||||
// DoScriptText(YELL_RESSURECT,m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
Unit* ingvar = Unit::GetUnit((*m_creature), pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
|
||||
if (ingvar)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 1:
|
||||
ingvar->RemoveAura(SPELL_SUMMON_BANSHEE);
|
||||
ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true);
|
||||
DoCast(ingvar, SPELL_SCOURG_RESURRECTION_BEAM);
|
||||
Resurect_Timer = 8000;
|
||||
Resurect_Phase = 1;
|
||||
break;
|
||||
case 2:
|
||||
m_creature->DealDamage(m_creature,m_creature->GetHealth());
|
||||
m_creature->RemoveCorpse();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void EnterCombat(Unit *who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Resurect_Timer)
|
||||
if (Resurect_Timer <= diff)
|
||||
{
|
||||
if (Resurect_Phase == 1)
|
||||
{
|
||||
Unit* ingvar = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
|
||||
if (ingvar)
|
||||
{
|
||||
ingvar->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false);
|
||||
}
|
||||
Resurect_Timer = 3000;
|
||||
Resurect_Phase = 2;
|
||||
} else if (Resurect_Phase == 2)
|
||||
{
|
||||
Creature* ingvar = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_INGVAR) : 0);
|
||||
if (ingvar)
|
||||
{
|
||||
ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);
|
||||
//ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false);
|
||||
//ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong
|
||||
Creature* c_ingvar = ingvar;
|
||||
|
||||
CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase();
|
||||
|
||||
m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30);
|
||||
++Resurect_Phase;
|
||||
}
|
||||
}
|
||||
|
||||
} else Resurect_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_annhylde_the_caller(Creature* pCreature)
|
||||
{
|
||||
return new mob_annhylde_the_callerAI (pCreature);
|
||||
}
|
||||
|
||||
enum eShadowAxe
|
||||
{
|
||||
SPELL_SHADOW_AXE_DAMAGE = 42750,
|
||||
H_SPELL_SHADOW_AXE_DAMAGE = 59719
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI
|
||||
{
|
||||
mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 Despawn_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Unit *pTarget = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50);
|
||||
if (pTarget)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_SHADOW_AXE_DAMAGE, H_SPELL_SHADOW_AXE_DAMAGE));
|
||||
float x,y,z;
|
||||
pTarget->GetPosition(x,y,z);
|
||||
m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
|
||||
}
|
||||
Despawn_Timer = 7000;
|
||||
}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void EnterCombat(Unit *who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Despawn_Timer <= diff)
|
||||
{
|
||||
m_creature->DealDamage(m_creature,m_creature->GetHealth());
|
||||
m_creature->RemoveCorpse();
|
||||
Despawn_Timer = 0;
|
||||
} else Despawn_Timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature* pCreature)
|
||||
{
|
||||
return new mob_ingvar_throw_dummyAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ingvar_the_plunderer()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ingvar_the_plunderer";
|
||||
newscript->GetAI = &GetAI_boss_ingvar_the_plunderer;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_annhylde_the_caller";
|
||||
newscript->GetAI = &GetAI_mob_annhylde_the_caller;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ingvar_throw_dummy";
|
||||
newscript->GetAI = &GetAI_mob_ingvar_throw_dummy;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,360 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Prince_Keleseth
|
||||
SD%Complete: 90
|
||||
SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells
|
||||
SDCategory: Utgarde Keep
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_keep.h"
|
||||
|
||||
enum eEnums
|
||||
{
|
||||
ACHIEVEMENT_ON_THE_ROCKS = 1919,
|
||||
|
||||
SPELL_SHADOWBOLT = 43667,
|
||||
SPELL_SHADOWBOLT_HEROIC = 59389,
|
||||
SPELL_FROST_TOMB = 48400,
|
||||
SPELL_FROST_TOMB_SUMMON = 42714,
|
||||
SPELL_DECREPIFY = 42702,
|
||||
SPELL_SCOURGE_RESSURRECTION = 42704,
|
||||
CREATURE_FROSTTOMB = 23965,
|
||||
CREATURE_SKELETON = 23970,
|
||||
|
||||
SAY_AGGRO = -1574000,
|
||||
SAY_FROST_TOMB = -1574001,
|
||||
SAY_SKELETONS = -1574002,
|
||||
SAY_KILL = -1574003,
|
||||
SAY_DEATH = -1574004
|
||||
};
|
||||
|
||||
#define SKELETONSPAWN_Z 42.8668
|
||||
|
||||
float SkeletonSpawnPoint[5][5]=
|
||||
{
|
||||
{156.2559, 259.2093},
|
||||
{156.2559, 259.2093},
|
||||
{156.2559, 259.2093},
|
||||
{156.2559, 259.2093},
|
||||
{156.2559, 259.2093},
|
||||
};
|
||||
|
||||
float AttackLoc[3]={197.636, 194.046, 40.8164};
|
||||
|
||||
bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919)
|
||||
|
||||
struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
|
||||
{
|
||||
mob_frost_tombAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
FrostTombGUID = 0;
|
||||
}
|
||||
|
||||
uint64 FrostTombGUID;
|
||||
|
||||
void SetPrisoner(Unit* uPrisoner)
|
||||
{
|
||||
FrostTombGUID = uPrisoner->GetGUID();
|
||||
}
|
||||
|
||||
void Reset(){ FrostTombGUID = 0; }
|
||||
void EnterCombat(Unit* who) {}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if (killer->GetGUID() != m_creature->GetGUID())
|
||||
ShatterFrostTomb = true;
|
||||
|
||||
if (FrostTombGUID)
|
||||
{
|
||||
Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID);
|
||||
if (FrostTomb)
|
||||
FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID);
|
||||
if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp)
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
|
||||
{
|
||||
boss_kelesethAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 FrostTombTimer;
|
||||
uint32 SummonSkeletonsTimer;
|
||||
uint32 RespawnSkeletonsTimer;
|
||||
uint32 ShadowboltTimer;
|
||||
uint64 SkeletonGUID[5];
|
||||
bool Skeletons;
|
||||
bool RespawnSkeletons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowboltTimer = 0;
|
||||
Skeletons = false;
|
||||
|
||||
ShatterFrostTomb = false;
|
||||
|
||||
ResetTimer();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (victim == m_creature)
|
||||
return;
|
||||
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (IsHeroic() && !ShatterFrostTomb)
|
||||
{
|
||||
AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS);
|
||||
if (AchievOnTheRocks)
|
||||
{
|
||||
Map* pMap = m_creature->GetMap();
|
||||
if (pMap && pMap->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &players = pMap->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
itr->getSource()->CompletedAchievement(AchievOnTheRocks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoZoneInCombat();
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void ResetTimer(uint32 inc = 0)
|
||||
{
|
||||
SummonSkeletonsTimer = 5000 + inc;
|
||||
FrostTombTimer = 28000 + inc;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (ShadowboltTimer <= diff)
|
||||
{
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
|
||||
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true);
|
||||
ShadowboltTimer = 10000;
|
||||
} else ShadowboltTimer -= diff;
|
||||
|
||||
if (!Skeletons)
|
||||
if ((SummonSkeletonsTimer <= diff))
|
||||
{
|
||||
Creature* Skeleton;
|
||||
DoScriptText(SAY_SKELETONS, m_creature);
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
if (Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ());
|
||||
Skeleton->AddThreat(m_creature->getVictim(), 0.0f);
|
||||
DoZoneInCombat(Skeleton);
|
||||
}
|
||||
}
|
||||
Skeletons = true;
|
||||
} else SummonSkeletonsTimer -= diff;
|
||||
|
||||
if (FrostTombTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
if (pTarget->isAlive())
|
||||
{
|
||||
//DoCast(pTarget, SPELL_FROST_TOMB_SUMMON, true);
|
||||
if (Creature *pChains = m_creature->SummonCreature(CREATURE_FROSTTOMB, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
|
||||
{
|
||||
CAST_AI(mob_frost_tombAI, pChains->AI())->SetPrisoner(pTarget);
|
||||
pChains->CastSpell(pTarget, SPELL_FROST_TOMB, true);
|
||||
|
||||
DoScriptText(SAY_FROST_TOMB, m_creature);
|
||||
}
|
||||
}
|
||||
FrostTombTimer = 15000;
|
||||
} else FrostTombTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI
|
||||
{
|
||||
mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
uint32 Respawn_Time;
|
||||
uint64 Target_Guid;
|
||||
uint32 Decrepify_Timer;
|
||||
|
||||
bool isDead;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Respawn_Time = 12000;
|
||||
Decrepify_Timer = urand(10000,20000);
|
||||
isDead = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who){}
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if (done_by->GetGUID() == m_creature->GetGUID())
|
||||
return;
|
||||
|
||||
if (damage >= m_creature->GetHealth())
|
||||
{
|
||||
PretendToDie();
|
||||
damage = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void PretendToDie()
|
||||
{
|
||||
isDead = true;
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->GetMotionMaster()->MovementExpired(false);
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
};
|
||||
|
||||
void Resurrect()
|
||||
{
|
||||
isDead = false;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(m_creature, SPELL_SCOURGE_RESSURRECTION, true);
|
||||
|
||||
if (m_creature->getVictim())
|
||||
{
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
m_creature->AI()->AttackStart(m_creature->getVictim());
|
||||
}
|
||||
else
|
||||
m_creature->GetMotionMaster()->Initialize();
|
||||
};
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
if (isDead)
|
||||
{
|
||||
if (Respawn_Time <= diff)
|
||||
{
|
||||
Resurrect();
|
||||
Respawn_Time = 12000;
|
||||
} else Respawn_Time -= diff;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Decrepify_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_DECREPIFY);
|
||||
Decrepify_Timer = 30000;
|
||||
} else Decrepify_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}else
|
||||
{
|
||||
if (m_creature->isAlive())
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_frost_tomb(Creature* pCreature)
|
||||
{
|
||||
return new mob_frost_tombAI(pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_keleseth(Creature* pCreature)
|
||||
{
|
||||
return new boss_kelesethAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_vrykul_skeleton(Creature* pCreature)
|
||||
{
|
||||
return new mob_vrykul_skeletonAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_keleseth()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_keleseth";
|
||||
newscript->GetAI = &GetAI_boss_keleseth;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_frost_tomb";
|
||||
newscript->GetAI = &GetAI_mob_frost_tomb;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_vrykul_skeleton";
|
||||
newscript->GetAI = &GetAI_mob_vrykul_skeleton;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Skarvald_Dalronn
|
||||
SD%Complete: 95
|
||||
SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB
|
||||
SDCategory: Utgarde Keep
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_keep.h"
|
||||
|
||||
enum eEnums
|
||||
{
|
||||
//signed for 24200, but used by 24200,27390
|
||||
YELL_SKARVALD_AGGRO = -1574011,
|
||||
YELL_SKARVALD_DAL_DIED = -1574012,
|
||||
YELL_SKARVALD_SKA_DIEDFIRST = -1574013,
|
||||
YELL_SKARVALD_KILL = -1574014,
|
||||
YELL_SKARVALD_DAL_DIEDFIRST = -1574015,
|
||||
|
||||
//signed for 24201, but used by 24201,27389
|
||||
YELL_DALRONN_AGGRO = -1574016,
|
||||
YELL_DALRONN_SKA_DIED = -1574017,
|
||||
YELL_DALRONN_DAL_DIEDFIRST = -1574018,
|
||||
YELL_DALRONN_KILL = -1574019,
|
||||
YELL_DALRONN_SKA_DIEDFIRST = -1574020,
|
||||
|
||||
//Spells of Skarvald and his Ghost
|
||||
MOB_SKARVALD_THE_CONSTRUCTOR = 24200,
|
||||
SPELL_CHARGE = 43651,
|
||||
SPELL_STONE_STRIKE = 48583,
|
||||
SPELL_SUMMON_SKARVALD_GHOST = 48613,
|
||||
MOB_SKARVALD_GHOST = 27390,
|
||||
//Spells of Dalronn and his Ghost
|
||||
MOB_DALRONN_THE_CONTROLLER = 24201,
|
||||
SPELL_SHADOW_BOLT = 43649,
|
||||
H_SPELL_SHADOW_BOLT = 59575,
|
||||
H_SPELL_SUMMON_SKELETONS = 52611,
|
||||
SPELL_DEBILITATE = 43650,
|
||||
SPELL_SUMMON_DALRONN_GHOST = 48612,
|
||||
MOB_DALRONN_GHOST = 27389
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI
|
||||
{
|
||||
boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
bool ghost;
|
||||
uint32 Charge_Timer;
|
||||
uint32 StoneStrike_Timer;
|
||||
uint32 Response_Timer;
|
||||
uint32 Check_Timer;
|
||||
bool Dalronn_isDead;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Charge_Timer = 5000;
|
||||
StoneStrike_Timer = 10000;
|
||||
Dalronn_isDead = false;
|
||||
Check_Timer = 5000;
|
||||
|
||||
ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST);
|
||||
if (!ghost && pInstance)
|
||||
{
|
||||
Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
|
||||
if (dalronn && dalronn->isDead())
|
||||
CAST_CRE(dalronn)->Respawn();
|
||||
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
if (!ghost && pInstance)
|
||||
{
|
||||
DoScriptText(YELL_SKARVALD_AGGRO,m_creature);
|
||||
|
||||
Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
|
||||
if (dalronn && dalronn->isAlive() && !dalronn->getVictim())
|
||||
dalronn->getThreatManager().addThreat(who,0.0f);
|
||||
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (!ghost && pInstance)
|
||||
{
|
||||
Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
|
||||
if (dalronn)
|
||||
{
|
||||
if (dalronn->isDead())
|
||||
{
|
||||
DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature);
|
||||
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature);
|
||||
|
||||
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
//DoCast(m_creature, SPELL_SUMMON_SKARVALD_GHOST, true);
|
||||
Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000);
|
||||
if (temp)
|
||||
{
|
||||
temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
temp->AI()->AttackStart(Killer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (!ghost)
|
||||
{
|
||||
DoScriptText(YELL_SKARVALD_KILL,m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (ghost)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS)
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!ghost)
|
||||
{
|
||||
if (Check_Timer)
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
Check_Timer = 5000;
|
||||
Unit* dalronn = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_DALRONN) : 0);
|
||||
if (dalronn && dalronn->isDead())
|
||||
{
|
||||
Dalronn_isDead = true;
|
||||
Response_Timer = 2000;
|
||||
Check_Timer = 0;
|
||||
}
|
||||
} else Check_Timer -= diff;
|
||||
|
||||
if (Response_Timer)
|
||||
if (Dalronn_isDead)
|
||||
if (Response_Timer <= diff)
|
||||
{
|
||||
DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature);
|
||||
|
||||
Response_Timer = 0;
|
||||
} else Response_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Charge_Timer <= diff)
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE);
|
||||
Charge_Timer = 5000+rand()%5000;
|
||||
} else Charge_Timer -= diff;
|
||||
|
||||
if (StoneStrike_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE);
|
||||
StoneStrike_Timer = 5000+rand()%5000;
|
||||
} else StoneStrike_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_skarvald_the_constructor(Creature* pCreature)
|
||||
{
|
||||
return new boss_skarvald_the_constructorAI (pCreature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI
|
||||
{
|
||||
boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
bool ghost;
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 Debilitate_Timer;
|
||||
uint32 Summon_Timer;
|
||||
|
||||
uint32 Response_Timer;
|
||||
uint32 Check_Timer;
|
||||
uint32 AggroYell_Timer;
|
||||
bool Skarvald_isDead;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowBolt_Timer = 1000;
|
||||
Debilitate_Timer = 5000;
|
||||
Summon_Timer = 10000;
|
||||
Check_Timer = 5000;
|
||||
Skarvald_isDead = false;
|
||||
AggroYell_Timer = 0;
|
||||
|
||||
ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST;
|
||||
if (!ghost && pInstance)
|
||||
{
|
||||
Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
|
||||
if (skarvald && skarvald->isDead())
|
||||
CAST_CRE(skarvald)->Respawn();
|
||||
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
if (!ghost && pInstance)
|
||||
{
|
||||
Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
|
||||
if (skarvald && skarvald->isAlive() && !skarvald->getVictim())
|
||||
skarvald->getThreatManager().addThreat(who,0.0f);
|
||||
|
||||
AggroYell_Timer = 5000;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (!ghost && pInstance)
|
||||
{
|
||||
Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
|
||||
if (skarvald)
|
||||
if (skarvald->isDead())
|
||||
{
|
||||
DoScriptText(YELL_DALRONN_SKA_DIED,m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature);
|
||||
|
||||
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
//DoCast(m_creature, SPELL_SUMMON_DALRONN_GHOST, true);
|
||||
Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000);
|
||||
if (temp)
|
||||
{
|
||||
temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
temp->AI()->AttackStart(Killer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if (!ghost)
|
||||
{
|
||||
DoScriptText(YELL_DALRONN_KILL,m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (ghost)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS)
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (AggroYell_Timer)
|
||||
if (AggroYell_Timer <= diff)
|
||||
{
|
||||
DoScriptText(YELL_DALRONN_AGGRO,m_creature);
|
||||
|
||||
AggroYell_Timer = 0;
|
||||
} else AggroYell_Timer -= diff;
|
||||
|
||||
if (!ghost)
|
||||
{
|
||||
if (Check_Timer)
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
Check_Timer = 5000;
|
||||
Unit* skarvald = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_SKARVALD) : 0);
|
||||
if (skarvald && skarvald->isDead())
|
||||
{
|
||||
Skarvald_isDead = true;
|
||||
Response_Timer = 2000;
|
||||
Check_Timer = 0;
|
||||
}
|
||||
} else Check_Timer -= diff;
|
||||
|
||||
if (Response_Timer)
|
||||
if (Skarvald_isDead)
|
||||
if (Response_Timer <= diff)
|
||||
{
|
||||
DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature);
|
||||
|
||||
Response_Timer = 0;
|
||||
} else Response_Timer -= diff;
|
||||
}
|
||||
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), DUNGEON_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT));
|
||||
ShadowBolt_Timer = 1000;
|
||||
}
|
||||
} else ShadowBolt_Timer -= diff;
|
||||
|
||||
if (Debilitate_Timer <= diff)
|
||||
{
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEBILITATE);
|
||||
Debilitate_Timer = 5000+rand()%5000;
|
||||
}
|
||||
} else Debilitate_Timer -= diff;
|
||||
|
||||
if (IsHeroic())
|
||||
if (Summon_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, H_SPELL_SUMMON_SKELETONS);
|
||||
Summon_Timer = (rand()%10000) + 20000;
|
||||
} else Summon_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_dalronn_the_controller(Creature* pCreature)
|
||||
{
|
||||
return new boss_dalronn_the_controllerAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_skarvald_dalronn()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_skarvald_the_constructor";
|
||||
newscript->GetAI = &GetAI_boss_skarvald_the_constructor;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_dalronn_the_controller";
|
||||
newscript->GetAI = &GetAI_boss_dalronn_the_controller;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,312 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Utgarde_Keep
|
||||
SD%Complete: 90
|
||||
SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts
|
||||
SDCategory: Utgarde Keep
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_keep.h"
|
||||
|
||||
#define MAX_ENCOUNTER 3
|
||||
|
||||
#define ENTRY_BELLOW_1 186688
|
||||
#define ENTRY_BELLOW_2 186689
|
||||
#define ENTRY_BELLOW_3 186690
|
||||
|
||||
#define ENTRY_FORGEFIRE_1 186692
|
||||
#define ENTRY_FORGEFIRE_2 186693
|
||||
#define ENTRY_FORGEFIRE_3 186691
|
||||
|
||||
#define ENTRY_GLOWING_ANVIL_1 186609
|
||||
#define ENTRY_GLOWING_ANVIL_2 186610
|
||||
#define ENTRY_GLOWING_ANVIL_3 186611
|
||||
|
||||
#define ENTRY_GIANT_PORTCULLIS_1 186756
|
||||
#define ENTRY_GIANT_PORTCULLIS_2 186694
|
||||
|
||||
/* Utgarde Keep encounters:
|
||||
0 - Prince Keleseth
|
||||
1 - Skarvald Dalronn
|
||||
2 - Ingvar the Plunderer
|
||||
*/
|
||||
|
||||
struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
||||
{
|
||||
instance_utgarde_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
|
||||
uint64 Keleseth;
|
||||
uint64 Skarvald;
|
||||
uint64 Dalronn;
|
||||
uint64 Ingvar;
|
||||
|
||||
uint64 forge_bellow[3];
|
||||
uint64 forge_fire[3];
|
||||
uint64 forge_anvil[3];
|
||||
uint64 portcullis[2];
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 forge_event[3];
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
Keleseth = 0;
|
||||
Skarvald = 0;
|
||||
Dalronn = 0;
|
||||
Ingvar = 0;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
forge_bellow[i] = 0;
|
||||
forge_fire[i] = 0;
|
||||
forge_anvil[i] = 0;
|
||||
forge_event[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
portcullis[0] = 0;
|
||||
portcullis[1] = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Player* GetPlayerInMap()
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* plr = itr->getSource())
|
||||
return plr;
|
||||
}
|
||||
}
|
||||
|
||||
debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool add)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case 23953: Keleseth = pCreature->GetGUID(); break;
|
||||
case 24201: Dalronn = pCreature->GetGUID(); break;
|
||||
case 24200: Skarvald = pCreature->GetGUID(); break;
|
||||
case 23954: Ingvar = pCreature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
//door and object id
|
||||
case ENTRY_BELLOW_1: forge_bellow[0] = pGo->GetGUID();
|
||||
if (forge_event[0] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_BELLOW_2: forge_bellow[1] = pGo->GetGUID();
|
||||
if (forge_event[1] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_BELLOW_3: forge_bellow[2] = pGo->GetGUID();
|
||||
if (forge_event[2] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_FORGEFIRE_1: forge_fire[0] = pGo->GetGUID();
|
||||
if (forge_event[0] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_FORGEFIRE_2: forge_fire[1] = pGo->GetGUID();
|
||||
if (forge_event[1] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_FORGEFIRE_3: forge_fire[2] = pGo->GetGUID();
|
||||
if (forge_event[2] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_GLOWING_ANVIL_1: forge_anvil[0] = pGo->GetGUID();
|
||||
if (forge_event[0] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_GLOWING_ANVIL_2: forge_anvil[1] = pGo->GetGUID();
|
||||
if (forge_event[1] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_GLOWING_ANVIL_3: forge_anvil[2] = pGo->GetGUID();
|
||||
if (forge_event[2] != NOT_STARTED)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_GIANT_PORTCULLIS_1: portcullis[0] = pGo->GetGUID();
|
||||
if (m_auiEncounter[2] == DONE)HandleGameObject(NULL,true,pGo);break;
|
||||
case ENTRY_GIANT_PORTCULLIS_2: portcullis[1] = pGo->GetGUID();
|
||||
if (m_auiEncounter[2] == DONE)HandleGameObject(NULL,true,pGo);break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_PRINCEKELESETH: return Keleseth;
|
||||
case DATA_DALRONN: return Dalronn;
|
||||
case DATA_SKARVALD: return Skarvald;
|
||||
case DATA_INGVAR: return Ingvar;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_PRINCEKELESETH_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_SKARVALD_DALRONN_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_INGVAR_EVENT:
|
||||
if (data == DONE)
|
||||
{
|
||||
HandleGameObject(portcullis[0], true);
|
||||
HandleGameObject(portcullis[1], true);
|
||||
}
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case EVENT_FORGE_1:
|
||||
if (data == NOT_STARTED)
|
||||
{
|
||||
HandleGameObject(forge_bellow[0],false);
|
||||
HandleGameObject(forge_fire[0],false);
|
||||
HandleGameObject(forge_anvil[0],false);
|
||||
}else
|
||||
{
|
||||
HandleGameObject(forge_bellow[0],true);
|
||||
HandleGameObject(forge_fire[0],true);
|
||||
HandleGameObject(forge_anvil[0],true);
|
||||
}
|
||||
forge_event[0] = data;
|
||||
break;
|
||||
case EVENT_FORGE_2:
|
||||
if (data == NOT_STARTED)
|
||||
{
|
||||
HandleGameObject(forge_bellow[1],false);
|
||||
HandleGameObject(forge_fire[1],false);
|
||||
HandleGameObject(forge_anvil[1],false);
|
||||
}else
|
||||
{
|
||||
HandleGameObject(forge_bellow[1],true);
|
||||
HandleGameObject(forge_fire[1],true);
|
||||
HandleGameObject(forge_anvil[1],true);
|
||||
}
|
||||
forge_event[1] = data;
|
||||
break;
|
||||
case EVENT_FORGE_3:
|
||||
if (data == NOT_STARTED)
|
||||
{
|
||||
HandleGameObject(forge_bellow[2],false);
|
||||
HandleGameObject(forge_fire[2],false);
|
||||
HandleGameObject(forge_anvil[2],false);
|
||||
}else
|
||||
{
|
||||
HandleGameObject(forge_bellow[2],true);
|
||||
HandleGameObject(forge_fire[2],true);
|
||||
HandleGameObject(forge_anvil[2],true);
|
||||
}
|
||||
forge_event[2] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_PRINCEKELESETH_EVENT: return m_auiEncounter[0];
|
||||
case DATA_SKARVALD_DALRONN_EVENT: return m_auiEncounter[1];
|
||||
case DATA_INGVAR_EVENT: return m_auiEncounter[2];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "U K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << forge_event[0] << " " << forge_event[1] << " " << forge_event[2];
|
||||
|
||||
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, data5;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5;
|
||||
|
||||
if (dataHead1 == 'U' && dataHead2 == 'K')
|
||||
{
|
||||
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;
|
||||
|
||||
forge_event[0] = data3;
|
||||
forge_event[1] = data4;
|
||||
forge_event[2] = data5;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_utgarde_keep(Map* pMap)
|
||||
{
|
||||
return new instance_utgarde_keep(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_utgarde_keep()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_utgarde_keep";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_keep.h"
|
||||
|
||||
uint32 entry_search[3] =
|
||||
{
|
||||
186609,
|
||||
186610,
|
||||
186611
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI
|
||||
{
|
||||
npc_dragonflayer_forge_masterAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
fm_Type = 0;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
uint8 fm_Type;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (fm_Type == 0) fm_Type = GetForgeMasterType();
|
||||
CheckForge();
|
||||
}
|
||||
|
||||
void CheckForge()
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
switch(fm_Type)
|
||||
{
|
||||
case 1:
|
||||
pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
case 2:
|
||||
pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
case 3:
|
||||
pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit *killer)
|
||||
{
|
||||
if (fm_Type == 0) fm_Type = GetForgeMasterType();
|
||||
if (pInstance)
|
||||
{
|
||||
switch(fm_Type)
|
||||
{
|
||||
case 1:
|
||||
pInstance->SetData(EVENT_FORGE_1,DONE);
|
||||
break;
|
||||
case 2:
|
||||
pInstance->SetData(EVENT_FORGE_2,DONE);
|
||||
break;
|
||||
case 3:
|
||||
pInstance->SetData(EVENT_FORGE_3,DONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
if (fm_Type == 0) fm_Type = GetForgeMasterType();
|
||||
if (pInstance)
|
||||
{
|
||||
switch(fm_Type)
|
||||
{
|
||||
case 1:
|
||||
pInstance->SetData(EVENT_FORGE_1,IN_PROGRESS);
|
||||
break;
|
||||
case 2:
|
||||
pInstance->SetData(EVENT_FORGE_2,IN_PROGRESS);
|
||||
break;
|
||||
case 3:
|
||||
pInstance->SetData(EVENT_FORGE_3,IN_PROGRESS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE);
|
||||
}
|
||||
|
||||
uint8 GetForgeMasterType()
|
||||
{
|
||||
float diff = 30.0f;
|
||||
int near_f = 0;
|
||||
|
||||
for (uint8 i = 0; i < 3 ; ++i)
|
||||
{
|
||||
GameObject* temp;
|
||||
temp = m_creature->FindNearestGameObject(entry_search[i],30);
|
||||
if (temp)
|
||||
{
|
||||
if (m_creature->IsWithinDist(temp,diff,false))
|
||||
{
|
||||
near_f = i + 1;
|
||||
diff = m_creature->GetDistance2d(temp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (near_f)
|
||||
{
|
||||
case 1: return 1;
|
||||
case 2: return 2;
|
||||
case 3: return 3;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (fm_Type == 0)
|
||||
fm_Type = GetForgeMasterType();
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_dragonflayer_forge_master(Creature* pCreature)
|
||||
{
|
||||
return new npc_dragonflayer_forge_masterAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_utgarde_keep()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_dragonflayer_forge_master";
|
||||
newscript->GetAI = &GetAI_npc_dragonflayer_forge_master;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef DEF_UTGARDE_KEEP_H
|
||||
#define DEF_UTGARDE_KEEP_H
|
||||
|
||||
#define DATA_PRINCEKELESETH 1
|
||||
#define DATA_SKARVALD 3
|
||||
#define DATA_DALRONN 4
|
||||
#define DATA_INGVAR 6
|
||||
|
||||
#define DATA_PRINCEKELESETH_EVENT 2
|
||||
#define DATA_SKARVALD_DALRONN_EVENT 5
|
||||
#define DATA_INGVAR_EVENT 7
|
||||
|
||||
#define EVENT_FORGE_1 8
|
||||
#define EVENT_FORGE_2 9
|
||||
#define EVENT_FORGE_3 10
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,823 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss palehoof
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_palehoof' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_pinnacle.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCING_SMASH = 48260,
|
||||
SPELL_IMPALE = 48261,
|
||||
H_SPELL_IMPALE = 59268,
|
||||
SPELL_WITHERING_ROAR = 48256,
|
||||
H_SPELL_WITHERING_ROAR = 59267,
|
||||
SPELL_FREEZE = 16245
|
||||
};
|
||||
|
||||
//Orb spells
|
||||
enum OrbSpells
|
||||
{
|
||||
SPELL_ORB_VISUAL = 48044,
|
||||
SPELL_ORB_CHANNEL = 48048
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1575000,
|
||||
SAY_SLAY_1 = -1575001,
|
||||
SAY_SLAY_2 = -1575002,
|
||||
SAY_DEATH = -1575003
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
MOB_STASIS_CONTROLLER = 26688
|
||||
};
|
||||
|
||||
struct Locations
|
||||
{
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
struct Locations moveLocs[]=
|
||||
{
|
||||
{261.6,-449.3,109.5},
|
||||
{263.3,-454.0,109.5},
|
||||
{291.5,-450.4,109.5},
|
||||
{291.5,-454.0,109.5},
|
||||
{310.0,-453.4,109.5},
|
||||
{238.6,-460.7,109.5}
|
||||
};
|
||||
|
||||
enum Phase
|
||||
{
|
||||
PHASE_FRENZIED_WORGEN,
|
||||
PHASE_RAVENOUS_FURLBORG,
|
||||
PHASE_MASSIVE_JORMUNGAR,
|
||||
PHASE_FEROCIOUS_RHINO,
|
||||
PHASE_GORTOK_PALEHOOF,
|
||||
PHASE_NONE
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI
|
||||
{
|
||||
boss_palehoofAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiArcingSmashTimer;
|
||||
uint32 uiImpaleTimer;
|
||||
uint32 uiWhiteringRoarTimer;
|
||||
uint32 uiWaitingTimer;
|
||||
Phase currentPhase;
|
||||
uint8 AddCount;
|
||||
bool DoneAdds[4];
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiArcingSmashTimer = 15000;
|
||||
uiImpaleTimer = 12000;
|
||||
uiWhiteringRoarTimer = 10000;
|
||||
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
for(uint32 i=0;i<4;i++)
|
||||
DoneAdds[i]=false;
|
||||
AddCount=0;
|
||||
|
||||
currentPhase=PHASE_NONE;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, NOT_STARTED);
|
||||
|
||||
Creature* pTemp;
|
||||
if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN))) && !pTemp->isAlive())
|
||||
pTemp->Respawn();
|
||||
if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO))) && !pTemp->isAlive())
|
||||
pTemp->Respawn();
|
||||
if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR))) && !pTemp->isAlive())
|
||||
pTemp->Respawn();
|
||||
if ((pTemp = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG))) && !pTemp->isAlive())
|
||||
pTemp->Respawn();
|
||||
|
||||
if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE)))
|
||||
{
|
||||
pGo->SetGoState(GO_STATE_READY);
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(who, true))
|
||||
{
|
||||
m_creature->AddThreat(who, 0.0f);
|
||||
m_creature->SetInCombatWith(who);
|
||||
who->SetInCombatWith(m_creature);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(currentPhase!=PHASE_GORTOK_PALEHOOF)
|
||||
return;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
Creature* pTemp = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
|
||||
if (pTemp && pTemp->isAlive())
|
||||
pTemp->DisappearAndDie();
|
||||
|
||||
if (uiArcingSmashTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ARCING_SMASH);
|
||||
uiArcingSmashTimer = urand(13000,17000);
|
||||
} else uiArcingSmashTimer -= diff;
|
||||
|
||||
if (uiImpaleTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_IMPALE, H_SPELL_IMPALE));
|
||||
uiImpaleTimer = urand(8000,12000);
|
||||
} else uiImpaleTimer -= diff;
|
||||
|
||||
if (uiWhiteringRoarTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_WITHERING_ROAR, H_SPELL_WITHERING_ROAR));
|
||||
uiWhiteringRoarTimer = urand(8000,12000);
|
||||
} else uiWhiteringRoarTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, DONE);
|
||||
Creature* pTemp = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
|
||||
if (pTemp && pTemp->isAlive())
|
||||
pTemp->DisappearAndDie();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
|
||||
}
|
||||
|
||||
void NextPhase()
|
||||
{
|
||||
if(currentPhase == PHASE_NONE)
|
||||
{
|
||||
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
|
||||
m_creature->SummonCreature(MOB_STASIS_CONTROLLER,moveLocs[5].x,moveLocs[5].y,moveLocs[5].z,0,TEMPSUMMON_CORPSE_DESPAWN);
|
||||
}
|
||||
Phase move = PHASE_NONE;
|
||||
if (AddCount >= DUNGEON_MODE(2,4))
|
||||
move = PHASE_GORTOK_PALEHOOF;
|
||||
else
|
||||
{
|
||||
//select random not yet defeated add
|
||||
uint8 next = urand(0,3);
|
||||
for(uint8 i=0; i < 16; i++)
|
||||
{
|
||||
if(!DoneAdds[i%4] && next == 0)
|
||||
{
|
||||
move = (Phase)(i%4);
|
||||
break;
|
||||
} else if (!DoneAdds[i%4] && next > 0)
|
||||
--next;
|
||||
}
|
||||
++AddCount;
|
||||
DoneAdds[move] = true;
|
||||
move = (Phase)(move%4);
|
||||
}
|
||||
//send orb to summon spot
|
||||
Creature *pOrb = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
|
||||
if (pOrb && pOrb->isAlive())
|
||||
{
|
||||
if(currentPhase == PHASE_NONE)
|
||||
pOrb->CastSpell(m_creature,SPELL_ORB_VISUAL,true);
|
||||
pOrb->GetMotionMaster()->MovePoint(move,moveLocs[move].x,moveLocs[move].y,moveLocs[move].z);
|
||||
}
|
||||
currentPhase = move;
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(m_creature, SPELL_FREEZE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_palehoof(Creature* pCreature)
|
||||
{
|
||||
return new boss_palehoofAI (pCreature);
|
||||
}
|
||||
|
||||
//ravenous furbolg's spells
|
||||
enum RavenousSpells
|
||||
{
|
||||
SPELL_CHAIN_LIGHTING = 48140,
|
||||
H_SPELL_CHAIN_LIGHTING = 59273,
|
||||
SPELL_CRAZED = 48139,
|
||||
SPELL_TERRIFYING_ROAR = 48144
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ravenous_furbolgAI : public ScriptedAI
|
||||
{
|
||||
mob_ravenous_furbolgAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiChainLightingTimer;
|
||||
uint32 uiCrazedTimer;
|
||||
uint32 uiTerrifyingRoarTimer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiChainLightingTimer = 5000;
|
||||
uiCrazedTimer = 10000;
|
||||
uiTerrifyingRoarTimer = 15000;
|
||||
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiChainLightingTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CHAIN_LIGHTING, H_SPELL_CHAIN_LIGHTING));
|
||||
uiChainLightingTimer = 5000 + rand()%5000;
|
||||
} else uiChainLightingTimer -= diff;
|
||||
|
||||
if (uiCrazedTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_CRAZED);
|
||||
uiCrazedTimer = 8000 + rand()%4000;
|
||||
} else uiCrazedTimer -= diff;
|
||||
|
||||
if (uiTerrifyingRoarTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_TERRIFYING_ROAR);
|
||||
uiTerrifyingRoarTimer = 10000 + rand()%10000;
|
||||
} else uiTerrifyingRoarTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(who, true))
|
||||
{
|
||||
m_creature->AddThreat(who, 0.0f);
|
||||
m_creature->SetInCombatWith(who);
|
||||
who->SetInCombatWith(m_creature);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(m_creature, SPELL_FREEZE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_ravenous_furbolg(Creature* pCreature)
|
||||
{
|
||||
return new mob_ravenous_furbolgAI (pCreature);
|
||||
}
|
||||
|
||||
//frenzied worgen's spells
|
||||
enum FrenziedSpells
|
||||
{
|
||||
SPELL_MORTAL_WOUND = 48137,
|
||||
H_SPELL_MORTAL_WOUND = 59265,
|
||||
SPELL_ENRAGE_1 = 48138,
|
||||
SPELL_ENRAGE_2 = 48142
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_frenzied_worgenAI : public ScriptedAI
|
||||
{
|
||||
mob_frenzied_worgenAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiMortalWoundTimer;
|
||||
uint32 uiEnrage1Timer;
|
||||
uint32 uiEnrage2Timer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uint32 uiMortalWoundTimer = 5000;
|
||||
uint32 uiEnrage1Timer = 15000;
|
||||
uint32 uiEnrage2Timer = 10000;
|
||||
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiMortalWoundTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_MORTAL_WOUND, H_SPELL_MORTAL_WOUND));
|
||||
uiMortalWoundTimer = 3000 + rand()%4000;
|
||||
} else uiMortalWoundTimer -= diff;
|
||||
|
||||
if (uiEnrage1Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ENRAGE_1);
|
||||
uiEnrage1Timer = 15000;
|
||||
} else uiEnrage1Timer -= diff;
|
||||
|
||||
if (uiEnrage2Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ENRAGE_2);
|
||||
uiEnrage2Timer = 10000;
|
||||
} else uiEnrage2Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(who, true))
|
||||
{
|
||||
m_creature->AddThreat(who, 0.0f);
|
||||
m_creature->SetInCombatWith(who);
|
||||
who->SetInCombatWith(m_creature);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(m_creature, SPELL_FREEZE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_frenzied_worgen(Creature* pCreature)
|
||||
{
|
||||
return new mob_frenzied_worgenAI (pCreature);
|
||||
}
|
||||
|
||||
//ferocious rhino's spells
|
||||
enum FerociousSpells
|
||||
{
|
||||
SPELL_GORE = 48130,
|
||||
H_SPELL_GORE = 59264,
|
||||
SPELL_GRIEVOUS_WOUND = 48105,
|
||||
H_SPELL_GRIEVOUS_WOUND = 59263,
|
||||
SPELL_STOMP = 48131
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ferocious_rhinoAI : public ScriptedAI
|
||||
{
|
||||
mob_ferocious_rhinoAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiStompTimer;
|
||||
uint32 uiGoreTimer;
|
||||
uint32 uiGrievousWoundTimer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiStompTimer = 10000;
|
||||
uiGoreTimer = 15000;
|
||||
uiGrievousWoundTimer = 20000;
|
||||
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT)==IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiStompTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_STOMP);
|
||||
uiStompTimer = 8000 + rand()%4000;
|
||||
} else uiStompTimer -= diff;
|
||||
|
||||
if (uiGoreTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_GORE, H_SPELL_GORE));
|
||||
uiGoreTimer = 13000 + rand()%4000;
|
||||
} else uiGoreTimer -= diff;
|
||||
|
||||
if (uiGrievousWoundTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_GRIEVOUS_WOUND, H_SPELL_GRIEVOUS_WOUND));
|
||||
uiGrievousWoundTimer = 18000 + rand()%4000;
|
||||
} else uiGrievousWoundTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(who, true))
|
||||
{
|
||||
m_creature->AddThreat(who, 0.0f);
|
||||
m_creature->SetInCombatWith(who);
|
||||
who->SetInCombatWith(m_creature);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(m_creature, SPELL_FREEZE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_ferocious_rhino(Creature* pCreature)
|
||||
{
|
||||
return new mob_ferocious_rhinoAI (pCreature);
|
||||
}
|
||||
|
||||
//massive jormungar's spells
|
||||
enum MassiveSpells
|
||||
{
|
||||
SPELL_ACID_SPIT = 48132,
|
||||
SPELL_ACID_SPLATTER = 48136,
|
||||
H_SPELL_ACID_SPLATTER = 59272,
|
||||
SPELL_POISON_BREATH = 48133,
|
||||
H_SPELL_POISON_BREATH = 59271
|
||||
};
|
||||
|
||||
enum MassiveAdds
|
||||
{
|
||||
CREATURE_JORMUNGAR_WORM = 27228
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_massive_jormungarAI : public ScriptedAI
|
||||
{
|
||||
mob_massive_jormungarAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiAcidSpitTimer;
|
||||
uint32 uiAcidSplatterTimer;
|
||||
uint32 uiPoisonBreathTimer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiAcidSpitTimer = 3000;
|
||||
uiAcidSplatterTimer = 12000;
|
||||
uiPoisonBreathTimer = 10000;
|
||||
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (pInstance)
|
||||
if(pInstance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiAcidSpitTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_ACID_SPIT);
|
||||
uiAcidSpitTimer = 2000 + rand()%2000;
|
||||
} else uiAcidSpitTimer -= diff;
|
||||
|
||||
if (uiAcidSplatterTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_POISON_BREATH, H_SPELL_POISON_BREATH));
|
||||
uiAcidSplatterTimer = 10000 + rand()%4000;
|
||||
} else uiAcidSplatterTimer -= diff;
|
||||
|
||||
if (uiPoisonBreathTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_POISON_BREATH, H_SPELL_POISON_BREATH));
|
||||
uiPoisonBreathTimer = 8000 + rand()%4000;
|
||||
} else uiPoisonBreathTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if (m_creature->Attack(who, true))
|
||||
{
|
||||
m_creature->AddThreat(who, 0.0f);
|
||||
m_creature->SetInCombatWith(who);
|
||||
who->SetInCombatWith(m_creature);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
Creature *pPalehoof = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoofAI,pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
DoCast(m_creature, SPELL_FREEZE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_massive_jormungar(Creature* pCreature)
|
||||
{
|
||||
return new mob_massive_jormungarAI (pCreature);
|
||||
}
|
||||
|
||||
|
||||
struct TRINITY_DLL_DECL mob_palehoof_orbAI : public ScriptedAI
|
||||
{
|
||||
mob_palehoof_orbAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
uint32 SummonTimer;
|
||||
Phase currentPhase;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
currentPhase=PHASE_NONE;
|
||||
SummonTimer=5000;
|
||||
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING);
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_ORB_VISUAL);
|
||||
m_creature->SetSpeed(MOVE_FLIGHT , 0.5f);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(currentPhase==PHASE_NONE)
|
||||
return;
|
||||
|
||||
if(SummonTimer<=diff)
|
||||
{
|
||||
if(currentPhase<5&¤tPhase>=0)
|
||||
{
|
||||
Creature *pNext;
|
||||
switch(currentPhase)
|
||||
{
|
||||
case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN) : 0); break;
|
||||
case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG) : 0); break;
|
||||
case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR) : 0); break;
|
||||
case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
|
||||
case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
|
||||
}
|
||||
|
||||
if (pNext)
|
||||
{
|
||||
pNext->RemoveAurasDueToSpell(SPELL_FREEZE);
|
||||
pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
((Unit*)pNext)->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pNext->SetInCombatWithZone();
|
||||
pNext->Attack(pNext->SelectNearestTarget(100),true);
|
||||
|
||||
}
|
||||
currentPhase=PHASE_NONE;
|
||||
}
|
||||
} else SummonTimer-=diff;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
if(id<0 || id>4)
|
||||
return;
|
||||
Creature *pNext;
|
||||
switch(id)
|
||||
{
|
||||
case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FRENZIED_WORGEN) : 0); break;
|
||||
case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_RAVENOUS_FURBOLG) : 0); break;
|
||||
case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_MASSIVE_JORMUNGAR) : 0); break;
|
||||
case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_FEROCIOUS_RHINO) : 0); break;
|
||||
case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
|
||||
}
|
||||
if(pNext)
|
||||
DoCast(pNext, SPELL_ORB_CHANNEL, false);
|
||||
currentPhase=(Phase)id;
|
||||
SummonTimer=5000;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_palehoof_orb(Creature* pCreature)
|
||||
{
|
||||
return new mob_palehoof_orbAI (pCreature);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool GOHello_palehoof_sphere(Player *pPlayer, GameObject *pGO)
|
||||
{
|
||||
ScriptedInstance *pInstance = pGO->GetInstanceData();
|
||||
|
||||
Creature *pPalehoof = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->isAlive())
|
||||
{
|
||||
// maybe these are hacks :(
|
||||
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
pGO->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
CAST_AI(boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AddSC_boss_palehoof()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_palehoof";
|
||||
newscript->GetAI = &GetAI_boss_palehoof;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ravenous_furbolg";
|
||||
newscript->GetAI = &GetAI_mob_ravenous_furbolg;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_frenzied_worgen";
|
||||
newscript->GetAI = &GetAI_mob_frenzied_worgen;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ferocious_rhino";
|
||||
newscript->GetAI = &GetAI_mob_ferocious_rhino;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_massive_jormungar";
|
||||
newscript->GetAI = &GetAI_mob_massive_jormungar;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_palehoof_orb";
|
||||
newscript->GetAI = &GetAI_mob_palehoof_orb;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "go_palehoof_sphere";
|
||||
newscript->pGOHello=&GOHello_palehoof_sphere;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,252 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss skadi
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_skadi' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_pinnacle.h"
|
||||
|
||||
//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons
|
||||
//Phase 1 Kill the Skadi drake mount with harppons launcher
|
||||
//Phase 2 Kill the Skadi
|
||||
|
||||
//Skadi Spells
|
||||
#define SPELL_CRUSH 50234
|
||||
#define H_SPELL_CRUSH 59330
|
||||
#define SPELL_POISONED_SPEAR 50225
|
||||
#define H_SPELL_POISONED_SPEAR 59331
|
||||
#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s
|
||||
#define H_SPELL_WHIRLWIND 59332
|
||||
|
||||
//Spawned creatures
|
||||
#define CREATURE_YMIRJAR_WARRIOR 26690
|
||||
#define CREATURE_YMIRJAR_WITCH_DOCTOR 26691
|
||||
#define CREATURE_YMIRJAR_HARPOONER 26692
|
||||
|
||||
#define DATA_MOUNT 27043
|
||||
|
||||
//not in db
|
||||
//Yell
|
||||
#define SAY_AGGRO -1575004
|
||||
#define SAY_KILL_1 -1575005
|
||||
#define SAY_KILL_2 -1575006
|
||||
#define SAY_KILL_3 -1575007
|
||||
#define SAY_DEATH -1575008
|
||||
#define SAY_DRAKE_DEATH -1575009
|
||||
#define SAY_DRAKE_HIT_1 -1575010
|
||||
#define SAY_DRAKE_HIT_2 -1575011
|
||||
#define SAY_DRAKE_BREATH_1 -1575012
|
||||
#define SAY_DRAKE_BREATH_2 -1575013
|
||||
#define SAY_DRAKE_BREATH_3 -1575014
|
||||
|
||||
//Spawn locations
|
||||
struct Locations
|
||||
{
|
||||
float x, y, z;
|
||||
uint32 id;
|
||||
};
|
||||
|
||||
static Locations SpawnLoc[]=
|
||||
{
|
||||
{340.556, -511.493, 104.352},
|
||||
{367.741, -512.865, 104.828},
|
||||
{399.546, -512.755, 104.834},
|
||||
{430.551, -514.320, 105.055},
|
||||
{468.931, -513.555, 104.723}
|
||||
};
|
||||
|
||||
enum CombatPhase
|
||||
{
|
||||
FLYING,
|
||||
SKADI
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI
|
||||
{
|
||||
boss_skadiAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiCrushTimer;
|
||||
uint32 uiPoisonedSpearTimer;
|
||||
uint32 uiWhirlwindTimer;
|
||||
uint32 uiMovementTimer;
|
||||
uint32 uiWaypointId;
|
||||
uint32 uiSpawnCounter;
|
||||
|
||||
CombatPhase Phase;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiCrushTimer = 8000;
|
||||
uiPoisonedSpearTimer = 10000;
|
||||
uiWhirlwindTimer = 20000;
|
||||
uiSpawnCounter = 0;
|
||||
|
||||
uiWaypointId = 0;
|
||||
|
||||
Phase = SKADI;
|
||||
|
||||
m_creature->Unmount();
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
m_creature->Mount(DATA_MOUNT);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->GetMotionMaster()->MovePoint(uiWaypointId, 340.259, -510.541, 120.869);
|
||||
|
||||
Phase = FLYING;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
switch(Phase)
|
||||
{
|
||||
case FLYING:
|
||||
if (uiMovementTimer <= diff)
|
||||
{
|
||||
switch(uiWaypointId)
|
||||
{
|
||||
case 0: m_creature->GetMotionMaster()->MovePoint(uiWaypointId, 340.259, -510.541, 120.869); break;
|
||||
case 1: m_creature->GetMotionMaster()->MovePoint(uiWaypointId, 472.977, -513.636, 120.869); break;
|
||||
case 200:
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->Unmount();
|
||||
Phase = SKADI;
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
AttackStart(pTarget);
|
||||
break;
|
||||
}
|
||||
} else uiMovementTimer -= diff;
|
||||
break;
|
||||
case SKADI:
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiCrushTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CRUSH, H_SPELL_CRUSH));
|
||||
uiCrushTimer = 8000;
|
||||
} else uiCrushTimer -= diff;
|
||||
|
||||
if (uiPoisonedSpearTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(SPELL_POISONED_SPEAR, H_SPELL_POISONED_SPEAR));
|
||||
uiPoisonedSpearTimer = 10000;
|
||||
} else uiPoisonedSpearTimer -= diff;
|
||||
|
||||
if (uiWhirlwindTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
m_creature->CastSpell(pTarget, DUNGEON_MODE(SPELL_WHIRLWIND, H_SPELL_WHIRLWIND), false);
|
||||
} else uiWhirlwindTimer = 20000;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if(type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (uiSpawnCounter >= DUNGEON_MODE(4, 5))
|
||||
{
|
||||
uiWaypointId = 200;
|
||||
uiMovementTimer = 3000;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
case 0:
|
||||
SpawnMobs(uiSpawnCounter);
|
||||
uiWaypointId = 1;
|
||||
++uiSpawnCounter;
|
||||
uiMovementTimer = 3000;
|
||||
break;
|
||||
case 1:
|
||||
SpawnMobs(uiSpawnCounter);
|
||||
uiWaypointId = 0;
|
||||
++uiSpawnCounter;
|
||||
uiMovementTimer = 3000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpawnMobs(uint32 spot)
|
||||
{
|
||||
uint8 uiMaxSpawn = DUNGEON_MODE(5, 6);
|
||||
for (uint8 i = 0; i < uiMaxSpawn; ++i)
|
||||
{
|
||||
Creature* pTemp;
|
||||
switch (urand(0,2))
|
||||
{
|
||||
case 0: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
|
||||
case 1: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
|
||||
case 2: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break;
|
||||
}
|
||||
if (pTemp)
|
||||
{
|
||||
pTemp->SetInCombatWithZone();
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
pTemp->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_skadi(Creature* pCreature)
|
||||
{
|
||||
return new boss_skadiAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_skadi()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_skadi";
|
||||
newscript->GetAI = &GetAI_boss_skadi;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,384 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss svala
|
||||
SDAuthor: Tartalo
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_svala' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_pinnacle.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CALL_FLAMES = 48258,
|
||||
SPELL_RITUAL_OF_THE_SWORD = 48276, //Effect #1 Teleport, Effect #2 Dummy
|
||||
SPELL_SINSTER_STRIKE = 15667,
|
||||
H_SPELL_SINSTER_STRIKE = 59409,
|
||||
SPELL_SVALA_TRANSFORMING1 = 54140,
|
||||
SPELL_SVALA_TRANSFORMING2 = 54205
|
||||
};
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_DIALOG_WITH_ARTHAS_1 = -1575015,
|
||||
SAY_DIALOG_WITH_ARTHAS_2 = -1575016,
|
||||
SAY_DIALOG_WITH_ARTHAS_3 = -1575017,
|
||||
SAY_AGGRO = -1575018,
|
||||
SAY_SLAY_1 = -1575019,
|
||||
SAY_SLAY_2 = -1575020,
|
||||
SAY_SLAY_3 = -1575021,
|
||||
SAY_DEATH = -1575022,
|
||||
SAY_SACRIFICE_PLAYER_1 = -1575023,
|
||||
SAY_SACRIFICE_PLAYER_2 = -1575024,
|
||||
SAY_SACRIFICE_PLAYER_3 = -1575025,
|
||||
SAY_SACRIFICE_PLAYER_4 = -1575026,
|
||||
SAY_SACRIFICE_PLAYER_5 = -1575027,
|
||||
SAY_DIALOG_OF_ARTHAS_1 = -1575028,
|
||||
SAY_DIALOG_OF_ARTHAS_2 = -1575029
|
||||
};
|
||||
enum Creatures
|
||||
{
|
||||
CREATURE_ARTHAS = 24266, // Image of Arthas
|
||||
CREATURE_SVALA_SORROWGRAVE = 26668, // Svala after transformation
|
||||
CREATURE_SVALA = 29281, // Svala before transformation
|
||||
CREATURE_RITUAL_CHANNELER = 27281
|
||||
};
|
||||
enum ChannelerSpells
|
||||
{
|
||||
//ritual channeler's spells
|
||||
SPELL_PARALYZE = 48278,
|
||||
SPELL_SHADOWS_IN_THE_DARK = 59407
|
||||
};
|
||||
enum Misc
|
||||
{
|
||||
DATA_SVALA_DISPLAY_ID = 25944
|
||||
};
|
||||
enum IntroPhase
|
||||
{
|
||||
IDLE,
|
||||
INTRO,
|
||||
FINISHED
|
||||
};
|
||||
enum CombatPhase
|
||||
{
|
||||
NORMAL,
|
||||
SACRIFICING
|
||||
};
|
||||
struct Locations
|
||||
{
|
||||
float x, y, z;
|
||||
};
|
||||
static Locations RitualChannelerLocations[]=
|
||||
{
|
||||
{296.42, -355.01, 90.94},
|
||||
{302.36, -352.01, 90.54},
|
||||
{291.39, -350.89, 90.54}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI
|
||||
{
|
||||
boss_svalaAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiIntroTimer;
|
||||
|
||||
uint8 uiIntroPhase;
|
||||
|
||||
IntroPhase Phase;
|
||||
|
||||
Creature* pArthas;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = IDLE;
|
||||
uiIntroTimer = 1000;
|
||||
uiIntroPhase = 0;
|
||||
pArthas = NULL;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* pWho)
|
||||
{
|
||||
if (!pWho)
|
||||
return;
|
||||
if (Phase == IDLE && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && Phase == IDLE && m_creature->IsWithinDistInMap(pWho, 40))
|
||||
{
|
||||
Phase = INTRO;
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (pArthas = m_creature->SummonCreature(CREATURE_ARTHAS, 295.81, -366.16, 92.57, 1.58, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000))
|
||||
{
|
||||
pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
pArthas->SetFloatValue(OBJECT_FIELD_SCALE_X, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Phase != INTRO)
|
||||
return;
|
||||
|
||||
if (uiIntroTimer <= diff)
|
||||
{
|
||||
if(!pArthas)
|
||||
return;
|
||||
|
||||
switch (uiIntroPhase)
|
||||
{
|
||||
case 0:
|
||||
DoScriptText(SAY_DIALOG_WITH_ARTHAS_1, m_creature);
|
||||
++uiIntroPhase;
|
||||
uiIntroTimer = 3500;
|
||||
break;
|
||||
case 1:
|
||||
DoScriptText(SAY_DIALOG_OF_ARTHAS_1, pArthas);
|
||||
++uiIntroPhase;
|
||||
uiIntroTimer = 3500;
|
||||
break;
|
||||
case 2:
|
||||
DoScriptText(SAY_DIALOG_WITH_ARTHAS_2, m_creature);
|
||||
++uiIntroPhase;
|
||||
uiIntroTimer = 3500;
|
||||
break;
|
||||
case 3:
|
||||
DoScriptText(SAY_DIALOG_OF_ARTHAS_2, pArthas);
|
||||
++uiIntroPhase;
|
||||
uiIntroTimer = 3500;
|
||||
break;
|
||||
case 4:
|
||||
DoScriptText(SAY_DIALOG_WITH_ARTHAS_3, m_creature);
|
||||
DoCast(m_creature, SPELL_SVALA_TRANSFORMING1);
|
||||
++uiIntroPhase;
|
||||
uiIntroTimer = 2800;
|
||||
break;
|
||||
case 5:
|
||||
DoCast(m_creature, SPELL_SVALA_TRANSFORMING2);
|
||||
++uiIntroPhase;
|
||||
uiIntroTimer = 200;
|
||||
break;
|
||||
case 6:
|
||||
if (Creature* pSvalaSorrowgrave = m_creature->SummonCreature(CREATURE_SVALA_SORROWGRAVE, 296.632, -346.075, 90.6307, 1.58, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000))
|
||||
{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetDisplayId(DATA_SVALA_DISPLAY_ID);
|
||||
pArthas->DisappearAndDie();
|
||||
Phase = FINISHED;
|
||||
}
|
||||
else Reset();
|
||||
return;
|
||||
}
|
||||
} else uiIntroTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ritual_channelerAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_ritual_channelerAI(Creature *c) :Scripted_NoMovementAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(m_creature, SPELL_SHADOWS_IN_THE_DARK);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (who && !who->HasAura(SPELL_PARALYZE,0))
|
||||
DoCast(who, SPELL_PARALYZE);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_svala_sorrowgraveAI : public ScriptedAI
|
||||
{
|
||||
boss_svala_sorrowgraveAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiSinsterStrikeTimer;
|
||||
uint32 uiCallFlamesTimer;
|
||||
uint32 uiRitualOfSwordTimer;
|
||||
uint32 uiSacrificeTimer;
|
||||
|
||||
CombatPhase Phase;
|
||||
|
||||
Creature* pRitualChanneler[3];
|
||||
Unit* pSacrificeTarget;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiSinsterStrikeTimer = 7000;
|
||||
uiCallFlamesTimer = 10000;
|
||||
uiRitualOfSwordTimer = 20000;
|
||||
uiSacrificeTimer = 8000;
|
||||
|
||||
Phase = NORMAL;
|
||||
|
||||
DoTeleportTo(296.632, -346.075, 90.6307);
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
pRitualChanneler[i] = NULL;
|
||||
pSacrificeTarget = NULL;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Phase == NORMAL)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiSinsterStrikeTimer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SINSTER_STRIKE, H_SPELL_SINSTER_STRIKE));
|
||||
uiSinsterStrikeTimer = urand(5000,9000);
|
||||
} else uiSinsterStrikeTimer -= diff;
|
||||
|
||||
if (uiCallFlamesTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
DoCast(pTarget, SPELL_CALL_FLAMES);
|
||||
uiCallFlamesTimer = urand(8000,12000);
|
||||
}
|
||||
} else uiCallFlamesTimer -= diff;
|
||||
|
||||
if (uiRitualOfSwordTimer <= diff)
|
||||
{
|
||||
pSacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
if (pSacrificeTarget)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SACRIFICE_PLAYER_1,SAY_SACRIFICE_PLAYER_2,SAY_SACRIFICE_PLAYER_3,SAY_SACRIFICE_PLAYER_4,SAY_SACRIFICE_PLAYER_5),m_creature);
|
||||
DoCast(pSacrificeTarget, SPELL_RITUAL_OF_THE_SWORD);
|
||||
//Spell doesn't teleport
|
||||
DoTeleportPlayer(pSacrificeTarget, 296.632, -346.075, 90.63, 4.6);
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLY_MODE);
|
||||
DoTeleportTo(296.632, -346.075, 120.85);
|
||||
Phase = SACRIFICING;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (pRitualChanneler[i] = m_creature->SummonCreature(CREATURE_RITUAL_CHANNELER, RitualChannelerLocations[i].x, RitualChannelerLocations[i].y, RitualChannelerLocations[i].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000))
|
||||
if (mob_ritual_channelerAI *pChannelerAI = CAST_AI(mob_ritual_channelerAI,pRitualChanneler[i]->AI()))
|
||||
pChannelerAI->AttackStartNoMove(pSacrificeTarget);
|
||||
|
||||
uiRitualOfSwordTimer = urand(18000,22000);
|
||||
}
|
||||
} else uiRitualOfSwordTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else //SACRIFICING
|
||||
{
|
||||
if (uiSacrificeTimer <= diff)
|
||||
{
|
||||
bool bSacrificed = false;
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (pRitualChanneler[i] && pRitualChanneler[i]->isAlive())
|
||||
{
|
||||
bSacrificed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bSacrificed && pSacrificeTarget && pSacrificeTarget->isAlive())
|
||||
m_creature->Kill(pSacrificeTarget, false); // durability damage?
|
||||
|
||||
//go down
|
||||
Phase = NORMAL;
|
||||
pSacrificeTarget = NULL;
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
m_creature->GetMotionMaster()->MoveChase(pTarget);
|
||||
|
||||
uiSacrificeTimer = 8000;
|
||||
}
|
||||
else uiSacrificeTimer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* pVictim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
Creature* pSvala = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_SVALA));
|
||||
if (pSvala && pSvala->isAlive())
|
||||
pKiller->Kill(pSvala);
|
||||
|
||||
pInstance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
|
||||
}
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_svala(Creature* pCreature)
|
||||
{
|
||||
return new boss_svalaAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_ritual_channeler(Creature* pCreature)
|
||||
{
|
||||
return new mob_ritual_channelerAI(pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_svala_sorrowgrave(Creature* pCreature)
|
||||
{
|
||||
return new boss_svala_sorrowgraveAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_svala()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_svala";
|
||||
newscript->GetAI = &GetAI_boss_svala;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_ritual_channeler";
|
||||
newscript->GetAI = &GetAI_mob_ritual_channeler;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_svala_sorrowgrave";
|
||||
newscript->GetAI = &GetAI_boss_svala_sorrowgrave;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,367 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss ymiron
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_ymiron' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_pinnacle.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BANE = 48294,
|
||||
H_SPELL_BANE = 59301,
|
||||
SPELL_DARK_SLASH = 48292,
|
||||
SPELL_FETID_ROT = 48291,
|
||||
H_SPELL_FETID_ROT = 59300,
|
||||
SPELL_SCREAMS_OF_THE_DEAD = 51750,
|
||||
SPELL_SPIRIT_BURST = 48529,
|
||||
H_SPELL_SPIRIT_BURST = 59305,
|
||||
SPELL_SPIRIT_STRIKE = 48423,
|
||||
H_SPELL_SPIRIT_STRIKE = 59304,
|
||||
SPELL_ANCESTORS_VENGEANCE = 16939,
|
||||
|
||||
SPELL_SUMMON_AVENGING_SPIRIT = 48592,
|
||||
SPELL_SUMMON_SPIRIT_FOUNT = 48386,
|
||||
|
||||
SPELL_CHANNEL_SPIRIT_TO_YMIRON = 48316,
|
||||
SPELL_CHANNEL_YMIRON_TO_SPIRIT = 48307,
|
||||
|
||||
SPELL_SPIRIT_FOUNT = 48380,
|
||||
H_SPELL_SPIRIT_FOUNT = 59320
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1575028,
|
||||
SAY_SLAY_1 = -1575029,
|
||||
SAY_SLAY_2 = -1575030,
|
||||
SAY_SLAY_3 = -1575031,
|
||||
SAY_SLAY_4 = -1575032,
|
||||
SAY_DEATH = -1575033,
|
||||
SAY_SUMMON_BJORN = -1575034,
|
||||
SAY_SUMMON_HALDOR = -1575035,
|
||||
SAY_SUMMON_RANULF = -1575036,
|
||||
SAY_SUMMON_TORGYN = -1575037
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
CREATURE_BJORN = 27303,
|
||||
CREATURE_BJORN_VISUAL = 27304,
|
||||
CREATURE_HALDOR = 27307,
|
||||
CREATURE_HALDOR_VISUAL = 27310,
|
||||
CREATURE_RANULF = 27308,
|
||||
CREATURE_RANULF_VISUAL = 27311,
|
||||
CREATURE_TORGYN = 27309,
|
||||
CREATURE_TORGYN_VISUAL = 27312,
|
||||
CREATURE_SPIRIT_FOUNT = 27339,
|
||||
CREATURE_AVENGING_SPIRIT = 27386
|
||||
};
|
||||
|
||||
struct ActiveBoatStruct
|
||||
{
|
||||
uint32 npc;
|
||||
uint32 say;
|
||||
float MoveX,MoveY,MoveZ,SpawnX,SpawnY,SpawnZ,SpawnO;
|
||||
};
|
||||
|
||||
static ActiveBoatStruct ActiveBot[4] =
|
||||
{
|
||||
{CREATURE_BJORN_VISUAL, SAY_SUMMON_BJORN, 404.379, -335.335, 104.756, 413.594, -335.408, 107.995, 3.157},
|
||||
{CREATURE_HALDOR_VISUAL, SAY_SUMMON_HALDOR, 380.813, -335.069, 104.756, 369.994, -334.771, 107.995, 6.232},
|
||||
{CREATURE_RANULF_VISUAL, SAY_SUMMON_RANULF, 381.546, -314.362, 104.756, 370.841, -314.426, 107.995, 6.232},
|
||||
{CREATURE_TORGYN_VISUAL, SAY_SUMMON_TORGYN, 404.310, -314.761, 104.756, 413.992, -314.703, 107.995, 3.157}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI
|
||||
{
|
||||
boss_ymironAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
srand(time(NULL));
|
||||
for (int i = 0; i < 4; ++i)
|
||||
m_uiActiveOrder[i] = i;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
int r = i + (rand()%(4-i));
|
||||
int temp = m_uiActiveOrder[i];
|
||||
m_uiActiveOrder[i] = m_uiActiveOrder[r];
|
||||
m_uiActiveOrder[r] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
bool m_bIsWalking;
|
||||
bool m_bIsPause;
|
||||
bool m_bIsActiveWithBJORN;
|
||||
bool m_bIsActiveWithHALDOR;
|
||||
bool m_bIsActiveWithRANULF;
|
||||
bool m_bIsActiveWithTORGYN;
|
||||
|
||||
uint8 m_uiActiveOrder[4];
|
||||
uint8 m_uiActivedNumber;
|
||||
|
||||
uint32 m_uiFetidRot_Timer;
|
||||
uint32 m_uiBane_Timer;
|
||||
uint32 m_uiDarkSlash_Timer;
|
||||
uint32 m_uiAncestors_Vengeance_Timer;
|
||||
|
||||
uint32 m_uiAbility_BJORN_Timer;
|
||||
uint32 m_uiAbility_HALDOR_Timer;
|
||||
uint32 m_uiAbility_RANULF_Timer;
|
||||
uint32 m_uiAbility_TORGYN_Timer;
|
||||
|
||||
uint32 m_uiPause_Timer;
|
||||
uint32 m_uiHealthAmountModifier;
|
||||
uint32 m_uiHealthAmountMultipler;
|
||||
|
||||
uint64 m_uiActivedCreatureGUID;
|
||||
uint64 m_uiOrbGUID;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_bIsPause = false;
|
||||
m_bIsActiveWithBJORN = false;
|
||||
m_bIsActiveWithHALDOR = false;
|
||||
m_bIsActiveWithRANULF = false;
|
||||
m_bIsActiveWithTORGYN = false;
|
||||
|
||||
m_uiFetidRot_Timer = urand(8000,13000);
|
||||
m_uiBane_Timer = urand(18000,23000);
|
||||
m_uiDarkSlash_Timer = urand(28000,33000);
|
||||
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(60000,45000);
|
||||
m_uiPause_Timer = 0;
|
||||
|
||||
m_uiAbility_BJORN_Timer = 0;
|
||||
m_uiAbility_HALDOR_Timer = 0;
|
||||
m_uiAbility_RANULF_Timer = 0;
|
||||
m_uiAbility_TORGYN_Timer = 0;
|
||||
|
||||
m_uiActivedNumber = 0;
|
||||
m_uiHealthAmountModifier = 1;
|
||||
m_uiHealthAmountMultipler = DUNGEON_MODE(20,25);
|
||||
|
||||
DespawnBoatGhosts(m_uiActivedCreatureGUID);
|
||||
DespawnBoatGhosts(m_uiOrbGUID);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KING_YMIRON_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KING_YMIRON_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (m_bIsWalking)
|
||||
{
|
||||
if (m_uiPause_Timer <= diff)
|
||||
{
|
||||
DoScriptText(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].say, m_creature);
|
||||
DoCast(m_creature, SPELL_CHANNEL_YMIRON_TO_SPIRIT); // should be on spirit
|
||||
if (Creature* pTemp = m_creature->SummonCreature(ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].npc, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnX, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnY, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnZ, ActiveBot[m_uiActiveOrder[m_uiActivedNumber]].SpawnO, TEMPSUMMON_CORPSE_DESPAWN, 0))
|
||||
{
|
||||
m_uiActivedCreatureGUID = pTemp->GetGUID();
|
||||
pTemp->CastSpell(m_creature, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true);
|
||||
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pTemp->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
switch(m_uiActiveOrder[m_uiActivedNumber])
|
||||
{
|
||||
case 0: m_bIsActiveWithBJORN = true; break;
|
||||
case 1: m_bIsActiveWithHALDOR = true; break;
|
||||
case 2: m_bIsActiveWithRANULF = true; break;
|
||||
case 3: m_bIsActiveWithTORGYN = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
m_bIsPause = true;
|
||||
m_bIsWalking = false;
|
||||
m_uiPause_Timer = 3000;
|
||||
} else m_uiPause_Timer -= diff;
|
||||
return;
|
||||
}
|
||||
else if (m_bIsPause)
|
||||
{
|
||||
if (m_uiPause_Timer <= diff)
|
||||
{
|
||||
m_uiAbility_BJORN_Timer = 5000;
|
||||
m_uiAbility_HALDOR_Timer = 5000;
|
||||
m_uiAbility_RANULF_Timer = 5000;
|
||||
m_uiAbility_TORGYN_Timer = 5000;
|
||||
|
||||
m_bIsPause = false;
|
||||
m_uiPause_Timer = 0;
|
||||
} else m_uiPause_Timer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!m_bIsPause)
|
||||
{
|
||||
// Normal spells ------------------------------------------------------------------------
|
||||
if (m_uiBane_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_BANE, H_SPELL_BANE));
|
||||
m_uiBane_Timer = urand(20000,25000);
|
||||
} else m_uiBane_Timer -= diff;
|
||||
|
||||
if (m_uiFetidRot_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_FETID_ROT, H_SPELL_FETID_ROT));
|
||||
m_uiFetidRot_Timer = urand(10000,15000);
|
||||
} else m_uiFetidRot_Timer -= diff;
|
||||
|
||||
if (m_uiDarkSlash_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_DARK_SLASH);
|
||||
m_uiDarkSlash_Timer = urand(30000,35000);
|
||||
} else m_uiDarkSlash_Timer -= diff;
|
||||
|
||||
if (m_uiAncestors_Vengeance_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_ANCESTORS_VENGEANCE);
|
||||
m_uiAncestors_Vengeance_Timer = DUNGEON_MODE(urand(60000,65000),urand(45000,50000));
|
||||
} else m_uiAncestors_Vengeance_Timer -= diff;
|
||||
|
||||
// Abilities ------------------------------------------------------------------------------
|
||||
if (m_bIsActiveWithBJORN && m_uiAbility_BJORN_Timer <= diff)
|
||||
{
|
||||
//DoCast(m_creature, SPELL_SUMMON_SPIRIT_FOUNT); // works fine, but using summon has better control
|
||||
if (Creature* pTemp = m_creature->SummonCreature(CREATURE_SPIRIT_FOUNT, 385+rand()%10, -330+rand()%10, 104.756, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 180000))
|
||||
{
|
||||
pTemp->SetSpeed(MOVE_RUN, 0.4f);
|
||||
pTemp->CastSpell(pTemp, DUNGEON_MODE(SPELL_SPIRIT_FOUNT, H_SPELL_SPIRIT_FOUNT), true);
|
||||
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
pTemp->SetDisplayId(11686);
|
||||
//pTemp->GetMotionMaster()->MoveChase(m_creature->getVictim());
|
||||
m_uiOrbGUID = pTemp->GetGUID();
|
||||
}
|
||||
m_bIsActiveWithBJORN = false; // only one orb
|
||||
} else m_uiAbility_BJORN_Timer -= diff;
|
||||
|
||||
if (m_bIsActiveWithHALDOR && m_uiAbility_HALDOR_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_SPIRIT_STRIKE, H_SPELL_SPIRIT_STRIKE));
|
||||
m_uiAbility_HALDOR_Timer = 5000; // overtime
|
||||
} else m_uiAbility_HALDOR_Timer -= diff;
|
||||
|
||||
if (m_bIsActiveWithRANULF && m_uiAbility_RANULF_Timer <= diff)
|
||||
{
|
||||
DoCast(m_creature, DUNGEON_MODE(SPELL_SPIRIT_BURST, H_SPELL_SPIRIT_BURST));
|
||||
m_uiAbility_RANULF_Timer = 10000; // overtime
|
||||
} else m_uiAbility_RANULF_Timer -= diff;
|
||||
|
||||
if (m_bIsActiveWithTORGYN && m_uiAbility_TORGYN_Timer <= diff)
|
||||
{
|
||||
float x,y,z;
|
||||
x = m_creature->GetPositionX()-5;
|
||||
y = m_creature->GetPositionY()-5;
|
||||
z = m_creature->GetPositionZ();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
//DoCast(m_creature, SPELL_SUMMON_AVENGING_SPIRIT); // works fine, but using summon has better control
|
||||
if (Creature* pTemp = m_creature->SummonCreature(CREATURE_AVENGING_SPIRIT, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
{
|
||||
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
pTemp->AddThreat(pTarget, 0.0f);
|
||||
pTemp->AI()->AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_uiAbility_TORGYN_Timer = 15000; // overtime
|
||||
} else m_uiAbility_TORGYN_Timer -= diff;
|
||||
|
||||
// Health check -----------------------------------------------------------------------------
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(m_uiHealthAmountMultipler * m_uiHealthAmountModifier)))
|
||||
{
|
||||
uint8 m_uiOrder = m_uiHealthAmountModifier - 1;
|
||||
++m_uiHealthAmountModifier;
|
||||
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
DoCast(m_creature, SPELL_SCREAMS_OF_THE_DEAD);
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->StopMoving();
|
||||
m_creature->AttackStop();
|
||||
m_creature->GetMotionMaster()->MovePoint(0, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveX, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveY, ActiveBot[m_uiActiveOrder[m_uiOrder]].MoveZ);
|
||||
|
||||
DespawnBoatGhosts(m_uiActivedCreatureGUID);
|
||||
DespawnBoatGhosts(m_uiOrbGUID);
|
||||
|
||||
m_bIsActiveWithBJORN = false;
|
||||
m_bIsActiveWithHALDOR = false;
|
||||
m_bIsActiveWithRANULF = false;
|
||||
m_bIsActiveWithTORGYN = false;
|
||||
|
||||
m_uiBane_Timer += 8000;
|
||||
m_uiFetidRot_Timer += 8000;
|
||||
m_uiDarkSlash_Timer += 8000;
|
||||
m_uiAncestors_Vengeance_Timer += 8000;
|
||||
|
||||
m_uiActivedNumber = m_uiOrder;
|
||||
m_bIsWalking = true;
|
||||
m_uiPause_Timer = 2000;
|
||||
return;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
DespawnBoatGhosts(m_uiActivedCreatureGUID);
|
||||
DespawnBoatGhosts(m_uiOrbGUID);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KING_YMIRON_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), m_creature);
|
||||
}
|
||||
|
||||
void DespawnBoatGhosts(uint64& m_uiCreatureGUID)
|
||||
{
|
||||
if (m_uiCreatureGUID)
|
||||
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, m_uiCreatureGUID))
|
||||
pTemp->DisappearAndDie();
|
||||
|
||||
m_uiCreatureGUID = 0;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_ymiron(Creature* pCreature)
|
||||
{
|
||||
return new boss_ymironAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ymiron()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ymiron";
|
||||
newscript->GetAI = &GetAI_boss_ymiron;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
#include "ScriptedPch.h"
|
||||
#include "utgarde_pinnacle.h"
|
||||
|
||||
#define MAX_ENCOUNTER 4
|
||||
|
||||
/* Utgarde Pinnacle encounters:
|
||||
0 - Svala Sorrowgrave
|
||||
1 - Gortok Palehoof
|
||||
2 - Skadi the Ruthless
|
||||
3 - King Ymiron
|
||||
*/
|
||||
|
||||
#define ENTRY_SKADI_THE_RUTHLESS_DOOR 192173
|
||||
#define ENTRY_KING_YMIRON_DOOR 192174
|
||||
#define ENTRY_GORK_PALEHOOF_SPHERE 188593
|
||||
|
||||
struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance
|
||||
{
|
||||
instance_pinnacle(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
|
||||
uint64 uiSvalaSorrowgrave;
|
||||
uint64 uiGortokPalehoof;
|
||||
uint64 uiSkadiTheRuthless;
|
||||
uint64 uiKingYmiron;
|
||||
|
||||
uint64 uiSkadiTheRuthlessDoor;
|
||||
uint64 uiKingYmironDoor;
|
||||
uint64 uiGortokPalehoofSphere;
|
||||
|
||||
uint64 uiFrenziedWorgen;
|
||||
uint64 uiRavenousFurbolg;
|
||||
uint64 uiFerociousRhino;
|
||||
uint64 uiMassiveJormungar;
|
||||
uint64 uiPalehoofOrb;
|
||||
|
||||
uint64 uiSvala;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
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 26668: uiSvalaSorrowgrave = pCreature->GetGUID(); break;
|
||||
case 26687: uiGortokPalehoof = pCreature->GetGUID(); break;
|
||||
case 26693: uiSkadiTheRuthless = pCreature->GetGUID(); break;
|
||||
case 26861: uiKingYmiron = pCreature->GetGUID(); break;
|
||||
case 26683: uiFrenziedWorgen = pCreature->GetGUID(); break;
|
||||
case 26684: uiRavenousFurbolg = pCreature->GetGUID(); break;
|
||||
case 26685: uiMassiveJormungar = pCreature->GetGUID(); break;
|
||||
case 26686: uiFerociousRhino = pCreature->GetGUID(); break;
|
||||
case 29281: uiSvala = pCreature->GetGUID(); break;
|
||||
case 26688: uiPalehoofOrb = pCreature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case ENTRY_SKADI_THE_RUTHLESS_DOOR:
|
||||
uiSkadiTheRuthlessDoor = pGo->GetGUID();
|
||||
if (m_auiEncounter[2] == DONE) HandleGameObject(NULL,true,pGo);
|
||||
break;
|
||||
case ENTRY_KING_YMIRON_DOOR:
|
||||
uiKingYmironDoor = pGo->GetGUID();
|
||||
if (m_auiEncounter[3] == DONE) HandleGameObject(NULL,true,pGo);
|
||||
break;
|
||||
case ENTRY_GORK_PALEHOOF_SPHERE:
|
||||
uiGortokPalehoofSphere = pGo->GetGUID();
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
{
|
||||
HandleGameObject(NULL,true,pGo);
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_GORTOK_PALEHOOF_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_SKADI_THE_RUTHLESS_EVENT:
|
||||
if (data == DONE)
|
||||
HandleGameObject(uiSkadiTheRuthlessDoor,true);
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_KING_YMIRON_EVENT:
|
||||
if (data == DONE)
|
||||
HandleGameObject(uiKingYmironDoor,true);
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE_EVENT: return m_auiEncounter[0];
|
||||
case DATA_GORTOK_PALEHOOF_EVENT: return m_auiEncounter[1];
|
||||
case DATA_SKADI_THE_RUTHLESS_EVENT: return m_auiEncounter[2];
|
||||
case DATA_KING_YMIRON_EVENT: return m_auiEncounter[3];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE: return uiSvalaSorrowgrave;
|
||||
case DATA_GORTOK_PALEHOOF: return uiGortokPalehoof;
|
||||
case DATA_SKADI_THE_RUTHLESS: return uiSkadiTheRuthless;
|
||||
case DATA_KING_YMIRON: return uiKingYmiron;
|
||||
case DATA_MOB_FRENZIED_WORGEN: return uiFrenziedWorgen;
|
||||
case DATA_MOB_RAVENOUS_FURBOLG: return uiRavenousFurbolg;
|
||||
case DATA_MOB_MASSIVE_JORMUNGAR: return uiMassiveJormungar;
|
||||
case DATA_MOB_FEROCIOUS_RHINO: return uiFerociousRhino;
|
||||
case DATA_MOB_ORB: return uiPalehoofOrb;
|
||||
case DATA_SVALA: return uiSvala;
|
||||
case DATA_GORTOK_PALEHOOF_SPHERE: return uiGortokPalehoofSphere;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "U P " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << m_auiEncounter[3];
|
||||
|
||||
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;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
|
||||
|
||||
if (dataHead1 == 'U' && dataHead2 == 'K')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
m_auiEncounter[3] = data3;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_utgarde_pinnacle(Map* pMap)
|
||||
{
|
||||
return new instance_pinnacle(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_utgarde_pinnacle()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_utgarde_pinnacle";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_utgarde_pinnacle;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef DEF_PINNACLE_H
|
||||
#define DEF_PINNACLE_H
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_SVALA_SORROWGRAVE_EVENT,
|
||||
DATA_GORTOK_PALEHOOF_EVENT,
|
||||
DATA_SKADI_THE_RUTHLESS_EVENT,
|
||||
DATA_KING_YMIRON_EVENT
|
||||
};
|
||||
enum Data64
|
||||
{
|
||||
DATA_SVALA,
|
||||
DATA_SVALA_SORROWGRAVE,
|
||||
DATA_GORTOK_PALEHOOF,
|
||||
DATA_SKADI_THE_RUTHLESS,
|
||||
DATA_KING_YMIRON,
|
||||
DATA_MOB_FRENZIED_WORGEN,
|
||||
DATA_MOB_RAVENOUS_FURBOLG,
|
||||
DATA_MOB_MASSIVE_JORMUNGAR,
|
||||
DATA_MOB_FEROCIOUS_RHINO,
|
||||
DATA_MOB_ORB,
|
||||
DATA_GORTOK_PALEHOOF_SPHERE
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user