Scripts/BloodFurnace:
* cleanup InstanceScript * fix broggok poison cloud Scripts/Naxxramas/Grobbulus: * fix poison cloud * fix mutating injection
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
UPDATE `creature_template` SET `unit_flags`=33685504, `rangeattacktime`=2000, `spell1`=0 WHERE `entry` IN (16363,29379);
|
||||
|
||||
UPDATE `creature_template` SET `minlevel`=60, `maxlevel`=60, `faction_A`=14, `faction_H`=14, `unit_flags`=33947648, `baseattacktime`=2000, `rangeattacktime`=2000, `spell1`=0, `InhabitType`=4, `flags_extra`=128 WHERE `entry` IN (17662,18602);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_broggok_poison_cloud' WHERE `entry`=17662;
|
||||
|
||||
DELETE FROM `spelldifficulty_dbc` WHERE `spellid0` IN (28157,28158,30913,30917,30914);
|
||||
INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`, `spellid2`, `spellid3`) VALUES
|
||||
(28157,28157,54364,0,0),
|
||||
(28158,28158,54362,0,0),
|
||||
(30913,30913,38458,0,0),
|
||||
(30917,30917,38459,0,0),
|
||||
(30914,30914,38462,0,0);
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (28169,28158,54362,30914,38462);
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(28169,'spell_grobbulus_mutating_injection'),
|
||||
(28158,'spell_grobbulus_poison_cloud'),
|
||||
(54362,'spell_grobbulus_poison_cloud'),
|
||||
(30914,'spell_broggok_poison_cloud'),
|
||||
(38462,'spell_broggok_poison_cloud');
|
||||
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-28169;
|
||||
@@ -5684,9 +5684,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
|
||||
case 46284:
|
||||
target->CastCustomSpell(triggerSpellId, SPELLVALUE_MAX_TARGETS, m_tickNumber / 10 + 1, NULL, true, NULL, this);
|
||||
return;
|
||||
// Poison (Grobbulus)
|
||||
case 28158:
|
||||
case 54362:
|
||||
// Slime Pool (Dreadscale & Acidmaw)
|
||||
case 66882:
|
||||
target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), NULL, true, NULL, this);
|
||||
|
||||
@@ -17,18 +17,18 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "naxxramas.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "naxxramas.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BOMBARD_SLIME = 28280,
|
||||
SPELL_POISON_CLOUD = 28240,
|
||||
SPELL_MUTATING_INJECTION = 28169,
|
||||
SPELL_SLIME_SPRAY = 28157,
|
||||
H_SPELL_SLIME_SPRAY = 54364,
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_POISON_CLOUD_ADD = 59116
|
||||
SPELL_MUTATING_INJECTION = 28169,
|
||||
SPELL_MUTATING_EXPLOSION = 28206,
|
||||
SPELL_POISON_CLOUD = 28240,
|
||||
SPELL_POISON_CLOUD_PASSIVE = 28158,
|
||||
SPELL_BERSERK = 26662
|
||||
};
|
||||
|
||||
enum Events
|
||||
@@ -46,115 +46,183 @@ enum CreatureId
|
||||
|
||||
class boss_grobbulus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_grobbulus() : CreatureScript("boss_grobbulus") { }
|
||||
public:
|
||||
boss_grobbulus() : CreatureScript("boss_grobbulus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_grobbulusAI(creature);
|
||||
}
|
||||
|
||||
struct boss_grobbulusAI : public BossAI
|
||||
{
|
||||
boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS)
|
||||
struct boss_grobbulusAI : public BossAI
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_POISON_CLOUD_ADD, true);
|
||||
}
|
||||
boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_CLOUD, 15000);
|
||||
events.ScheduleEvent(EVENT_INJECT, 20000);
|
||||
events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure
|
||||
events.ScheduleEvent(EVENT_BERSERK, 12*60000);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spell) OVERRIDE
|
||||
{
|
||||
if (spell->Id == uint32(SPELL_SLIME_SPRAY))
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (TempSummon* slime = me->SummonCreature(NPC_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0))
|
||||
DoZoneInCombat(slime);
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_CLOUD, 15000);
|
||||
events.ScheduleEvent(EVENT_INJECT, 20000);
|
||||
events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000)); // not sure
|
||||
events.ScheduleEvent(EVENT_BERSERK, 12 * 60000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE
|
||||
{
|
||||
switch (eventId)
|
||||
if (spell->Id == SPELL_SLIME_SPRAY)
|
||||
me->SummonCreature(NPC_FALLOUT_SLIME, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CLOUD:
|
||||
DoCastAOE(SPELL_POISON_CLOUD);
|
||||
events.ScheduleEvent(EVENT_CLOUD, 15000);
|
||||
return;
|
||||
case EVENT_BERSERK:
|
||||
DoCastAOE(SPELL_BERSERK);
|
||||
return;
|
||||
case EVENT_SPRAY:
|
||||
DoCastAOE(SPELL_SLIME_SPRAY);
|
||||
events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000);
|
||||
return;
|
||||
case EVENT_INJECT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
if (!target->HasAura(SPELL_MUTATING_INJECTION))
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_CLOUD:
|
||||
DoCastAOE(SPELL_POISON_CLOUD);
|
||||
events.ScheduleEvent(EVENT_CLOUD, 15000);
|
||||
return;
|
||||
case EVENT_BERSERK:
|
||||
DoCastAOE(SPELL_BERSERK, true);
|
||||
return;
|
||||
case EVENT_SPRAY:
|
||||
DoCastAOE(SPELL_SLIME_SPRAY);
|
||||
events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000));
|
||||
return;
|
||||
case EVENT_INJECT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_MUTATING_INJECTION))
|
||||
DoCast(target, SPELL_MUTATING_INJECTION);
|
||||
events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
|
||||
return;
|
||||
events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct()));
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_grobbulusAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_grobbulus_poison_cloud : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { }
|
||||
public:
|
||||
npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_grobbulus_poison_cloudAI(creature);
|
||||
}
|
||||
|
||||
struct npc_grobbulus_poison_cloudAI : public ScriptedAI
|
||||
{
|
||||
npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
|
||||
struct npc_grobbulus_poison_cloudAI : public ScriptedAI
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
uint32 Cloud_Timer;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
Cloud_Timer = 1000;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (Cloud_Timer <= diff)
|
||||
npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
DoCast(me, SPELL_POISON_CLOUD_ADD);
|
||||
Cloud_Timer = 10000;
|
||||
} else Cloud_Timer -= diff;
|
||||
}
|
||||
};
|
||||
SetCombatMovement(false);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
|
||||
{
|
||||
// no visual when casting in ctor or Reset()
|
||||
DoCast(me, SPELL_POISON_CLOUD_PASSIVE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE { }
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_grobbulus_poison_cloudAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 28169 - Mutating Injection
|
||||
class spell_grobbulus_mutating_injection : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_grobbulus_mutating_injection() : SpellScriptLoader("spell_grobbulus_mutating_injection") { }
|
||||
|
||||
class spell_grobbulus_mutating_injection_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_grobbulus_mutating_injection_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MUTATING_EXPLOSION)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_POISON_CLOUD))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
|
||||
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->CastSpell(GetTarget(), SPELL_MUTATING_EXPLOSION, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, true, NULL, aurEff, GetCasterGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_grobbulus_mutating_injection_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const OVERRIDE
|
||||
{
|
||||
return new spell_grobbulus_mutating_injection_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 28158, 54362 - Poison (Grobbulus)
|
||||
class spell_grobbulus_poison_cloud : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_grobbulus_poison_cloud() : SpellScriptLoader("spell_grobbulus_poison_cloud") { }
|
||||
|
||||
class spell_grobbulus_poison_cloud_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_grobbulus_poison_cloud_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
|
||||
int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
|
||||
GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_grobbulus_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const OVERRIDE
|
||||
{
|
||||
return new spell_grobbulus_poison_cloud_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_grobbulus()
|
||||
{
|
||||
new boss_grobbulus();
|
||||
new npc_grobbulus_poison_cloud();
|
||||
new spell_grobbulus_mutating_injection();
|
||||
new spell_grobbulus_poison_cloud();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
|
||||
* 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
|
||||
@@ -16,32 +15,59 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DEF_BLOOD_FURNACE_H
|
||||
#define DEF_BLOOD_FURNACE_H
|
||||
#ifndef BLOOD_FURNACE_H_
|
||||
#define BLOOD_FURNACE_H_
|
||||
|
||||
#define BFScriptName "instance_blood_furnace"
|
||||
uint32 const EncounterCount = 3;
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_THE_MAKER = 1,
|
||||
DATA_BROGGOK = 2,
|
||||
DATA_KELIDAN_THE_MAKER = 3,
|
||||
TYPE_THE_MAKER_EVENT = 4,
|
||||
TYPE_BROGGOK_EVENT = 5,
|
||||
TYPE_KELIDAN_THE_BREAKER_EVENT = 6,
|
||||
DATA_DOOR1 = 7,
|
||||
DATA_DOOR2 = 8,
|
||||
DATA_DOOR3 = 9,
|
||||
DATA_DOOR4 = 10,
|
||||
DATA_DOOR5 = 11,
|
||||
DATA_DOOR6 = 12,
|
||||
DATA_PRISON_CELL1 = 13,
|
||||
DATA_PRISON_CELL2 = 14,
|
||||
DATA_PRISON_CELL3 = 15,
|
||||
DATA_PRISON_CELL4 = 16,
|
||||
DATA_PRISON_CELL5 = 17,
|
||||
DATA_PRISON_CELL6 = 18,
|
||||
DATA_PRISON_CELL7 = 19,
|
||||
DATA_PRISON_CELL8 = 20,
|
||||
DATA_BROGGOK_LEVER = 21
|
||||
// Encounter States/Boss GUIDs
|
||||
DATA_THE_MAKER = 0,
|
||||
DATA_BROGGOK = 1,
|
||||
DATA_KELIDAN_THE_BREAKER = 2,
|
||||
|
||||
// Additional Data
|
||||
DATA_DOOR_4 = 3,
|
||||
DATA_PRISON_CELL1 = 4,
|
||||
DATA_PRISON_CELL2 = 5,
|
||||
DATA_PRISON_CELL3 = 6,
|
||||
DATA_PRISON_CELL4 = 7,
|
||||
DATA_PRISON_CELL5 = 8,
|
||||
DATA_PRISON_CELL6 = 9,
|
||||
DATA_PRISON_CELL7 = 10,
|
||||
DATA_PRISON_CELL8 = 11,
|
||||
DATA_BROGGOK_LEVER = 12
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_THE_MAKER = 17381,
|
||||
NPC_BROGGOK = 17380,
|
||||
NPC_KELIDAN_THE_BREAKER = 17377,
|
||||
NPC_PRISONER = 17398
|
||||
};
|
||||
|
||||
enum GameObjectIds
|
||||
{
|
||||
GO_PRISON_DOOR_01 = 181766, // Final Exit Door
|
||||
GO_PRISON_DOOR_02 = 181811, // The Maker Front Door
|
||||
GO_PRISON_DOOR_03 = 181812, // The Maker Rear Door
|
||||
GO_PRISON_DOOR_04 = 181819, // Broggok Rear Door
|
||||
GO_PRISON_DOOR_05 = 181822, // Broggok Front Door
|
||||
GO_SUMMON_DOOR = 181823, // Kelidan Exit Door
|
||||
|
||||
GO_PRISON_CELL_DOOR_1 = 181813, // The Maker Prison Cell front right
|
||||
GO_PRISON_CELL_DOOR_2 = 181814, // The Maker Prison Cell back right
|
||||
GO_PRISON_CELL_DOOR_3 = 181816, // The Maker Prison Cell front left
|
||||
GO_PRISON_CELL_DOOR_4 = 181815, // The Maker Prison Cell back left
|
||||
GO_PRISON_CELL_DOOR_5 = 181821, // Broggok Prison Cell front right
|
||||
GO_PRISON_CELL_DOOR_6 = 181818, // Broggok Prison Cell back right
|
||||
GO_PRISON_CELL_DOOR_7 = 181820, // Broggok Prison Cell front left
|
||||
GO_PRISON_CELL_DOOR_8 = 181817, // Broggok Prison Cell back left
|
||||
|
||||
GO_BROGGOK_LEVER = 181982
|
||||
};
|
||||
|
||||
enum ActionIds
|
||||
@@ -51,5 +77,11 @@ enum ActionIds
|
||||
ACTION_PREPARE_BROGGOK = 3
|
||||
};
|
||||
|
||||
#endif
|
||||
template<class AI>
|
||||
AI* GetBloodFurnaceAI(Creature* creature)
|
||||
{
|
||||
return GetInstanceAI<AI>(creature, BFScriptName);
|
||||
}
|
||||
|
||||
#endif // BLOOD_FURNACE_H_
|
||||
|
||||
|
||||
@@ -29,35 +29,26 @@ EndScriptData */
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = 0
|
||||
SAY_AGGRO = 0
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SLIME_SPRAY = 30913,
|
||||
SPELL_POISON_CLOUD = 30916,
|
||||
SPELL_POISON_BOLT = 30917,
|
||||
SPELL_SLIME_SPRAY = 30913,
|
||||
SPELL_POISON_CLOUD = 30916,
|
||||
SPELL_POISON_BOLT = 30917,
|
||||
|
||||
SPELL_POISON = 30914
|
||||
SPELL_POISON_CLOUD_PASSIVE = 30914
|
||||
};
|
||||
|
||||
class boss_broggok : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_broggok()
|
||||
: CreatureScript("boss_broggok")
|
||||
{
|
||||
}
|
||||
boss_broggok() : CreatureScript("boss_broggok") { }
|
||||
|
||||
struct boss_broggokAI : public BossAI
|
||||
{
|
||||
boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK) { }
|
||||
|
||||
uint32 AcidSpray_Timer;
|
||||
uint32 PoisonSpawn_Timer;
|
||||
@@ -71,28 +62,22 @@ class boss_broggok : public CreatureScript
|
||||
PoisonSpawn_Timer = 5000;
|
||||
PoisonBolt_Timer = 7000;
|
||||
DoAction(ACTION_RESET_BROGGOK);
|
||||
instance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
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, me->GetGUID());
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!canAttack)
|
||||
return;
|
||||
|
||||
if (AcidSpray_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SLIME_SPRAY);
|
||||
@@ -122,9 +107,7 @@ class boss_broggok : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR4), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR5), true);
|
||||
instance->SetData(TYPE_BROGGOK_EVENT, DONE);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void DoAction(int32 action) OVERRIDE
|
||||
@@ -151,7 +134,34 @@ class boss_broggok : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetInstanceAI<boss_broggokAI>(creature);
|
||||
return GetBloodFurnaceAI<boss_broggokAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_broggok_poison_cloud : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_broggok_poison_cloud() : CreatureScript("npc_broggok_poison_cloud") { }
|
||||
|
||||
struct npc_broggok_poison_cloudAI : public ScriptedAI
|
||||
{
|
||||
npc_broggok_poison_cloudAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
creature->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) OVERRIDE
|
||||
{
|
||||
DoCast(me, SPELL_POISON_CLOUD_PASSIVE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/) OVERRIDE { }
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_broggok_poison_cloudAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -163,19 +173,60 @@ class go_broggok_lever : public GameObjectScript
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (instance->GetData(TYPE_BROGGOK_EVENT) != DONE && instance->GetData(TYPE_BROGGOK_EVENT) != IN_PROGRESS)
|
||||
if (instance->GetBossState(DATA_BROGGOK) != DONE && instance->GetBossState(DATA_BROGGOK) != IN_PROGRESS)
|
||||
{
|
||||
instance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS);
|
||||
if (Creature* broggok = Creature::GetCreature(*go, instance->GetData64(DATA_BROGGOK)))
|
||||
instance->SetBossState(DATA_BROGGOK, IN_PROGRESS);
|
||||
if (Creature* broggok = ObjectAccessor::GetCreature(*go, instance->GetData64(DATA_BROGGOK)))
|
||||
broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK);
|
||||
}
|
||||
|
||||
go->UseDoorOrButton();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// 30914, 38462 - Poison (Broggok)
|
||||
class spell_broggok_poison_cloud : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_broggok_poison_cloud() : SpellScriptLoader("spell_broggok_poison_cloud") { }
|
||||
|
||||
class spell_broggok_poison_cloud_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_broggok_poison_cloud_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
|
||||
int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
|
||||
GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_broggok_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const OVERRIDE
|
||||
{
|
||||
return new spell_broggok_poison_cloud_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_broggok()
|
||||
{
|
||||
new boss_broggok();
|
||||
new npc_broggok_poison_cloud();
|
||||
new go_broggok_lever();
|
||||
new spell_broggok_poison_cloud();
|
||||
}
|
||||
|
||||
+9
-31
@@ -16,18 +16,6 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Kelidan_The_Breaker
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Hellfire Citadel, Blood Furnace
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
boss_kelidan_the_breaker
|
||||
npc_shadowmoon_channeler
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuras.h"
|
||||
@@ -71,23 +59,16 @@ const float ShadowmoonChannelers[5][4]=
|
||||
class boss_kelidan_the_breaker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_kelidan_the_breaker() : CreatureScript("boss_kelidan_the_breaker") { }
|
||||
|
||||
boss_kelidan_the_breaker()
|
||||
: CreatureScript("boss_kelidan_the_breaker")
|
||||
struct boss_kelidan_the_breakerAI : public BossAI
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
boss_kelidan_the_breakerAI(Creature* creature) : ScriptedAI(creature)
|
||||
boss_kelidan_the_breakerAI(Creature* creature) : BossAI(creature, DATA_KELIDAN_THE_BREAKER)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
for (uint8 i=0; i<5; ++i)
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
Channelers[i] = 0;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ShadowVolley_Timer;
|
||||
uint32 BurningNova_Timer;
|
||||
uint32 Firenova_Timer;
|
||||
@@ -99,6 +80,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
_Reset();
|
||||
ShadowVolley_Timer = 1000;
|
||||
BurningNova_Timer = 15000;
|
||||
Corruption_Timer = 5000;
|
||||
@@ -108,16 +90,15 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
SummonChannelers();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) OVERRIDE
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_WAKE);
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoStartMovement(who);
|
||||
instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -189,11 +170,8 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DIE);
|
||||
|
||||
instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR1), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR6), true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -270,7 +248,7 @@ class boss_kelidan_the_breaker : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetInstanceAI<boss_kelidan_the_breakerAI>(creature);
|
||||
return GetBloodFurnaceAI<boss_kelidan_the_breakerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -368,7 +346,7 @@ class npc_shadowmoon_channeler : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetInstanceAI<npc_shadowmoon_channelerAI>(creature);
|
||||
return GetBloodFurnaceAI<npc_shadowmoon_channelerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -45,20 +45,11 @@ enum Spells
|
||||
class boss_the_maker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_the_maker() : CreatureScript("boss_the_maker") { }
|
||||
|
||||
boss_the_maker()
|
||||
: CreatureScript("boss_the_maker")
|
||||
struct boss_the_makerAI : public BossAI
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_the_makerAI : public ScriptedAI
|
||||
{
|
||||
boss_the_makerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
boss_the_makerAI(Creature* creature) : BossAI(creature, DATA_THE_MAKER) { }
|
||||
|
||||
uint32 AcidSpray_Timer;
|
||||
uint32 ExplodingBreaker_Timer;
|
||||
@@ -67,37 +58,30 @@ class boss_the_maker : public CreatureScript
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
_Reset();
|
||||
AcidSpray_Timer = 15000;
|
||||
ExplodingBreaker_Timer = 6000;
|
||||
Domination_Timer = 120000;
|
||||
Knockdown_Timer = 10000;
|
||||
|
||||
instance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
instance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR2), false);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
void KilledUnit(Unit* who) OVERRIDE
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DIE);
|
||||
|
||||
instance->SetData(TYPE_THE_MAKER_EVENT, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR3), true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
@@ -147,7 +131,7 @@ class boss_the_maker : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetInstanceAI<boss_the_makerAI>(creature);
|
||||
return GetBloodFurnaceAI<boss_the_makerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+197
-220
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
|
||||
* 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
|
||||
@@ -16,292 +15,207 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Blood_Furnace
|
||||
SD%Complete: 85
|
||||
SDComment:
|
||||
SDCategory: Hellfire Citadel, Blood Furnace
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "blood_furnace.h"
|
||||
#include "CreatureAI.h"
|
||||
|
||||
#define ENTRY_SEWER1 181823
|
||||
#define ENTRY_SEWER2 181766
|
||||
#define MAX_ENCOUNTER 3
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_PRISON_DOOR_01, DATA_KELIDAN_THE_BREAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_PRISON_DOOR_02, DATA_THE_MAKER, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_PRISON_DOOR_03, DATA_THE_MAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_PRISON_DOOR_04, DATA_BROGGOK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_PRISON_DOOR_05, DATA_BROGGOK, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_SUMMON_DOOR, DATA_KELIDAN_THE_BREAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
};
|
||||
|
||||
class instance_blood_furnace : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_blood_furnace()
|
||||
: InstanceMapScript("instance_blood_furnace", 542) { }
|
||||
instance_blood_furnace() : InstanceMapScript(BFScriptName, 542) { }
|
||||
|
||||
struct instance_blood_furnace_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
uint64 The_MakerGUID;
|
||||
uint64 BroggokGUID;
|
||||
uint64 Kelidan_The_BreakerGUID;
|
||||
|
||||
uint64 Door1GUID;
|
||||
uint64 Door2GUID;
|
||||
uint64 Door3GUID;
|
||||
uint64 Door4GUID;
|
||||
uint64 Door5GUID;
|
||||
uint64 Door6GUID;
|
||||
|
||||
uint64 PrisonCell1GUID;
|
||||
uint64 PrisonCell2GUID;
|
||||
uint64 PrisonCell3GUID;
|
||||
uint64 PrisonCell4GUID;
|
||||
uint64 PrisonCell5GUID;
|
||||
uint64 PrisonCell6GUID;
|
||||
uint64 PrisonCell7GUID;
|
||||
uint64 PrisonCell8GUID;
|
||||
|
||||
std::set<uint64> PrisonersCell5;
|
||||
std::set<uint64> PrisonersCell6;
|
||||
std::set<uint64> PrisonersCell7;
|
||||
std::set<uint64> PrisonersCell8;
|
||||
|
||||
uint8 PrisonerCounter5;
|
||||
uint8 PrisonerCounter6;
|
||||
uint8 PrisonerCounter7;
|
||||
uint8 PrisonerCounter8;
|
||||
|
||||
uint64 BroggokLeverGUID;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
void Initialize() OVERRIDE
|
||||
instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
The_MakerGUID = 0;
|
||||
BroggokGUID = 0;
|
||||
Kelidan_The_BreakerGUID = 0;
|
||||
TheMakerGUID = 0;
|
||||
BroggokGUID = 0;
|
||||
KelidanTheBreakerGUID = 0;
|
||||
|
||||
Door1GUID = 0;
|
||||
Door2GUID = 0;
|
||||
Door3GUID = 0;
|
||||
Door4GUID = 0;
|
||||
Door5GUID = 0;
|
||||
Door6GUID = 0;
|
||||
BroggokLeverGUID = 0;
|
||||
PrisonDoor4GUID = 0;
|
||||
|
||||
PrisonCell1GUID = 0;
|
||||
PrisonCell2GUID = 0;
|
||||
PrisonCell3GUID = 0;
|
||||
PrisonCell4GUID = 0;
|
||||
PrisonCell5GUID = 0;
|
||||
PrisonCell6GUID = 0;
|
||||
PrisonCell7GUID = 0;
|
||||
PrisonCell8GUID = 0;
|
||||
memset(PrisonCellGUIDs, 0, 8 * sizeof(uint64));
|
||||
|
||||
PrisonersCell5.clear();
|
||||
PrisonersCell6.clear();
|
||||
PrisonersCell7.clear();
|
||||
PrisonersCell8.clear();
|
||||
|
||||
PrisonerCounter5 = 0;
|
||||
PrisonerCounter6 = 0;
|
||||
PrisonerCounter7 = 0;
|
||||
PrisonerCounter8 = 0;
|
||||
|
||||
BroggokLeverGUID = 0;
|
||||
PrisonerCounter5 = 0;
|
||||
PrisonerCounter6 = 0;
|
||||
PrisonerCounter7 = 0;
|
||||
PrisonerCounter8 = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) OVERRIDE
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case 17381:
|
||||
The_MakerGUID = creature->GetGUID();
|
||||
case NPC_THE_MAKER:
|
||||
TheMakerGUID = creature->GetGUID();
|
||||
break;
|
||||
case 17380:
|
||||
case NPC_BROGGOK:
|
||||
BroggokGUID = creature->GetGUID();
|
||||
break;
|
||||
case 17377:
|
||||
Kelidan_The_BreakerGUID = creature->GetGUID();
|
||||
case NPC_KELIDAN_THE_BREAKER:
|
||||
KelidanTheBreakerGUID = creature->GetGUID();
|
||||
break;
|
||||
case 17398:
|
||||
case NPC_PRISONER:
|
||||
StorePrisoner(creature);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit) OVERRIDE
|
||||
{
|
||||
if (unit && unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == 17398)
|
||||
if (unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == NPC_PRISONER)
|
||||
PrisonerDied(unit->GetGUID());
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) OVERRIDE
|
||||
{
|
||||
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();
|
||||
|
||||
if (go->GetEntry() == 181982)
|
||||
BroggokLeverGUID = go->GetGUID(); //Broggok lever
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data) const OVERRIDE
|
||||
{
|
||||
switch (data)
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
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;
|
||||
case DATA_BROGGOK_LEVER: return BroggokLeverGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_THE_MAKER_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case TYPE_BROGGOK_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
UpdateBroggokEvent(data);
|
||||
break;
|
||||
case TYPE_KELIDAN_THE_BREAKER_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
case GO_PRISON_DOOR_04:
|
||||
PrisonDoor4GUID = go->GetGUID();
|
||||
// no break
|
||||
case GO_PRISON_DOOR_01:
|
||||
case GO_PRISON_DOOR_02:
|
||||
case GO_PRISON_DOOR_03:
|
||||
case GO_PRISON_DOOR_05:
|
||||
case GO_SUMMON_DOOR:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
case GO_BROGGOK_LEVER:
|
||||
BroggokLeverGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_1:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL1 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_2:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL2 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_3:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL3 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_4:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL4 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_5:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL5 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_6:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL6 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_7:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL7 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
case GO_PRISON_CELL_DOOR_8:
|
||||
PrisonCellGUIDs[DATA_PRISON_CELL8 - DATA_PRISON_CELL1] = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const OVERRIDE
|
||||
void OnGameObjectRemove(GameObject* go) OVERRIDE
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_PRISON_DOOR_01:
|
||||
case GO_PRISON_DOOR_02:
|
||||
case GO_PRISON_DOOR_03:
|
||||
case GO_PRISON_DOOR_04:
|
||||
case GO_PRISON_DOOR_05:
|
||||
case GO_SUMMON_DOOR:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0];
|
||||
case TYPE_BROGGOK_EVENT: return m_auiEncounter[1];
|
||||
case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2];
|
||||
case DATA_THE_MAKER:
|
||||
return TheMakerGUID;
|
||||
case DATA_BROGGOK:
|
||||
return BroggokGUID;
|
||||
case DATA_KELIDAN_THE_BREAKER:
|
||||
return KelidanTheBreakerGUID;
|
||||
case DATA_BROGGOK_LEVER:
|
||||
return BroggokLeverGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* Save()
|
||||
bool SetBossState(uint32 type, EncounterState state) OVERRIDE
|
||||
{
|
||||
return str_data.c_str();
|
||||
}
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
void Load(const char* in) OVERRIDE
|
||||
{
|
||||
if (!in)
|
||||
switch (type)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2];
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void UpdateBroggokEvent(uint32 data)
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
ActivateCell(DATA_PRISON_CELL5);
|
||||
HandleGameObject(Door4GUID, false);
|
||||
case DATA_BROGGOK:
|
||||
switch (state)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
ActivateCell(DATA_PRISON_CELL5);
|
||||
break;
|
||||
case NOT_STARTED:
|
||||
ResetPrisons();
|
||||
if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
|
||||
lever->Respawn();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NOT_STARTED:
|
||||
ResetPrisons();
|
||||
HandleGameObject(Door5GUID, false);
|
||||
HandleGameObject(Door4GUID, true);
|
||||
if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID))
|
||||
lever->Respawn();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ResetPrisons()
|
||||
{
|
||||
PrisonerCounter5 = PrisonersCell5.size();
|
||||
ResetPrisoners(PrisonersCell5);
|
||||
HandleGameObject(PrisonCell5GUID, false);
|
||||
HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL5 - DATA_PRISON_CELL1], false);
|
||||
|
||||
PrisonerCounter6 = PrisonersCell6.size();
|
||||
ResetPrisoners(PrisonersCell6);
|
||||
HandleGameObject(PrisonCell6GUID, false);
|
||||
HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL6 - DATA_PRISON_CELL1], false);
|
||||
|
||||
PrisonerCounter7 = PrisonersCell7.size();
|
||||
ResetPrisoners(PrisonersCell7);
|
||||
HandleGameObject(PrisonCell7GUID, false);
|
||||
HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL7 - DATA_PRISON_CELL1], false);
|
||||
|
||||
PrisonerCounter8 = PrisonersCell8.size();
|
||||
ResetPrisoners(PrisonersCell8);
|
||||
HandleGameObject(PrisonCell8GUID, false);
|
||||
HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL8 - DATA_PRISON_CELL1], false);
|
||||
}
|
||||
|
||||
void ResetPrisoners(const std::set<uint64>& prisoners)
|
||||
@@ -367,7 +281,7 @@ class instance_blood_furnace : public InstanceMapScript
|
||||
else if (PrisonersCell7.find(guid) != PrisonersCell7.end() && --PrisonerCounter7 <= 0)
|
||||
ActivateCell(DATA_PRISON_CELL8);
|
||||
else if (PrisonersCell8.find(guid) != PrisonersCell8.end() && --PrisonerCounter8 <= 0)
|
||||
ActivateCell(DATA_DOOR5);
|
||||
ActivateCell(DATA_DOOR_4);
|
||||
}
|
||||
|
||||
void ActivateCell(uint8 id)
|
||||
@@ -375,30 +289,30 @@ class instance_blood_furnace : public InstanceMapScript
|
||||
switch (id)
|
||||
{
|
||||
case DATA_PRISON_CELL5:
|
||||
HandleGameObject(PrisonCell5GUID, true);
|
||||
HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
|
||||
ActivatePrisoners(PrisonersCell5);
|
||||
break;
|
||||
case DATA_PRISON_CELL6:
|
||||
HandleGameObject(PrisonCell6GUID, true);
|
||||
HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
|
||||
ActivatePrisoners(PrisonersCell6);
|
||||
break;
|
||||
case DATA_PRISON_CELL7:
|
||||
HandleGameObject(PrisonCell7GUID, true);
|
||||
HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
|
||||
ActivatePrisoners(PrisonersCell7);
|
||||
break;
|
||||
case DATA_PRISON_CELL8:
|
||||
HandleGameObject(PrisonCell8GUID, true);
|
||||
HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true);
|
||||
ActivatePrisoners(PrisonersCell8);
|
||||
break;
|
||||
case DATA_DOOR5:
|
||||
HandleGameObject(Door5GUID, true);
|
||||
case DATA_DOOR_4:
|
||||
HandleGameObject(PrisonDoor4GUID, true);
|
||||
if (Creature* broggok = instance->GetCreature(BroggokGUID))
|
||||
broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ActivatePrisoners(const std::set<uint64>& prisoners)
|
||||
void ActivatePrisoners(std::set<uint64> const& prisoners)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator i = prisoners.begin(); i != prisoners.end(); ++i)
|
||||
if (Creature* prisoner = instance->GetCreature(*i))
|
||||
@@ -407,6 +321,69 @@ class instance_blood_furnace : public InstanceMapScript
|
||||
prisoner->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData() OVERRIDE
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "B F " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* str) OVERRIDE
|
||||
{
|
||||
if (!str)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'B' && dataHead2 == 'F')
|
||||
{
|
||||
for (uint32 i = 0; i < EncounterCount; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 TheMakerGUID;
|
||||
uint64 BroggokGUID;
|
||||
uint64 KelidanTheBreakerGUID;
|
||||
|
||||
uint64 BroggokLeverGUID;
|
||||
uint64 PrisonDoor4GUID;
|
||||
|
||||
uint64 PrisonCellGUIDs[8];
|
||||
|
||||
std::set<uint64>PrisonersCell5;
|
||||
std::set<uint64>PrisonersCell6;
|
||||
std::set<uint64>PrisonersCell7;
|
||||
std::set<uint64>PrisonersCell8;
|
||||
|
||||
uint8 PrisonerCounter5;
|
||||
uint8 PrisonerCounter6;
|
||||
uint8 PrisonerCounter7;
|
||||
uint8 PrisonerCounter8;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
|
||||
|
||||
@@ -879,7 +879,7 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE)
|
||||
if (GetId() == SPELL_DK_BLOOD_PRESENCE)
|
||||
target->CastSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, true);
|
||||
else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED))
|
||||
@@ -890,7 +890,7 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_DK_FROST_PRESENCE)
|
||||
if (GetId() == SPELL_DK_FROST_PRESENCE)
|
||||
target->CastSpell(target, SPELL_DK_FROST_PRESENCE_TRIGGERED, true);
|
||||
else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED))
|
||||
@@ -901,12 +901,12 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE)
|
||||
if (GetId() == SPELL_DK_UNHOLY_PRESENCE)
|
||||
target->CastSpell(target, SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, true);
|
||||
|
||||
if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0))
|
||||
{
|
||||
if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE)
|
||||
if (GetId() == SPELL_DK_UNHOLY_PRESENCE)
|
||||
{
|
||||
// Not listed as any effect, only base points set
|
||||
int32 bp = impAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
|
||||
Reference in New Issue
Block a user