mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
*Updated Kelidan the Breaker script - by Iskander
--HG-- branch : trunk
This commit is contained in:
6
sql/updates/935_world_scripts.sql
Normal file
6
sql/updates/935_world_scripts.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
DELETE FROM `creature` WHERE `id` = '17653';
|
||||
|
||||
UPDATE `gameobject_template` SET `flags` = '4' WHERE `entry` IN ('181766','181823');
|
||||
UPDATE `gameobject` SET `SpawnMask` = '3',`state` = '1' WHERE `id` IN ('181766','181823');
|
||||
|
||||
UPDATE `instance_template` SET `script` = 'instance_blood_furnace' WHERE `map` = '542';
|
||||
@@ -144,4 +144,5 @@ INSTALL(FILES
|
||||
927_characters.sql
|
||||
930_characters.sql
|
||||
933_world_scripts.sql
|
||||
935_world_scripts.sql
|
||||
DESTINATION share/trinity/sql/updates)
|
||||
|
||||
@@ -157,6 +157,8 @@ SET(trinityscript_LIB_SRCS
|
||||
scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp
|
||||
scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
|
||||
scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp
|
||||
scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp
|
||||
scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h
|
||||
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp
|
||||
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp
|
||||
scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp
|
||||
|
||||
@@ -191,6 +191,8 @@ scripts/zone/gruuls_lair/instance_gruuls_lair.cpp \
|
||||
scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp \
|
||||
scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp \
|
||||
scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp \
|
||||
scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp \
|
||||
scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h \
|
||||
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \
|
||||
scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \
|
||||
scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \
|
||||
|
||||
@@ -299,6 +299,7 @@ extern void AddSC_instance_gruuls_lair();
|
||||
extern void AddSC_boss_broggok();
|
||||
extern void AddSC_boss_kelidan_the_breaker();
|
||||
extern void AddSC_boss_the_maker();
|
||||
extern void AddSC_instance_blood_furnace();
|
||||
|
||||
//--Magtheridon's Lair
|
||||
extern void AddSC_boss_magtheridon();
|
||||
@@ -1503,6 +1504,7 @@ void ScriptsInit()
|
||||
AddSC_boss_broggok();
|
||||
AddSC_boss_kelidan_the_breaker();
|
||||
AddSC_boss_the_maker();
|
||||
AddSC_instance_blood_furnace();
|
||||
|
||||
//--Magtheridon's Lair
|
||||
AddSC_boss_magtheridon();
|
||||
|
||||
@@ -1431,6 +1431,14 @@
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Magtheridon's lair"
|
||||
|
||||
@@ -1608,6 +1608,14 @@
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Magtheridon's lair"
|
||||
|
||||
@@ -1601,6 +1601,14 @@
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\boss_the_maker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\def_blood_furnace.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\hellfire_citadel\blood_furnace\instance_blood_furnace.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Magtheridon's lair"
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Kelidan_The_Breaker
|
||||
SD%Complete: 60
|
||||
SDComment: Event with channeleres vs. boss not implemented yet
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Hellfire Citadel, Blood Furnace
|
||||
EndScriptData */
|
||||
|
||||
@@ -27,6 +27,7 @@ mob_shadowmoon_channeler
|
||||
EndContentData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_blood_furnace.h"
|
||||
|
||||
#define SAY_WAKE -1542000
|
||||
|
||||
@@ -40,6 +41,8 @@ EndContentData */
|
||||
#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
|
||||
@@ -47,8 +50,23 @@ EndContentData */
|
||||
#define SPELL_SHADOW_BOLT_VOLLEY 28599
|
||||
#define H_SPELL_SHADOW_BOLT_VOLLEY 40070
|
||||
|
||||
#define SPELL_BURNING_NOVA 30940
|
||||
#define SPELL_VORTEX 37370
|
||||
#define ENTRY_KELIDAN 17377
|
||||
#define ENTRY_CHANNELER 17653
|
||||
|
||||
const float ShadowmoonChannelers[5][4]=
|
||||
{
|
||||
{302,-87,-24.4,0.157},
|
||||
{321,-63.5,-24.6,4.887},
|
||||
{346,-74.5,-24.6,3.595},
|
||||
{344,-103.5,-24.5,2.356},
|
||||
{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
|
||||
{
|
||||
@@ -56,6 +74,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
for(int i=0; i<5; i++) Channelers[i] = NULL;
|
||||
Reset();
|
||||
}
|
||||
|
||||
@@ -66,19 +85,28 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
uint32 BurningNova_Timer;
|
||||
uint32 Firenova_Timer;
|
||||
uint32 Corruption_Timer;
|
||||
uint32 check_Timer;
|
||||
bool Firenova;
|
||||
bool addYell;
|
||||
Creature *Channelers[5];
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowVolley_Timer = 1000;
|
||||
BurningNova_Timer = 15000;
|
||||
Corruption_Timer = 5000;
|
||||
check_Timer = 0;
|
||||
Firenova = false;
|
||||
addYell = false;
|
||||
SummonChannelers();
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
DoScriptText(SAY_WAKE, m_creature);
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
@@ -93,21 +121,83 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelerEngaged(Unit* who)
|
||||
{
|
||||
if(who && !addYell)
|
||||
{
|
||||
addYell = true;
|
||||
switch(rand()%3)
|
||||
{
|
||||
case 0: DoScriptText(SAY_ADD_AGGRO_1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_ADD_AGGRO_2, m_creature); break;
|
||||
default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break;
|
||||
}
|
||||
}
|
||||
for(int i=0; i<5; i++)
|
||||
if(who && Channelers[i] && !Channelers[i]->isInCombat())
|
||||
Channelers[i]->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
void ChannelerDied(Unit* killer)
|
||||
{
|
||||
for(int i=0; i<5; i++)
|
||||
if(Channelers[i] && Channelers[i]->isAlive())
|
||||
return;
|
||||
if(killer)
|
||||
m_creature->AI()->AttackStart(killer);
|
||||
}
|
||||
|
||||
Creature* GetChanneled(Creature *channeler)
|
||||
{
|
||||
SummonChannelers();
|
||||
if(!channeler) return NULL;
|
||||
int i;
|
||||
for(i=0; i<5; i++)
|
||||
if(Channelers[i] && Channelers[i]->GetGUID()==channeler->GetGUID())
|
||||
break;
|
||||
return Channelers[(i+2)%5];
|
||||
}
|
||||
|
||||
void SummonChannelers()
|
||||
{
|
||||
for(int i=0; i<5; i++)
|
||||
if(!Channelers[i] || Channelers[i]->isDead())
|
||||
Channelers[i] = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summon)
|
||||
{
|
||||
for(int i=0; i<5; i++)
|
||||
if(!Channelers[i] || Channelers[i]->isDead())
|
||||
return;
|
||||
DoCast(m_creature,SPELL_EVOCATION);
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
DoScriptText(SAY_DIE, m_creature);
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_KELIDANEVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
|
||||
{
|
||||
if(check_Timer < diff)
|
||||
{
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
DoCast(m_creature,SPELL_EVOCATION);
|
||||
check_Timer = 5000;
|
||||
}else check_Timer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Firenova)
|
||||
{
|
||||
if (Firenova_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA);
|
||||
DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA,true);
|
||||
Firenova = false;
|
||||
ShadowVolley_Timer = 2000;
|
||||
}else Firenova_Timer -=diff;
|
||||
@@ -134,10 +224,18 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
|
||||
DoScriptText(SAY_NOVA, m_creature);
|
||||
|
||||
if (HeroicMode)
|
||||
DoCast(m_creature,SPELL_VORTEX);
|
||||
if(SpellEntry *nova = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BURNING_NOVA))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
DoCast(m_creature,SPELL_BURNING_NOVA);
|
||||
if (HeroicMode)
|
||||
DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
|
||||
|
||||
BurningNova_Timer = 20000+rand()%8000;
|
||||
Firenova_Timer= 5000;
|
||||
@@ -161,9 +259,7 @@ CreatureAI* GetAI_boss_kelidan_the_breaker(Creature *_Creature)
|
||||
#define H_SPELL_SHADOW_BOLT 15472
|
||||
|
||||
#define SPELL_MARK_OF_SHADOW 30937
|
||||
|
||||
#define SPELL_CHANNELING 0 //initial spell channeling boss/each other not known
|
||||
//when engaged all channelers must stop, trigger yell (SAY_ADD_AGGRO_*), and engage.
|
||||
#define SPELL_CHANNELING 39123
|
||||
|
||||
struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI
|
||||
{
|
||||
@@ -179,22 +275,46 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI
|
||||
|
||||
uint32 ShadowBolt_Timer;
|
||||
uint32 MarkOfShadow_Timer;
|
||||
uint32 check_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ShadowBolt_Timer = 1000+rand()%1000;
|
||||
MarkOfShadow_Timer = 5000+rand()%2000;
|
||||
check_Timer = 0;
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
//trigger boss to yell
|
||||
if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100))
|
||||
((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerEngaged(who);
|
||||
if (m_creature->IsNonMeleeSpellCasted(false))
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
DoStartMovement(who);
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100))
|
||||
((boss_kelidan_the_breakerAI*)Kelidan->AI())->ChannelerDied(Killer);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!m_creature->SelectHostilTarget() || !m_creature->getVictim())
|
||||
{
|
||||
if(check_Timer < diff)
|
||||
{
|
||||
if (!m_creature->IsNonMeleeSpellCasted(false))
|
||||
if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100))
|
||||
if(Creature *channeled = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature))
|
||||
DoCast(channeled,SPELL_CHANNELING);
|
||||
check_Timer = 5000;
|
||||
}else check_Timer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
if (MarkOfShadow_Timer < diff)
|
||||
{
|
||||
@@ -231,4 +351,4 @@ void AddSC_boss_kelidan_the_breaker()
|
||||
newscript->Name="mob_shadowmoon_channeler";
|
||||
newscript->GetAI = &GetAI_mob_shadowmoon_channeler;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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_KELIDANEVENT 1
|
||||
#endif
|
||||
@@ -0,0 +1,112 @@
|
||||
/* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Blood_Furnace
|
||||
SD%Complete: 85
|
||||
SDComment:
|
||||
SDCategory: Hellfire Citadel, Blood Furnace
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_blood_furnace.h"
|
||||
|
||||
#define ENTRY_DOOR1 181823
|
||||
#define ENTRY_DOOR2 181766
|
||||
|
||||
struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
|
||||
{
|
||||
instance_blood_furnace(Map *map) : ScriptedInstance(map) {Initialize();};
|
||||
|
||||
|
||||
uint64 Door1GUID;
|
||||
uint64 Door2GUID;
|
||||
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Door1GUID = 0;
|
||||
Door2GUID = 0;
|
||||
}
|
||||
|
||||
void OnObjectCreate(GameObject *go)
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case ENTRY_DOOR1: Door1GUID = go->GetGUID(); break;
|
||||
case ENTRY_DOOR2: Door2GUID = go->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
Player* GetPlayerInMap()
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if (Player* plr = itr->getSource())
|
||||
return plr;
|
||||
}
|
||||
}
|
||||
|
||||
debug_log("SD2: Instance Blood Furnace: GetPlayerInMap, but PlayerList is empty!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void HandleGameObject(uint64 guid, uint32 state)
|
||||
{
|
||||
Player *player = GetPlayerInMap();
|
||||
|
||||
if (!player || !guid)
|
||||
{
|
||||
debug_log("SD2: Blood Furnace: HandleGameObject fail");
|
||||
return;
|
||||
}
|
||||
|
||||
if (GameObject *go = GameObject::GetGameObject(*player,guid))
|
||||
go->SetGoState(state);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_KELIDANEVENT:
|
||||
if( data == DONE )
|
||||
{
|
||||
HandleGameObject(Door1GUID,0);
|
||||
HandleGameObject(Door2GUID,0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_blood_furnace(Map* map)
|
||||
{
|
||||
return new instance_blood_furnace(map);
|
||||
}
|
||||
|
||||
void AddSC_instance_blood_furnace()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_blood_furnace";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
Reference in New Issue
Block a user