diff options
3 files changed, 492 insertions, 438 deletions
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index cf9346e1ce4..5be5e38e8a8 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -25,169 +25,184 @@ EndScriptData */ #include "ScriptPCH.h" -#define SAY_AGGRO -1553000 -#define SAY_KILL_1 -1553001 -#define SAY_KILL_2 -1553002 -#define SAY_TREE_1 -1553003 -#define SAY_TREE_2 -1553004 -#define SAY_DEATH -1553005 +enum eSays +{ + SAY_AGGRO = -1553000, + SAY_KILL_1 = -1553001, + SAY_KILL_2 = -1553002, + SAY_TREE_1 = -1553003, + SAY_TREE_2 = -1553004, + SAY_DEATH = -1553005, +}; -#define SPELL_TRANQUILITY 34550 -#define SPELL_TREE_FORM 34551 +enum eSpells +{ + SPELL_TRANQUILITY = 34550, + SPELL_TREE_FORM = 34551, + SPELL_SUMMON_FRAYER = 34557, + SPELL_PLANT_WHITE = 34759, + SPELL_PLANT_GREEN = 34761, + SPELL_PLANT_BLUE = 34762, + SPELL_PLANT_RED = 34763, +}; -#define SPELL_SUMMON_FRAYER 34557 #define ENTRY_FRAYER 19953 -#define SPELL_PLANT_WHITE 34759 -#define SPELL_PLANT_GREEN 34761 -#define SPELL_PLANT_BLUE 34762 -#define SPELL_PLANT_RED 34763 - -struct boss_high_botanist_freywinnAI : public ScriptedAI +class boss_high_botanist_freywinn : public CreatureScript { - boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} - - std::list<uint64> Adds_List; - - uint32 SummonSeedling_Timer; - uint32 TreeForm_Timer; - uint32 MoveCheck_Timer; - uint32 DeadAddsCount; - bool MoveFree; - - void Reset() - { - Adds_List.clear(); - - SummonSeedling_Timer = 6000; - TreeForm_Timer = 30000; - MoveCheck_Timer = 1000; - DeadAddsCount = 0; - MoveFree = true; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_FRAYER) - Adds_List.push_back(summoned->GetGUID()); - } - - void DoSummonSeedling() - { - switch(rand()%4) + public: + + boss_high_botanist_freywinn() + : CreatureScript("boss_high_botanist_freywinn") { - case 0: DoCast(me, SPELL_PLANT_WHITE); break; - case 1: DoCast(me, SPELL_PLANT_GREEN); break; - case 2: DoCast(me, SPELL_PLANT_BLUE); break; - case 3: DoCast(me, SPELL_PLANT_RED); break; } - } - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } + struct boss_high_botanist_freywinnAI : public ScriptedAI + { + boss_high_botanist_freywinnAI(Creature* pCreature) : ScriptedAI(pCreature) {} - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } + std::list<uint64> Adds_List; - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; + uint32 SummonSeedling_Timer; + uint32 TreeForm_Timer; + uint32 MoveCheck_Timer; + uint32 DeadAddsCount; + bool MoveFree; - if (TreeForm_Timer <= diff) - { - DoScriptText(RAND(SAY_TREE_1,SAY_TREE_2), me); + void Reset() + { + Adds_List.clear(); - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); + SummonSeedling_Timer = 6000; + TreeForm_Timer = 30000; + MoveCheck_Timer = 1000; + DeadAddsCount = 0; + MoveFree = true; + } - me->RemoveAllAuras(); + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } - DoCast(me, SPELL_SUMMON_FRAYER, true); - DoCast(me, SPELL_TRANQUILITY, true); - DoCast(me, SPELL_TREE_FORM, true); + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_FRAYER) + Adds_List.push_back(summoned->GetGUID()); + } - me->GetMotionMaster()->MoveIdle(); - MoveFree = false; + void DoSummonSeedling() + { + switch(rand()%4) + { + case 0: DoCast(me, SPELL_PLANT_WHITE); break; + case 1: DoCast(me, SPELL_PLANT_GREEN); break; + case 2: DoCast(me, SPELL_PLANT_BLUE); break; + case 3: DoCast(me, SPELL_PLANT_RED); break; + } + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } - TreeForm_Timer = 75000; - } else TreeForm_Timer -= diff; + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } - if (!MoveFree) - { - if (MoveCheck_Timer <= diff) + void UpdateAI(const uint32 diff) { - if (!Adds_List.empty()) + if (!UpdateVictim()) + return; + + if (TreeForm_Timer <= diff) { - for (std::list<uint64>::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) + DoScriptText(RAND(SAY_TREE_1,SAY_TREE_2), me); + + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + me->RemoveAllAuras(); + + DoCast(me, SPELL_SUMMON_FRAYER, true); + DoCast(me, SPELL_TRANQUILITY, true); + DoCast(me, SPELL_TREE_FORM, true); + + me->GetMotionMaster()->MoveIdle(); + MoveFree = false; + + TreeForm_Timer = 75000; + } + else + TreeForm_Timer -= diff; + + if (!MoveFree) + { + if (MoveCheck_Timer <= diff) { - if (Unit *temp = Unit::GetUnit(*me,*itr)) + if (!Adds_List.empty()) { - if (!temp->isAlive()) + for (std::list<uint64>::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) { - Adds_List.erase(itr); - ++DeadAddsCount; - break; + if (Unit *temp = Unit::GetUnit(*me,*itr)) + { + if (!temp->isAlive()) + { + Adds_List.erase(itr); + ++DeadAddsCount; + break; + } + } } } + + if (DeadAddsCount < 3 && TreeForm_Timer-30000 <= diff) + DeadAddsCount = 3; + + if (DeadAddsCount >= 3) + { + Adds_List.clear(); + DeadAddsCount = 0; + + me->InterruptNonMeleeSpells(true); + me->RemoveAllAuras(); + me->GetMotionMaster()->MoveChase(me->getVictim()); + MoveFree = true; + } + MoveCheck_Timer = 500; } + else + MoveCheck_Timer -= diff; + + return; } - if (DeadAddsCount < 3 && TreeForm_Timer-30000 <= diff) - DeadAddsCount = 3; + /*if (me->HasAura(SPELL_TREE_FORM,0) || me->HasAura(SPELL_TRANQUILITY,0)) + return;*/ - if (DeadAddsCount >= 3) + //one random seedling every 5 secs, but not in tree form + if (SummonSeedling_Timer <= diff) { - Adds_List.clear(); - DeadAddsCount = 0; + DoSummonSeedling(); + SummonSeedling_Timer = 6000; + } + else + SummonSeedling_Timer -= diff; - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->GetMotionMaster()->MoveChase(me->getVictim()); - MoveFree = true; - } - MoveCheck_Timer = 500; + DoMeleeAttackIfReady(); } - else MoveCheck_Timer -= diff; - - return; - } - - /*if (me->HasAura(SPELL_TREE_FORM,0) || me->HasAura(SPELL_TRANQUILITY,0)) - return;*/ + }; - //one random seedling every 5 secs, but not in tree form - if (SummonSeedling_Timer <= diff) + CreatureAI* GetAI(Creature* Creature) const { - DoSummonSeedling(); - SummonSeedling_Timer = 6000; - } else SummonSeedling_Timer -= diff; - - DoMeleeAttackIfReady(); - } + return new boss_high_botanist_freywinnAI (Creature); + } }; -CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) -{ - return new boss_high_botanist_freywinnAI (pCreature); -} - void AddSC_boss_high_botanist_freywinn() { - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_high_botanist_freywinn"; - newscript->GetAI = &GetAI_boss_high_botanist_freywinn; - newscript->RegisterSelf(); + new boss_high_botanist_freywinn(); } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index 8fc44da614c..21239c265d9 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -25,183 +25,200 @@ EndScriptData */ #include "ScriptPCH.h" -#define EMOTE_SUMMON -1553006 - -#define SPELL_ALLERGIC_REACTION 34697 -#define SPELL_TELEPORT_SELF 34673 - -#define SPELL_SUMMON_LASHER_1 34681 -#define SPELL_SUMMON_FLAYER_1 34682 -#define SPELL_SUMMON_LASHER_2 34684 -#define SPELL_SUMMON_FLAYER_2 34685 -#define SPELL_SUMMON_LASHER_3 34686 -#define SPELL_SUMMON_FLAYER_4 34687 -#define SPELL_SUMMON_LASHER_4 34688 -#define SPELL_SUMMON_FLAYER_3 34690 - -#define MODEL_DEFAULT 13109 -#define MODEL_ARCANE 14213 -#define MODEL_FIRE 13110 -#define MODEL_FROST 14112 -#define MODEL_NATURE 14214 - -struct boss_lajAI : public ScriptedAI +enum eSpells +{ + SPELL_ALLERGIC_REACTION = 34697, + SPELL_TELEPORT_SELF = 34673, + + SPELL_SUMMON_LASHER_1 = 34681, + SPELL_SUMMON_FLAYER_1 = 34682, + SPELL_SUMMON_LASHER_2 = 34684, + SPELL_SUMMON_FLAYER_2 = 34685, + SPELL_SUMMON_LASHER_3 = 34686, + SPELL_SUMMON_FLAYER_4 = 34687, + SPELL_SUMMON_LASHER_4 = 34688, + SPELL_SUMMON_FLAYER_3 = 34690, +}; +enum eOthers +{ + EMOTE_SUMMON = -1553006, + MODEL_DEFAULT = 13109, + MODEL_ARCANE = 14213, + MODEL_FIRE = 13110, + MODEL_FROST = 14112, + MODEL_NATURE = 14214, +}; + +class boss_laj : public CreatureScript { - boss_lajAI(Creature *c) : ScriptedAI(c) {} - - bool CanSummon; - uint32 Teleport_Timer; - uint32 Summon_Timer; - uint32 Transform_Timer; - uint32 Allergic_Timer; - - void Reset() - { - me->SetDisplayId(MODEL_DEFAULT); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - CanSummon = false; - Teleport_Timer = 20000; - Summon_Timer = 2500; - Transform_Timer = 30000; - Allergic_Timer = 5000; - } - - void DoTransform() - { - switch(rand()%5) + public: + + boss_laj() + : CreatureScript("boss_laj") + { + } + + struct boss_lajAI : public ScriptedAI { - case 0: + boss_lajAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + bool CanSummon; + uint32 Teleport_Timer; + uint32 Summon_Timer; + uint32 Transform_Timer; + uint32 Allergic_Timer; + + void Reset() + { me->SetDisplayId(MODEL_DEFAULT); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 1: - me->SetDisplayId(MODEL_ARCANE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 2: - me->SetDisplayId(MODEL_FIRE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 3: - me->SetDisplayId(MODEL_FROST); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 4: - me->SetDisplayId(MODEL_NATURE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - break; - } - } - - void DoSummons() - { - switch(rand()%4) - { - case 0: - DoCast(me, SPELL_SUMMON_LASHER_1, true); - DoCast(me, SPELL_SUMMON_FLAYER_1, true); - break; - case 1: - DoCast(me, SPELL_SUMMON_LASHER_2, true); - DoCast(me, SPELL_SUMMON_FLAYER_2, true); - break; - case 2: - DoCast(me, SPELL_SUMMON_LASHER_3, true); - DoCast(me, SPELL_SUMMON_FLAYER_3, true); - break; - case 3: - DoCast(me, SPELL_SUMMON_LASHER_4, true); - DoCast(me, SPELL_SUMMON_FLAYER_4, true); - break; - } - CanSummon = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustSummoned(Creature *summon) - { - if (summon && me->getVictim()) - summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CanSummon) - { - if (Summon_Timer <= diff) - { - DoScriptText(EMOTE_SUMMON, me); - DoSummons(); + CanSummon = false; + Teleport_Timer = 20000; Summon_Timer = 2500; - } else Summon_Timer -= diff; - } + Transform_Timer = 30000; + Allergic_Timer = 5000; + } - if (Allergic_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ALLERGIC_REACTION); - Allergic_Timer = 25000+rand()%15000; - } else Allergic_Timer -= diff; + void DoTransform() + { + switch(rand()%5) + { + case 0: + me->SetDisplayId(MODEL_DEFAULT); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 1: + me->SetDisplayId(MODEL_ARCANE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 2: + me->SetDisplayId(MODEL_FIRE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 3: + me->SetDisplayId(MODEL_FROST); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 4: + me->SetDisplayId(MODEL_NATURE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + break; + } + } + + void DoSummons() + { + switch(rand()%4) + { + case 0: + DoCast(me, SPELL_SUMMON_LASHER_1, true); + DoCast(me, SPELL_SUMMON_FLAYER_1, true); + break; + case 1: + DoCast(me, SPELL_SUMMON_LASHER_2, true); + DoCast(me, SPELL_SUMMON_FLAYER_2, true); + break; + case 2: + DoCast(me, SPELL_SUMMON_LASHER_3, true); + DoCast(me, SPELL_SUMMON_FLAYER_3, true); + break; + case 3: + DoCast(me, SPELL_SUMMON_LASHER_4, true); + DoCast(me, SPELL_SUMMON_FLAYER_4, true); + break; + } + CanSummon = false; + } + + void EnterCombat(Unit * /*who*/) + { + } - if (Teleport_Timer <= diff) - { - DoCast(me, SPELL_TELEPORT_SELF); - Teleport_Timer = 30000+rand()%10000; - CanSummon = true; - } else Teleport_Timer -= diff; + void JustSummoned(Creature *summon) + { + if (summon && me->getVictim()) + summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } - if (Transform_Timer <= diff) + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CanSummon) + { + if (Summon_Timer <= diff) + { + DoScriptText(EMOTE_SUMMON, me); + DoSummons(); + Summon_Timer = 2500; + } + else + Summon_Timer -= diff; + } + + if (Allergic_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ALLERGIC_REACTION); + Allergic_Timer = 25000+rand()%15000; + } + else + Allergic_Timer -= diff; + + if (Teleport_Timer <= diff) + { + DoCast(me, SPELL_TELEPORT_SELF); + Teleport_Timer = 30000+rand()%10000; + CanSummon = true; + } + else + Teleport_Timer -= diff; + + if (Transform_Timer <= diff) + { + DoTransform(); + Transform_Timer = 25000+rand()%15000; + } + else + Transform_Timer -= diff; + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI_boss_laj(Creature* Creature) const { - DoTransform(); - Transform_Timer = 25000+rand()%15000; - } else Transform_Timer -= diff; - - DoMeleeAttackIfReady(); - } + return new boss_lajAI (Creature); + } }; -CreatureAI* GetAI_boss_laj(Creature* pCreature) -{ - return new boss_lajAI (pCreature); -} - void AddSC_boss_laj() { - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_laj"; - newscript->GetAI = &GetAI_boss_laj; - newscript->RegisterSelf(); + new boss_laj(); } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index d844b931a79..378d07857ca 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -25,194 +25,216 @@ EndScriptData */ #include "ScriptPCH.h" +enum eSays +{ + SAY_AGGRO = -1553007, + SAY_SLAY_1 = -1553008, + SAY_SLAY_2 = -1553009, + SAY_SUMMON_1 = -1553010, + SAY_SUMMON_2 = -1553011, + SAY_DEATH = -1553012, +}; + +enum eSpells +{ + WAR_STOMP = 34716, + SUMMON_TREANTS = 34727, // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) + ARCANE_VOLLEY = 36705, + ARCANE_VOLLEY_H = 39133, + SPELL_HEAL_FATHER = 6262, +}; + +enum eOthers +{ + CREATURE_TREANT = 19949, + TREANT_SPAWN_DIST = 50, //50 yards from Warp Splinter's spawn point +}; + +float treant_pos[6][3] = +{ + {24.301233, 427.221100, -27.060635}, + {16.795492, 359.678802, -27.355425}, + {53.493484, 345.381470, -26.196192}, + {61.867096, 439.362732, -25.921030}, + {109.861877, 423.201630, -27.356019}, + {106.780159, 355.582581, -27.593357} +}; + /*##### # mob_treant (Sapling) #####*/ - -#define SPELL_HEAL_FATHER 6262 - -struct mob_treantAI : public ScriptedAI +class mob_warp_splinter_treant : public CreatureScript { - mob_treantAI (Creature *c) : ScriptedAI(c) - { - WarpGuid = 0; - } + public: - uint64 WarpGuid; - uint32 check_Timer; + mob_warp_splinter_treant() + : CreatureScript("mob_warp_splinter_treant") + { + } + struct mob_warp_splinter_treantAI : public ScriptedAI + { + mob_warp_splinter_treantAI (Creature* pCreature) : ScriptedAI(pCreature) + { + WarpGuid = 0; + } + + uint64 WarpGuid; + uint32 check_Timer; - void Reset() - { - check_Timer = 0; - } + void Reset() + { + check_Timer = 0; + } - void EnterCombat(Unit * /*who*/) {} + void EnterCombat(Unit * /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (WarpGuid && check_Timer <= diff) + void UpdateAI(const uint32 diff) { - if (Unit *Warp = Unit::GetUnit(*me, WarpGuid)) + if (!UpdateVictim()) { - if (me->IsWithinMeleeRange(Warp,2.5f)) + if (WarpGuid && check_Timer <= diff) { - int32 CurrentHP_Treant = (int32)me->GetHealth(); - Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, me->GetGUID()); - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; + if (Unit *Warp = Unit::GetUnit(*me, WarpGuid)) + { + if (me->IsWithinMeleeRange(Warp,2.5f)) + { + int32 CurrentHP_Treant = (int32)me->GetHealth(); + Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, me->GetGUID()); + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + me->GetMotionMaster()->MoveFollow(Warp,0,0); + } + check_Timer = 1000; } - me->GetMotionMaster()->MoveFollow(Warp,0,0); + else + check_Timer -= diff; + return; } - check_Timer = 1000; - } else check_Timer -= diff; - return; - } - if (me->getVictim()->GetGUID() != WarpGuid) - DoMeleeAttackIfReady(); - } + if (me->getVictim()->GetGUID() != WarpGuid) + DoMeleeAttackIfReady(); + } + }; + CreatureAI* GetAI(Creature* Creature) const + { + return new mob_warp_splinter_treantAI (Creature); + } }; /*##### # boss_warp_splinter #####*/ +class boss_warp_splinter : public CreatureScript +{ + public: + + boss_warp_splinter() + : CreatureScript("boss_warp_splinter") + { + } + struct boss_warp_splinterAI : public ScriptedAI + { + boss_warp_splinterAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Treant_Spawn_Pos_X = pCreature->GetPositionX(); + Treant_Spawn_Pos_Y = pCreature->GetPositionY(); + } -#define SAY_AGGRO -1553007 -#define SAY_SLAY_1 -1553008 -#define SAY_SLAY_2 -1553009 -#define SAY_SUMMON_1 -1553010 -#define SAY_SUMMON_2 -1553011 -#define SAY_DEATH -1553012 + uint32 War_Stomp_Timer; + uint32 Summon_Treants_Timer; + uint32 Arcane_Volley_Timer; -#define WAR_STOMP 34716 -#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) -#define ARCANE_VOLLEY DUNGEON_MODE(36705, 39133) + float Treant_Spawn_Pos_X; + float Treant_Spawn_Pos_Y; -#define CREATURE_TREANT 19949 + void Reset() + { + War_Stomp_Timer = 25000 + rand()%15000; + Summon_Treants_Timer = 45000; + Arcane_Volley_Timer = 8000 + rand()%12000; -#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point + me->SetSpeed(MOVE_RUN, 0.7f, true); + } -float treant_pos[6][3] = -{ - {24.301233, 427.221100, -27.060635}, - {16.795492, 359.678802, -27.355425}, - {53.493484, 345.381470, -26.196192}, - {61.867096, 439.362732, -25.921030}, - {109.861877, 423.201630, -27.356019}, - {106.780159, 355.582581, -27.593357} -}; + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } -struct boss_warp_splinterAI : public ScriptedAI -{ - boss_warp_splinterAI(Creature *c) : ScriptedAI(c) - { - Treant_Spawn_Pos_X = c->GetPositionX(); - Treant_Spawn_Pos_Y = c->GetPositionY(); - } - - uint32 War_Stomp_Timer; - uint32 Summon_Treants_Timer; - uint32 Arcane_Volley_Timer; - - float Treant_Spawn_Pos_X; - float Treant_Spawn_Pos_Y; - - void Reset() - { - War_Stomp_Timer = 25000 + rand()%15000; - Summon_Treants_Timer = 45000; - Arcane_Volley_Timer = 8000 + rand()%12000; - - me->SetSpeed(MOVE_RUN, 0.7f, true); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void SummonTreants() - { - for (uint8 i = 0; i < 6; ++i) - { - float angle = (M_PI / 3) * i; + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } - float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); - float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); - float O = - me->GetAngle(X,Y); + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } - if (Creature *pTreant = me->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) - CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = me->GetGUID(); - } - DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2), me); - } + void SummonTreants() + { + for (uint8 i = 0; i < 6; ++i) + { + float angle = (M_PI / 3) * i; - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; + float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); + float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); + float O = - me->GetAngle(X,Y); - //Check for War Stomp - if (War_Stomp_Timer <= diff) - { - DoCast(me->getVictim(), WAR_STOMP); - War_Stomp_Timer = 25000 + rand()%15000; - } else War_Stomp_Timer -= diff; + if (Creature *pTreant = me->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) + CAST_AI(mob_warp_splinter_treant::mob_warp_splinter_treantAI, pTreant->AI())->WarpGuid = me->GetGUID(); + } + DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2), me); + } - //Check for Arcane Volley - if (Arcane_Volley_Timer <= diff) - { - DoCast(me->getVictim(), ARCANE_VOLLEY); - Arcane_Volley_Timer = 20000 + rand()%15000; - } else Arcane_Volley_Timer -= diff; + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; - //Check for Summon Treants - if (Summon_Treants_Timer <= diff) - { - SummonTreants(); - Summon_Treants_Timer = 45000; - } else Summon_Treants_Timer -= diff; + //Check for War Stomp + if (War_Stomp_Timer <= diff) + { + DoCast(me->getVictim(), WAR_STOMP); + War_Stomp_Timer = 25000 + rand()%15000; + } + else + War_Stomp_Timer -= diff; - DoMeleeAttackIfReady(); - } -}; + //Check for Arcane Volley + if (Arcane_Volley_Timer <= diff) + { + DoCast(me->getVictim(), DUNGEON_MODE(ARCANE_VOLLEY,ARCANE_VOLLEY_H)); + Arcane_Volley_Timer = 20000 + rand()%15000; + } + else + Arcane_Volley_Timer -= diff; + + //Check for Summon Treants + if (Summon_Treants_Timer <= diff) + { + SummonTreants(); + Summon_Treants_Timer = 45000; + } + else + Summon_Treants_Timer -= diff; -CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) -{ - return new boss_warp_splinterAI (pCreature); -} + DoMeleeAttackIfReady(); + } + }; -CreatureAI* GetAI_mob_treant(Creature* pCreature) -{ - return new mob_treantAI (pCreature); -} + CreatureAI* GetAI(Creature* Creature) const + { + return new boss_warp_splinterAI (Creature); + } +}; void AddSC_boss_warp_splinter() { - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_warp_splinter"; - newscript->GetAI = &GetAI_boss_warp_splinter; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_warp_splinter_treant"; - newscript->GetAI = &GetAI_mob_treant; - newscript->RegisterSelf(); + new boss_warp_splinter(); + new mob_warp_splinter_treant(); } |