diff options
Diffstat (limited to 'src')
5 files changed, 91 insertions, 295 deletions
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp index e3ac1e418a3..92971bf16cf 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -6,24 +6,22 @@ * * 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 + * 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 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData SDName: Boss_Broggok -SD%Complete: 70 -SDComment: pre-event not made +SD%Complete: 100 +SDComment: SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ #include "precompiled.h" -#include "def_blood_furnace.h" - #define SAY_AGGRO -1542008 @@ -35,14 +33,8 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI { - boss_broggokAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } + boss_broggokAI(Creature *c) : ScriptedAI(c) {} - ScriptedInstance* pInstance; - uint32 AcidSpray_Timer; uint32 PoisonSpawn_Timer; uint32 PoisonBolt_Timer; @@ -52,45 +44,32 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI AcidSpray_Timer = 10000; PoisonSpawn_Timer = 5000; PoisonBolt_Timer = 7000; - ToggleDoors(0, DATA_DOOR4); - if(pInstance) - pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); } - void EnterCombat(Unit *who) + void Aggro(Unit *who) { DoScriptText(SAY_AGGRO, m_creature); - ToggleDoors(1, DATA_DOOR4); - if(pInstance) - pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); } void UpdateAI(const uint32 diff) { - if (!UpdateVictim() ) + + if (!UpdateVictim()) return; - if (AcidSpray_Timer < diff) + if(AcidSpray_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY); AcidSpray_Timer = 4000+rand()%8000; }else AcidSpray_Timer -=diff; - if (PoisonBolt_Timer < diff) + if(PoisonBolt_Timer < diff) { DoCast(m_creature->getVictim(),SPELL_POISON_BOLT); PoisonBolt_Timer = 4000+rand()%8000; }else PoisonBolt_Timer -=diff; - if (PoisonSpawn_Timer < diff) + if(PoisonSpawn_Timer < diff) { DoCast(m_creature,SPELL_POISON_CLOUD); PoisonSpawn_Timer = 20000; @@ -98,31 +77,9 @@ struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI DoMeleeAttackIfReady(); } - - void JustDied(Unit* who) - { - ToggleDoors(0, DATA_DOOR4); - ToggleDoors(0, DATA_DOOR5); - if(pInstance) - pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); - } - - void ToggleDoors(uint8 close, uint64 DOOR) - { - if (pInstance) - { - if (GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DOOR))) - { - if (close == 1) - Doors->SetGoState(GO_STATE_READY); // Closed - else - Doors->SetGoState(GO_STATE_ACTIVE); // Open - } - } - } }; -CreatureAI* GetAI_boss_broggok(Creature *_Creature) +CreatureAI* GetAI_boss_broggokAI(Creature *_Creature) { return new boss_broggokAI (_Creature); } @@ -131,7 +88,8 @@ void AddSC_boss_broggok() { Script *newscript; newscript = new Script; - newscript->Name = "boss_broggok"; - newscript->GetAI = &GetAI_boss_broggok; + newscript->Name="boss_broggok"; + newscript->GetAI = &GetAI_boss_broggokAI; newscript->RegisterSelf(); } + diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp index 4d28469bf04..64bd8e04de1 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -62,14 +62,19 @@ const float ShadowmoonChannelers[5][4]= {316,-109,-24.6,1.257} }; +class TRINITY_DLL_DECL BurningNovaAura : public Aura +{ + public: + BurningNovaAura(SpellEntry *spell, uint32 eff, Unit *target, Unit *caster) : Aura(spell, eff, NULL, target, caster, NULL){} +}; + struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI { boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) { - pInstance = (c->GetInstanceData()); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); - for(int i=0; i<5; ++i) - Channelers[i] = 0; + for(int i=0; i<5; ++i) Channelers[i] = 0; } ScriptedInstance* pInstance; @@ -93,18 +98,14 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI Firenova = false; addYell = false; SummonChannelers(); - if(pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); } - - void EnterCombat(Unit *who) + + void Aggro(Unit *who) { DoScriptText(SAY_WAKE, m_creature); if (m_creature->IsNonMeleeSpellCasted(false)) m_creature->InterruptNonMeleeSpells(true); DoStartMovement(who); - if(pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); } void KilledUnit(Unit* victim) @@ -183,11 +184,8 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI void JustDied(Unit* Killer) { DoScriptText(SAY_DIE, m_creature); - ToggleDoors(0, DATA_DOOR1); - ToggleDoors(0, DATA_DOOR6); - - if(pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); + if(pInstance) + pInstance->SetData(DATA_KELIDANEVENT, DONE); } void UpdateAI(const uint32 diff) @@ -234,16 +232,14 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI DoScriptText(SAY_NOVA, m_creature); - if(SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) + if(SpellEntry *nova = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BURNING_NOVA)) { - uint8 eff_mask=0; - for (int i=0; i<3; i++) - { - if (!nova->Effect[i]) - continue; - eff_mask|=1<<i; - } - m_creature->AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature)); + for(uint32 i = 0; i < 3; ++i) + if(nova->Effect[i] == SPELL_EFFECT_APPLY_AURA) + { + Aura *Aur = new BurningNovaAura(nova, i, m_creature, m_creature); + m_creature->AddAura(Aur); + } } if (HeroicMode) @@ -256,20 +252,6 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI DoMeleeAttackIfReady(); } - - void ToggleDoors(uint8 close, uint64 DOOR) - { - if (pInstance) - { - if (GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DOOR))) - { - if (close == 1) - Doors->SetGoState(GO_STATE_READY); // Closed - else - Doors->SetGoState(GO_STATE_ACTIVE); // Open - } - } - } }; CreatureAI* GetAI_boss_kelidan_the_breaker(Creature *_Creature) @@ -291,7 +273,7 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI { mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) { - pInstance = (c->GetInstanceData()); + pInstance = ((ScriptedInstance*)c->GetInstanceData()); HeroicMode = m_creature->GetMap()->IsHeroic(); } @@ -311,10 +293,10 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI m_creature->InterruptNonMeleeSpells(true); } - void EnterCombat(Unit* who) + void Aggro(Unit* who) { - if(Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); + if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) + ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerEngaged(who); if (m_creature->IsNonMeleeSpellCasted(false)) m_creature->InterruptNonMeleeSpells(true); DoStartMovement(who); @@ -322,8 +304,8 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI void JustDied(Unit* Killer) { - if(Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); + if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) + ((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerDied(Killer); } void UpdateAI(const uint32 diff) @@ -333,9 +315,9 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI if(check_Timer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) - if(Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100, m_creature)) { - uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature); + uint64 channeler = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature); if(Unit *channeled = Unit::GetUnit(*m_creature, channeler)) DoCast(channeled,SPELL_CHANNELING); } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp index fce2e175888..65c98d5ef8d 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -22,7 +22,6 @@ SDCategory: Hellfire Citadel, Blood Furnace EndScriptData */ #include "precompiled.h" -#include "def_blood_furnace.h" #define SAY_AGGRO_1 -1542009 #define SAY_AGGRO_2 -1542010 @@ -38,13 +37,7 @@ EndScriptData */ struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI { - boss_the_makerAI(Creature *c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); - Reset(); - } - - ScriptedInstance* pInstance; + boss_the_makerAI(Creature *c) : ScriptedAI(c) {} uint32 AcidSpray_Timer; uint32 ExplodingBreaker_Timer; @@ -56,14 +49,10 @@ struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI AcidSpray_Timer = 15000; ExplodingBreaker_Timer = 6000; Domination_Timer = 120000; - Knockdown_Timer = 10000; - - ToggleDoors(0, DATA_DOOR2); - if(pInstance) - pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); + Knockdown_Timer = 10000; } - - void EnterCombat(Unit *who) + + void Aggro(Unit *who) { switch(rand()%3) { @@ -71,10 +60,6 @@ struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; } - - ToggleDoors(1, DATA_DOOR2); - if(pInstance) - pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); } void KilledUnit(Unit* victim) @@ -89,12 +74,7 @@ struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI void JustDied(Unit* Killer) { DoScriptText(SAY_DIE, m_creature); - ToggleDoors(0, DATA_DOOR2); - ToggleDoors(0, DATA_DOOR3); - - if(pInstance) - pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); - } + } void UpdateAI(const uint32 diff) { @@ -134,20 +114,6 @@ struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI DoMeleeAttackIfReady(); } - - void ToggleDoors(uint8 close, uint64 DOOR) - { - if (pInstance) - { - if (GameObject* Doors = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DOOR))) - { - if (close == 1) - Doors->SetGoState(GO_STATE_READY); // Closed - else - Doors->SetGoState(GO_STATE_ACTIVE); // Open - } - } - } }; CreatureAI* GetAI_boss_the_makerAI(Creature *_Creature) diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h index 52677a6da37..e6a49847a5c 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h @@ -1,42 +1,10 @@ /* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ #ifndef DEF_BLOOD_FURNACE_H #define DEF_BLOOD_FURNACE_H -#define DATA_THE_MAKER 1 -#define DATA_BROGGOK 2 -#define DATA_KELIDAN_THE_MAKER 3 -#define TYPE_THE_MAKER_EVENT 4 -#define TYPE_BROGGOK_EVENT 5 -#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 -#define DATA_DOOR1 7 -#define DATA_DOOR2 8 -#define DATA_DOOR3 9 -#define DATA_DOOR4 10 -#define DATA_DOOR5 11 -#define DATA_DOOR6 12 -#define DATA_PRISON_CELL1 13 -#define DATA_PRISON_CELL2 14 -#define DATA_PRISON_CELL3 15 -#define DATA_PRISON_CELL4 16 -#define DATA_PRISON_CELL5 17 -#define DATA_PRISON_CELL6 18 -#define DATA_PRISON_CELL7 19 -#define DATA_PRISON_CELL8 20 +#define DATA_KELIDANEVENT 1 #endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp index 2cefb3fee4c..caf29b1f213 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -26,155 +26,77 @@ EndScriptData */ #define ENTRY_SEWER1 181823 #define ENTRY_SEWER2 181766 -#define ENCOUNTERS 3 struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance { instance_blood_furnace(Map *map) : ScriptedInstance(map) {Initialize();}; - uint64 The_MakerGUID; - uint64 BroggokGUID; - uint64 Kelidan_The_BreakerGUID; - uint64 Door1GUID; - uint64 Door2GUID; - uint64 Door3GUID; - uint64 Door4GUID; - uint64 Door5GUID; - uint64 Door6GUID; + uint64 Sewer1GUID; + uint64 Sewer2GUID; - uint64 PrisonCell1GUID; - uint64 PrisonCell2GUID; - uint64 PrisonCell3GUID; - uint64 PrisonCell4GUID; - uint64 PrisonCell5GUID; - uint64 PrisonCell6GUID; - uint64 PrisonCell7GUID; - uint64 PrisonCell8GUID; - - uint32 Encounter[ENCOUNTERS]; void Initialize() { - The_MakerGUID = 0; - BroggokGUID = 0; - Kelidan_The_BreakerGUID = 0; - - Door1GUID = 0; - Door2GUID = 0; - Door3GUID = 0; - Door4GUID = 0; - Door5GUID = 0; - Door6GUID = 0; - - PrisonCell1GUID = 0; - PrisonCell2GUID = 0; - PrisonCell3GUID = 0; - PrisonCell4GUID = 0; - PrisonCell5GUID = 0; - PrisonCell6GUID = 0; - PrisonCell7GUID = 0; - PrisonCell8GUID = 0; - - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; + Sewer1GUID = 0; + Sewer2GUID = 0; } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnObjectCreate(GameObject *go) { - switch(creature->GetEntry()) + switch(go->GetEntry()) { - case 17381: The_MakerGUID = creature->GetGUID(); break; - case 17380: BroggokGUID = creature->GetGUID(); break; - case 17377: Kelidan_The_BreakerGUID = creature->GetGUID(); break; + case ENTRY_SEWER1: Sewer1GUID = go->GetGUID(); break; + case ENTRY_SEWER2: Sewer2GUID = go->GetGUID(); break; } } - void OnObjectCreate(GameObject *go) + Player* GetPlayerInMap() { - if (go->GetEntry() == 181766) //Final exit door - Door1GUID = go->GetGUID(); - if (go->GetEntry() == 181811) //The Maker Front door - Door2GUID = go->GetGUID(); - if (go->GetEntry() == 181812) //The Maker Rear door - Door3GUID = go->GetGUID(); - if (go->GetEntry() == 181822) //Broggok Front door - Door4GUID = go->GetGUID(); - if (go->GetEntry() == 181819) //Broggok Rear door - Door5GUID = go->GetGUID(); - if (go->GetEntry() == 181823) //Kelidan exit door - Door6GUID = go->GetGUID(); - - if (go->GetEntry() == 181813) //The Maker prison cell front right - PrisonCell1GUID = go->GetGUID(); - if (go->GetEntry() == 181814) //The Maker prison cell back right - PrisonCell2GUID = go->GetGUID(); - if (go->GetEntry() == 181816) //The Maker prison cell front left - PrisonCell3GUID = go->GetGUID(); - if (go->GetEntry() == 181815) //The Maker prison cell back left - PrisonCell4GUID = go->GetGUID(); - if (go->GetEntry() == 181821) //Broggok prison cell front right - PrisonCell5GUID = go->GetGUID(); - if (go->GetEntry() == 181818) //Broggok prison cell back right - PrisonCell6GUID = go->GetGUID(); - if (go->GetEntry() == 181820) //Broggok prison cell front left - PrisonCell7GUID = go->GetGUID(); - if (go->GetEntry() == 181817) //Broggok prison cell back left - PrisonCell8GUID = go->GetGUID(); - } + Map::PlayerList const& players = instance->GetPlayers(); - uint64 GetData64(uint32 data) - { - switch(data) + if (!players.isEmpty()) { - case DATA_THE_MAKER: return The_MakerGUID; - case DATA_BROGGOK: return BroggokGUID; - case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; - case DATA_DOOR1: return Door1GUID; - case DATA_DOOR2: return Door2GUID; - case DATA_DOOR3: return Door3GUID; - case DATA_DOOR4: return Door4GUID; - case DATA_DOOR5: return Door5GUID; - case DATA_DOOR6: return Door6GUID; - case DATA_PRISON_CELL1: return PrisonCell1GUID; - case DATA_PRISON_CELL2: return PrisonCell2GUID; - case DATA_PRISON_CELL3: return PrisonCell3GUID; - case DATA_PRISON_CELL4: return PrisonCell4GUID; - case DATA_PRISON_CELL5: return PrisonCell5GUID; - case DATA_PRISON_CELL6: return PrisonCell6GUID; - case DATA_PRISON_CELL7: return PrisonCell7GUID; - case DATA_PRISON_CELL8: return PrisonCell8GUID; + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } } - return 0; + debug_log("TSCR: Instance Blood Furnace: GetPlayerInMap, but PlayerList is empty!"); + return NULL; } - void SetData(uint32 type, uint32 data) + void HandleGameObject(uint64 guid, uint32 state) { - switch(data) - { - case TYPE_THE_MAKER_EVENT: Encounter[0] = data; break; - case TYPE_BROGGOK_EVENT: Encounter[1] = data; break; - case TYPE_KELIDAN_THE_BREAKER_EVENT: Encounter[2] = data; break; - } + Player *player = GetPlayerInMap(); + + if (!player || !guid) + { + debug_log("TSCR: Blood Furnace: HandleGameObject fail"); + return; + } + + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); } - uint32 GetData(uint32 data) + void SetData(uint32 type, uint32 data) { - switch(data) + switch(type) { - case TYPE_THE_MAKER_EVENT: return Encounter[0]; - case TYPE_BROGGOK_EVENT: return Encounter[1]; - case TYPE_KELIDAN_THE_BREAKER_EVENT: return Encounter[2]; + case DATA_KELIDANEVENT: + if( data == DONE ) + { + HandleGameObject(Sewer1GUID,0); + HandleGameObject(Sewer2GUID,0); + } + break; } - - return 0; } - }; - InstanceData* GetInstanceData_instance_blood_furnace(Map* map) { return new instance_blood_furnace(map); |