diff options
Diffstat (limited to 'src')
4 files changed, 212 insertions, 25 deletions
diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp index a906471832f..cdfc09f1434 100644 --- a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp @@ -1,36 +1,33 @@ /* -* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> -* -* 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 -*/ + * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> + * + * 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 + */ /* Script Data Start SDName: Boss dred -SDAuthor: LordVanMartin -SD%Complete: -SDComment: +SDAuthor: Manuel +SD%Complete: 100 % +SDComment: MAYBE need more improve the "Raptor Call". SDCategory: Script Data End */ -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ #include "precompiled.h" #include "drak_tharon_keep.h" -enum Spells +enum eSpells { SPELL_BELLOWING_ROAR = 44863, // fears the group, can be resisted/dispelled SPELL_GRIEVOUS_BITE = 48920, @@ -38,7 +35,15 @@ enum Spells SPELL_FEARSOME_ROAR = 48849, H_SPELL_FEARSOME_ROAR = 48849, //Not stacking, debuff SPELL_PIERCING_SLASH = 48878, //debuff -->Armor reduced by 75% - SPELL_RAPTOR_CALL = 59416 //dummy + SPELL_RAPTOR_CALL = 59416, //dummy + + SPELL_GUT_RIP = 49710, + SPELL_REND = 13738 +}; + +enum eArchivements +{ + ACHIEV_BETTER_OFF_DRED = 2039 }; struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI @@ -48,12 +53,26 @@ struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI pInstance = c->GetInstanceData(); } + uint32 BellowingRoarTimer; + uint32 GrievousBiteTimer; + uint32 ManglingSlashTimer; + uint32 FearsomeRoarTimer; + uint32 PiercingSlashTimer; + uint32 RaptorCallTimer; + ScriptedInstance* pInstance; void Reset() { if (pInstance) pInstance->SetData(DATA_DRED_EVENT,NOT_STARTED); + + BellowingRoarTimer = 33000; + GrievousBiteTimer = 20000; + ManglingSlashTimer = 18500; + FearsomeRoarTimer = urand(10000,20000); + PiercingSlashTimer = 17000; + RaptorCallTimer = 12000; } void EnterCombat(Unit* who) @@ -68,13 +87,63 @@ struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI if (!UpdateVictim()) return; + if (BellowingRoarTimer < diff) + { + DoCastAOE(SPELL_BELLOWING_ROAR, false); + BellowingRoarTimer = 40000; + } else BellowingRoarTimer -=diff; + + if (GrievousBiteTimer < diff) + { + DoCastVictim(SPELL_GRIEVOUS_BITE ,false); + GrievousBiteTimer = 20000; + } else GrievousBiteTimer -=diff; + + if (ManglingSlashTimer < diff) + { + DoCastVictim(SPELL_MANGLING_SLASH,false); + ManglingSlashTimer = 20000; + } else ManglingSlashTimer -=diff; + + if (FearsomeRoarTimer < diff) + { + DoCastAOE(HEROIC(SPELL_FEARSOME_ROAR, H_SPELL_FEARSOME_ROAR),false); + FearsomeRoarTimer = urand(16,18)*1000; + } else FearsomeRoarTimer -=diff; + + if (PiercingSlashTimer < diff) + { + DoCastVictim(SPELL_PIERCING_SLASH,false); + PiercingSlashTimer = 20000; + } else PiercingSlashTimer -=diff; + + if (RaptorCallTimer < diff) + { + DoCastVictim(SPELL_RAPTOR_CALL,false); + + float x,y,z; + + m_creature->GetClosePoint(x,y,z,m_creature->GetObjectSize()/3,10.0f); + m_creature->SummonCreature(26628,x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1000); + + m_creature->GetClosePoint(x,y,z,m_creature->GetObjectSize()/3,10.0f); + m_creature->SummonCreature(26641,x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1000); + + RaptorCallTimer = 20000; + } else RaptorCallTimer -=diff; + DoMeleeAttackIfReady(); } void JustDied(Unit* killer) { if (pInstance) + { pInstance->SetData(DATA_DRED_EVENT,DONE); + + if (HeroicMode && pInstance->GetData(DATA_KING_DRED_ACHIEV) == 6) + pInstance->DoCompleteAchievement(ACHIEV_BETTER_OFF_DRED); + } } }; @@ -83,11 +152,117 @@ CreatureAI* GetAI_boss_dred(Creature* pCreature) return new boss_dredAI (pCreature); } +struct TRINITY_DLL_DECL npc_drakkari_gutripperAI : public ScriptedAI +{ + npc_drakkari_gutripperAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 GutRipTimer; + + void Reset() + { + GutRipTimer = urand(10,15)*1000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (GutRipTimer < diff) + { + DoCastVictim(SPELL_GUT_RIP,false); + GutRipTimer = urand(10,15)*1000; + }else GutRipTimer -=diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + if (pInstance) + { + if (m_creature->GetMap()->IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6) + { + pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1); + } + } + } +}; + +CreatureAI* GetAI_npc_drakkari_gutripper(Creature* pCreature) +{ + return new npc_drakkari_gutripperAI (pCreature); +} + +struct TRINITY_DLL_DECL npc_drakkari_scytheclawAI : public ScriptedAI +{ + npc_drakkari_scytheclawAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 RendTimer; + + void Reset() + { + RendTimer = urand(10,15)*1000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (RendTimer < diff) + { + DoCastVictim(SPELL_REND,false); + RendTimer = urand(10,15)*1000; + }else RendTimer -=diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + if (pInstance) + { + if (m_creature->GetMap()->IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6) + { + pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1); + } + } + } +}; + +CreatureAI* GetAI_npc_drakkari_scytheclaw(Creature* pCreature) +{ + return new npc_drakkari_scytheclawAI (pCreature); +} + void AddSC_boss_dred() { Script *newscript; newscript = new Script; + newscript->Name = "npc_drakkari_gutripper"; + newscript->GetAI = &GetAI_npc_drakkari_gutripper; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_drakkari_scytheclaw"; + newscript->GetAI = &GetAI_npc_drakkari_scytheclaw; + newscript->RegisterSelf(); + + newscript = new Script; newscript->Name = "boss_dred"; newscript->GetAI = &GetAI_boss_dred; newscript->RegisterSelf(); diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/drak_tharon_keep.h b/src/bindings/scripts/scripts/northrend/draktharon_keep/drak_tharon_keep.h index 544bfa78cc5..bfa447e58c7 100644 --- a/src/bindings/scripts/scripts/northrend/draktharon_keep/drak_tharon_keep.h +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/drak_tharon_keep.h @@ -23,7 +23,8 @@ enum Data DATA_TROLLGORE_EVENT, DATA_NOVOS_EVENT, DATA_DRED_EVENT, - DATA_THARON_JA_EVENT + DATA_THARON_JA_EVENT, + DATA_KING_DRED_ACHIEV }; enum Data64 { diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp index 08529a58a62..2925c69c873 100644 --- a/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp @@ -20,6 +20,7 @@ #include "drak_tharon_keep.h" #define MAX_ENCOUNTER 4 + /* Drak'Tharon Keep encounters: 0 - Trollgore 1 - Novos @@ -46,6 +47,8 @@ struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance { instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + uint8 uiDredAchievCounter; + uint64 uiTrollgore; uint64 uiNovos; uint64 uiDred; @@ -70,6 +73,7 @@ struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance uiNovosCrystal2 = 0; uiNovosCrystal3 = 0; uiNovosCrystal4 = 0; + uiDredAchievCounter = 0; } bool IsEncounterInProgress() const @@ -151,6 +155,10 @@ struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance case DATA_THARON_JA_EVENT: m_auiEncounter[3] = data; break; + + case DATA_KING_DRED_ACHIEV: + uiDredAchievCounter = data; + break; } if (data == DONE) @@ -167,6 +175,7 @@ struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance case DATA_NOVOS_EVENT: return m_auiEncounter[1]; case DATA_DRED_EVENT: return m_auiEncounter[2]; case DATA_THARON_JA_EVENT: return m_auiEncounter[3]; + case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter; } return 0; } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 5b70484d5c7..3cf0eb61b7c 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -343,6 +343,7 @@ extern void AddSC_boss_emalon(); extern void AddSC_instance_archavon(); extern void AddSC_boss_trollgore(); //Drak'Tharon Keep extern void AddSC_boss_novos(); +extern void AddSC_boss_dred(); extern void AddSC_boss_tharon_ja(); extern void AddSC_instance_drak_tharon(); extern void AddSC_boss_cyanigosa(); //Violet Hold @@ -789,6 +790,7 @@ void AddScripts() AddSC_instance_archavon(); AddSC_boss_trollgore(); //Drak'Tharon Keep AddSC_boss_novos(); + AddSC_boss_dred(); AddSC_boss_tharon_ja(); AddSC_instance_drak_tharon(); AddSC_boss_cyanigosa(); //Violet Hold |
