diff options
author | tartalo <none@none> | 2009-11-02 16:56:34 +0100 |
---|---|---|
committer | tartalo <none@none> | 2009-11-02 16:56:34 +0100 |
commit | 0be1b0251c42d69b3685dd3b445a2a9c58738a50 (patch) | |
tree | f4995857fbca409da4fb742c487a64293e7e758a | |
parent | 46ebbdbba7c46c82625c13a86ac755e7cf512f94 (diff) |
Culling of Stratholme: Cleanup + instance script + main bosses combat AI.
Prerequisite for event script merge
--HG--
branch : trunk
7 files changed, 364 insertions, 92 deletions
diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp index a2fe66bb7ea..a8d5c40da9d 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp @@ -1,14 +1,30 @@ +/* +* 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 epoch -SDAuthor: LordVanMartin -SD%Complete: -SDComment: +SDAuthor: Tartalo +SD%Complete: 80 +SDComment: TODO: Intro, consecutive attacks to a random target durin time wrap, adjust timers SDCategory: Script Data End */ -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ #include "precompiled.h" #include "culling_of_stratholme.h" @@ -34,6 +50,11 @@ enum Yells SAY_SLAY_3 = -1595007, //"You were destined to fail. " SAY_DEATH = -1595008 //"*gurgles*" }; +enum CombatPhases +{ + INTRO, + COMBAT +}; struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI { @@ -41,11 +62,28 @@ struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI { pInstance = c->GetInstanceData(); } + + uint8 uiStep; + + uint32 uiStepTimer; + uint32 uiWoundingStrikeTimer; + uint32 uiTimeWarpTimer; + uint32 uiTimeStopTimer; + uint32 uiCurseOfExertionTimer; + + CombatPhases Phase; ScriptedInstance* pInstance; void Reset() { + uiStep = 1; + uiStepTimer = 26000; + uiCurseOfExertionTimer = 9300; + uiTimeWarpTimer = 25300; + uiTimeStopTimer = 21300; + uiWoundingStrikeTimer = 5300; + if (pInstance) pInstance->SetData(DATA_EPOCH_EVENT, NOT_STARTED); } @@ -58,14 +96,43 @@ struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI pInstance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) { + if (Phase == INTRO) + { + return; + } + //Return since we have no target if (!UpdateVictim()) return; + if (uiCurseOfExertionTimer < diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_CURSE_OF_EXERTION); + uiCurseOfExertionTimer = 9300; + } else uiCurseOfExertionTimer -= diff; + + if (uiWoundingStrikeTimer < diff) + { + DoCastVictim(HEROIC(SPELL_WOUNDING_STRIKE, H_SPELL_WOUNDING_STRIKE)); + uiWoundingStrikeTimer = 5300; + } else uiWoundingStrikeTimer -= diff; + + if (uiTimeStopTimer < diff) + { + DoCastAOE(SPELL_TIME_STOP); + uiTimeStopTimer = 21300; + } else uiTimeStopTimer -= diff; + + if (uiTimeWarpTimer < diff) + { + DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), m_creature); + DoCastAOE(SPELL_TIME_WARP); + uiTimeWarpTimer = 25300; + } else uiTimeWarpTimer -= diff; + DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_infinite.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_infinite.cpp index fef2d77d652..f3a128f909d 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_infinite.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_infinite.cpp @@ -1,3 +1,21 @@ +/* +* 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 +*/ + #include "precompiled.h" #include "culling_of_stratholme.h" diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp index e786cf84ced..64d662e7a1e 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp @@ -1,8 +1,26 @@ +/* +* 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 mal_ganis -SDAuthor: LordVanMartin -SD%Complete: -SDComment: +SDAuthor: Tartalo +SD%Complete: 80 +SDComment: TODO: Intro & outro SDCategory: Script Data End */ @@ -19,6 +37,7 @@ enum Spells SPELL_MIND_BLAST = 52722, //Inflicts 4163 to 4837 Shadow damage to an enemy. H_SPELL_MIND_BLAST = 58850, SPELL_SLEEP = 52721, //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target. + H_SPELL_SLEEP = 58849, SPELL_VAMPIRIC_TOUCH = 52723 //Heals the caster for half the damage dealt by a melee attack. }; @@ -44,6 +63,12 @@ enum Yells SAY_ESCAPE_SPEECH_2 = -1595025 }; +enum CombatPhases +{ + COMBAT, + OUTRO +}; + struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI { boss_mal_ganisAI(Creature *c) : ScriptedAI(c) @@ -51,17 +76,31 @@ struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI pInstance = c->GetInstanceData(); } - bool yelled, - yelled2, - yelled3; + uint32 uiCarrionSwarmTimer; + uint32 uiMindBlastTimer; + uint32 uiVampiricTouchTimer; + uint32 uiSleepTimer; + + uint8 uiOutroStep; + + bool bYelled; + bool bYelled2; + + Creature *pArthas; + CombatPhases Phase; ScriptedInstance* pInstance; void Reset() { - yelled = false; - yelled2 = false; - yelled3 = false; + bYelled = false; + bYelled2 = false; + pArthas = NULL; + Phase = COMBAT; + uiCarrionSwarmTimer = 6000; + uiMindBlastTimer = 11000; + uiVampiricTouchTimer = urand(10000,15000); + uiSleepTimer = urand(15000,20000); if (pInstance) pInstance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED); @@ -70,48 +109,84 @@ struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI void EnterCombat(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); + + pArthas = GetClosestCreatureWithEntry(m_creature, NPC_ARTHAS, 150.0f); if (pInstance) - pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS); + pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} void UpdateAI(const uint32 diff) { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!yelled) + switch(Phase) { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) - { - DoScriptText(SAY_30HEALTH, m_creature); - yelled = true; - } + case COMBAT: + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!bYelled && HealthBelowPct(30)) + { + DoScriptText(SAY_30HEALTH, m_creature); + bYelled = true; + } + + if (!bYelled2 && HealthBelowPct(15)) + { + DoScriptText(SAY_15HEALTH, m_creature); + bYelled2 = true; + } + + if (HealthBelowPct(1)) + { + //Handle Escape Event: Don't forget to add Player::RewardPlayerAndGroupAtEvent + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + uiOutroStep = 1; + Phase = OUTRO; + return; + } + + if (pArthas && pArthas->isDead()) + { + EnterEvadeMode(); + m_creature->DisappearAndDie(); + if (pInstance) + pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL); + } + + if (uiCarrionSwarmTimer < diff) + { + DoCastVictim(HEROIC(SPELL_CARRION_SWARM,H_SPELL_CARRION_SWARM)); + uiCarrionSwarmTimer = 7000; + } else uiCarrionSwarmTimer -= diff; + + if (uiMindBlastTimer < diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, HEROIC(SPELL_MIND_BLAST,H_SPELL_MIND_BLAST)); + } else uiMindBlastTimer -= diff; + + if (uiVampiricTouchTimer < diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_VAMPIRIC_TOUCH); + } else uiVampiricTouchTimer -= diff; + + if (uiSleepTimer < diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, HEROIC(SPELL_SLEEP,H_SPELL_SLEEP)); + uiSleepTimer = urand(15000,20000); + } else uiSleepTimer -= diff; + + DoMeleeAttackIfReady(); + break; } - - if (!yelled2) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) - { - DoScriptText(SAY_15HEALTH, m_creature); - yelled2 = true; - } - } - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) - { - //Handle Escape Event - } - - DoMeleeAttackIfReady(); } void JustDied(Unit* killer) { if (pInstance) - pInstance->SetData(DATA_MAL_GANIS_EVENT, NOT_STARTED); + pInstance->SetData(DATA_MAL_GANIS_EVENT, DONE); } void KilledUnit(Unit *victim) { diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp index 7235eb35072..375f883c36f 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp @@ -1,34 +1,49 @@ +/* +* 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 meathook -SDAuthor: LordVanMartin -SD%Complete: -SDComment: +SDAuthor: Tartalo +SD%Complete: 100 +SDComment: It may need timer adjustment SDCategory: Script Data End */ -/*** SQL START *** -update creature_template set scriptname = 'boss_meathook' where entry = ''; -*** SQL END ***/ #include "precompiled.h" #include "culling_of_stratholme.h" enum Spells { - SPELL_CONSTRICTING_CHAINS = 52696, //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. - H_SPELL_CONSTRICTING_CHAINS = 58823, - SPELL_DISEASE_EXPULSION = 52666, //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. - H_SPELL_DISEASE_EXPULSION = 58824, - SPELL_FRENZY = 58841 //Increases the caster's Physical damage by 10% for 30 sec. + SPELL_CONSTRICTING_CHAINS = 52696, //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. + H_SPELL_CONSTRICTING_CHAINS = 58823, + SPELL_DISEASE_EXPULSION = 52666, //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. + H_SPELL_DISEASE_EXPULSION = 58824, + SPELL_FRENZY = 58841 //Increases the caster's Physical damage by 10% for 30 sec. }; //not in db enum Yells { - SAY_AGGRO = -1595026, - SAY_SLAY_1 = -1595027, - SAY_SLAY_2 = -1595028, - SAY_SLAY_3 = -1595029, - SAY_SPAWN = -1595030, - SAY_DEATH = -1595031 + SAY_AGGRO = -1595026, + SAY_SLAY_1 = -1595027, + SAY_SLAY_2 = -1595028, + SAY_SLAY_3 = -1595029, + SAY_SPAWN = -1595030, + SAY_DEATH = -1595031 }; struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI @@ -36,6 +51,8 @@ struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI boss_meathookAI(Creature *c) : ScriptedAI(c) { pInstance = c->GetInstanceData(); + if (pInstance) + DoScriptText(SAY_SPAWN,m_creature); } uint32 uiChainTimer; @@ -47,8 +64,8 @@ struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI void Reset() { uiChainTimer = urand(12000,17000); //seen on video 13, 17, 15, 12, 16 - uiDiseaseTimer = urand(2000,3000); //approx 3s - uiFrenzyTimer = urand(20000,30000); //made it up + uiDiseaseTimer = urand(2000,4000); //approx 3s + uiFrenzyTimer = urand(21000,26000); //made it up if (pInstance) pInstance->SetData(DATA_MEATHOOK_EVENT, NOT_STARTED); @@ -62,10 +79,6 @@ struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI pInstance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS); } - void AttackStart(Unit* who) {} - - void MoveInLineOfSight(Unit* who, const uint32 diff) {} - void UpdateAI(const uint32 diff) { //Return since we have no target @@ -74,20 +87,21 @@ struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI if (uiDiseaseTimer <= diff) { - DoCast(m_creature->getVictim(), HEROIC(SPELL_DISEASE_EXPULSION,H_SPELL_DISEASE_EXPULSION)); + DoCastAOE(HEROIC(SPELL_DISEASE_EXPULSION,H_SPELL_DISEASE_EXPULSION)); uiDiseaseTimer = urand(1500,4000); } else uiDiseaseTimer -= diff; if (uiFrenzyTimer <= diff) { - DoCast(m_creature->getVictim(), SPELL_FRENZY); - uiFrenzyTimer = urand(20000,30000); + DoCast(m_creature, SPELL_FRENZY); + uiFrenzyTimer = urand(21000,26000); } else uiFrenzyTimer -= diff; if (uiChainTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), HEROIC(SPELL_CONSTRICTING_CHAINS,H_SPELL_CONSTRICTING_CHAINS)); //anyone but the tank - uiChainTimer = urand(2000,3000); + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, HEROIC(SPELL_CONSTRICTING_CHAINS,H_SPELL_CONSTRICTING_CHAINS)); //anyone but the tank + uiChainTimer = urand(2000,4000); } else uiChainTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp index b8896652aed..d7d5cf44ab0 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp @@ -1,8 +1,26 @@ +/* +* 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 salramm -SDAuthor: LordVanMartin -SD%Complete: -SDComment: +SDAuthor: Tartalo +SD%Complete: 80 +SDComment: TODO: Intro SDCategory: Script Data End */ @@ -94,8 +112,8 @@ struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI //Shadow bolt timer if (Shadow_bolt_Timer <= diff) { - if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(random_pTarget, HEROIC(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT)); + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, HEROIC(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT)); Shadow_bolt_Timer = urand(8000,12000); } else Shadow_bolt_Timer -= diff; diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h index d5c2acae277..5c3e4228cab 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h @@ -1,3 +1,21 @@ +/* +* 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 +*/ + #ifndef DEF_CULLING_OF_STRATHOLME_H #define DEF_CULLING_OF_STRATHOLME_H @@ -16,15 +34,28 @@ enum Data64 DATA_SALRAMM, DATA_EPOCH, DATA_MAL_GANIS, - DATA_INFINITE + DATA_INFINITE, + DATA_SHKAF_GATE, + DATA_MAL_GANIS_GATE_1, + DATA_MAL_GANIS_GATE_2, + DATA_MAL_GANIS_CHEST +}; + +enum Creatures +{ + NPC_MEATHOOK = 26529, + NPC_SALRAMM = 26530, + NPC_EPOCH = 26532, + NPC_MAL_GANIS = 26533, + NPC_INFINITE = 32273, + NPC_ARTHAS = 26499 }; -enum Bosses +enum GameObjects { - CREATURE_MEATHOOK = 26529, - CREATURE_SALRAMM = 26530, - CREATURE_EPOCH = 26532, - CREATURE_MAL_GANIS = 26533, - CREATURE_INFINITE = 32273 + GO_SHKAF_GATE = 188686, + GO_MALGANIS_GATE_1 = 187711, + GO_MALGANIS_GATE_2 = 187723, + GO_MALGANIS_CHEST = 190663 }; #endif diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp index effa2003b6c..b70b1152fc9 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp @@ -1,3 +1,21 @@ +/* +* 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 +*/ + #include "precompiled.h" #include "culling_of_stratholme.h" @@ -20,6 +38,11 @@ struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance uint64 uiEpoch; uint64 uiMalGanis; uint64 uiInfinite; + + uint64 uiShkafGate; + uint64 uiMalGanisGate1; + uint64 uiMalGanisGate2; + uint64 uiMalGanisChest; uint8 m_auiEncounter[MAX_ENCOUNTER]; std::string str_data; @@ -36,23 +59,42 @@ struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance { switch(pCreature->GetEntry()) { - case CREATURE_MEATHOOK: + case NPC_MEATHOOK: uiMeathook = pCreature->GetGUID(); break; - case CREATURE_SALRAMM: + case NPC_SALRAMM: uiSalramm = pCreature->GetGUID(); break; - case CREATURE_EPOCH: + case NPC_EPOCH: uiEpoch = pCreature->GetGUID(); break; - case CREATURE_MAL_GANIS: + case NPC_MAL_GANIS: uiMalGanis = pCreature->GetGUID(); break; - case CREATURE_INFINITE: + case NPC_INFINITE: uiInfinite = pCreature->GetGUID(); break; } } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case GO_SHKAF_GATE: + uiShkafGate = pGo->GetGUID(); + break; + case GO_MALGANIS_GATE_1: + uiMalGanisGate1 = pGo->GetGUID(); + break; + case GO_MALGANIS_GATE_2: + uiMalGanisGate2 = pGo->GetGUID(); + break; + case GO_MALGANIS_CHEST: + uiMalGanisChest = pGo->GetGUID(); + break; + } + } void SetData(uint32 type, uint32 data) { @@ -69,6 +111,9 @@ struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance break; case DATA_MAL_GANIS_EVENT: m_auiEncounter[3] = data; + GameObject *pGate; + if (data == IN_PROGRESS && (pGate = instance->GetGameObject(uiMalGanisGate2))) + pGate->SetGoState(GO_STATE_READY); break; case DATA_INFINITE_EVENT: m_auiEncounter[4] = data; @@ -99,7 +144,11 @@ struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance case DATA_MEATHOOK: return uiMeathook; case DATA_SALRAMM: return uiSalramm; case DATA_EPOCH: return uiEpoch; + case DATA_MAL_GANIS: return uiMalGanis; case DATA_INFINITE: return uiInfinite; + case DATA_MAL_GANIS_GATE_1: return uiMalGanisGate1; + case DATA_MAL_GANIS_GATE_2: return uiMalGanisGate2; + case DATA_MAL_GANIS_CHEST: return uiMalGanisChest; } return 0; } |