mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Merge [SD2]
r1021 Remove ScriptedAI boolean InCombat and use real combat state instead where check is needed. r1022 Added new ScriptedInstance function, DoUseDoorOrButton() for future use in instance scripts. r1023 Updated instance function DoUseDoorOrButton with additional variables. Remove some older code and replace to use new function. r1024 Fix typo in previous commit. - Skip r1025 Added instance script for blood furnace and make bosses set instance data. Some code cleanup - only some code cleanup --HG-- branch : trunk
This commit is contained in:
@@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
{
|
||||
case EVENT_T_TIMER:
|
||||
{
|
||||
if (!InCombat)
|
||||
if (!m_creature->isInCombat())
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
@@ -148,7 +148,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_TIMER_OOC:
|
||||
{
|
||||
if (InCombat)
|
||||
if (m_creature->isInCombat())
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
@@ -168,7 +168,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_HP:
|
||||
{
|
||||
if (!InCombat || !m_creature->GetMaxHealth())
|
||||
if (!m_creature->isInCombat() || !m_creature->GetMaxHealth())
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
|
||||
@@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_MANA:
|
||||
{
|
||||
if (!InCombat || !m_creature->GetMaxPower(POWER_MANA))
|
||||
if (!m_creature->isInCombat() || !m_creature->GetMaxPower(POWER_MANA))
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->GetPower(POWER_MANA)*100) / m_creature->GetMaxPower(POWER_MANA);
|
||||
@@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_TARGET_HP:
|
||||
{
|
||||
if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
|
||||
if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->GetMaxHealth())
|
||||
return false;
|
||||
|
||||
uint32 perc = (m_creature->getVictim()->GetHealth()*100) / m_creature->getVictim()->GetMaxHealth();
|
||||
@@ -328,7 +328,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_TARGET_CASTING:
|
||||
{
|
||||
if (!InCombat || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
|
||||
if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true))
|
||||
return false;
|
||||
|
||||
//Repeat Timers
|
||||
@@ -348,7 +348,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_FRIENDLY_HP:
|
||||
{
|
||||
if (!InCombat)
|
||||
if (!m_creature->isInCombat())
|
||||
return false;
|
||||
|
||||
Unit* pUnit = DoSelectLowestHpFriendly(param2, param1);
|
||||
@@ -375,7 +375,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
break;
|
||||
case EVENT_T_FRIENDLY_IS_CC:
|
||||
{
|
||||
if (!InCombat)
|
||||
if (!m_creature->isInCombat())
|
||||
return false;
|
||||
|
||||
std::list<Creature*> pList = DoFindFriendlyCC(param2);
|
||||
@@ -1030,7 +1030,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
InCombat = false;
|
||||
IsFleeing = false;
|
||||
Reset();
|
||||
|
||||
@@ -1110,7 +1109,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
InCombat = false;
|
||||
IsFleeing = false;
|
||||
Reset();
|
||||
|
||||
@@ -1207,9 +1205,8 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
{
|
||||
//Begin melee attack if we are within range
|
||||
|
||||
if (!InCombat)
|
||||
if (!m_creature->isInCombat())
|
||||
{
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
|
||||
@@ -1226,7 +1223,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!who || InCombat)
|
||||
if (!who || m_creature->isInCombat())
|
||||
return;
|
||||
|
||||
//Check for OOC LOS Event
|
||||
@@ -1278,7 +1275,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Check if we are in combat (also updates calls threat update code)
|
||||
bool Combat = InCombat ? UpdateVictim() : false;
|
||||
bool Combat = m_creature->isInCombat() ? UpdateVictim() : false;
|
||||
|
||||
//Must return if creature isn't alive. Normally select hostil target and get victim prevent this
|
||||
if (!m_creature->isAlive())
|
||||
|
||||
@@ -103,7 +103,7 @@ struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
//Combat check
|
||||
if (InCombat && m_creature->getVictim())
|
||||
if (m_creature->isInCombat() && m_creature->getVictim())
|
||||
{
|
||||
if (DeathCoilTimer < diff)
|
||||
{
|
||||
|
||||
@@ -30,21 +30,17 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
|
||||
{
|
||||
instance_sethekk_halls(Map *map) : ScriptedInstance(map) {Initialize();};
|
||||
|
||||
GameObject *IkissDoor;
|
||||
uint64 m_uiIkissDoorGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
IkissDoor = NULL;
|
||||
m_uiIkissDoorGUID = 0;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject *go, bool add)
|
||||
void OnObjectCreate(GameObject* pGo)
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case IKISS_DOOR:
|
||||
IkissDoor = go;
|
||||
break;
|
||||
}
|
||||
if (pGo->GetEntry() == IKISS_DOOR)
|
||||
m_uiIkissDoorGUID = pGo->GetGUID();
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
@@ -52,8 +48,8 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance
|
||||
switch(type)
|
||||
{
|
||||
case DATA_IKISSDOOREVENT:
|
||||
if( IkissDoor )
|
||||
IkissDoor->SetGoState(GO_STATE_ACTIVE);
|
||||
if (data == DONE)
|
||||
DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,16 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case REFECTORY_DOOR: RefectoryDoorGUID = go->GetGUID(); break;
|
||||
case SCREAMING_HALL_DOOR: ScreamingHallDoorGUID = go->GetGUID(); break;
|
||||
case REFECTORY_DOOR:
|
||||
RefectoryDoorGUID = go->GetGUID();
|
||||
if (Encounter[2] == DONE)
|
||||
DoUseDoorOrButton(RefectoryDoorGUID);
|
||||
break;
|
||||
case SCREAMING_HALL_DOOR:
|
||||
ScreamingHallDoorGUID = go->GetGUID();
|
||||
if (Encounter[3] == DONE)
|
||||
DoUseDoorOrButton(ScreamingHallDoorGUID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,17 +125,13 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
|
||||
|
||||
case DATA_BLACKHEARTTHEINCITEREVENT:
|
||||
if( data == DONE )
|
||||
{
|
||||
HandleGameObject(RefectoryDoorGUID, true);
|
||||
}
|
||||
DoUseDoorOrButton(RefectoryDoorGUID);
|
||||
Encounter[2] = data;
|
||||
break;
|
||||
|
||||
case DATA_GRANDMASTERVORPILEVENT:
|
||||
if( data == DONE )
|
||||
{
|
||||
HandleGameObject(ScreamingHallDoorGUID, true);
|
||||
}
|
||||
DoUseDoorOrButton(ScreamingHallDoorGUID);
|
||||
Encounter[3] = data;
|
||||
break;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
|
||||
CheckTeronTimer = 5000;
|
||||
}else CheckTeronTimer -= diff;
|
||||
|
||||
if(ShadowBoltTimer < diff && InCombat)
|
||||
if(ShadowBoltTimer < diff && m_creature->isInCombat())
|
||||
{
|
||||
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT);
|
||||
ShadowBoltTimer = 10000;
|
||||
@@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
|
||||
m_creature->AddThreat(who, 1.0f);
|
||||
}
|
||||
|
||||
if(!InCombat && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER))
|
||||
if(!m_creature->isInCombat() && !Intro && m_creature->IsWithinDistInMap(who, 60.0f) && (who->GetTypeId() == TYPEID_PLAYER))
|
||||
{
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS);
|
||||
@@ -427,7 +427,6 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
|
||||
DoomBlossom->setFaction(m_creature->getFaction());
|
||||
DoomBlossom->AddThreat(target, 1.0f);
|
||||
((mob_doom_blossomAI*)DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID());
|
||||
((mob_doom_blossomAI*)DoomBlossom->AI())->InCombat = true;
|
||||
SetThreatList(DoomBlossom);
|
||||
SummonDoomBlossomTimer = 35000;
|
||||
}
|
||||
|
||||
@@ -107,8 +107,10 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
|
||||
{
|
||||
if(GameObject* Doors = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS)))
|
||||
{
|
||||
if(close) Doors->SetGoState(GO_STATE_READY); // Closed
|
||||
else Doors->SetGoState(GO_STATE_ACTIVE); // Open
|
||||
if(close)
|
||||
Doors->SetGoState(GO_STATE_READY); // Closed
|
||||
else
|
||||
Doors->SetGoState(GO_STATE_ACTIVE); // Open
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,6 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
uint8 Phase;
|
||||
|
||||
bool Entangle;
|
||||
bool InCombat;
|
||||
bool Intro;
|
||||
bool CanAttack;
|
||||
bool JustCreated;
|
||||
@@ -181,7 +180,6 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
Phase = 0;
|
||||
|
||||
Entangle = false;
|
||||
InCombat = false;
|
||||
if(JustCreated)
|
||||
{
|
||||
CanAttack = false;
|
||||
@@ -241,7 +239,6 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
case 3: DoScriptText(SAY_AGGRO4, m_creature); break;
|
||||
}
|
||||
|
||||
InCombat = true;
|
||||
Phase = 1;
|
||||
|
||||
if(pInstance)
|
||||
@@ -266,7 +263,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
if(Phase != 2)
|
||||
AttackStart(who);
|
||||
|
||||
if(!InCombat)
|
||||
if(!m_creature->isInCombat())
|
||||
StartEvent();
|
||||
}
|
||||
|
||||
@@ -293,7 +290,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
if(Phase != 2)
|
||||
AttackStart(who);
|
||||
|
||||
if(!InCombat)
|
||||
if(!m_creature->isInCombat())
|
||||
StartEvent();
|
||||
}
|
||||
}
|
||||
@@ -340,7 +337,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
//to prevent abuses during phase 2
|
||||
if(Phase == 2 && !m_creature->getVictim() && InCombat)
|
||||
if(Phase == 2 && !m_creature->getVictim() && m_creature->isInCombat())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -672,7 +669,7 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
}
|
||||
if(CAST_AI(boss_lady_vashjAI, Vashj->AI())->InCombat == false || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead())
|
||||
if(!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead())
|
||||
{
|
||||
//call Unsummon()
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
|
||||
@@ -24,21 +24,22 @@ EndScriptData */
|
||||
#include "precompiled.h"
|
||||
#include "def_blood_furnace.h"
|
||||
|
||||
|
||||
#define SAY_AGGRO -1542008
|
||||
|
||||
#define SPELL_SLIME_SPRAY 30913
|
||||
#define SPELL_POISON_CLOUD 30916
|
||||
#define SPELL_POISON_BOLT 30917
|
||||
|
||||
#define SPELL_POISON 30914
|
||||
enum
|
||||
{
|
||||
SAY_AGGRO = -1542008,
|
||||
|
||||
SPELL_SLIME_SPRAY = 30913,
|
||||
SPELL_POISON_CLOUD = 30916,
|
||||
SPELL_POISON_BOLT = 30917,
|
||||
|
||||
SPELL_POISON = 30914
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI
|
||||
{
|
||||
boss_broggokAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
@@ -29,29 +29,32 @@ EndContentData */
|
||||
#include "precompiled.h"
|
||||
#include "def_blood_furnace.h"
|
||||
|
||||
#define SAY_WAKE -1542000
|
||||
enum
|
||||
{
|
||||
SAY_WAKE = -1542000,
|
||||
SAY_ADD_AGGRO_1 = -1542001,
|
||||
SAY_ADD_AGGRO_2 = -1542002,
|
||||
SAY_ADD_AGGRO_3 = -1542003,
|
||||
SAY_KILL_1 = -1542004,
|
||||
SAY_KILL_2 = -1542005,
|
||||
SAY_NOVA = -1542006,
|
||||
SAY_DIE = -1542007,
|
||||
|
||||
#define SAY_ADD_AGGRO_1 -1542001
|
||||
#define SAY_ADD_AGGRO_2 -1542002
|
||||
#define SAY_ADD_AGGRO_3 -1542003
|
||||
SPELL_CORRUPTION = 30938,
|
||||
SPELL_EVOCATION = 30935,
|
||||
|
||||
SPELL_FIRE_NOVA = 33132,
|
||||
H_SPELL_FIRE_NOVA = 37371,
|
||||
|
||||
SPELL_SHADOW_BOLT_VOLLEY = 28599,
|
||||
H_SPELL_SHADOW_BOLT_VOLLEY = 40070,
|
||||
|
||||
SPELL_BURNING_NOVA = 30940,
|
||||
SPELL_VORTEX = 37370,
|
||||
|
||||
#define SAY_KILL_1 -1542004
|
||||
#define SAY_KILL_2 -1542005
|
||||
#define SAY_NOVA -1542006
|
||||
#define SAY_DIE -1542007
|
||||
|
||||
#define SPELL_CORRUPTION 30938
|
||||
#define SPELL_EVOCATION 30935
|
||||
#define SPELL_BURNING_NOVA 30940
|
||||
|
||||
#define SPELL_FIRE_NOVA 33132
|
||||
#define H_SPELL_FIRE_NOVA 37371
|
||||
|
||||
#define SPELL_SHADOW_BOLT_VOLLEY 28599
|
||||
#define H_SPELL_SHADOW_BOLT_VOLLEY 40070
|
||||
|
||||
#define ENTRY_KELIDAN 17377
|
||||
#define ENTRY_CHANNELER 17653
|
||||
ENTRY_KELIDAN = 17377,
|
||||
ENTRY_CHANNELER = 17653
|
||||
};
|
||||
|
||||
const float ShadowmoonChannelers[5][4]=
|
||||
{
|
||||
@@ -67,7 +70,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
for(int i=0; i<5; ++i)
|
||||
Channelers[i] = 0;
|
||||
}
|
||||
@@ -281,18 +284,21 @@ CreatureAI* GetAI_boss_kelidan_the_breaker(Creature *_Creature)
|
||||
## mob_shadowmoon_channeler
|
||||
######*/
|
||||
|
||||
#define SPELL_SHADOW_BOLT 12739
|
||||
#define H_SPELL_SHADOW_BOLT 15472
|
||||
|
||||
#define SPELL_MARK_OF_SHADOW 30937
|
||||
#define SPELL_CHANNELING 39123
|
||||
enum
|
||||
{
|
||||
SPELL_SHADOW_BOLT = 12739,
|
||||
H_SPELL_SHADOW_BOLT = 15472,
|
||||
|
||||
SPELL_MARK_OF_SHADOW = 30937,
|
||||
SPELL_CHANNELING = 39123
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI
|
||||
{
|
||||
mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
@@ -24,24 +24,26 @@ EndScriptData */
|
||||
#include "precompiled.h"
|
||||
#include "def_blood_furnace.h"
|
||||
|
||||
#define SAY_AGGRO_1 -1542009
|
||||
#define SAY_AGGRO_2 -1542010
|
||||
#define SAY_AGGRO_3 -1542011
|
||||
#define SAY_KILL_1 -1542012
|
||||
#define SAY_KILL_2 -1542013
|
||||
#define SAY_DIE -1542014
|
||||
enum
|
||||
{
|
||||
SAY_AGGRO_1 = -1542009,
|
||||
SAY_AGGRO_2 = -1542010,
|
||||
SAY_AGGRO_3 = -1542011,
|
||||
SAY_KILL_1 = -1542012,
|
||||
SAY_KILL_2 = -1542013,
|
||||
SAY_DIE = -1542014,
|
||||
|
||||
#define SPELL_ACID_SPRAY 38153 // heroic 38973 ??? 38153
|
||||
#define SPELL_EXPLODING_BREAKER 30925
|
||||
#define SPELL_KNOCKDOWN 20276
|
||||
#define SPELL_DOMINATION 25772 // ???
|
||||
SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153
|
||||
SPELL_EXPLODING_BREAKER = 30925,
|
||||
SPELL_KNOCKDOWN = 20276,
|
||||
SPELL_DOMINATION = 25772 // ???
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI
|
||||
{
|
||||
boss_the_makerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
Reset();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
@@ -189,7 +189,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance
|
||||
case DATA_COLLAPSE:
|
||||
// true - collapse / false - reset
|
||||
for(std::set<uint64>::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i)
|
||||
HandleGameObject(*i, data);
|
||||
DoUseDoorOrButton(*i);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -74,7 +74,7 @@ struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI
|
||||
|
||||
void InitialYell()
|
||||
{
|
||||
if(!InCombat)
|
||||
if(!m_creature->isInCombat())
|
||||
{
|
||||
switch(rand()%3)
|
||||
{
|
||||
|
||||
@@ -82,17 +82,17 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
|
||||
case GO_COURTYARD_DOOR:
|
||||
DoorCourtyardGUID = go->GetGUID();
|
||||
if (Encounter[0] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
DoUseDoorOrButton(DoorCourtyardGUID);
|
||||
break;
|
||||
case GO_SORCERER_DOOR:
|
||||
DoorSorcererGUID = go->GetGUID();
|
||||
if (Encounter[2] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
DoUseDoorOrButton(DoorSorcererGUID);
|
||||
break;
|
||||
case GO_ARUGAL_DOOR:
|
||||
DoorArugalGUID = go->GetGUID();
|
||||
if (Encounter[3] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
DoUseDoorOrButton(DoorArugalGUID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
|
||||
{
|
||||
case TYPE_FREE_NPC:
|
||||
if(data == DONE)
|
||||
HandleGameObject(DoorCourtyardGUID,0);
|
||||
DoUseDoorOrButton(DoorCourtyardGUID);
|
||||
Encounter[0] = data;
|
||||
break;
|
||||
case TYPE_RETHILGORE:
|
||||
@@ -125,12 +125,12 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance
|
||||
break;
|
||||
case TYPE_FENRUS:
|
||||
if(data == DONE)
|
||||
HandleGameObject(DoorSorcererGUID,0);
|
||||
DoUseDoorOrButton(DoorSorcererGUID);
|
||||
Encounter[2] = data;
|
||||
break;
|
||||
case TYPE_NANDOS:
|
||||
if(data == DONE)
|
||||
HandleGameObject(DoorArugalGUID,0);
|
||||
DoUseDoorOrButton(DoorArugalGUID);
|
||||
Encounter[3] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -193,21 +193,21 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
|
||||
case TYPE_BARONESS:
|
||||
Encounter[1] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
UpdateGoState(ziggurat1GUID,0,false);
|
||||
UpdateGoState(ziggurat1GUID,GO_STATE_ACTIVE,false);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
break;
|
||||
case TYPE_NERUB:
|
||||
Encounter[2] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
UpdateGoState(ziggurat2GUID,0,false);
|
||||
UpdateGoState(ziggurat2GUID,GO_STATE_ACTIVE,false);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
break;
|
||||
case TYPE_PALLID:
|
||||
Encounter[3] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
UpdateGoState(ziggurat3GUID,0,false);
|
||||
UpdateGoState(ziggurat3GUID,GO_STATE_ACTIVE,false);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
break;
|
||||
@@ -215,7 +215,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
if (Encounter[4] != IN_PROGRESS)
|
||||
UpdateGoState(portGauntletGUID,1,false);
|
||||
UpdateGoState(portGauntletGUID,GO_STATE_READY,false);
|
||||
|
||||
uint32 count = abomnationGUID.size();
|
||||
for(std::set<uint64>::iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i)
|
||||
@@ -348,8 +348,8 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
pBaron->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000);
|
||||
|
||||
UpdateGoState(ziggurat4GUID,0,false);
|
||||
UpdateGoState(ziggurat5GUID,0,false);
|
||||
UpdateGoState(ziggurat4GUID,GO_STATE_ACTIVE,false);
|
||||
UpdateGoState(ziggurat5GUID,GO_STATE_ACTIVE,false);
|
||||
debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
|
||||
}
|
||||
SlaugtherSquare_Timer = 0;
|
||||
|
||||
@@ -99,7 +99,6 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
bool InCombat;
|
||||
bool SisterDeath;
|
||||
bool Enraged;
|
||||
|
||||
@@ -112,7 +111,6 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
InCombat = false;
|
||||
Enraged = false;
|
||||
|
||||
if(pInstance)
|
||||
@@ -127,12 +125,11 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
|
||||
if(Temp->getVictim())
|
||||
{
|
||||
m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
|
||||
InCombat = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!InCombat)
|
||||
if(!m_creature->isInCombat())
|
||||
{
|
||||
ShadowbladesTimer = 10000;
|
||||
ShadownovaTimer = 30000;
|
||||
@@ -360,7 +357,6 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
bool InCombat;
|
||||
bool SisterDeath;
|
||||
bool Enraged;
|
||||
|
||||
@@ -376,7 +372,6 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
|
||||
void Reset()
|
||||
{
|
||||
InCombat = false;
|
||||
Enraged = false;
|
||||
|
||||
if(pInstance)
|
||||
@@ -391,12 +386,11 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
if(Temp->getVictim())
|
||||
{
|
||||
m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f);
|
||||
InCombat = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!InCombat)
|
||||
if(!m_creature->isInCombat())
|
||||
{
|
||||
ConflagrationTimer = 45000;
|
||||
BlazeTimer = 100;
|
||||
@@ -430,7 +424,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
|
||||
void AttackStart(Unit *who)
|
||||
{
|
||||
if (!InCombat)
|
||||
if (!m_creature->isInCombat())
|
||||
{
|
||||
Scripted_NoMovementAI::AttackStart(who);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI
|
||||
|
||||
bool Enrage;
|
||||
bool Submerged;
|
||||
bool InCombat;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
|
||||
@@ -59,7 +59,6 @@ struct TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI
|
||||
uint32 WallMinionTimer;
|
||||
bool wakingUp;
|
||||
|
||||
bool InCombat;
|
||||
bool guardiansAwake;
|
||||
bool vaultWalkersAwake;
|
||||
ScriptedInstance* pInstance;
|
||||
@@ -70,7 +69,6 @@ struct TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI
|
||||
Awaken_Timer = 0;
|
||||
WallMinionTimer = 10000;
|
||||
|
||||
InCombat = false;
|
||||
wakingUp = false;
|
||||
guardiansAwake = false;
|
||||
vaultWalkersAwake = false;
|
||||
@@ -217,7 +215,6 @@ struct TRINITY_DLL_DECL mob_archaedas_minionsAI : public ScriptedAI
|
||||
int32 Awaken_Timer;
|
||||
bool wakingUp;
|
||||
|
||||
bool InCombat;
|
||||
bool amIAwake;
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
@@ -226,7 +223,6 @@ struct TRINITY_DLL_DECL mob_archaedas_minionsAI : public ScriptedAI
|
||||
Arcing_Timer = 3000;
|
||||
Awaken_Timer = 0;
|
||||
|
||||
InCombat = false;
|
||||
wakingUp = false;
|
||||
amIAwake = false;
|
||||
|
||||
@@ -362,12 +358,10 @@ struct TRINITY_DLL_DECL mob_stonekeepersAI : public ScriptedAI
|
||||
pInstance = (m_creature->GetInstanceData());
|
||||
}
|
||||
|
||||
bool InCombat;
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
InCombat = false;
|
||||
m_creature->setFaction(35);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
|
||||
@@ -242,3 +242,40 @@ std::string InstanceData::GetBossSaveData()
|
||||
saveStream << (uint32)i->state << " ";
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState)
|
||||
{
|
||||
if (!uiGuid)
|
||||
return;
|
||||
|
||||
GameObject* pGo = instance->GetGameObject(uiGuid);
|
||||
|
||||
if (pGo)
|
||||
{
|
||||
if (pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR || pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON)
|
||||
{
|
||||
if (pGo->getLootState() == GO_READY)
|
||||
pGo->UseDoorOrButton(uiWithRestoreTime,bUseAlternativeState);
|
||||
else if (pGo->getLootState() == GO_ACTIVATED)
|
||||
pGo->ResetDoorOrButton();
|
||||
}
|
||||
else
|
||||
error_log("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType());
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn)
|
||||
{
|
||||
if (GameObject* pGo = instance->GetGameObject(uiGuid))
|
||||
{
|
||||
//not expect any of these should ever be handled
|
||||
if (pGo->GetGoType()==GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType()==GAMEOBJECT_TYPE_DOOR ||
|
||||
pGo->GetGoType()==GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType()==GAMEOBJECT_TYPE_TRAP)
|
||||
return;
|
||||
|
||||
if (pGo->isSpawned())
|
||||
return;
|
||||
|
||||
pGo->SetRespawnTime(uiTimeToDespawn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,6 +143,12 @@ class TRINITY_DLL_SPEC InstanceData : public ZoneScript
|
||||
//use HandleGameObject(GUID,boolen,NULL); in any other script
|
||||
void HandleGameObject(uint64 GUID, bool open, GameObject *go = NULL);
|
||||
|
||||
//change active state of doors or buttons
|
||||
void DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime = 0, bool bUseAlternativeState = false);
|
||||
|
||||
//Respawns a GO having negative spawntimesecs in gameobject-table
|
||||
void DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn = MINUTE);
|
||||
|
||||
virtual bool SetBossState(uint32 id, EncounterState state);
|
||||
const BossBoundaryMap * GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; }
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user