Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From fa7d2e4d4fb37634b899776ef0923969892a0408 Mon Sep 17 00:00:00 2001
- From: lobuz <lobuz87@gmail.com>
- Date: Thu, 28 Apr 2011 13:44:36 +0200
- Subject: [PATCH 1/3] [Signum/Scripts] Init scripts for 'The Stonecore' and rename Emu name
- ---
- .../TheStonecore/instance_the_stonecore.cpp | 183 +++++++++++++++++
- .../EasternKingdoms/TheStonecore/the_stonecore.cpp | 209 ++++++++++++++++++++
- .../EasternKingdoms/TheStonecore/the_stonecore.h | 51 +++++
- src/server/shared/SystemConfig.h | 2 +-
- 4 files changed, 444 insertions(+), 1 deletions(-)
- create mode 100644 src/server/scripts/EasternKingdoms/TheStonecore/instance_the_stonecore.cpp
- create mode 100644 src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.cpp
- create mode 100644 src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.h
- diff --git a/src/server/scripts/EasternKingdoms/TheStonecore/instance_the_stonecore.cpp b/src/server/scripts/EasternKingdoms/TheStonecore/instance_the_stonecore.cpp
- new file mode 100644
- index 0000000..1c043dd
- --- /dev/null
- +++ b/src/server/scripts/EasternKingdoms/TheStonecore/instance_the_stonecore.cpp
- @@ -0,0 +1,183 @@
- +/*
- + * Copyright (C) 2010-2011
- + * Author: Jakub "lobuz" Trojanowski
- + * email: lobuz87@gmail.com
- + */
- +
- +#include "ScriptPCH.h"
- +#include "the_stonecore.h"
- +
- +#define MAX_ENCOUNTER 4
- +
- +class instance_the_stonecore : public InstanceMapScript
- +{
- +public:
- + instance_the_stonecore() : InstanceMapScript("instance_the_stonecore", 111) { }
- +
- + InstanceScript* GetInstanceScript(InstanceMap* pMap) const
- + {
- + return new instance_the_stonecore_InstanceMapScript(pMap);
- + }
- +
- + struct instance_the_stonecore_InstanceMapScript : public InstanceScript
- + {
- + instance_the_stonecore_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {};
- +
- + uint64 uiCorborus;
- + uint64 uiSlabhide;
- + uint64 uiOzruk;
- + uint64 uiHighPriestessAzil;
- + uint32 uiTeamInInstance;
- + uint32 uiEncounter[MAX_ENCOUNTER];
- +
- + void Initialize()
- + {
- + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- + uiEncounter[i] = NOT_STARTED;
- +
- + uiCorborus = 0;
- + uiSlabhide = 0;
- + uiOzruk = 0;
- + uiHighPriestessAzil = 0;
- +
- + }
- +
- + bool IsEncounterInProgress() const
- + {
- + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- + if (uiEncounter[i] == IN_PROGRESS)
- + return true;
- +
- + return false;
- + }
- +
- + void OnCreatureCreate(Creature* pCreature, bool /*add*/)
- + {
- + Map::PlayerList const &players = instance->GetPlayers();
- +
- + if (!players.isEmpty())
- + {
- + if (Player* pPlayer = players.begin()->getSource())
- + uiTeamInInstance = pPlayer->GetTeam();
- + }
- +
- + switch(pCreature->GetEntry())
- + {
- + case BOSS_CORBORUS:
- + uiCorborus = pCreature->GetGUID();
- + break;
- + case BOSS_SLABHIDE:
- + uiSlabhide = pCreature->GetGUID();
- + break;
- + case BOSS_OZRUK:
- + uiOzruk = pCreature->GetGUID();
- + break;
- + case BOSS_HIGH_PRIESTESS_AZIL:
- + uiHighPriestessAzil = pCreature->GetGUID();
- + break;
- + }
- + }
- +
- + uint64 GetData64(uint32 identifier)
- + {
- + switch(identifier)
- + {
- + case DATA_CORBORUS: return uiCorborus;
- + case DATA_SLABHIDE: return uiSlabhide;
- + case DATA_OZRUK: return uiOzruk;
- + case DATA_HIGH_PRIESTESS_AZIL: return uiHighPriestessAzil;
- + }
- +
- + return 0;
- + }
- +
- + void SetData(uint32 type, uint32 data)
- + {
- + switch(type)
- + {
- + case DATA_CORBORUS_EVENT:
- + uiEncounter[0] = data;
- + break;
- + case DATA_SLABHIDE_EVENT:
- + uiEncounter[1] = data;
- + break;
- + case DATA_OZRUK_EVENT:
- + uiEncounter[2] = data;
- + break;
- + case DATA_HIGH_PRIESTESS_AZIL_EVENT:
- + uiEncounter[3] = data;
- + break;
- + }
- +
- + if (data == DONE)
- + SaveToDB();
- + }
- +
- + uint32 GetData(uint32 type)
- + {
- + switch(type)
- + {
- + case DATA_CORBORUS_EVENT: return uiEncounter[0];
- + case DATA_SLABHIDE_EVENT: return uiEncounter[1];
- + case DATA_OZRUK_EVENT: return uiEncounter[2];
- + case DATA_HIGH_PRIESTESS_AZIL_EVENT: return uiEncounter[3];
- + }
- +
- + return 0;
- + }
- +
- + std::string GetSaveData()
- + {
- + OUT_SAVE_INST_DATA;
- +
- + std::string str_data;
- +
- + std::ostringstream saveStream;
- + saveStream << "P S " << uiEncounter[0] << " " << uiEncounter[1] << " " << uiEncounter[2] << " " << uiEncounter[3];
- +
- + str_data = saveStream.str();
- +
- + OUT_SAVE_INST_DATA_COMPLETE;
- + return str_data;
- + }
- +
- + void Load(const char* in)
- + {
- + if (!in)
- + {
- + OUT_LOAD_INST_DATA_FAIL;
- + return;
- + }
- +
- + OUT_LOAD_INST_DATA(in);
- +
- + char dataHead1, dataHead2;
- + uint16 data0, data1, data2, data3;
- +
- + std::istringstream loadStream(in);
- + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
- +
- + if (dataHead1 == 'P' && dataHead2 == 'S')
- + {
- + uiEncounter[0] = data0;
- + uiEncounter[1] = data1;
- + uiEncounter[2] = data2;
- + uiEncounter[3] = data3;
- +
- + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- + if (uiEncounter[i] == IN_PROGRESS)
- + uiEncounter[i] = NOT_STARTED;
- +
- + } else OUT_LOAD_INST_DATA_FAIL;
- +
- + OUT_LOAD_INST_DATA_COMPLETE;
- + }
- + };
- +
- +};
- +
- +
- +void AddSC_instance_the_stonecore()
- +{
- + new instance_the_stonecore();
- +}
- diff --git a/src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.cpp b/src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.cpp
- new file mode 100644
- index 0000000..808a7b1
- --- /dev/null
- +++ b/src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.cpp
- @@ -0,0 +1,209 @@
- +/*
- + * Copyright (C) 2010-2011
- + * Author: Jakub "lobuz" Trojanowski
- + * email: lobuz87@gmail.com
- + */
- +
- +#include "ScriptPCH.h"
- +#include "the_stonecore.h"
- +
- +/***************************************TRASH SPELLS*************************************/
- +// Crystalspawn Giant (42810) Health: 536,810 - 1,202,925
- +#define SPELL_QUAKE DUNGEON_MODE(81008,92631)
- +
- +// IMP (43014) Health: 4,468 - 7,749, Mana: 16,676 - 17,816
- +#define SPELL_FELL_FIREBALL DUNGEON_MODE(80344,92638)
- +
- +// Millhouse Manastorm (43391) Health: 386,505 - 513,248, Mana: 186,560 - 197,380
- +#define SPELL_BLUR 81216
- +#define SPELL_FEAR 81442
- +#define SPELL_FROSTBOLT_VOLLEY DUNGEON_MODE(81440,92642)
- +#define SPELL_IMPENDING_DOOM 86830
- +#define SPELL_SHADOW_BOLT DUNGEON_MODE(81439,92641)
- +#define SPELL_SHADOWFURY DUNGEON_MODE(81441,92644)
- +#define SPELL_TIGULE 81220
- +
- +// Rock Borer (43917,42845) Health: 6,702 - 11,624
- +#define SPELL_ROCK_BORE DUNGEON_MODE(80028,92630)
- +
- +// Stonecore Berserker (43430) Health: 312,753 - 387,450
- +#define SPELL_SCHARGE 81574
- +#define SPELL_SPINNING_SLASH 81568
- +
- +// Stonecore Bruiser (42692) Health: 590,491 - 1,202,925
- +#define SPELL_BODY_SLAM 80180
- +#define SPELL_SHOCKWAVE DUNGEON_MODE(80195,92640)
- +
- +// Stonecore Earthshaper (43537) Health: 250,201 - 309,960, Mana: 19,394
- +#define SPELL_DUST_STORM 81463
- +#define SPELL_FORCE_OF_EARTH 81459
- +#define SPELL_GROUND_SHOCK DUNGEON_MODE(81530,92628)
- +#define SPELL_LAVA_BURST DUNGEON_MODE(81576,92626)
- +
- +// Stonecore Flayer (42808) Health: 312,753 - 387,450
- +#define SPELL_FLAY 79922
- +
- +// Stonecore Magmalord (42789) Health: 312,753 - 387,450, Mana: 25,014 - 26,724
- +#define SPELL_IGNITE DUNGEON_MODE(80151,92636)
- +#define SPELL_MAGMA_ERUPTION 80038
- +
- +// Stonecore Rift Conjurer (42691) Health: 312,753 - 387,450, Mana: 16,676 - 17,816
- +#define SPELL_DEMON_PORTAL 80308
- +#define SPELL_SHADOWBOLT DUNGEON_MODE(80279,92637)
- +
- +//Stonecore Sentry (42695) Health: 6,702 - 11,624
- +// BIEGA ZA CREAPAMI I PRZYWOLUJE DO TARGETA
- +
- +// Stonecore Warbringer (42696) Health: 312,753 - 387,450
- +#define SPELL_CLAVE 15496
- +#define SPELL_RAGE 80158
- +
- +enum eEvents
- +{
- + EVENT_NONE,
- + EVENT_QUAKE,
- + EVENT_FELL_FIREBALL,
- + EVENT_BLUR,
- + EVENT_FEAR,
- + EVENT_FROSTBOLT_VOLLEY,
- + EVENT_IMPENDING_DOOM,
- + EVENT_SHADOW_BOLT,
- + EVENT_SHADOWFURY,
- + EVENT_TIGULE,
- + EVENT_ROCK_BORE,
- + EVENT_SCHARGE,
- + EVENT_SPINNING_SLASH,
- + EVENT_BODY_SLAM,
- + EVENT_SHOCKWAVE,
- + EVENT_DUST_STORM,
- + EVENT_FORCE_OF_EARTH,
- + EVENT_GROUND_SHOCK,
- + EVENT_LAVA_BURST,
- + EVENT_FLAY,
- + EVENT_IGNITE,
- + EVENT_MAGMA_ERUPTION,
- + EVENT_DEMON_PORTAL,
- + EVENT_SHADOWBOLT,
- + EVENT_CLAVE,
- + EVENT_RAGE,
- +};
- +
- +// Crystalspawn Giant (42810) AI
- +class mob_crystalspawn_giant : public CreatureScript
- +{
- +public:
- + mob_crystalspawn_giant() : CreatureScript("mob_crystalspawn_giant") { }
- +
- + CreatureAI* GetAI(Creature* pCreature) const
- + {
- + return new mob_crystalspawn_giantAI(pCreature);
- + }
- +
- + struct mob_crystalspawn_giantAI : public ScriptedAI
- + {
- + mob_crystalspawn_giantAI(Creature *c) : ScriptedAI(c)
- + {
- + }
- +
- + EventMap events;
- +
- + void Reset()
- + {
- + events.Reset();
- + }
- +
- + void EnterCombat(Unit* /*who*/)
- + {
- + events.ScheduleEvent(EVENT_QUAKE, 5000);
- + }
- +
- + void UpdateAI(const uint32 diff)
- + {
- + if (!UpdateVictim())
- + return;
- +
- + events.Update(diff);
- +
- + if (me->hasUnitState(UNIT_STAT_CASTING))
- + return;
- +
- + while (uint32 eventId = events.ExecuteEvent())
- + {
- + switch(eventId)
- + {
- + case EVENT_QUAKE:
- + DoCast(me->getVictim(), SPELL_QUAKE);
- + events.RescheduleEvent(EVENT_QUAKE, 7000);
- + return;
- + }
- + }
- +
- + DoMeleeAttackIfReady();
- + }
- + };
- +
- +};
- +
- +// Imp (43014)
- +class mob_impp : public CreatureScript
- +{
- +public:
- + mob_impp() : CreatureScript("mob_impp") { }
- +
- + CreatureAI* GetAI(Creature* pCreature) const
- + {
- + return new mob_imppAI(pCreature);
- + }
- +
- + struct mob_imppAI : public ScriptedAI
- + {
- + mob_imppAI(Creature *c) : ScriptedAI(c)
- + {
- + }
- +
- + EventMap events;
- +
- + void Reset()
- + {
- + events.Reset();
- + }
- +
- + void EnterCombat(Unit* /*who*/)
- + {
- + events.ScheduleEvent(EVENT_FELL_FIREBALL, 1000);
- + }
- +
- + void UpdateAI(const uint32 diff)
- + {
- + if (!UpdateVictim())
- + return;
- +
- + events.Update(diff);
- +
- + if (me->hasUnitState(UNIT_STAT_CASTING))
- + return;
- +
- + while (uint32 eventId = events.ExecuteEvent())
- + {
- + switch(eventId)
- + {
- + case EVENT_FELL_FIREBALL:
- + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
- + DoCast(pTarget, SPELL_FELL_FIREBALL);
- + events.RescheduleEvent(EVENT_FELL_FIREBALL, 1000);
- + return;
- + }
- + }
- +
- + DoMeleeAttackIfReady();
- + }
- + };
- +
- +};
- +
- +void AddSC_the_stonecore()
- +{
- + new mob_crystalspawn_giant();
- + new mob_impp();
- +
- +}
- \ No newline at end of file
- diff --git a/src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.h b/src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.h
- new file mode 100644
- index 0000000..5a033b0
- --- /dev/null
- +++ b/src/server/scripts/EasternKingdoms/TheStonecore/the_stonecore.h
- @@ -0,0 +1,51 @@
- +/*
- + * Copyright (C) 2010-2011
- + * Author: Jakub "lobuz" Trojanowski
- + * email: lobuz87@gmail.com
- + */
- +
- +#ifndef DEF_THE_STONECORE_H
- +#define DEF_THE_STONECORE_H
- +
- +enum Data
- +{
- + DATA_CORBORUS_EVENT,
- + DATA_SLABHIDE_EVENT,
- + DATA_OZRUK_EVENT,
- + DATA_HIGH_PRIESTESS_AZIL_EVENT,
- + DATA_TEAM_IN_INSTANCE,
- +};
- +
- +enum Data64
- +{
- + DATA_CORBORUS,
- + DATA_SLABHIDE,
- + DATA_OZRUK,
- + DATA_HIGH_PRIESTESS_AZIL,
- +};
- +
- +enum Creatures
- +{
- + // Boss
- + BOSS_CORBORUS = 43438,
- + BOSS_SLABHIDE = 43214,
- + BOSS_OZRUK = 42188,
- + BOSS_HIGH_PRIESTESS_AZIL = 42333,
- +
- + // Trash npc
- + CREATURE_CRYSTALSPAWN_GIANT = 42810,
- + CREATURE_IMP = 43014,
- + CREATURE_MILLHOUSE_MANASTORM = 43391,
- + CREATURE_ROCK_BORER = 43917,
- + CREATURE_ROCK_BORER2 = 42845,
- + CREATURE_STONECORE_BERSERKER = 43430,
- + CREATURE_STONECORE_BRUISER = 42692,
- + CREATURE_STONECORE_EARTHSHAPER = 43537,
- + CREATURE_STONECORE_FLAYER = 42808,
- + CREATURE_MAGMALORD = 42789,
- + CREATURE_RIFT_CONJURER = 42691,
- + CREATURE_STONECORE_SENTRY = 42695,
- + CREATURE_STONECORE_WARBRINGER = 42696,
- +};
- +
- +#endif
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement