*Fix Bugs in Keleseth Script + add some better timers
*Add Script for Vrykul Skeleton for Keleseth Event --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
-- Script for Yrykul Skeleton - Prince Keleseth Event
|
||||||
|
update creature_template set scriptname = 'mob_vrykul_skeleton' where entry = 23970;
|
||||||
@@ -2055,7 +2055,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_keep.h"
|
RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|||||||
@@ -1161,7 +1161,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_keep.h"
|
RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|||||||
@@ -858,7 +858,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_keep.h"
|
RelativePath="..\scripts\zone\utgarde_keep\utgarde_keep\def_utgarde_keep.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|||||||
@@ -18,18 +18,20 @@
|
|||||||
|
|
||||||
/* ScriptData
|
/* ScriptData
|
||||||
SDName: Boss_Prince_Keleseth
|
SDName: Boss_Prince_Keleseth
|
||||||
SD%Complete: 80
|
SD%Complete: 90
|
||||||
SDComment: Normal and Heroic Support. Needs Prince Movements, Needs skeletons resurrection, Needs adjustments to blizzlike timers, Needs adjustments to use spell though. Needs Shadowbolt castbar
|
SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells
|
||||||
SDCategory: Utgarde Keep
|
SDCategory: Utgarde Keep
|
||||||
EndScriptData */
|
EndScriptData */
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
#include "def_keep.h"
|
#include "def_utgarde_keep.h"
|
||||||
|
|
||||||
#define SPELL_SHADOWBOLT 43667
|
#define SPELL_SHADOWBOLT 43667
|
||||||
#define SPELL_SHADOWBOLT_HEROIC 59389
|
#define SPELL_SHADOWBOLT_HEROIC 59389
|
||||||
#define SPELL_FROST_TOMB 48400
|
#define SPELL_FROST_TOMB 48400
|
||||||
#define SPELL_FROST_TOMB_SUMMON 42714
|
#define SPELL_FROST_TOMB_SUMMON 42714
|
||||||
|
#define SPELL_DECREPIFY 42702
|
||||||
|
#define SPELL_SCOURGE_RESSURRECTION 42704
|
||||||
#define CREATURE_FROSTTOMB 23965
|
#define CREATURE_FROSTTOMB 23965
|
||||||
#define CREATURE_SKELETON 23970
|
#define CREATURE_SKELETON 23970
|
||||||
|
|
||||||
@@ -44,10 +46,10 @@ EndScriptData */
|
|||||||
float SkeletonSpawnPoint[5][5]=
|
float SkeletonSpawnPoint[5][5]=
|
||||||
{
|
{
|
||||||
{156.2559, 259.2093},
|
{156.2559, 259.2093},
|
||||||
{156.2559, 259.2093},
|
{156.2559, 259.2093},
|
||||||
{156.2559, 259.2093},
|
{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};
|
float AttackLoc[3]={197.636, 194.046, 40.8164};
|
||||||
@@ -56,16 +58,18 @@ struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
mob_frost_tombAI(Creature *c) : ScriptedAI(c)
|
mob_frost_tombAI(Creature *c) : ScriptedAI(c)
|
||||||
{
|
{
|
||||||
|
FrostTombGUID = 0;
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 FrostTombGUID;
|
uint64 FrostTombGUID;
|
||||||
|
|
||||||
void Reset()
|
void SetPrisoner(Unit* uPrisoner)
|
||||||
{
|
{
|
||||||
FrostTombGUID = 0;
|
FrostTombGUID = uPrisoner->GetGUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Reset(){ FrostTombGUID = 0; }
|
||||||
void Aggro(Unit* who) {}
|
void Aggro(Unit* who) {}
|
||||||
void AttackStart(Unit* who) {}
|
void AttackStart(Unit* who) {}
|
||||||
void MoveInLineOfSight(Unit* who) {}
|
void MoveInLineOfSight(Unit* who) {}
|
||||||
@@ -79,6 +83,13 @@ struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
|
|||||||
FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB);
|
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,0)) || !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
|
struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
|
||||||
@@ -87,30 +98,30 @@ struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||||
Reset();
|
Reset();
|
||||||
Heroic = c->GetMap()->IsHeroic();
|
Heroic = c->GetMap()->IsHeroic();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptedInstance* pInstance;
|
ScriptedInstance* pInstance;
|
||||||
|
|
||||||
uint32 FrostTombTimer;
|
uint32 FrostTombTimer;
|
||||||
uint32 SummonSkeletonsTimer;
|
uint32 SummonSkeletonsTimer;
|
||||||
uint32 RespawnSkeletonsTimer;
|
uint32 RespawnSkeletonsTimer;
|
||||||
uint32 ShadowboltTimer;
|
uint32 ShadowboltTimer;
|
||||||
uint64 SkeletonGUID[5];
|
uint64 SkeletonGUID[5];
|
||||||
bool Skeletons;
|
bool Skeletons;
|
||||||
bool Heroic;
|
bool Heroic;
|
||||||
bool RespawnSkeletons;
|
bool RespawnSkeletons;
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
ShadowboltTimer = 0;
|
ShadowboltTimer = 0;
|
||||||
Skeletons = false;
|
Skeletons = false;
|
||||||
|
|
||||||
ResetTimer();
|
ResetTimer();
|
||||||
|
|
||||||
if(pInstance)
|
if(pInstance)
|
||||||
pInstance->SetData(DATA_PRINCEKELESETH, NOT_STARTED);
|
pInstance->SetData(DATA_PRINCEKELESETH, NOT_STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KilledUnit(Unit *victim)
|
void KilledUnit(Unit *victim)
|
||||||
{
|
{
|
||||||
@@ -152,51 +163,148 @@ struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI
|
|||||||
{
|
{
|
||||||
Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
|
Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
|
||||||
if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||||
m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT:SPELL_SHADOWBOLT_HEROIC, true);
|
m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true);
|
||||||
ShadowboltTimer = 2000;
|
ShadowboltTimer = 10000;
|
||||||
}else ShadowboltTimer -= diff;
|
}else ShadowboltTimer -= diff;
|
||||||
|
|
||||||
if((SummonSkeletonsTimer < diff) && !Skeletons)
|
if(!Skeletons)
|
||||||
{
|
if((SummonSkeletonsTimer < diff))
|
||||||
Creature* Skeleton;
|
|
||||||
DoScriptText(SAY_SKELETONS, m_creature);
|
|
||||||
for(uint8 i = 0; i < 5; ++i)
|
|
||||||
{
|
{
|
||||||
Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_MANUAL_DESPAWN,0);
|
Creature* Skeleton;
|
||||||
if(Skeleton)
|
DoScriptText(SAY_SKELETONS, m_creature);
|
||||||
|
for(uint8 i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
|
||||||
Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ());
|
if(Skeleton)
|
||||||
Skeleton->AddThreat(m_creature, 0.0f);
|
{
|
||||||
DoZoneInCombat(Skeleton);
|
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;
|
||||||
Skeletons = true;
|
}else SummonSkeletonsTimer -= diff;
|
||||||
}else SummonSkeletonsTimer -= diff;
|
|
||||||
|
|
||||||
if(FrostTombTimer < diff)
|
if(FrostTombTimer < diff)
|
||||||
{
|
{
|
||||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
|
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
|
||||||
if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
if(target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
DoCast(target, SAY_FROST_TOMB, true);
|
//DoCast(target, SPELL_FROST_TOMB_SUMMON, true);
|
||||||
Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 20000);
|
Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000);
|
||||||
if(Chains)
|
if(Chains)
|
||||||
{
|
{
|
||||||
((mob_frost_tombAI*)Chains->AI())->FrostTombGUID = target->GetGUID();
|
((mob_frost_tombAI*)Chains->AI())->SetPrisoner(target);
|
||||||
Chains->CastSpell(target, SPELL_FROST_TOMB, true);
|
Chains->CastSpell(target, SPELL_FROST_TOMB, true);
|
||||||
|
|
||||||
DoScriptText(SAY_FROST_TOMB, m_creature);
|
DoScriptText(SAY_FROST_TOMB, m_creature);
|
||||||
|
|
||||||
FrostTombTimer = 15000;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FrostTombTimer = 15000;
|
||||||
}else FrostTombTimer -= diff;
|
}else FrostTombTimer -= diff;
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI
|
||||||
|
{
|
||||||
|
mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c)
|
||||||
|
{
|
||||||
|
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||||
|
Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
ScriptedInstance *pInstance;
|
||||||
|
uint32 Respawn_Time;
|
||||||
|
uint64 Target_Guid;
|
||||||
|
uint32 Decrepify_Timer;
|
||||||
|
|
||||||
|
bool isDead;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
Respawn_Time = 12000;
|
||||||
|
Decrepify_Timer = 10000 + rand()%20000;
|
||||||
|
isDead = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Aggro(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);
|
||||||
|
m_creature->CastSpell(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->GetData(DATA_PRINCEKELESETH) == 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 *_Creature)
|
CreatureAI* GetAI_mob_frost_tomb(Creature *_Creature)
|
||||||
{
|
{
|
||||||
return new mob_frost_tombAI(_Creature);
|
return new mob_frost_tombAI(_Creature);
|
||||||
@@ -207,6 +315,11 @@ CreatureAI* GetAI_boss_keleseth(Creature *_Creature)
|
|||||||
return new boss_kelesethAI (_Creature);
|
return new boss_kelesethAI (_Creature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CreatureAI* GetAI_mob_vrykul_skeleton(Creature *_Creature)
|
||||||
|
{
|
||||||
|
return new mob_vrykul_skeletonAI (_Creature);
|
||||||
|
}
|
||||||
|
|
||||||
void AddSC_boss_keleseth()
|
void AddSC_boss_keleseth()
|
||||||
{
|
{
|
||||||
Script *newscript;
|
Script *newscript;
|
||||||
@@ -220,4 +333,9 @@ void AddSC_boss_keleseth()
|
|||||||
newscript->Name = "mob_frost_tomb";
|
newscript->Name = "mob_frost_tomb";
|
||||||
newscript->GetAI = &GetAI_mob_frost_tomb;
|
newscript->GetAI = &GetAI_mob_frost_tomb;
|
||||||
newscript->RegisterSelf();
|
newscript->RegisterSelf();
|
||||||
|
|
||||||
|
newscript = new Script;
|
||||||
|
newscript->Name="mob_vrykul_skeleton";
|
||||||
|
newscript->GetAI = GetAI_mob_vrykul_skeleton;
|
||||||
|
newscript->RegisterSelf();
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-6
@@ -16,11 +16,13 @@
|
|||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DEF_KEEP_H
|
#ifndef DEF_UTGARDE_KEEP_H
|
||||||
#define DEF_KEEP_H
|
#define DEF_UTGARDE_KEEP_H
|
||||||
|
|
||||||
#define DATA_PRINCEKELESETH 1
|
#define DATA_PRINCEKELESETH 1
|
||||||
#define DATA_DALRON 2
|
#define DATA_SKARVALD 2
|
||||||
#define DATA_SKARVALD 3
|
#define DATA_DALRONN 3
|
||||||
#define DATA_INGVAR 4
|
#define DATA_INGVAR 4
|
||||||
|
|
||||||
|
#define DATA_SKARVALD_DALRONN_EVENT 2
|
||||||
#endif
|
#endif
|
||||||
+78
-75
@@ -18,21 +18,20 @@
|
|||||||
|
|
||||||
/* ScriptData
|
/* ScriptData
|
||||||
SDName: Instance_Utgarde_Keep
|
SDName: Instance_Utgarde_Keep
|
||||||
SD%Complete: 0
|
SD%Complete: 90
|
||||||
SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts
|
SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts
|
||||||
SDCategory: Utgarde Keep
|
SDCategory: Utgarde Keep
|
||||||
EndScriptData */
|
EndScriptData */
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
#include "def_keep.h"
|
#include "def_utgarde_keep.h"
|
||||||
|
|
||||||
#define ENCOUNTERS 4
|
#define ENCOUNTERS 3
|
||||||
|
|
||||||
/* Utgarde Keep encounters:
|
/* Utgarde Keep encounters:
|
||||||
0 - Prince Keleseth
|
0 - Prince Keleseth
|
||||||
1 - Skarvald
|
1 - Skarvald Dalronn
|
||||||
2 - Dalronn
|
2 - Ingvar the Plunderer
|
||||||
3 - Ingvar the Plunderer
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
||||||
@@ -52,13 +51,13 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
Keleseth = 0;
|
Keleseth = 0;
|
||||||
Skarvald = 0;
|
Skarvald = 0;
|
||||||
Dalronn =0;
|
Dalronn =0;
|
||||||
Ingvar =0;
|
Ingvar =0;
|
||||||
|
|
||||||
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
||||||
Encounters[i] = NOT_STARTED;
|
Encounters[i] = NOT_STARTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsEncounterInProgress() const
|
bool IsEncounterInProgress() const
|
||||||
{
|
{
|
||||||
@@ -69,41 +68,41 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player* GetPlayerInMap()
|
Player* GetPlayerInMap()
|
||||||
{
|
{
|
||||||
Map::PlayerList const& players = instance->GetPlayers();
|
Map::PlayerList const& players = instance->GetPlayers();
|
||||||
|
|
||||||
if (!players.isEmpty())
|
if (!players.isEmpty())
|
||||||
{
|
{
|
||||||
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (Player* plr = itr->getSource())
|
if (Player* plr = itr->getSource())
|
||||||
return plr;
|
return plr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!");
|
debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleGameObject(uint64 guid, uint32 state)
|
void HandleGameObject(uint64 guid, uint32 state)
|
||||||
{
|
{
|
||||||
Player *player = GetPlayerInMap();
|
Player *player = GetPlayerInMap();
|
||||||
|
|
||||||
if (!player || !guid)
|
if (!player || !guid)
|
||||||
{
|
{
|
||||||
debug_log("TSCR: Utgarde Keep: HandleGameObject fail");
|
debug_log("TSCR: Utgarde Keep: HandleGameObject fail");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameObject *go = GameObject::GetGameObject(*player,guid))
|
if (GameObject *go = GameObject::GetGameObject(*player,guid))
|
||||||
go->SetGoState(state);
|
go->SetGoState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
|
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
|
||||||
{
|
{
|
||||||
switch(creature->GetEntry())
|
switch(creature->GetEntry())
|
||||||
{
|
{
|
||||||
case 23953: Keleseth = creature->GetGUID(); break;
|
case 23953: Keleseth = creature->GetGUID(); break;
|
||||||
case 24200: Dalronn = creature->GetGUID(); break;
|
case 24200: Dalronn = creature->GetGUID(); break;
|
||||||
case 24201: Skarvald = creature->GetGUID(); break;
|
case 24201: Skarvald = creature->GetGUID(); break;
|
||||||
case 23954: Ingvar = creature->GetGUID(); break;
|
case 23954: Ingvar = creature->GetGUID(); break;
|
||||||
@@ -112,10 +111,10 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
|
|
||||||
void OnObjectCreate(GameObject* go)
|
void OnObjectCreate(GameObject* go)
|
||||||
{
|
{
|
||||||
switch(go->GetEntry())
|
//switch(go->GetEntry())
|
||||||
{
|
//{
|
||||||
//door and object id
|
//door and object id
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64 GetData64(uint32 identifier)
|
uint64 GetData64(uint32 identifier)
|
||||||
@@ -123,9 +122,9 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
switch(identifier)
|
switch(identifier)
|
||||||
{
|
{
|
||||||
case DATA_PRINCEKELESETH: return Keleseth;
|
case DATA_PRINCEKELESETH: return Keleseth;
|
||||||
case DATA_DALRON: return Dalronn;
|
case DATA_DALRONN: return Dalronn;
|
||||||
case DATA_SKARVALD: return Skarvald;
|
case DATA_SKARVALD: return Skarvald;
|
||||||
case DATA_INGVAR: return Ingvar;
|
case DATA_INGVAR: return Ingvar;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -141,18 +140,12 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
//HandleGameObject(doorname, 0);
|
//HandleGameObject(doorname, 0);
|
||||||
}
|
}
|
||||||
Encounters[0] = data;break;
|
Encounters[0] = data;break;
|
||||||
case DATA_DALRON:
|
case DATA_SKARVALD_DALRONN_EVENT:
|
||||||
if(data == DONE)
|
if(data == DONE)
|
||||||
{
|
{
|
||||||
//HandleGameObject(doorname, 0);
|
//HandleGameObject(doorname, 0);
|
||||||
}
|
}
|
||||||
Encounters[1] = data; break;
|
Encounters[1] = data; break;
|
||||||
case DATA_SKARVALD:
|
|
||||||
if(data == DONE)
|
|
||||||
{
|
|
||||||
//HandleGameObject(doorname, 0);
|
|
||||||
}
|
|
||||||
Encounters[2] = data; break;
|
|
||||||
case DATA_INGVAR:
|
case DATA_INGVAR:
|
||||||
if(data == DONE)
|
if(data == DONE)
|
||||||
{
|
{
|
||||||
@@ -162,18 +155,18 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data == DONE)
|
if (data == DONE)
|
||||||
{
|
{
|
||||||
OUT_SAVE_INST_DATA;
|
OUT_SAVE_INST_DATA;
|
||||||
|
|
||||||
std::ostringstream saveStream;
|
std::ostringstream saveStream;
|
||||||
saveStream << Encounters[0] << " " << Encounters[1] << " "
|
saveStream << "U K " << Encounters[0] << " " << Encounters[1] << " "
|
||||||
<< Encounters[2] << " " << Encounters[3];
|
<< Encounters[2];
|
||||||
|
|
||||||
str_data = saveStream.str();
|
str_data = saveStream.str();
|
||||||
|
|
||||||
SaveToDB();
|
SaveToDB();
|
||||||
OUT_SAVE_INST_DATA_COMPLETE;
|
OUT_SAVE_INST_DATA_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 GetData(uint32 type)
|
uint32 GetData(uint32 type)
|
||||||
@@ -181,7 +174,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case DATA_PRINCEKELESETH: return Encounters[0];
|
case DATA_PRINCEKELESETH: return Encounters[0];
|
||||||
case DATA_DALRON: return Encounters[1];
|
case DATA_DALRONN: return Encounters[1];
|
||||||
case DATA_SKARVALD: return Encounters[2];
|
case DATA_SKARVALD: return Encounters[2];
|
||||||
case DATA_INGVAR: return Encounters[3];
|
case DATA_INGVAR: return Encounters[3];
|
||||||
}
|
}
|
||||||
@@ -190,30 +183,40 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char* Save()
|
const char* Save()
|
||||||
{
|
{
|
||||||
return str_data.c_str();
|
return str_data.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Load(const char* in)
|
void Load(const char* in)
|
||||||
{
|
{
|
||||||
if (!in)
|
if (!in)
|
||||||
{
|
{
|
||||||
OUT_LOAD_INST_DATA_FAIL;
|
OUT_LOAD_INST_DATA_FAIL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OUT_LOAD_INST_DATA(in);
|
OUT_LOAD_INST_DATA(in);
|
||||||
|
|
||||||
std::istringstream loadStream(in);
|
char dataHead1, dataHead2;
|
||||||
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2]
|
uint16 data0,data1,data2;
|
||||||
>> Encounters[3];
|
|
||||||
|
|
||||||
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
std::istringstream loadStream(in);
|
||||||
if (Encounters[i] == IN_PROGRESS)
|
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2;
|
||||||
Encounters[i] = NOT_STARTED;
|
|
||||||
|
|
||||||
OUT_LOAD_INST_DATA_COMPLETE;
|
if( dataHead1 == 'U' && dataHead2 == 'K')
|
||||||
}
|
{
|
||||||
|
Encounters[0] = data0;
|
||||||
|
Encounters[1] = data1;
|
||||||
|
Encounters[2] = data2;
|
||||||
|
|
||||||
|
for(uint8 i = 0; i < ENCOUNTERS; ++i)
|
||||||
|
if (Encounters[i] == IN_PROGRESS)
|
||||||
|
Encounters[i] = NOT_STARTED;
|
||||||
|
|
||||||
|
}else OUT_LOAD_INST_DATA_FAIL;
|
||||||
|
|
||||||
|
OUT_LOAD_INST_DATA_COMPLETE;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
InstanceData* GetInstanceData_instance_utgarde_keep(Map* map)
|
InstanceData* GetInstanceData_instance_utgarde_keep(Map* map)
|
||||||
|
|||||||
Reference in New Issue
Block a user