diff options
| author | Machiavelli <none@none> | 2009-06-10 08:45:45 +0200 |
|---|---|---|
| committer | Machiavelli <none@none> | 2009-06-10 08:45:45 +0200 |
| commit | ee9beadbc20d24ec11346858db36c029c9c04b90 (patch) | |
| tree | ad8d5f89f9b7e1418c5bc00990370224b91453f3 /src/bindings/scripts | |
| parent | f137dc02ecadb515928655dd6603f33187731fec (diff) | |
| parent | c9d9ae1e491243f82be5ac84dc2ad51dfbae35eb (diff) | |
Merge
--HG--
branch : trunk
Diffstat (limited to 'src/bindings/scripts')
48 files changed, 1159 insertions, 548 deletions
diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am index 8d871dfcf25..466236c3418 100644 --- a/src/bindings/scripts/Makefile.am +++ b/src/bindings/scripts/Makefile.am @@ -270,6 +270,12 @@ scripts/zone/naxxramas/boss_sapphiron.cpp \ scripts/zone/naxxramas/boss_thaddius.cpp \ scripts/zone/naxxramas/instance_naxxramas.cpp \ scripts/zone/netherstorm/netherstorm.cpp \ +scripts/zone/nexus/nexus/boss_magus_telestra.cpp \ +scripts/zone/nexus/nexus/boss_anomalus.cpp \ +scripts/zone/nexus/nexus/boss_ormorok.cpp \ +scripts/zone/nexus/nexus/boss_keristrasza.cpp \ +scripts/zone/nexus/nexus/def_nexus.h \ +scripts/zone/nexus/nexus/instance_nexus.cpp \ scripts/zone/onyxias_lair/boss_onyxia.cpp \ scripts/zone/orgrimmar/orgrimmar.cpp \ scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp \ diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index e98ea3395cb..0a440fb8c10 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -401,6 +401,13 @@ extern void AddSC_instance_naxxramas(); //Netherstorm extern void AddSC_netherstorm(); +//The Nexus +extern void AddSC_boss_magus_telestra(); +extern void AddSC_boss_anomalus(); +extern void AddSC_boss_ormorok(); +extern void AddSC_boss_keristrasza(); +extern void AddSC_instance_nexus(); + //Onyxia's Lair extern void AddSC_boss_onyxia(); @@ -1286,6 +1293,13 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Netherstorm AddSC_netherstorm(); + //The Nexus + AddSC_boss_magus_telestra(); + AddSC_boss_anomalus(); + AddSC_boss_ormorok(); + AddSC_boss_keristrasza(); + AddSC_instance_nexus(); + //Onyxia's Lair AddSC_boss_onyxia(); diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 1a39f5b3947..afe05d56e58 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2514,22 +2514,30 @@ <Filter Name="Nexus" > - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp" - > - </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp" + > + </File> <File RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp" > @@ -2539,10 +2547,6 @@ > </File> <File - RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h" - > - </File> - <File RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp" > </File> diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index cfcbcc54059..bf6ee205867 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2513,22 +2513,30 @@ <Filter Name="Nexus" > - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp" - > - </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h" + > + </File> + <File + RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp" + > + </File> <File RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp" > @@ -2537,14 +2545,6 @@ RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp" > </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h" - > - </File> - <File - RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp" - > - </File> </Filter> <Filter Name="Oculus" diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp index 57584769cfa..fbe926ffba0 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -37,7 +37,7 @@ struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance IkissDoor = NULL; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp index f99f9a130aa..34bda60c1b7 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -240,9 +240,9 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if(who && !m_creature->getVictim() && m_creature->canStartAttack(who)) - AttackStart(who); - if (!Intro && who && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) { DoScriptText(SAY_INTRO, m_creature); Intro = true; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp index 37194a89b21..cc63d253d1b 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -69,7 +69,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance return false; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance std::string GetSaveData() { - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp index 595a05a727f..9e35d95cdcd 100644 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp @@ -69,9 +69,9 @@ struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch(creature_entry) + switch(creature->GetEntry()) { case 29309: Elder_Nadox = creature->GetGUID(); break; case 29308: Prince_Taldaram = creature->GetGUID(); break; @@ -142,7 +142,7 @@ struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance str_data = saveStream.str(); OUT_SAVE_INST_DATA_COMPLETE; - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp index 7e0252f2009..a054e9ab2d8 100644 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp +++ b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp @@ -64,9 +64,9 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch(creature_entry) + switch(creature->GetEntry()) { case 28684: Krikthir = creature->GetGUID(); break; case 28921: Hadronox = creature->GetGUID(); break; @@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance str_data = saveStream.str(); OUT_SAVE_INST_DATA_COMPLETE; - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp index 3f71e2070ab..b0259a09518 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp @@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance return NULL; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -148,7 +148,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance } } - void OnObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -305,7 +305,7 @@ struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance std::string GetSaveData() { - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp index d9f3ecd808a..d84bd96791d 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp @@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance return NULL; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance } } - void OnObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -267,7 +267,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance std::string GetSaveData() { - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp index 697134cd82d..e988782ad60 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance player->SendUpdateWorldState(WORLD_STATE_BM,0); } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { if (creature->GetEntry() == C_MEDIVH) MedivhGUID = creature->GetGUID(); diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp index 77ba7fd7ce2..b6a9f0fecae 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp @@ -434,14 +434,10 @@ void hyjalAI::EnterCombat(Unit *who) void hyjalAI::MoveInLineOfSight(Unit *who) { - if(IsDummy)return; - if (IsBeingEscorted && !GetAttack()) - return; - - if(m_creature->getVictim() || !m_creature->canStartAttack(who)) + if(IsDummy) return; - AttackStart(who); + npc_escortAI::MoveInLineOfSight(who); } void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp index cdcd6cb6b66..df0b1a7d9c1 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance return false; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -120,7 +120,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance HandleGameObject(DoorGUID, open, NULL); } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance std::string GetSaveData() { - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp index 3c34e42cee5..dc9946e468a 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -96,7 +96,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance debug_log("TSCR: Instance Old Hillsbrad: UpdateOHWorldState, but PlayerList is empty!"); } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp index 4e104fc2846..da3e6e15c8e 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp @@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance return false; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -140,7 +140,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp index 55ef0716638..b2a58ef7ed1 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp @@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance return NULL; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -115,7 +115,7 @@ struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance } } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp index 72498f388ec..c80f77f0f0f 100644 --- a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp +++ b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp @@ -141,7 +141,7 @@ struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4); } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp index 4790bf1f97d..68e15fd0282 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp @@ -629,7 +629,7 @@ CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature) return new npc_dkc1_gothikAI(_Creature); } -// npc 28912 quest 17217 boss 29001 go 191092 +// npc 28912 quest 17217 boss 29001 mob 29007 go 191092 void AddSC_the_scarlet_enclave() { diff --git a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp index aaded603f80..6ee3aba6d12 100644 --- a/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/zone/eversong_woods/eversong_woods.cpp @@ -649,22 +649,16 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI WaveTimer = 0; } - void EnterCombat(Unit* who){} - void MoveInLineOfSight(Unit* who) { - if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress) + if(!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) { if( CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE ) { - float Radius = 10.0; - if( m_creature->IsWithinDistInMap(who, Radius) ) - { - PlayerGUID = who->GetGUID(); - WaveTimer = 1000; - EndTimer = 60000; - Progress = true; - } + PlayerGUID = who->GetGUID(); + WaveTimer = 1000; + EndTimer = 60000; + Progress = true; } } } diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp index 4c90fdf49a8..b2199e08576 100644 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp +++ b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp @@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance return false; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance } } - void OnObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp index 035bd8aadfe..224f9bfe2a4 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -42,7 +42,7 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance Sewer2GUID = 0; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp index 9893c3c6849..c106924d5b7 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp @@ -42,12 +42,12 @@ struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance } - void OnObjectCreate(GameObject* pGo) + void OnGameObjectCreate(GameObject *go, bool add) { - switch(pGo->GetEntry()) + switch(go->GetEntry()) { - case 185168: m_uiChestNGUID = pGo->GetGUID(); break; - case 185169: m_uiChestHGUID = pGo->GetGUID(); break; + case 185168: m_uiChestNGUID = go->GetGUID(); break; + case 185169: m_uiChestHGUID = go->GetGUID(); break; } } diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp index 8f3a28e02a3..872c074373d 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -71,7 +71,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance return false; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -84,7 +84,7 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance } } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp index b606ff0f97e..cc39ec22e63 100644 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp +++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp @@ -45,7 +45,7 @@ struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance Encounter[i] = NOT_STARTED; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch( go->GetEntry() ) { @@ -53,9 +53,9 @@ struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch( creature_entry ) + switch(creature->GetEntry()) { case 16807: nethekurseGUID = creature->GetGUID(); break; } diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp index 12c7c3fa2ad..df0ac6851af 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp @@ -170,10 +170,7 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { if(!Intro && !Flying) - { - if(!m_creature->getVictim() && m_creature->canStartAttack(who)) - ScriptedAI::AttackStart(who); - } + ScriptedAI::MoveInLineOfSight(who); } void MovementInform(uint32 type, uint32 id) diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp index 62ad6fcf42c..e469a19707e 100644 --- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp +++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp @@ -126,7 +126,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance return 0; } - void OnCreatureCreate(Creature *creature, uint32 entry) + void OnCreatureCreate(Creature *creature, bool add) { switch (creature->GetEntry()) { @@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance } } - void OnObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -249,7 +249,7 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance std::string GetSaveData() { - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp index 57484cb5ef4..952bd4fc0b1 100644 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp +++ b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp @@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance } } - void OnCreatureCreate(Creature *creature, uint32 entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -123,7 +123,7 @@ struct TRINITY_DLL_DECL instance_magisters_terrace : public ScriptedInstance } } - void OnObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp index bfaa583e033..5050238ee92 100644 --- a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp +++ b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp @@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance }; - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -124,9 +124,9 @@ struct TRINITY_DLL_DECL instance_molten_core : public ScriptedInstance } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch (creature_entry) + switch (creature->GetEntry()) { case ID_LUCIFRON: Lucifron = creature->GetGUID(); diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp index 92f276e07d8..0220935873e 100644 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp @@ -1,121 +1,256 @@ -/* Script Data Start -SDName: Boss anomalus -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ +/* 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: Boss_Anomalus +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + #include "precompiled.h" +#include "def_nexus.h" //Spells -#define SPELL_SPARK_1 47751 -#define SPELL_SPARK_2 57062 +#define SPELL_SPARK_N 47751 +#define SPELL_SPARK_H 57062 #define SPELL_RIFT_SHIELD 47748 -#define SPELL_CHARGE_RIFT 47747 -#define SPELL_ARCANE_ATTRACTION 57063 -#define SPELL_CREATE_RIFT 47743 //Dummy ---> summons (npc 26918) "Chaotic Rift", which spawns "Crazed Mana Wraith"s (npc 26746) +#define SPELL_CHARGE_RIFT 47747 //Works wrong (affect players, not rifts) +#define SPELL_CREATE_RIFT 47743 //Don't work, using WA +#define SPELL_ARCANE_ATTRACTION 57063 //No idea, when it's used -#define MOB_CRAZED_MANA_WRAITH 26746 -#define NPC_CHAOTIC_RIFT 26918 +#define MOB_CRAZED_MANA_WRAITH 26746 +#define MOB_CHAOTIC_RIFT 26918 +#define SPELL_CHAOTIC_ENERGY_BURST 47688 +#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737 +#define SPELL_ARCANEFORM 48019 //Chaotic Rift visual //Yell -#define SAY_AGGRO -1576000 -#define SAY_KILL -1576001 -#define SAY_DEATH -1576002 -#define SAY_RIFT -1576003 -#define SAY_SHIELD -1576004 +#define SAY_AGGRO -1576010 +#define SAY_DEATH -1576011 +#define SAY_RIFT -1576012 +#define SAY_SHIELD -1576013 + +float RiftLocation[6][3]= +{ + {652.64, -273.70, -8.75}, + {634.45, -265.94, -8.44}, + {620.73, -281.17, -9.02}, + {626.10, -304.67, -9.44}, + {639.87, -314.11, -9.49}, + {651.72, -297.44, -9.37} +}; struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI { - boss_anomalusAI(Creature *c) : ScriptedAI(c) {} + boss_anomalusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Reset(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; - void Reset() {} - void EnterCombat(Unit* who) + uint8 Phase; + uint32 SPELL_SPARK_Timer; + uint32 SPELL_CREATE_RIFT_Timer; + uint64 ChaoticRiftGUID; + + void Reset() + { + Phase = 0; + SPELL_SPARK_Timer = 5000; + SPELL_CREATE_RIFT_Timer = 25000; + ChaoticRiftGUID = 0; + + if(pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED); + } + + void Aggro(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) + + void UpdateAI(const uint32 diff) { - //Return since we have no target - if(!UpdateVictim()) + if (!UpdateVictim()) + { return; + } + + if (m_creature->HasAura(SPELL_RIFT_SHIELD)) + { + Unit* Rift; + if (ChaoticRiftGUID) + Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID); + if (Rift && Rift->isDead()) + { + m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); + ChaoticRiftGUID = 0; + } + return; + } else + ChaoticRiftGUID = 0; - //Source DBM - if((((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 80) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 77)) - || (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 52)) - || (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 27))) + if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75)) + { + Phase = 1; + DoScriptText(SAY_SHIELD, m_creature); + DoCast(m_creature, SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50)) + { + Phase = 2; + DoScriptText(SAY_SHIELD , m_creature); + DoCast(m_creature,SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + Phase = 3; + DoScriptText(SAY_SHIELD , m_creature); + DoCast(m_creature,SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if (SPELL_SPARK_Timer < diff) { - //Summon rift at a random location - } + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N); + SPELL_SPARK_Timer = 5000; + }else SPELL_SPARK_Timer -=diff; + + if (SPELL_CREATE_RIFT_Timer < diff) + { + DoScriptText(SAY_RIFT , m_creature); - DoMeleeAttackIfReady(); + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + SPELL_CREATE_RIFT_Timer = 25000; + }else SPELL_CREATE_RIFT_Timer -=diff; + + DoMeleeAttackIfReady(); } - void JustDied(Unit* killer) + + void JustDied(Unit* killer) { DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if(victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, DONE); } }; -/*###### -## Crazed Mana Wraiths -######*/ -#define SPELL_ARCANE_MISSILES 33833 - -struct TRINITY_DLL_DECL mob_crazed_mana_wraithAI : public ScriptedAI +struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI { - mob_crazed_mana_wraithAI(Creature *c) : ScriptedAI(c) {} + mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c) + { + pInstance = c->GetInstanceData(); + Reset(); + } - void Reset() {} - void EnterCombat(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if(!UpdateVictim()) - return; + ScriptedInstance* pInstance; - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; + uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer; + uint32 SUMMON_CRAZED_MANA_WRAITH_Timer; -/*###### -## Chaotic Rift -######*/ -#define SPELL_CHAOTIC_ENERGY_BURST 47688 -#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737 + void Reset() + { + SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; + SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; + m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. + //Model for ally (1126) does not show auras. Horde model works perfect. + //Set model to horde number + DoCast(m_creature, SPELL_ARCANEFORM, false); + } -struct TRINITY_DLL_DECL npc_chaotic_riftAI : public ScriptedAI -{ - npc_chaotic_riftAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 diff) { - //Return since we have no target - if(!UpdateVictim()) + if (!UpdateVictim()) + { return; + } - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} + if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff) + { + Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) + DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); + else + DoCast(target, SPELL_CHAOTIC_ENERGY_BURST); + SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; + }else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff; + + if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff) + { + Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Wraith) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Wraith->AI()->AttackStart(target); + Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); + if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) + SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; + else + SUMMON_CRAZED_MANA_WRAITH_Timer = 10000; + }else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff; + } }; -CreatureAI* GetAI_npc_chaotic_rift(Creature *_Creature) +CreatureAI* GetAI_mob_chaotic_rift(Creature *_Creature) { - return new npc_chaotic_riftAI (_Creature); + return new mob_chaotic_riftAI (_Creature); } CreatureAI* GetAI_boss_anomalus(Creature *_Creature) @@ -123,11 +258,6 @@ CreatureAI* GetAI_boss_anomalus(Creature *_Creature) return new boss_anomalusAI (_Creature); } -CreatureAI* GetAI_mob_crazed_mana_wraith(Creature *_Creature) -{ - return new boss_anomalusAI (_Creature); -} - void AddSC_boss_anomalus() { Script *newscript; @@ -136,14 +266,9 @@ void AddSC_boss_anomalus() newscript->Name="boss_anomalus"; newscript->GetAI = &GetAI_boss_anomalus; newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_crazed_mana_wraith"; - newscript->GetAI = &GetAI_mob_crazed_mana_wraith; - newscript->RegisterSelf(); - + newscript = new Script; - newscript->Name="npc_chaotic_rift"; - newscript->GetAI = &GetAI_npc_chaotic_rift; + newscript->Name="mob_chaotic_rift"; + newscript->GetAI = &GetAI_mob_chaotic_rift; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp index c2b6d3d4a8b..ed7a3e6867e 100644 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp @@ -1,74 +1,152 @@ -/* Script Data Start -SDName: Boss keristrasza -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; -*** SQL END ***/ +/* 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: Boss_Keristrasza +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + #include "precompiled.h" +#include "def_nexus.h" //Spells +#define SPELL_FROZEN_PRISON 47854 #define SPELL_TAIL_SWEEP 50155 -#define SPELL_CRYSTAL_CHAINS 50997 +#define SPELL_CRYSTAL_CHAINS 50997 #define SPELL_ENRAGE 8599 -#define SPELL_CRYSTALFIRE_BREATH_1 48096 -#define SPELL_CRYSTALFIRE_BREATH_2 57091 -#define SPELL_CRYSTALIZE 48179 -#define SPELL_INTENSE_COLD 48095 //stackable debuff +#define SPELL_CRYSTALFIRE_BREATH_N 48096 +#define SPELL_CRYSTALFIRE_BREATH_H 57091 +#define SPELL_CRYSTALIZE 48179 +#define SPELL_INTENSE_COLD 48094 //Yell -#define SAY_AGGRO -1576005 -#define SAY_SLAY -1576006 -#define SAY_ENRAGE -1576007 -#define SAY_DEATH -1576008 -#define SAY_CRYSTAL_NOVA -1576009 +#define SAY_AGGRO -1576040 +#define SAY_SLAY -1576041 +#define SAY_ENRAGE -1576042 +#define SAY_DEATH -1576043 +#define SAY_CRYSTAL_NOVA -1576044 struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI { - boss_keristraszaAI(Creature *c) : ScriptedAI(c) {} + boss_keristraszaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 CRYSTALFIRE_BREATH_Timer; + uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer; + uint32 TAIL_SWEEP_Timer; + bool Enrage; - bool enraged; + void Reset() + { + CRYSTALFIRE_BREATH_Timer = 14000; + CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; + TAIL_SWEEP_Timer = 5000; + Enrage = false; + m_creature->RemoveAurasDueToSpell(SPELL_INTENSE_COLD); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + }else{ + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false); + } + } - void Reset() + void MoveInLineOfSight(Unit *who) { - enraged = false; + if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) != DONE && pInstance->GetData(DATA_MAGUS_TELESTRA_EVENT) == DONE && + pInstance->GetData(DATA_ANOMALUS_EVENT) == DONE && pInstance->GetData(DATA_ORMOROK_EVENT) == DONE && + m_creature->IsHostileTo(who) && m_creature->IsWithinDist(who, 15.0f, false)) + { + pInstance->SetData(DATA_KERISTRASZA_FREED, DONE); + } + if (pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE) + { + m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + ScriptedAI::MoveInLineOfSight(who); + } } - void EnterCombat(Unit* who) + + void Aggro(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); + DoCast(m_creature, SPELL_INTENSE_COLD); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) + + void UpdateAI(const uint32 diff) { - //Return since we have no target - if(!UpdateVictim()) + if (!UpdateVictim()) + { return; + } + + if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + DoScriptText(SAY_ENRAGE , m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Enrage = true; + } - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 10) + if (CRYSTALFIRE_BREATH_Timer < diff) { - if(!enraged) - { - DoScriptText(SAY_ENRAGE, m_creature); - DoCast(m_creature, SPELL_ENRAGE); - enraged = true; - } - } + DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N); + CRYSTALFIRE_BREATH_Timer = 14000; + }else CRYSTALFIRE_BREATH_Timer -=diff; + + if (TAIL_SWEEP_Timer < diff) + { + DoCast(m_creature, SPELL_TAIL_SWEEP); + TAIL_SWEEP_Timer = 5000; + }else TAIL_SWEEP_Timer -=diff; - DoMeleeAttackIfReady(); + if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff) + { + DoScriptText(SAY_CRYSTAL_NOVA , m_creature); + if (HeroicMode) + DoCast(m_creature, SPELL_CRYSTALIZE); + else + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CRYSTAL_CHAINS); + CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; + }else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff; + + DoMeleeAttackIfReady(); } - void JustDied(Unit* killer) + + void JustDied(Unit* killer) { DoScriptText(SAY_DEATH, m_creature); } + void KilledUnit(Unit *victim) { - if(victim == m_creature) - return; DoScriptText(SAY_SLAY, m_creature); } }; diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp index f3d9e72267f..8132b99b014 100644 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp @@ -1,103 +1,278 @@ -/* Script Data Start -SDName: Boss magus_telestra -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ +/* 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: Boss_Magus_Telestra +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + #include "precompiled.h" #include "def_nexus.h" - //Spells -//phase 1 -#define SPELL_ICE_NOVA 47772 -#define SPELL_ICE_NOVA 56935 -#define SPELL_FIREBOMB 47773 -#define SPELL_FIREBOMB 56934 -#define SPELL_GAVITY_WELL 47756 - -//Phase 2 -->50% HP (3 clones, Frost, Fire, Arcane) -//Frost Magus (npc 26930) -#define FROST_MAGUS_VISUAL 47706 //Dummy -#define SPELL_BLIZZARD_N 47727 -#define SPELL_ICE_BARB_N 47729 -//heroic -#define SPELL_BLIZZARD_H 56936 -#define SPELL_ICE_BARB_H 56937 - -//Fire Magus (npc 26928) -#define FIRE_MAGUS_VISUAL 47705 //Dummy -#define SPELL_FIRE_BLAST 47721 -#define SPELL_SCORCH 47723 -//heroic -#define SPELL_FIRE_BLAST_H 56939 -#define SPELL_SCORCH_H 56938 - -//Arcane Magus (npc 26929) -#define ARCANE_MAGUS_VISUAL 47704 //Dummy -#define SPELL_CRITTER 47731 -#define SPELL_TIME_STOP 47736 +#define SPELL_ICE_NOVA_N 47772 +#define SPELL_ICE_NOVA_H 56935 +#define SPELL_FIREBOMB_N 47773 +#define SPELL_FIREBOMB_H 56934 +#define SPELL_GRAVITY_WELL 47756 +#define SPELL_TELESTRA_BACK 47714 + +float CenterOfRoom[1][4] = +{ + {504.80, 89.07, -16.12, 6.27} +}; + +//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic) +#define MOB_FIRE_MAGUS 26928 +#define MOB_FROST_MAGUS 26930 +#define MOB_ARCANE_MAGUS 26929 + +#define SPELL_FIRE_MAGUS_VISUAL 47705 +#define SPELL_FROST_MAGUS_VISUAL 47706 +#define SPELL_ARCANE_MAGUS_VISUAL 47704 //Yell -#define SAY_AGGRO -1576010 -#define SAY_KILL -1576011 -#define SAY_DEATH -1576012 -#define SAY_MERGE -1576013 -#define SAY_SPLIT_1 -1576014 -#define SAY_SPLIT_2 -1576015 +#define SAY_AGGRO -1576000 +#define SAY_KILL -1576001 +#define SAY_DEATH -1576002 +#define SAY_MERGE -1576003 +#define SAY_SPLIT_1 -1576004 +#define SAY_SPLIT_2 -1576005 struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI { - boss_magus_telestraAI(Creature *c) : ScriptedAI(c) {} + boss_magus_telestraAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Reset(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; - bool splited; - uint64 Magus_frost, - Magus_fire, - Magus_arcane; + uint64 FireMagusGUID; + uint64 FrostMagusGUID; + uint64 ArcaneMagusGUID; + bool FireMagusDead; + bool FrostMagusDead; + bool ArcaneMagusDead; + + uint32 AppearDelay_Timer; + bool AppearDelay; + + uint8 Phase; + + uint32 SPELL_ICE_NOVA_Timer; + uint32 SPELL_FIREBOMB_Timer; + uint32 SPELL_GRAVITY_WELL_Timer; void Reset() { - splited = false; + Phase = 0; + //These times are probably wrong + SPELL_ICE_NOVA_Timer = 7000; + SPELL_FIREBOMB_Timer = 0; + SPELL_GRAVITY_WELL_Timer = 15000; + + FireMagusGUID = 0; + FrostMagusGUID = 0; + ArcaneMagusGUID = 0; + + AppearDelay = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + if(pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED); } - void EnterCombat(Unit* who) + + void Aggro(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) + + uint64 SplitPersonality(uint32 entry) + { + Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Summoned) + { + switch (entry) + { + case MOB_FIRE_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false); + break; + } + case MOB_FROST_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false); + break; + } + case MOB_ARCANE_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false); + break; + } + } + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); + return Summoned->GetGUID(); + } + return 0; + } + + void UpdateAI(const uint32 diff) { //Return since we have no target - if(!UpdateVictim()) + if (!UpdateVictim()) + { return; + } - if(!splited) + if (AppearDelay) { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50) + m_creature->StopMoving(); + m_creature->AttackStop(); + if (AppearDelay_Timer < diff) { - DoScriptText(SAY_SPLIT_1, m_creature); - //HandleSplit - splited = true; - } + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AppearDelay = false; + }else AppearDelay_Timer -= diff; + return; } - DoMeleeAttackIfReady(); + + if ((Phase == 1)||(Phase == 3)) + { + Unit* FireMagus; + Unit* FrostMagus; + Unit* ArcaneMagus; + if (FireMagusGUID) + FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID); + if (FrostMagusGUID) + FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID); + if (ArcaneMagusGUID) + ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID); + if (FireMagus && FireMagus->isDead()) + FireMagusDead = true; + if (FrostMagus && FrostMagus->isDead()) + FrostMagusDead = true; + if (ArcaneMagus && ArcaneMagus->isDead()) + ArcaneMagusDead = true; + if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->Relocate(CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); + DoCast(m_creature, SPELL_TELESTRA_BACK); + m_creature->SetVisibility(VISIBILITY_ON); + if (Phase == 1) + Phase = 2; + if (Phase == 3) + Phase = 4; + FireMagusGUID = 0; + FrostMagusGUID = 0; + ArcaneMagusGUID = 0; + AppearDelay = true; + AppearDelay_Timer = 4000; + DoScriptText(SAY_MERGE, m_creature); + }else + return; + } + + if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5))) + { + Phase = 1; + m_creature->CastStop(); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); + FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); + ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); + FireMagusDead = false; + FrostMagusDead = false; + ArcaneMagusDead = false; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + return; + } + + if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1))) + { + Phase = 3; + m_creature->CastStop(); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); + FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); + ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); + FireMagusDead = false; + FrostMagusDead = false; + ArcaneMagusDead = false; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + return; + } + + if (SPELL_ICE_NOVA_Timer < diff) + { + m_creature->CastStop(); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N); + SPELL_ICE_NOVA_Timer = 15000; + }else SPELL_ICE_NOVA_Timer -=diff; + + if (SPELL_GRAVITY_WELL_Timer < diff) + { + m_creature->CastStop(); + if (Unit* target = m_creature->getVictim()) + DoCast(target, SPELL_GRAVITY_WELL); + SPELL_GRAVITY_WELL_Timer = 15000; + }else SPELL_GRAVITY_WELL_Timer -=diff; + + if (SPELL_FIREBOMB_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N); + SPELL_FIREBOMB_Timer = 2000; + }else SPELL_FIREBOMB_Timer -=diff; + + DoMeleeAttackIfReady(); } + void JustDied(Unit* killer) - { + { DoScriptText(SAY_DEATH, m_creature); - } + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); + } + void KilledUnit(Unit *victim) { - if(victim == m_creature) - return; DoScriptText(SAY_KILL, m_creature); } }; diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp index eacaf771071..51c12bbdb6a 100644 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp @@ -1,79 +1,288 @@ -/* Script Data Start -SDName: Boss ormorok -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ +/* 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: Boss_Ormorok +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + #include "precompiled.h" +#include "def_nexus.h" //Spells -#define SPELL_CRYSTAL_SPIKES_1 47958 -#define SPELL_CRYSTAL_SPIKES_2 57082 -#define SPELL_CRYSTAL_SPIKES_3 57083 +#define SPELL_CRYSTAL_SPIKES_N 47958 //Don't work, using walkaround +#define SPELL_CRYSTAL_SPIKES_H 57082 //Don't work, using walkaround +//Walkaround for spells Crystal Spikes ----------------- +#define SPELL_CRYSTALL_SPIKE_DAMAGE_N 47944 +#define SPELL_CRYSTALL_SPIKE_DAMAGE_H 57067 +#define SPELL_CRYSTAL_SPIKE_PREVISUAL 50442 +#define MOB_CRYSTAL_SPIKE 27099 +//------------------------------------------------------ #define SPELL_SPELL_REFLECTION 47981 #define SPELL_TRAMPLE_N 48016 #define SPELL_TRAMPLE_H 57066 -#define SPELL_FRENZY_N 48017 -#define SPELL_FRENZY_H 57086 +#define SPELL_FRENZY 48017 #define SPELL_SUMMON_CRYSTALLINE_TANGLER 61564 //summons npc 32665 +#define MOB_CRYSTALLINE_TANGLER 32665 +#define SPELL_ROOTS 28858 //proper spell id is unknown //Yell -#define SAY_AGGRO -1576016 -#define SAY_KILL -1576017 -#define SAY_DEATH -1576018 -#define SAY_REFLECT -1576019 -#define SAY_ICE_SPIKES -1576020 +#define SAY_AGGRO -1576020 +#define SAY_DEATH -1576021 +#define SAY_REFLECT -1576022 +#define SAY_CRYSTAL_SPIKES -1576023 +#define SAY_KILL -1576024 + +#define SPIKE_DISTANCE 5.0f struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI { - boss_ormorokAI(Creature *c) : ScriptedAI(c) {} + boss_ormorokAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Reset(); + HeroicMode = c->GetMap()->IsHeroic(); + } - bool frenzy; + ScriptedInstance* pInstance; + bool HeroicMode; + bool Frenzy; + bool CrystalSpikes; + uint8 CrystalSpikes_Count; + float BaseX; + float BaseY; + float BaseZ; + float BaseO; + float SpikeXY[4][2]; - void Reset() - { - frenzy = false; - } - void EnterCombat(Unit* who) + uint32 SPELL_CRYSTAL_SPIKES_Timer; + uint32 CRYSTAL_SPIKES_Timer; + uint32 SPELL_TRAMPLE_Timer; + uint32 SPELL_FRENZY_Timer; + uint32 SPELL_SPELL_REFLECTION_Timer; + uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer; + + void Reset() + { + SPELL_CRYSTAL_SPIKES_Timer = 12000; + SPELL_TRAMPLE_Timer = 10000; + SPELL_SPELL_REFLECTION_Timer = 30000; + SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; + Frenzy = false; + CrystalSpikes = false; + if(pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED); + } + + void Aggro(Unit* who) { DoScriptText(SAY_AGGRO, m_creature); } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) + + void UpdateAI(const uint32 diff) { - //Return since we have no target - if(!UpdateVictim()) + if (!UpdateVictim()) + { return; + } + if (CrystalSpikes) + if (CRYSTAL_SPIKES_Timer < diff) + { + SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); + SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); + SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); + SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); + SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); + SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); + SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); + SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); + for (uint8 i = 0; i < 4; i++) + Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000); + if (++CrystalSpikes_Count >= 13) + CrystalSpikes = false; + CRYSTAL_SPIKES_Timer = 200; + }else CRYSTAL_SPIKES_Timer -= diff; - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 25) + if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) { - if(!frenzy) - { - DoCast(m_creature, SPELL_FRENZY_N); - frenzy = true; - } - } + DoCast(m_creature, SPELL_FRENZY); + Frenzy = true; + } - DoMeleeAttackIfReady(); + if (SPELL_TRAMPLE_Timer < diff) + { + DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N); + SPELL_TRAMPLE_Timer = 10000; + }else SPELL_TRAMPLE_Timer -= diff; + + if (SPELL_SPELL_REFLECTION_Timer < diff) + { + DoScriptText(SAY_REFLECT, m_creature); + DoCast(m_creature, SPELL_SPELL_REFLECTION); + SPELL_SPELL_REFLECTION_Timer = 30000; + }else SPELL_SPELL_REFLECTION_Timer -= diff; + + if (SPELL_CRYSTAL_SPIKES_Timer < diff) + { + DoScriptText(SAY_CRYSTAL_SPIKES, m_creature); + CrystalSpikes = true; + CrystalSpikes_Count = 1; + CRYSTAL_SPIKES_Timer = 0; + BaseX = m_creature->GetPositionX(); + BaseY = m_creature->GetPositionY(); + BaseZ = m_creature->GetPositionZ(); + BaseO = m_creature->GetOrientation(); + SPELL_CRYSTAL_SPIKES_Timer = 20000; + }else SPELL_CRYSTAL_SPIKES_Timer -=diff; + + if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff)) + { + Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Crystalline_Tangler) + { + Unit* target = NULL; + uint8 Healer = 0; + for (uint8 j = 1; j<=4; j++) + { + switch (j) + { + case 1: Healer = CLASS_PRIEST; break; + case 2: Healer = CLASS_PALADIN; break; + case 3: Healer = CLASS_DRUID; break; + case 4: Healer = CLASS_SHAMAN; break; + } + std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()); + if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer) + { + target = pTemp; + break; + } + } + if (target) + break; + } + if (!target) + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Crystalline_Tangler->AI()->AttackStart(target); + Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f); + } + } + SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; + }else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff; + + DoMeleeAttackIfReady(); } - void JustDied(Unit* killer) + + void JustDied(Unit* killer) { DoScriptText(SAY_DEATH, m_creature); + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, DONE); } - void KilledUnit(Unit *victim) + + void KilledUnit(Unit *victim) { - if(victim == m_creature) - return; DoScriptText(SAY_KILL, m_creature); } + }; +struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI +{ + mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c) + { + Reset(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer; + uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer; + + void Reset() + { + SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700; + SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000; + m_creature->SetLevel(80); // + m_creature->setFaction(16); //Walkaround to be independent from data in DB + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // + } + + void UpdateAI(const uint32 diff) + { + if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff) + { + DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL); + SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000; + }else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff; + + if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff) + { + DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N); + SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000; + }else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff; + } +}; + +struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI +{ + mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) + { + Reset(); + } + + uint32 SPELL_ROOTS_Timer; + + void Reset() + { + SPELL_ROOTS_Timer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (SPELL_ROOTS_Timer < diff) + { + if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false)) + { + DoCast(m_creature->getVictim(), SPELL_ROOTS); + SPELL_ROOTS_Timer = 15000; + } + }else SPELL_ROOTS_Timer -=diff; + } +}; + +CreatureAI* GetAI_mob_crystal_spike(Creature *_Creature) +{ + return new mob_crystal_spikeAI (_Creature); +} + +CreatureAI* GetAI_mob_crystalline_tangler(Creature *_Creature) +{ + return new mob_crystalline_tanglerAI (_Creature); +} + CreatureAI* GetAI_boss_ormorok(Creature *_Creature) { return new boss_ormorokAI (_Creature); @@ -85,6 +294,16 @@ void AddSC_boss_ormorok() newscript = new Script; newscript->Name="boss_ormorok"; - newscript->GetAI = &GetAI_boss_ormorok; + newscript->GetAI = GetAI_boss_ormorok; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crystal_spike"; + newscript->GetAI = &GetAI_mob_crystal_spike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crystalline_tangler"; + newscript->GetAI = &GetAI_mob_crystalline_tangler; newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h index d868c72adf6..59fb3528f69 100644 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h @@ -1,35 +1,11 @@ #ifndef DEF_NEXUS_H #define DEF_NEXUS_H -#define DATA_ANOMALUSDEAD 1 -#define DATA_ANOMALUS_DEATH 2 -#define DATA_ORMOROKDDEAD 3 -#define DATA_ORMOROK_DEATH 4 +#define DATA_MAGUS_TELESTRA_EVENT 1 +#define DATA_ANOMALUS_EVENT 2 +#define DATA_ORMOROK_EVENT 3 +#define DATA_KERISTRASZA_FREED 4 -#define DATA_MAGUSTELESTRADEAD 5 -#define DATA_MAGUSTELESTRA_DEATH 6 -#define DATA_MAGUSTELESTRA_A_DEAD 7 -#define DATA_MAGUSTELESTRA_A_DEATH 8 -#define DATA_MAGUSTELESTRA_F_DEAD 9 -#define DATA_MAGUSTELESTRA_F_DEATH 10 -#define DATA_MAGUSTELESTRA_FI_DEAD 11 -#define DATA_MAGUSTELESTRA_FI_DEATH 12 +#define DATA_ANOMALUS 5 -#define DATA_KERISTRASZADEAD 13 -#define DATA_KERISTRASZA_DEATH 14 -#define DATA_COMMANDER_KOLURGDEAD 15 -#define DATA_COMMANDER_KOLURG_DEATH 16 -#define DATA_COMMANDER_STOUTBEARDDEAD 17 -#define DATA_COMMANDER_STOUTBEARD_DEATH 18 -#define DATA_ANOMALUS 19 -#define DATA_ORMOROK 20 - -#define DATA_MAGUSTELESTRA 21 -#define DATA_MAGUSTELESTRA_A 22 -#define DATA_MAGUSTELESTRA_F 23 -#define DATA_MAGUSTELESTRA_FI 24 - -#define DATA_KERISTRASZA 25 -#define DATA_COMMANDER_KOLURG 26 -#define DATA_COMMANDER_STOUTBEARD 27 #endif diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp index 01d0ade1e25..e953fbc9b29 100644 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp +++ b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp @@ -1,145 +1,176 @@ +/* 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_Nexus +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + #include "precompiled.h" #include "def_nexus.h" +#define NUMBER_OF_ENCOUNTERS 4 + struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance { instance_nexus(Map *Map) : ScriptedInstance(Map) {Initialize();}; - uint64 Anomalus, - Ormorok, - Magus_telestra, - Magus_frost, - Magus_fire, - Magus_arcane, - keristrasza, - Commander_kolurg, - Commander_stoutbeard; - bool IsBossDied[9]; + std::string strInstData; + uint64 Anomalus; + uint32 Encounters[NUMBER_OF_ENCOUNTERS]; void Initialize() { - Anomalus = 0; - Ormorok = 0; - Magus_telestra =0; - Magus_frost =0; - Magus_fire =0; - Magus_arcane =0; - keristrasza =0; - Commander_kolurg = 0; - Commander_stoutbeard = 0; - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; - IsBossDied[3] = false; - IsBossDied[4] = false; - IsBossDied[5] = false; - IsBossDied[6] = false; - IsBossDied[7] = false; - IsBossDied[8] = false; + Anomalus = 0; + for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++) + Encounters[i] = NOT_STARTED; } - bool IsEncounterInProgress() const + void OnCreatureCreate(Creature* pCreature, bool add) { - //not active - return false; + Map::PlayerList const& players = instance->GetPlayers(); + uint32 TeamInInstance; + + if (!players.isEmpty()) + { + if (Player* pPlayer = players.begin()->getSource()) + { + TeamInInstance = pPlayer->GetTeam(); + } + } + switch(pCreature->GetEntry()) + { + case 26763: Anomalus = pCreature->GetGUID(); break; + case 26800: + { + //26799 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24358); + break; + } + case 26802: + { + //26801 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24354); + break; + } + case 26805: + { + //26803 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24357); + break; + } + case 27949: + { + //27947 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24352); + break; + } + case 26796: + { + //26798 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24352); + break; + } + } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + + uint64 GetData64(uint32 uiIdentifier) { - switch(creature->GetEntry()) + switch(uiIdentifier) { - case 26763: Anomalus = creature->GetGUID(); break; - case 26794: Ormorok = creature->GetGUID(); break; - case 26731: Magus_telestra = creature->GetGUID(); break; - case 26930: Magus_frost = creature->GetGUID(); break; - case 26928: Magus_fire = creature->GetGUID(); break; - case 26926: Magus_arcane = creature->GetGUID(); break; - case 26723: keristrasza = creature->GetGUID(); break; - case 26798: Commander_kolurg = creature->GetGUID(); break; - case 26796: Commander_stoutbeard = creature->GetGUID(); break; + case DATA_ANOMALUS: + return Anomalus; } + return 0; } - uint32 GetData(uint32 type) + + uint32 GetData(uint32 identifier) { - switch(type) + switch(identifier) { - case DATA_ANOMALUSDEAD: - if(IsBossDied[0]) - return 1; - break; - case DATA_ORMOROKDDEAD: - if(IsBossDied[1]) - return 1; - break; - case DATA_MAGUSTELESTRADEAD: - if(IsBossDied[2]) - return 1; - break; - case DATA_MAGUSTELESTRA_A_DEAD: - if(IsBossDied[3]) - return 1; - break; - case DATA_MAGUSTELESTRA_F_DEAD: - if(IsBossDied[4]) - return 1; - break; - case DATA_MAGUSTELESTRA_FI_DEAD: - if(IsBossDied[5]) - return 1; - break; - case DATA_KERISTRASZADEAD: - if(IsBossDied[6]) - return 1; - break; - case DATA_COMMANDER_KOLURGDEAD: - if(IsBossDied[7]) - return 1; - break; - case DATA_COMMANDER_STOUTBEARDDEAD: - if(IsBossDied[8]) - return 1; - break; + case DATA_MAGUS_TELESTRA_EVENT: return Encounters[0]; + case DATA_ANOMALUS_EVENT: return Encounters[1]; + case DATA_ORMOROK_EVENT: return Encounters[2]; + case DATA_KERISTRASZA_FREED: return Encounters[3]; } - return 0; } - uint64 GetData64 (uint32 identifier) + void SetData(uint32 identifier, uint32 data) { - return 0; + switch(identifier) + { + case DATA_MAGUS_TELESTRA_EVENT: Encounters[0] = data; break; + case DATA_ANOMALUS_EVENT: Encounters[1] = data; break; + case DATA_ORMOROK_EVENT: Encounters[2] = data; break; + case DATA_KERISTRASZA_FREED: Encounters[3] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " + << Encounters[3]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + std::string GetSaveData() + { + return strInstData; } - void SetData(uint32 type, uint32 data) + void Load(const char* chrIn) { - switch(type) + if (!chrIn) { - case DATA_ANOMALUS_DEATH: - IsBossDied[0] = true; - break; - case DATA_ORMOROK_DEATH: - IsBossDied[1] = true; - break; - case DATA_MAGUSTELESTRA_DEATH: - IsBossDied[2] = true; - break; - case DATA_MAGUSTELESTRA_A_DEATH: - IsBossDied[3] = true; - break; - case DATA_MAGUSTELESTRA_F_DEATH: - IsBossDied[4] = true; - break; - case DATA_MAGUSTELESTRA_FI_DEAD: - IsBossDied[5] = true; - break; - case DATA_KERISTRASZA_DEATH: - IsBossDied[6] = true; - break; - case DATA_COMMANDER_KOLURG_DEATH: - IsBossDied[7] = true; - break; - case DATA_COMMANDER_STOUTBEARD_DEATH: - IsBossDied[8] = true; - break; + OUT_LOAD_INST_DATA_FAIL; + return; } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3]; + + for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i) + { + if (Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; } }; diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp index 4c1bd810388..ec694063a1b 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance Encounter[i] = NOT_STARTED; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -73,9 +73,9 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch(creature_entry) + switch(creature->GetEntry()) { case ENTRY_HORSEMAN: HorsemanGUID = creature->GetGUID(); break; case ENTRY_HEAD: HeadGUID = creature->GetGUID(); break; diff --git a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp index d99546fbcea..b98de35d038 100644 --- a/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp +++ b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL instance_scholomance : public ScriptedInstance Encounter[i] = NOT_STARTED; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp index fc8970c6f8a..fb8b14c368e 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp @@ -82,7 +82,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance return NULL; } - void OnCreatureCreate(Creature* pCreature, uint32 uiCreature) + void OnCreatureCreate(Creature* pCreature, bool add) { switch(pCreature->GetEntry()) { @@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance } } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -188,7 +188,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance std::string GetSaveData() { - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp index 988667ebe5c..71d9b66aa4c 100644 --- a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp +++ b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp @@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance } } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp index 72c062c865a..f8c7dde1ca2 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp @@ -119,9 +119,9 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance return NULL; } - void OnCreatureCreate(Creature* creature, uint32 entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch(entry) + switch(creature->GetEntry()) { case 24850: Kalecgos_Dragon = creature->GetGUID(); break; case 24891: Kalecgos_Human = creature->GetGUID(); break; @@ -139,17 +139,17 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance } } - void OnObjectCreate(GameObject* gobj) + void OnGameObjectCreate(GameObject *go, bool add) { - switch(gobj->GetEntry()) + switch(go->GetEntry()) { - case 188421: ForceField = gobj->GetGUID(); break; - case 188075: FireBarrier = gobj->GetGUID(); break; - case 187979: Gate[0] = gobj->GetGUID(); break; - case 187770: Gate[1] = gobj->GetGUID(); break; - case 187896: Gate[2] = gobj->GetGUID(); break; - case 187990: Gate[3] = gobj->GetGUID(); break; - case 188118: Gate[4] = gobj->GetGUID(); break; + case 188421: ForceField = go->GetGUID(); break; + case 188075: FireBarrier = go->GetGUID(); break; + case 187979: Gate[0] = go->GetGUID(); break; + case 187770: Gate[1] = go->GetGUID(); break; + case 187896: Gate[2] = go->GetGUID(); break; + case 187990: Gate[3] = go->GetGUID(); break; + case 188118: Gate[4] = go->GetGUID(); break; } } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp index a0d21e302b5..ec52a8b116e 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -91,7 +91,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance return false; } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -107,7 +107,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance } } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { if (creature->GetEntry() == MELLICHAR) MellicharGUID = creature->GetGUID(); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp index 55ef8c60bbd..d6e7ee20f2b 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp @@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance return false; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp index e8806b62957..907cf6c67d5 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp @@ -33,10 +33,6 @@ struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance uint32 Encounters[ENCOUNTERS]; - void OnCreatureCreate (Creature *creature, uint32 creature_entry) - { - } - void Initialize() { for(uint8 i = 0; i < ENCOUNTERS; ++i) diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp index 9048591b774..9b5a3f4f5f3 100644 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -59,9 +59,9 @@ struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance CthunPhase = 0; } - void OnCreatureCreate (Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch (creature_entry) + switch (creature->GetEntry()) { case 15263: SkeramGUID = creature->GetGUID(); break; case 15544: VemGUID = creature->GetGUID(); break; diff --git a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp index 3da5e679cab..119d0b1c885 100644 --- a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp +++ b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp @@ -57,7 +57,7 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance std::vector<uint64> earthenGuardian; std::vector<uint64> archaedasWallMinions; // minions lined up around the wall - void OnObjectCreate (GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch (go->GetEntry()) { @@ -238,9 +238,9 @@ struct TRINITY_DLL_DECL instance_uldaman : public ScriptedInstance } - void OnCreatureCreate (Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch (creature_entry) { + switch (creature->GetEntry()) { case 4857: // Stone Keeper SetFrozenState (creature); stoneKeeper.push_back(creature->GetGUID()); diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp index d483006642d..44147a4e5c5 100644 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp @@ -105,9 +105,9 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance return NULL; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch(creature_entry) + switch(creature->GetEntry()) { case 23953: Keleseth = creature->GetGUID(); break; case 24201: Dalronn = creature->GetGUID(); break; @@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance } } - void OnObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { @@ -242,7 +242,7 @@ struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance str_data = saveStream.str(); OUT_SAVE_INST_DATA_COMPLETE; - return str_data.c_str(); + return str_data; } void Load(const char* in) diff --git a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp index 8ff01927908..22477bb4b4f 100644 --- a/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp +++ b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp @@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance return false; } - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { switch(creature->GetEntry()) { @@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance } } - void OnObjectCreate(GameObject *go) + void OnGameObjectCreate(GameObject *go, bool add) { switch(go->GetEntry()) { diff --git a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp index eb3cbd1d495..e09335bba92 100644 --- a/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp +++ b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp @@ -37,9 +37,9 @@ struct TRINITY_DLL_DECL instance_zulgurub : public ScriptedInstance uint64 ThekalGUID; uint64 JindoGUID; - void OnCreatureCreate (Creature *creature, uint32 creature_entry) + void OnCreatureCreate(Creature *creature, bool add) { - switch (creature_entry) + switch (creature->GetEntry()) { case 11347: LorKhanGUID = creature->GetGUID(); |
