From cae67ea8dc085a24164c585e6406014bbee0a245 Mon Sep 17 00:00:00 2001 From: TheLuda Date: Sat, 10 Sep 2011 14:53:18 +0200 Subject: [PATCH 01/15] -- Add branch notice to README. **develop** may be unstable. Signed-off-by: TheLuda --- README.mdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.mdown b/README.mdown index 27f1940e..5f894db1 100644 --- a/README.mdown +++ b/README.mdown @@ -14,6 +14,16 @@ be a part of any redistributable packages made from this software. No licenses should be removed from this software if you are making redistributable copies. +Development +----------- +The **develop** branch is where the development of *scriptdev0* is done. Any +of the commits submitted here may or may not become part of the next release. + +It is recommended to use the **master** branch for stable systems, and only use +the **develop** branch if you intend to test commits and submit issues and/or +reports. + + Compatibility ------------- The *scriptdev0* bindings are compatible with [mangos-zero revision 1765][10] From b91afb0299f86caa3d65eedd522e5a425654b409 Mon Sep 17 00:00:00 2001 From: TheLuda Date: Sat, 10 Sep 2011 20:19:27 +0200 Subject: [PATCH 02/15] Require CMake version 2.8 to buid git_id tool. CMake 2.8 and newer versions add extended platform support and allow for builds using clang. [1]: http://clang.llvm.org/ "C language frontend for LLVM" Signed-off-by: TheLuda --- tool/git_id/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/git_id/CMakeLists.txt b/tool/git_id/CMakeLists.txt index 5250bebc..90bbd6ac 100644 --- a/tool/git_id/CMakeLists.txt +++ b/tool/git_id/CMakeLists.txt @@ -15,6 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -SET(CMAKE_VERBOSE_MAKEFILE ON) -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required (VERSION 2.8) + ADD_EXECUTABLE (git_id git_id.cpp) From cc1b14e799764be75ef28c5a7052cfa9afeef209 Mon Sep 17 00:00:00 2001 From: Salja Date: Sun, 11 Sep 2011 16:30:26 +0200 Subject: [PATCH 03/15] [z0469] Backport: Fix typo in Wailing Caverns escort event texts. Signed-off-by: Salja --- sql/Updates/z0469_r2277_scriptdevzero.sql | 1 + sql/scriptdevzero_script_full.sql | 2 +- system/revision_nr.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 sql/Updates/z0469_r2277_scriptdevzero.sql diff --git a/sql/Updates/z0469_r2277_scriptdevzero.sql b/sql/Updates/z0469_r2277_scriptdevzero.sql new file mode 100644 index 00000000..933e10cd --- /dev/null +++ b/sql/Updates/z0469_r2277_scriptdevzero.sql @@ -0,0 +1 @@ +UPDATE script_texts SET content_default='I must make the necessary preparations before the awakening ritual can begin. You must protect me!' WHERE entry=-1043001; diff --git a/sql/scriptdevzero_script_full.sql b/sql/scriptdevzero_script_full.sql index 4c7ed8cd..cdb8927d 100644 --- a/sql/scriptdevzero_script_full.sql +++ b/sql/scriptdevzero_script_full.sql @@ -851,7 +851,7 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen -- -1 043 000 WAILING CAVERNS INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES (-1043000,'At last! Naralex can be awakened! Come aid me, brave adventurers!',0,6,0,0,'Disciple of Naralex - SAY_INTRO'), -(-1043001,'I must make the nescessary preparations before the awakening ritual can begin. You must protect me!',0,0,0,0,'SAY_PREPARE'), +(-1043001,'I must make the necessary preparations before the awakening ritual can begin. You must protect me!',0,0,0,0,'SAY_PREPARE'), (-1043002,'These caverns were once a temple of promise for regrowth in the Barrens. Now, they are the halls of nightmares.',0,0,0,0,'Disciple of Naralex - SAY_FIRST_CORNER'), (-1043003,'Come. We must continue. There is much to be done before we can pull Naralex from his nightmare.',0,0,0,0,'Disciple of Naralex - SAY_CONTINUE'), (-1043004,'Within this circle of fire I must cast the spell to banish the spirits of the slain Fanglords.',0,0,0,0,'Disciple of Naralex - SAY_CIRCLE_BANISH'), diff --git a/system/revision_nr.h b/system/revision_nr.h index 1fc9a814..0bdc1766 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0468" + #define REVISION_NR "0469" #endif // __REVISION_NR_H__ From 003c36e2d5a6bfbde0ed10844b6eff23ce2b4de6 Mon Sep 17 00:00:00 2001 From: Salja Date: Fri, 23 Sep 2011 01:05:08 +0200 Subject: [PATCH 04/15] [z0470] Backport/Update: Implement quest 8736 - The Nightmare Manifests Thanks Xfurry * The Phantasm Shade summon event has a lot of guesswork inside * Fly effect for Eranikus is disabled due to the impossibility to cancel the effect * Thanks to Nitka for providing the original patch and Patman for providing the HD video recording Signed-off-by: Salja --- scripts/kalimdor/moonglade.cpp | 99 ++++++++++++----------- sql/Updates/z0470_r2289_scriptdevzero.sql | 3 + sql/scriptdevzero_script_full.sql | 2 +- system/revision_nr.h | 2 +- 4 files changed, 56 insertions(+), 50 deletions(-) create mode 100644 sql/Updates/z0470_r2289_scriptdevzero.sql diff --git a/scripts/kalimdor/moonglade.cpp b/scripts/kalimdor/moonglade.cpp index 886d2196..ae6e6b86 100644 --- a/scripts/kalimdor/moonglade.cpp +++ b/scripts/kalimdor/moonglade.cpp @@ -302,8 +302,8 @@ static EventLocations aShadowsLocations[] = {7811.48f, -2573.20f, 488.49f}, // Outside shade points - basically only the first set of coords is used for the summoning; there is no solid proof of using the other coords {7888.32f, -2566.25f, 487.02f}, - //{7946.12f, -2577.10f, 489.97f}, - //{7963.00f, -2492.03f, 487.84f} + {7946.12f, -2577.10f, 489.97f}, + {7963.00f, -2492.03f, 487.84f} }; struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI @@ -315,7 +315,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI uint32 m_uiShadesummonTimer; uint32 m_uiOutroTimer; - ObjectGuid m_uiEranikusGUID; + ObjectGuid m_eranikusGuid; uint8 m_uiOutroPhase; uint8 m_uiSummonCount; @@ -330,7 +330,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI m_uiOutroPhase = 0; m_uiSummonCount = 0; - m_uiEranikusGUID.Clear(); + m_eranikusGuid.Clear(); m_uiShadesummonTimer = 0; m_uiHealTimer = 10000; @@ -345,18 +345,17 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI switch(pSummoned->GetEntry()) { case NPC_ERANIKUS_TYRANT: - m_uiEranikusGUID = pSummoned->GetObjectGuid(); + m_eranikusGuid = pSummoned->GetObjectGuid(); // Make Eranikus unattackable first - pSummoned->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND /*| UNIT_BYTE1_FLAG_UNK_2*/); + // ToDo: uncomment the fly effect when it will be possible to cancel it properly + //pSummoned->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND /*| UNIT_BYTE1_FLAG_UNK_2*/); pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pSummoned->AddSplineFlag(SPLINEFLAG_FLYING); - pSummoned->SetRespawnDelay(DAY); break; case NPC_NIGHTMARE_PHANTASM: // ToDo: set faction to DB pSummoned->setFaction(14); pSummoned->AI()->AttackStart(m_creature); - pSummoned->SetRespawnDelay(DAY); break; } } @@ -383,13 +382,11 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI void JustDied(Unit* pKiller) { - // set quest to failed - if (Player* pPlayer = GetPlayerForEscort()) - pPlayer->FailQuest(QUEST_NIGHTMARE_MANIFESTS); - - // despawn the summons - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + // Make Eranikus evade in order to despawn all the summons + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) pEranikus->AI()->EnterEvadeMode(); + + npc_escortAI::JustDied(pKiller); } void WaypointReached(uint32 uiPointId) @@ -417,7 +414,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI DoCastSpellIfCan(m_creature, SPELL_CONJURE_RIFT); break; case 17: - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) { // This big yellow emote was removed at some point in WotLK //DoScriptText(EMOTE_SUMMON_ERANIKUS, pEranikus); @@ -428,37 +425,37 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI DoScriptText(SAY_REMULOS_TAUNT_1, m_creature); break; case 19: - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) DoScriptText(EMOTE_ERANIKUS_LAUGH, pEranikus); break; case 20: - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) DoScriptText(SAY_ERANIKUS_TAUNT_2, pEranikus); break; case 21: DoScriptText(SAY_REMULOS_TAUNT_3, m_creature); break; case 22: - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) DoScriptText(SAY_ERANIKUS_TAUNT_4, pEranikus); break; case 23: - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) DoScriptText(EMOTE_ERANIKUS_ATTACK, pEranikus); break; case 24: if (Player* pPlayer = GetPlayerForEscort()) DoScriptText(SAY_REMULOS_DEFEND_1, m_creature, pPlayer); - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_FLIGHT, aEranikusLocations[1].m_fX, aEranikusLocations[1].m_fY, aEranikusLocations[1].m_fZ); break; case 28: DoScriptText(SAY_REMULOS_DEFEND_2, m_creature); - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) m_creature->SetFacingToObject(pEranikus); break; case 29: - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) DoScriptText(SAY_ERANIKUS_SHADOWS, pEranikus); break; case 30: @@ -495,6 +492,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI case 1: // Despawn Remulos after the outro is finished - he will respawn automatically at his home position after a few min DoScriptText(SAY_REMULOS_OUTRO_2, m_creature); + m_creature->SetRespawnDelay(1*MINUTE); m_creature->ForcedDespawn(3000); m_uiOutroTimer = 0; break; @@ -517,7 +515,7 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI for (uint8 i = 0; i < MAX_SHADOWS; ++i) m_creature->SummonCreature(NPC_NIGHTMARE_PHANTASM, aShadowsLocations[i].m_fX, aShadowsLocations[i].m_fY, aShadowsLocations[i].m_fZ, 0,TEMPSUMMON_DEAD_DESPAWN, 0); - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) DoScriptText(SAY_ERANIKUS_ATTACK_1, pEranikus); ++m_uiSummonCount; @@ -527,15 +525,15 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI // Summon 3 shades per turn until the maximum summon turns are reached float fX, fY, fZ; - // Randomize the summon point - guesswork; not used - //uint8 uiSummonPoint = roll_chance_i(70) ? MAX_SHADOWS : urand(MAX_SHADOWS + 1, 2*MAX_SHADOWS - 1); + // Randomize the summon point + uint8 uiSummonPoint = roll_chance_i(70) ? MAX_SHADOWS : urand(MAX_SHADOWS + 1, MAX_SHADOWS + 2); if (m_uiSummonCount < MAX_SUMMON_TURNS) { for (uint8 i = 0; i < MAX_SHADOWS; ++i) { - m_creature->GetRandomPoint(aShadowsLocations[MAX_SHADOWS].m_fX, aShadowsLocations[MAX_SHADOWS].m_fY, aShadowsLocations[MAX_SHADOWS].m_fZ, 10.0f, fX, fY, fZ); - m_creature->SummonCreature(NPC_NIGHTMARE_PHANTASM, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->GetRandomPoint(aShadowsLocations[uiSummonPoint].m_fX, aShadowsLocations[uiSummonPoint].m_fY, aShadowsLocations[uiSummonPoint].m_fZ, 10.0f, fX, fY, fZ); + m_creature->SummonCreature(NPC_NIGHTMARE_PHANTASM, fX, fY, fZ, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); } ++m_uiSummonCount; @@ -547,11 +545,11 @@ struct MANGOS_DLL_DECL npc_keeper_remulosAI : public npc_escortAI { m_uiShadesummonTimer = 0; - if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_uiEranikusGUID)) + if (Creature* pEranikus = m_creature->GetMap()->GetCreature(m_eranikusGuid)) { - pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_COMBAT, aEranikusLocations[2].m_fX, aEranikusLocations[2].m_fY, aEranikusLocations[2].m_fZ); pEranikus->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0); pEranikus->RemoveSplineFlag(SPLINEFLAG_FLYING); + pEranikus->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_COMBAT, aEranikusLocations[2].m_fX, aEranikusLocations[2].m_fY, aEranikusLocations[2].m_fZ); } } else @@ -605,14 +603,14 @@ bool QuestAccept_npc_keeper_remulos(Player* pPlayer, Creature* pCreature, const { if (pQuest->GetQuestId() == QUEST_NIGHTMARE_MANIFESTS) { - // avoid starting the escort twice - pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - if (npc_keeper_remulosAI* pEscortAI = dynamic_cast(pCreature->AI())) pEscortAI->Start(true, pPlayer, pQuest); + + return true; } - return true; + // Return false for other quests in order to handle DB scripts. Example: quest 8447 + return false; } bool EffectDummyCreature_conjure_rift(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) @@ -620,7 +618,7 @@ bool EffectDummyCreature_conjure_rift(Unit* pCaster, uint32 uiSpellId, SpellEffe //always check spellid and effectindex if (uiSpellId == SPELL_CONJURE_RIFT && uiEffIndex == EFFECT_INDEX_0) { - pCaster->SummonCreature(NPC_ERANIKUS_TYRANT, aEranikusLocations[0].m_fX, aEranikusLocations[0].m_fY, aEranikusLocations[0].m_fZ, aEranikusLocations[0].m_fO, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + pCaster->SummonCreature(NPC_ERANIKUS_TYRANT, aEranikusLocations[0].m_fX, aEranikusLocations[0].m_fY, aEranikusLocations[0].m_fZ, aEranikusLocations[0].m_fO, TEMPSUMMON_DEAD_DESPAWN, 0); //always return true when we are handling this spell and effect return true; @@ -663,8 +661,8 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI uint8 m_uiTyrandeMovePoint; uint8 m_uiHealthCheck; - ObjectGuid m_uiRemulosGUID; - ObjectGuid m_uiTyrandeGUID; + ObjectGuid m_remulosGuid; + ObjectGuid m_tyrandeGuid; GUIDList m_lPriestessList; void Reset() @@ -674,8 +672,8 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI m_uiShadowboltVolleyTimer = 5000; m_uiTyrandeMoveTimer = 0; - m_uiRemulosGUID.Clear(); - m_uiTyrandeGUID.Clear(); + m_remulosGuid.Clear(); + m_tyrandeGuid.Clear(); m_uiHealthCheck = 85; m_uiEventPhase = 0; @@ -699,7 +697,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI // Get Remulos guid and make him stop summoning shades if (Creature* pRemulos = GetClosestCreatureWithEntry(m_creature, NPC_REMULOS, 50.0f)) { - m_uiRemulosGUID = pRemulos->GetObjectGuid(); + m_remulosGuid = pRemulos->GetObjectGuid(); pRemulos->AI()->EnterEvadeMode(); } @@ -717,7 +715,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI m_creature->ForcedDespawn(); DoDespawnSummoned(); - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) pTyrande->ForcedDespawn(); } } @@ -745,12 +743,14 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI switch(pSummoned->GetEntry()) { case NPC_TYRANDE_WHISPERWIND: - m_uiTyrandeGUID = pSummoned->GetObjectGuid(); + m_tyrandeGuid = pSummoned->GetObjectGuid(); + pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); pSummoned->GetMotionMaster()->MovePoint(POINT_ID_TYRANDE_HEAL, aTyrandeLocations[1].m_fX, aTyrandeLocations[1].m_fY, aTyrandeLocations[1].m_fZ); break; case NPC_ELUNE_PRIESTESS: m_lPriestessList.push_back(pSummoned->GetObjectGuid()); float fX, fY, fZ; + pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); m_creature->GetRandomPoint(aTyrandeLocations[1].m_fX, aTyrandeLocations[1].m_fY, aTyrandeLocations[1].m_fZ, 10.0f, fX, fY, fZ); pSummoned->GetMotionMaster()->MovePoint(POINT_ID_TYRANDE_HEAL, fX, fY, fZ); break; @@ -814,12 +814,14 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI { case 0: // Eranikus is redeemed - make Tyrande kneel and stop casting - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) { pTyrande->InterruptNonMeleeSpells(false); pTyrande->SetStandState(UNIT_STAND_STATE_KNEEL); DoScriptText(EMOTE_TYRANDE_KNEEL, pTyrande); } + if (Creature* pRemulos = m_creature->GetMap()->GetCreature(m_remulosGuid)) + pRemulos->SetFacingToObject(m_creature); // Note: this emote was a world wide yellow emote before WotLK DoScriptText(EMOTE_ERANIKUS_REDEEM, m_creature); //DoCastSpellIfCan(m_creature, SPELL_MOONGLADE_TRANQUILITY); // spell id unk for the moment @@ -827,7 +829,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI m_uiEventTimer = 5000; break; case 1: - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) DoScriptText(SAY_TYRANDE_REDEEMED, pTyrande); m_uiEventTimer = 6000; break; @@ -839,6 +841,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI case 3: // Move Eranikus in front of Tyrande m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); m_creature->GetMotionMaster()->MovePoint(POINT_ID_ERANIKUS_REDEEMED, aEranikusLocations[3].m_fX, aEranikusLocations[3].m_fY, aEranikusLocations[3].m_fZ); m_uiEventTimer = 0; break; @@ -856,12 +859,12 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI break; case 7: // Complete Quest and end event - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) { pTyrande->SetStandState(UNIT_STAND_STATE_STAND); pTyrande->ForcedDespawn(9000); } - if (Creature* pRemulos = m_creature->GetMap()->GetCreature(m_uiRemulosGUID)) + if (Creature* pRemulos = m_creature->GetMap()->GetCreature(m_remulosGuid)) ((npc_keeper_remulosAI*)pRemulos->AI())->DoHandleOutro(m_creature); m_creature->HandleEmote(EMOTE_ONESHOT_BOW); m_creature->ForcedDespawn(2000); @@ -882,7 +885,7 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI { if (m_uiTyrandeMoveTimer <= uiDiff) { - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) pTyrande->GetMotionMaster()->MovePoint(POINT_ID_TYRANDE_ABSOLUTION, aTyrandeLocations[2].m_fX, aTyrandeLocations[2].m_fY, aTyrandeLocations[2].m_fZ); m_uiTyrandeMoveTimer = 0; } @@ -919,12 +922,12 @@ struct MANGOS_DLL_DECL boss_eranikusAI : public ScriptedAI m_uiHealthCheck = 31; break; case 31: - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) DoScriptText(SAY_TYRANDE_FORGIVEN_2, pTyrande); m_uiHealthCheck = 27; break; case 27: - if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_uiTyrandeGUID)) + if (Creature* pTyrande = m_creature->GetMap()->GetCreature(m_tyrandeGuid)) DoScriptText(SAY_TYRANDE_FORGIVEN_3, pTyrande); m_uiHealthCheck = 25; break; diff --git a/sql/Updates/z0470_r2289_scriptdevzero.sql b/sql/Updates/z0470_r2289_scriptdevzero.sql new file mode 100644 index 00000000..76b4cb2d --- /dev/null +++ b/sql/Updates/z0470_r2289_scriptdevzero.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1000716; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'), diff --git a/sql/scriptdevzero_script_full.sql b/sql/scriptdevzero_script_full.sql index cdb8927d..526abaa7 100644 --- a/sql/scriptdevzero_script_full.sql +++ b/sql/scriptdevzero_script_full.sql @@ -745,7 +745,7 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen (-1000714,'Well, I\'m off to the Gelkis. They\'re not as dumb as the Maraudines, but they\'re more reasonable.',0,0,0,3,'melizza SAY_3'), (-1000715,'We will locate the origin of the Nightmare through the fragments you collected, $N. From there, we will pull Eranikus through a rift in the Dream. Steel yourself, $C. We are inviting the embodiment of the Nightmare into our world.',0,0,0,0,'remulos SAY_REMULOS_INTRO_1'), -(-1000716,'To Nighthaven! Keep your army close, champion.',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'), +(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'), (-1000717,'The rift will be opened there, above the Lake Elun\'ara. Prepare yourself, $N. Eranikus entry into our world will be wrought with chaos and strife.',0,0,0,0,'remulos SAY_REMULOS_INTRO_3'), (-1000718,'He will stop at nothing to get to Malfurion\'s physical manifistation. That must not happen... We must keep the beast occupied long enough for Tyrande to arrive.',0,0,0,0,'remulos SAY_REMULOS_INTRO_4'), (-1000719,'Defend Nightaven, hero...',0,0,0,0,'remulos SAY_REMULOS_INTRO_5'), diff --git a/system/revision_nr.h b/system/revision_nr.h index 0bdc1766..aa96c059 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0469" + #define REVISION_NR "0470" #endif // __REVISION_NR_H__ From faddf07382affcbabef41b30b1b016d79fc2b812 Mon Sep 17 00:00:00 2001 From: Salja Date: Fri, 23 Sep 2011 19:50:44 +0200 Subject: [PATCH 05/15] [z0471] Delete Boss Ironaya and move to ACID. Signed-off-by: Salja --- VC100/100ScriptDev0.vcxproj | 1 - VC100/100ScriptDev0.vcxproj.filters | 3 - VC90/90ScriptDev0.vcproj | 4 - .../eastern_kingdoms/uldaman/boss_ironaya.cpp | 108 ------------------ sql/Updates/z0471_rxxxx_mangoszero.sql | 1 + system/ScriptLoader.cpp | 2 - system/revision_nr.h | 2 +- 7 files changed, 2 insertions(+), 119 deletions(-) delete mode 100644 scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp create mode 100644 sql/Updates/z0471_rxxxx_mangoszero.sql diff --git a/VC100/100ScriptDev0.vcxproj b/VC100/100ScriptDev0.vcxproj index 49f2f766..bcdb0aa9 100644 --- a/VC100/100ScriptDev0.vcxproj +++ b/VC100/100ScriptDev0.vcxproj @@ -336,7 +336,6 @@ - diff --git a/VC100/100ScriptDev0.vcxproj.filters b/VC100/100ScriptDev0.vcxproj.filters index d82c8bd2..84ee321f 100644 --- a/VC100/100ScriptDev0.vcxproj.filters +++ b/VC100/100ScriptDev0.vcxproj.filters @@ -453,9 +453,6 @@ scripts\eastern_kingdoms\uldaman - - scripts\eastern_kingdoms\uldaman - scripts\eastern_kingdoms\uldaman diff --git a/VC90/90ScriptDev0.vcproj b/VC90/90ScriptDev0.vcproj index ac3595e3..372285a0 100644 --- a/VC90/90ScriptDev0.vcproj +++ b/VC90/90ScriptDev0.vcproj @@ -1302,10 +1302,6 @@ RelativePath="..\scripts\eastern_kingdoms\uldaman\boss_archaedas.cpp" > - - diff --git a/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp b/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp deleted file mode 100644 index 46820957..00000000 --- a/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2006-2011 ScriptDev2 - * Copyright (C) 2010-2011 ScriptDev0 - * - * 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_Ironaya -SD%Complete: 100 -SDComment: -SDCategory: Uldaman -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1070000 - -#define SPELL_ARCINGSMASH 8374 -#define SPELL_KNOCKAWAY 10101 -#define SPELL_WSTOMP 11876 - -struct MANGOS_DLL_DECL boss_ironayaAI : public ScriptedAI -{ - boss_ironayaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} - - uint32 Arcing_Timer; - bool hasCastedWstomp; - bool hasCastedKnockaway; - - void Reset() - { - Arcing_Timer = 3000; - hasCastedKnockaway = false; - hasCastedWstomp = false; - } - - void Aggro(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) - return; - - //If we are <50% hp do knockaway ONCE - if (!hasCastedKnockaway && m_creature->GetHealthPercent() < 50.0f) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); - - // current aggro target is knocked away pick new target - Unit* Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0); - - if (!Target || Target == m_creature->getVictim()) - Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); - - if (Target) - m_creature->TauntApply(Target); - - //Shouldn't cast this agian - hasCastedKnockaway = true; - } - - //Arcing_Timer - if (Arcing_Timer < diff) - { - DoCastSpellIfCan(m_creature,SPELL_ARCINGSMASH); - Arcing_Timer = 13000; - }else Arcing_Timer -= diff; - - if (!hasCastedWstomp && m_creature->GetHealthPercent() < 25.0f) - { - DoCastSpellIfCan(m_creature,SPELL_WSTOMP); - hasCastedWstomp = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ironaya(Creature* pCreature) -{ - return new boss_ironayaAI(pCreature); -} - -void AddSC_boss_ironaya() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ironaya"; - newscript->GetAI = &GetAI_boss_ironaya; - newscript->RegisterSelf(); -} diff --git a/sql/Updates/z0471_rxxxx_mangoszero.sql b/sql/Updates/z0471_rxxxx_mangoszero.sql new file mode 100644 index 00000000..4d1dad6f --- /dev/null +++ b/sql/Updates/z0471_rxxxx_mangoszero.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=7228; diff --git a/system/ScriptLoader.cpp b/system/ScriptLoader.cpp index d2105e10..8dfbf37c 100644 --- a/system/ScriptLoader.cpp +++ b/system/ScriptLoader.cpp @@ -134,7 +134,6 @@ extern void AddSC_stratholme(); extern void AddSC_instance_sunken_temple(); //sunken_temple extern void AddSC_sunken_temple(); extern void AddSC_boss_archaedas(); //uldaman -extern void AddSC_boss_ironaya(); extern void AddSC_uldaman(); extern void AddSC_instance_uldaman(); extern void AddSC_boss_arlokk(); //zulgurub @@ -353,7 +352,6 @@ void AddScripts() AddSC_instance_sunken_temple(); //sunken_temple AddSC_sunken_temple(); AddSC_boss_archaedas(); //uldaman - AddSC_boss_ironaya(); AddSC_uldaman(); AddSC_instance_uldaman(); AddSC_boss_arlokk(); //zulgurub diff --git a/system/revision_nr.h b/system/revision_nr.h index aa96c059..35a02a18 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0470" + #define REVISION_NR "0471" #endif // __REVISION_NR_H__ From 0f4c2aa090b00c39978a97abc832a1bd7aef66a5 Mon Sep 17 00:00:00 2001 From: Salja Date: Mon, 26 Sep 2011 21:54:40 +0200 Subject: [PATCH 06/15] [z0472] Backport: Improve some things in Deadmines. Thanks stfx * Mr. Smite: Fix delay handling after he "used" his chest * Cannon event: Improve timed handling, make code more default, fix say types Signed-off-by: Salja --- .../eastern_kingdoms/deadmines/deadmines.cpp | 11 +-- .../eastern_kingdoms/deadmines/deadmines.h | 1 - .../deadmines/instance_deadmines.cpp | 69 +++++++------------ sql/Updates/z0472_r2300_scriptdevzero.sql | 3 + sql/scriptdevzero_script_full.sql | 4 +- system/revision_nr.h | 2 +- 6 files changed, 32 insertions(+), 58 deletions(-) create mode 100644 sql/Updates/z0472_r2300_scriptdevzero.sql diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.cpp b/scripts/eastern_kingdoms/deadmines/deadmines.cpp index 5c892ade..7ccd4b77 100644 --- a/scripts/eastern_kingdoms/deadmines/deadmines.cpp +++ b/scripts/eastern_kingdoms/deadmines/deadmines.cpp @@ -148,7 +148,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI m_creature->SetStandState(UNIT_STAND_STATE_STAND); m_uiPhase = PHASE_EQUIP_END; - m_uiEquipTimer = 5000; + m_uiEquipTimer = 1000; Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0); @@ -157,14 +157,6 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI EnterEvadeMode(); return; } - - // Takes longer to run further distance. Not accurate, but will probably be sufficient for most cases - if (m_creature->IsWithinDistInMap(pVictim, ATTACK_DISTANCE)) - m_uiEquipTimer -= 1000; - else if (m_creature->IsWithinDistInMap(pVictim, 2*ATTACK_DISTANCE)) - m_uiEquipTimer -= 2000; - else - m_uiEquipTimer -= 3000; } void PhaseEquipEnd() @@ -251,6 +243,7 @@ struct MANGOS_DLL_DECL boss_mr_smiteAI : public ScriptedAI m_uiPhase = PHASE_EQUIP_START; m_uiEquipTimer = 2500; + // will clear getVictim (m_attacking) m_creature->AttackStop(true); m_creature->RemoveAurasDueToSpell(SPELL_THRASH); } diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.h b/scripts/eastern_kingdoms/deadmines/deadmines.h index 9027dd16..f0031d50 100644 --- a/scripts/eastern_kingdoms/deadmines/deadmines.h +++ b/scripts/eastern_kingdoms/deadmines/deadmines.h @@ -71,7 +71,6 @@ class MANGOS_DLL_DECL instance_deadmines : public ScriptedInstance uint32 m_auiEncounter[MAX_ENCOUNTER]; uint32 m_uiIronDoorTimer; - uint32 m_uiDoorStep; }; #endif diff --git a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp index b447ecdf..bba22e00 100644 --- a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp +++ b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp @@ -28,8 +28,7 @@ EndScriptData */ #include "deadmines.h" instance_deadmines::instance_deadmines(Map* pMap) : ScriptedInstance(pMap), - m_uiIronDoorTimer(0), - m_uiDoorStep(0) + m_uiIronDoorTimer(0) { Initialize(); } @@ -124,12 +123,29 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData) { if (uiData == IN_PROGRESS) { - if (GameObject* pGo = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR)) + DoUseDoorOrButton(GO_IRON_CLAD_DOOR, 0, true); + m_uiIronDoorTimer = 15000; + + if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE)) + DoScriptText(INST_SAY_ALARM1, pMrSmite); + + if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR)) { - pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); - m_uiIronDoorTimer = 3000; + // should be static spawns, fetch the closest ones at the pier + if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f)) + { + pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ()); + } + + if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f)) + { + pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ()); + } } } + m_auiEncounter[0] = uiData; break; } @@ -160,46 +176,9 @@ void instance_deadmines::Update(uint32 uiDiff) if (m_uiIronDoorTimer <= uiDiff) { if (Creature* pMrSmite = GetSingleCreatureFromStorage(NPC_MR_SMITE)) - { - switch(m_uiDoorStep) - { - case 0: - DoScriptText(INST_SAY_ALARM1,pMrSmite); - m_uiIronDoorTimer = 2000; - ++m_uiDoorStep; - break; - case 1: - { - if (GameObject* pDoor = GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR)) - { - // should be static spawns, fetch the closest ones at the pier - if (Creature* pi1 = GetClosestCreatureWithEntry(pDoor, NPC_PIRATE, 40.0f)) - { - pi1->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - pi1->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ()); - } - - if (Creature* pi2 = GetClosestCreatureWithEntry(pDoor, NPC_SQUALLSHAPER, 40.0f)) - { - pi2->RemoveSplineFlag(SPLINEFLAG_WALKMODE); - pi2->GetMotionMaster()->MovePoint(0, pDoor->GetPositionX(), pDoor->GetPositionY(), pDoor->GetPositionZ()); - } - } - - ++m_uiDoorStep; - m_uiIronDoorTimer = 10000; - break; - } - case 2: - DoScriptText(INST_SAY_ALARM2,pMrSmite); - m_uiDoorStep = 0; - m_uiIronDoorTimer = 0; - debug_log("SD2: Instance Deadmines: Iron door event reached end."); - break; - } - } - else - m_uiIronDoorTimer = 0; + DoScriptText(INST_SAY_ALARM2, pMrSmite); + + m_uiIronDoorTimer = 0; } else m_uiIronDoorTimer -= uiDiff; diff --git a/sql/Updates/z0472_r2300_scriptdevzero.sql b/sql/Updates/z0472_r2300_scriptdevzero.sql new file mode 100644 index 00000000..76b4cb2d --- /dev/null +++ b/sql/Updates/z0472_r2300_scriptdevzero.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1000716; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'), diff --git a/sql/scriptdevzero_script_full.sql b/sql/scriptdevzero_script_full.sql index 526abaa7..8aa9d8fc 100644 --- a/sql/scriptdevzero_script_full.sql +++ b/sql/scriptdevzero_script_full.sql @@ -843,8 +843,8 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen -- -1 036 000 DEADMINES INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES -(-1036000,'You there, check out that noise.',5775,1,7,0,'smite INST_SAY_ALARM1'), -(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,1,7,0,'smite INST_SAY_ALARM2'), +(-1036000,'You there, check out that noise.',5775,6,7,0,'smite INST_SAY_ALARM1'), +(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,6,7,0,'smite INST_SAY_ALARM2'), (-1036002,'You land lubbers are tougher than I thought! I\'ll have to improvise!',5778,0,0,21,'smite SAY_PHASE_2'), (-1036003,'D\'ah! Now you\'re making me angry!',5779,0,0,15,'smite SAY_PHASE_3'); diff --git a/system/revision_nr.h b/system/revision_nr.h index 35a02a18..58590a9e 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0471" + #define REVISION_NR "0472" #endif // __REVISION_NR_H__ From 67f9fa868ae6c3b2bb5acce4a349316d90a80882 Mon Sep 17 00:00:00 2001 From: stfx Date: Mon, 26 Sep 2011 18:49:59 +0100 Subject: [PATCH 07/15] [z0473] Let SD2 wrapper to change equipment to use MaNGOS wrapper Signed-off-by: Schmoozerd --- include/sc_creature.cpp | 16 ++++++++-------- include/sc_creature.h | 2 +- system/revision_nr.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/sc_creature.cpp b/include/sc_creature.cpp index 8061b982..67795a20 100644 --- a/include/sc_creature.cpp +++ b/include/sc_creature.cpp @@ -458,22 +458,22 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float fMinimumRange) return pPlayer; } -void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged) +void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 iMainHand, int32 iOffHand, int32 iRanged) { if (bLoadDefault) { - m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipmentId,true); + m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipmentId, true); return; } - if (uiMainHand >= 0) - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand)); + if (iMainHand >= 0) + m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_0, iMainHand); - if (uiOffHand >= 0) - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand)); + if (iOffHand >= 0) + m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_1, iOffHand); - if (uiRanged >= 0) - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged)); + if (iRanged >= 0) + m_creature->SetVirtualItem(VIRTUAL_ITEM_SLOT_2, iRanged); } void ScriptedAI::SetCombatMovement(bool bCombatMove) diff --git a/include/sc_creature.h b/include/sc_creature.h index 03269d46..20d9c6a0 100644 --- a/include/sc_creature.h +++ b/include/sc_creature.h @@ -177,7 +177,7 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI //Checks if you can cast the specified spell bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false); - void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); + void SetEquipmentSlots(bool bLoadDefault, int32 iMainHand = EQUIP_NO_CHANGE, int32 iOffHand = EQUIP_NO_CHANGE, int32 iRanged = EQUIP_NO_CHANGE); //Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims void SetCombatMovement(bool bCombatMove); diff --git a/system/revision_nr.h b/system/revision_nr.h index 58590a9e..9c4391dc 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0472" + #define REVISION_NR "0473" #endif // __REVISION_NR_H__ From d667bdc70463b16beefd09dd7190f1e34c24e043 Mon Sep 17 00:00:00 2001 From: Salja Date: Mon, 26 Sep 2011 22:41:48 +0200 Subject: [PATCH 08/15] [z0474] Fix some problems with escortAI releated to special InCombat behaviour Thanks to Faq for pointing. Note that many of these problems are releated to default InCombat behaviour in core. --- base/escort_ai.cpp | 15 +++++++++++---- system/revision_nr.h | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/base/escort_ai.cpp b/base/escort_ai.cpp index eaa4a17c..8d85138b 100644 --- a/base/escort_ai.cpp +++ b/base/escort_ai.cpp @@ -97,6 +97,9 @@ void npc_escortAI::AttackStart(Unit* pWho) void npc_escortAI::EnterCombat(Unit* pEnemy) { + // Store combat start position + m_creature->SetCombatStartPosition(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + if (!pEnemy) return; @@ -234,10 +237,11 @@ void npc_escortAI::EnterEvadeMode() if (HasEscortState(STATE_ESCORT_ESCORTING)) { - debug_log("SD0: EscortAI has left combat and is now returning to CombatStartPosition."); - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + // We have left our path + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) { + debug_log("SD0: EscortAI has left combat and is now returning to CombatStartPosition."); + AddEscortState(STATE_ESCORT_RETURNING); float fPosX, fPosY, fPosZ; @@ -400,12 +404,15 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) //Make sure that we are still on the right waypoint if (CurrentWP->uiId != uiPointId) { - error_log("SD0: EscortAI reached waypoint out of order %u, expected %u.", uiPointId, CurrentWP->uiId); + error_log("SD0: EscortAI for Npc %u reached waypoint out of order %u, expected %u.", m_creature->GetEntry(), uiPointId, CurrentWP->uiId); return; } debug_log("SD0: EscortAI waypoint %u reached.", CurrentWP->uiId); + // In case we were moving while in combat, we should evade back to this position + m_creature->SetCombatStartPosition(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + //Call WP function WaypointReached(CurrentWP->uiId); diff --git a/system/revision_nr.h b/system/revision_nr.h index 9c4391dc..b3bd2df7 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0473" + #define REVISION_NR "0474" #endif // __REVISION_NR_H__ From b5302cb304352ffbd9f65253adf788cfe41befcb Mon Sep 17 00:00:00 2001 From: Salja Date: Mon, 3 Oct 2011 13:18:57 +0200 Subject: [PATCH 09/15] [z0475] Forgot SQL Update from last Commit. Signed-off-by: Salja --- sql/Updates/z0475_rxxxx_scriptdevzero.sql | 1 + system/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/Updates/z0475_rxxxx_scriptdevzero.sql diff --git a/sql/Updates/z0475_rxxxx_scriptdevzero.sql b/sql/Updates/z0475_rxxxx_scriptdevzero.sql new file mode 100644 index 00000000..cdfd62dc --- /dev/null +++ b/sql/Updates/z0475_rxxxx_scriptdevzero.sql @@ -0,0 +1 @@ +UPDATE script_texts SET type=6 WHERE entry IN (-1036000, -1036001); diff --git a/system/revision_nr.h b/system/revision_nr.h index b3bd2df7..3a436be8 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0474" + #define REVISION_NR "0475" #endif // __REVISION_NR_H__ From 4ebec9fae3bb2d5cb67393316872dc76f2d5a6ae Mon Sep 17 00:00:00 2001 From: stfx Date: Thu, 6 Oct 2011 15:45:30 +0100 Subject: [PATCH 10/15] [z0476] Add save & load support for Deadmines * Improve code in a few places * Remove unneeded script for a lever Signed-off-by: Schmoozerd --- .../eastern_kingdoms/deadmines/deadmines.cpp | 46 +++-------- .../eastern_kingdoms/deadmines/deadmines.h | 15 ++-- .../deadmines/instance_deadmines.cpp | 80 ++++++++++++------- sql/Updates/z0476_rxxxx_mangoszero.sql | 1 + sql/mangoszero_scriptname_full.sql | 1 - system/revision_nr.h | 2 +- 6 files changed, 76 insertions(+), 69 deletions(-) create mode 100644 sql/Updates/z0476_rxxxx_mangoszero.sql diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.cpp b/scripts/eastern_kingdoms/deadmines/deadmines.cpp index 7ccd4b77..2b602c53 100644 --- a/scripts/eastern_kingdoms/deadmines/deadmines.cpp +++ b/scripts/eastern_kingdoms/deadmines/deadmines.cpp @@ -274,21 +274,6 @@ CreatureAI* GetAI_boss_mr_smite(Creature* pCreature) return new boss_mr_smiteAI(pCreature); } -bool GOUse_go_door_lever_dm(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); - - if (!pInstance) - return false; - - GameObject* pGoDoor = pInstance->GetSingleGameObjectFromStorage(GO_IRON_CLAD_DOOR); - - if (pGoDoor && pGoDoor->GetGoState() == GO_STATE_READY) - return false; - - return true; -} - bool GOUse_go_defias_cannon(Player* pPlayer, GameObject* pGo) { ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); @@ -296,29 +281,24 @@ bool GOUse_go_defias_cannon(Player* pPlayer, GameObject* pGo) if (!pInstance) return false; - if (pInstance->GetData(TYPE_DEFIAS_ENDDOOR) == DONE || pInstance->GetData(TYPE_DEFIAS_ENDDOOR) == IN_PROGRESS) + if (pInstance->GetData(TYPE_IRON_CLAD_DOOR) == DONE) return false; - pInstance->SetData(TYPE_DEFIAS_ENDDOOR, IN_PROGRESS); + pInstance->SetData(TYPE_IRON_CLAD_DOOR, DONE); return false; } void AddSC_deadmines() { - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_mr_smite"; - newscript->GetAI = &GetAI_boss_mr_smite; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_door_lever_dm"; - newscript->pGOUse = &GOUse_go_door_lever_dm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_defias_cannon"; - newscript->pGOUse = &GOUse_go_defias_cannon; - newscript->RegisterSelf(); + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_mr_smite"; + pNewScript->GetAI = &GetAI_boss_mr_smite; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_defias_cannon"; + pNewScript->pGOUse = &GOUse_go_defias_cannon; + pNewScript->RegisterSelf(); } diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.h b/scripts/eastern_kingdoms/deadmines/deadmines.h index f0031d50..5ac6eaff 100644 --- a/scripts/eastern_kingdoms/deadmines/deadmines.h +++ b/scripts/eastern_kingdoms/deadmines/deadmines.h @@ -24,20 +24,19 @@ enum { MAX_ENCOUNTER = 4, - TYPE_DEFIAS_ENDDOOR = 1, - TYPE_RHAHKZOR = 2, - TYPE_SNEED = 3, - TYPE_GILNID = 4, + TYPE_RHAHKZOR = 0, + TYPE_SNEED = 1, + TYPE_GILNID = 2, + TYPE_IRON_CLAD_DOOR = 3, INST_SAY_ALARM1 = -1036000, INST_SAY_ALARM2 = -1036001, GO_FACTORY_DOOR = 13965, // rhahk'zor - GO_FOUNDRY_DOOR = 16399, // gilnid GO_MAST_ROOM_DOOR = 16400, // sneed + GO_FOUNDRY_DOOR = 16399, // gilnid GO_HEAVY_DOOR_1 = 17153, // to sneed GO_HEAVY_DOOR_2 = 17154, // to gilnid - GO_DOOR_LEVER = 101833, GO_IRON_CLAD_DOOR = 16397, GO_DEFIAS_CANNON = 16398, GO_SMITE_CHEST = 144111, // use to get correct location of mr.smites equipment changes @@ -65,10 +64,14 @@ class MANGOS_DLL_DECL instance_deadmines : public ScriptedInstance void SetData(uint32 uiType, uint32 uiData); uint32 GetData(uint32 uiType); + const char* Save() { return m_strInstData.c_str(); } + void Load(const char* chrIn); + void Update(uint32 uiDiff); private: uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string m_strInstData; uint32 m_uiIronDoorTimer; }; diff --git a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp index bba22e00..4f4bcd72 100644 --- a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp +++ b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp @@ -49,21 +49,25 @@ void instance_deadmines::OnObjectCreate(GameObject* pGo) switch(pGo->GetEntry()) { case GO_FACTORY_DOOR: - if (GetData(TYPE_RHAHKZOR) == DONE) + if (m_auiEncounter[TYPE_RHAHKZOR] == DONE) pGo->SetGoState(GO_STATE_ACTIVE); break; case GO_MAST_ROOM_DOOR: - if (GetData(TYPE_SNEED) == DONE) + if (m_auiEncounter[TYPE_SNEED] == DONE) pGo->SetGoState(GO_STATE_ACTIVE); break; case GO_FOUNDRY_DOOR: - if (GetData(TYPE_GILNID) == DONE) + if (m_auiEncounter[TYPE_GILNID] == DONE) pGo->SetGoState(GO_STATE_ACTIVE); break; case GO_IRON_CLAD_DOOR: + if (m_auiEncounter[TYPE_IRON_CLAD_DOOR] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); + + break; case GO_DEFIAS_CANNON: case GO_SMITE_CHEST: break; @@ -79,15 +83,9 @@ void instance_deadmines::OnCreatureDeath(Creature* pCreature) { switch(pCreature->GetEntry()) { - case NPC_RHAHKZOR: - SetData(TYPE_RHAHKZOR, DONE); - break; - case NPC_SNEED: - SetData(TYPE_SNEED, DONE); - break; - case NPC_GILNID: - SetData(TYPE_GILNID, DONE); - break; + case NPC_RHAHKZOR: SetData(TYPE_RHAHKZOR, DONE); break; + case NPC_SNEED: SetData(TYPE_SNEED, DONE); break; + case NPC_GILNID: SetData(TYPE_GILNID, DONE); break; } } @@ -100,7 +98,7 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData) if (uiData == DONE) DoUseDoorOrButton(GO_FACTORY_DOOR); - m_auiEncounter[1] = uiData; + m_auiEncounter[uiType] = uiData; break; } case TYPE_SNEED: @@ -108,7 +106,7 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData) if (uiData == DONE) DoUseDoorOrButton(GO_MAST_ROOM_DOOR); - m_auiEncounter[2] = uiData; + m_auiEncounter[uiType] = uiData; break; } case TYPE_GILNID: @@ -116,12 +114,12 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData) if (uiData == DONE) DoUseDoorOrButton(GO_FOUNDRY_DOOR); - m_auiEncounter[3] = uiData; + m_auiEncounter[uiType] = uiData; break; } - case TYPE_DEFIAS_ENDDOOR: + case TYPE_IRON_CLAD_DOOR: { - if (uiData == IN_PROGRESS) + if (uiData == DONE) { DoUseDoorOrButton(GO_IRON_CLAD_DOOR, 0, true); m_uiIronDoorTimer = 15000; @@ -146,27 +144,53 @@ void instance_deadmines::SetData(uint32 uiType, uint32 uiData) } } - m_auiEncounter[0] = uiData; + m_auiEncounter[uiType] = uiData; break; } } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + + m_strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } uint32 instance_deadmines::GetData(uint32 uiType) { - switch(uiType) + if (uiType < MAX_ENCOUNTER) + return m_auiEncounter[uiType]; + + return 0; +} + +void instance_deadmines::Load(const char* chrIn) +{ + if (!chrIn) { - case TYPE_DEFIAS_ENDDOOR: - return m_auiEncounter[0]; - case TYPE_RHAHKZOR: - return m_auiEncounter[1]; - case TYPE_SNEED: - return m_auiEncounter[2]; - case TYPE_GILNID: - return m_auiEncounter[3]; + OUT_LOAD_INST_DATA_FAIL; + return; } - return 0; + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; } void instance_deadmines::Update(uint32 uiDiff) diff --git a/sql/Updates/z0476_rxxxx_mangoszero.sql b/sql/Updates/z0476_rxxxx_mangoszero.sql new file mode 100644 index 00000000..6f927771 --- /dev/null +++ b/sql/Updates/z0476_rxxxx_mangoszero.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=101833; diff --git a/sql/mangoszero_scriptname_full.sql b/sql/mangoszero_scriptname_full.sql index 5c743012..f3eee6b7 100644 --- a/sql/mangoszero_scriptname_full.sql +++ b/sql/mangoszero_scriptname_full.sql @@ -239,7 +239,6 @@ UPDATE creature_template SET ScriptName='npc_threshwackonator' WHERE entry=6669; UPDATE creature_template SET ScriptName='boss_mr_smite' WHERE entry=646; UPDATE instance_template SET ScriptName='instance_deadmines' WHERE map=36; UPDATE gameobject_template SET ScriptName='go_defias_cannon' WHERE entry=16398; -UPDATE gameobject_template SET ScriptName='go_door_lever_dm' WHERE entry=101833; /* DEADWIND PASS */ diff --git a/system/revision_nr.h b/system/revision_nr.h index 3a436be8..021166fc 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0475" + #define REVISION_NR "0476" #endif // __REVISION_NR_H__ From b2f8b330319dcc08976f5951b179474df1e07fb2 Mon Sep 17 00:00:00 2001 From: stfx Date: Thu, 6 Oct 2011 15:22:10 +0100 Subject: [PATCH 11/15] [z0477] Add better support for CHAT_TYPE_ZONE_YELL. Requires MaNGOS [11812] * Improve a few style thingies * Fix a bug that would play sound with the Simulate function without having ZONE_YELL tpye * Add support to play sound of ZONE_YELL to the whole zone * Add support for whispered sound (currently unused) Signed-off-by: Schmoozerd --- ScriptMgr.cpp | 50 ++++++++++++++++++++++++++------------------ system/revision_nr.h | 2 +- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/ScriptMgr.cpp b/ScriptMgr.cpp index cc5377bf..5381af4d 100644 --- a/ScriptMgr.cpp +++ b/ScriptMgr.cpp @@ -148,7 +148,7 @@ void InitScriptLibrary() /** * Function that does script text * - * @param iTextEntry Entry of the text, stored in SD2-database + * @param iTextEntry Entry of the text, stored in SD0-database * @param pSource Source of the text * @param pTarget Can be NULL (depending on CHAT_TYPE of iTextEntry). Possible target for the text */ @@ -169,7 +169,6 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) } const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry); - if (!pData) { error_log("SD0: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", @@ -184,7 +183,18 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pData->uiSoundId) { if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) - pSource->PlayDirectSound(pData->uiSoundId); + { + if (pData->uiType == CHAT_TYPE_ZONE_YELL) + pSource->GetMap()->PlayDirectSoundToMap(pData->uiSoundId, pSource->GetZoneId()); + else if (pData->uiType == CHAT_TYPE_WHISPER || pData->uiType == CHAT_TYPE_BOSS_WHISPER) + { + // An error will be displayed for the text + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pSource->PlayDirectSound(pData->uiSoundId, (Player*)pTarget); + } + else + pSource->PlayDirectSound(pData->uiSoundId); + } else error_log("SD0: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); } @@ -238,7 +248,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) /** * Function that either simulates or does script text for a map * - * @param iTextEntry Entry of the text, stored in SD2-database, only type CHAT_TYPE_ZONE_YELL supported + * @param iTextEntry Entry of the text, stored in SD0-database, only type CHAT_TYPE_ZONE_YELL supported * @param uiCreatureEntry Id of the creature of whom saying will be simulated * @param pMap Given Map on which the map-wide text is displayed * @param pCreatureSource Can be NULL. If pointer to Creature is given, then the creature does the map-wide text @@ -248,51 +258,51 @@ void DoOrSimulateScriptTextForMap(int32 iTextEntry, uint32 uiCreatureEntry, Map* { if (!pMap) { - error_log("SD2: DoOrSimulateScriptTextForMap entry %i, invalid Map pointer.", iTextEntry); + error_log("SD0: DoOrSimulateScriptTextForMap entry %i, invalid Map pointer.", iTextEntry); return; } if (iTextEntry >= 0) { - error_log("SD2: DoOrSimulateScriptTextForMap with source entry %u for map %u attempts to process text entry %i, but text entry must be negative.", uiCreatureEntry, pMap->GetId(), iTextEntry); + error_log("SD0: DoOrSimulateScriptTextForMap with source entry %u for map %u attempts to process text entry %i, but text entry must be negative.", uiCreatureEntry, pMap->GetId(), iTextEntry); return; } CreatureInfo const* pInfo = GetCreatureTemplateStore(uiCreatureEntry); if (!pInfo) { - error_log("SD2: DoOrSimulateScriptTextForMap has invalid source entry %u for map %u.", uiCreatureEntry, pMap->GetId()); + error_log("SD0: DoOrSimulateScriptTextForMap has invalid source entry %u for map %u.", uiCreatureEntry, pMap->GetId()); return; } const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry); - if (!pData) { - error_log("SD2: DoOrSimulateScriptTextForMap with source entry %u for map %u could not find text entry %i.", uiCreatureEntry, pMap->GetId(), iTextEntry); + error_log("SD0: DoOrSimulateScriptTextForMap with source entry %u for map %u could not find text entry %i.", uiCreatureEntry, pMap->GetId(), iTextEntry); return; } - debug_log("SD2: DoOrSimulateScriptTextForMap: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", + debug_log("SD0: DoOrSimulateScriptTextForMap: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); + if (pData->uiType != CHAT_TYPE_ZONE_YELL) + { + error_log("SD0: DoSimulateScriptTextForMap entry %i has not supported chat type %u.", iTextEntry, pData->uiType); + return; + } + if (pData->uiSoundId) { if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) pMap->PlayDirectSoundToMap(pData->uiSoundId); else - error_log("SD2: DoOrSimulateScriptTextForMap entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); + error_log("SD0: DoOrSimulateScriptTextForMap entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); } - if (pData->uiType == CHAT_TYPE_ZONE_YELL) - { - if (pCreatureSource) // If provided pointer for sayer, use direct version - pMap->MonsterYellToMap(pCreatureSource->GetObjectGuid(), iTextEntry, pData->uiLanguage, pTarget); - else // Simulate yell - pMap->MonsterYellToMap(pInfo, iTextEntry, pData->uiLanguage, pTarget); - } - else - error_log("SD2: DoSimulateScriptTextForMap entry %i has not supported chat type %u.", iTextEntry, pData->uiType); + if (pCreatureSource) // If provided pointer for sayer, use direct version + pMap->MonsterYellToMap(pCreatureSource->GetObjectGuid(), iTextEntry, pData->uiLanguage, pTarget); + else // Simulate yell + pMap->MonsterYellToMap(pInfo, iTextEntry, pData->uiLanguage, pTarget); } //********************************* diff --git a/system/revision_nr.h b/system/revision_nr.h index 021166fc..0bf77269 100644 --- a/system/revision_nr.h +++ b/system/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "0476" + #define REVISION_NR "0477" #endif // __REVISION_NR_H__ From 6b801767e325ab735985bb6a163027a8d6bc0999 Mon Sep 17 00:00:00 2001 From: TheLuda Date: Thu, 6 Oct 2011 21:04:40 +0200 Subject: [PATCH 12/15] Corrected update query. Signed-off-by: TheLuda --- sql/Updates/z0472_r2300_scriptdevzero.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/Updates/z0472_r2300_scriptdevzero.sql b/sql/Updates/z0472_r2300_scriptdevzero.sql index 76b4cb2d..d8fbb524 100644 --- a/sql/Updates/z0472_r2300_scriptdevzero.sql +++ b/sql/Updates/z0472_r2300_scriptdevzero.sql @@ -1,3 +1,4 @@ DELETE FROM script_texts WHERE entry=-1000716; + INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES -(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'), +(-1000716,'To Nighthaven! Keep your army close, champion. ',0,0,0,0,'remulos SAY_REMULOS_INTRO_2'); From 16fa8c6bd38dc36419be0e4307c0538977190828 Mon Sep 17 00:00:00 2001 From: TheLuda Date: Thu, 6 Oct 2011 21:16:34 +0200 Subject: [PATCH 13/15] Corrected update query. The update was meant to update a game object template, not a creature template. Signed-off-by: TheLuda --- sql/Updates/z0476_rxxxx_mangoszero.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/Updates/z0476_rxxxx_mangoszero.sql b/sql/Updates/z0476_rxxxx_mangoszero.sql index 6f927771..fcfcff32 100644 --- a/sql/Updates/z0476_rxxxx_mangoszero.sql +++ b/sql/Updates/z0476_rxxxx_mangoszero.sql @@ -1 +1 @@ -UPDATE creature_template SET ScriptName='' WHERE entry=101833; +UPDATE gameobject_template SET ScriptName='' WHERE entry=101833; From 0bad8a57fad6ba5e149fb1c22ba32528e6219f56 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 27 Oct 2011 16:35:25 -0400 Subject: [PATCH 14/15] Fix compile error. --- ScriptMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScriptMgr.cpp b/ScriptMgr.cpp index 5381af4d..c69c84ef 100644 --- a/ScriptMgr.cpp +++ b/ScriptMgr.cpp @@ -185,7 +185,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) { if (pData->uiType == CHAT_TYPE_ZONE_YELL) - pSource->GetMap()->PlayDirectSoundToMap(pData->uiSoundId, pSource->GetZoneId()); + pSource->GetMap()->PlayDirectSoundToMap(pData->uiSoundId); else if (pData->uiType == CHAT_TYPE_WHISPER || pData->uiType == CHAT_TYPE_BOSS_WHISPER) { // An error will be displayed for the text From e8dab6dcb0b15de76956fb2317b82c241857027d Mon Sep 17 00:00:00 2001 From: ondravondra Date: Wed, 4 Jan 2012 11:22:35 +0100 Subject: [PATCH 15/15] Vael corrections corrected vael's cleave spell id and timer corrected vael's burning adrenaline casting order (mana user, mana user, tank, ...) removed bug where no other vael's abilities were used when there was no mana user (return at line 291) --- .../blackwing_lair/boss_vaelastrasz.cpp | 81 ++++++++++--------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp index be98e55a..e68f4a18 100644 --- a/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp @@ -43,7 +43,7 @@ enum SPELL_FIRE_NOVA = 23462, SPELL_TAIL_SWEEP = 15847, SPELL_BURNING_ADRENALINE = 23620, - SPELL_CLEAVE = 20684, // Chain cleave is most likely named something different and contains a dummy effect + SPELL_CLEAVE = 19983, // Chain cleave is most likely named something different and contains a dummy effect SPELL_NEFARIUS_CORRUPTION = 23642, @@ -83,8 +83,8 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI uint32 m_uiCleaveTimer; uint32 m_uiFlameBreathTimer; uint32 m_uiFireNovaTimer; - uint32 m_uiBurningAdrenalineCasterTimer; - uint32 m_uiBurningAdrenalineTankTimer; + uint32 m_uiBurningAdrenalineTimer; + uint32 m_uiBurningAdrenalineTarget; // 0,1 caster 2 tank uint32 m_uiTailSweepTimer; bool m_bHasYelled; @@ -96,10 +96,10 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI m_uiIntroPhase = 0; m_uiSpeechTimer = 0; m_uiSpeechNum = 0; - m_uiCleaveTimer = 8000; // These times are probably wrong + m_uiCleaveTimer = 6000; // These times are probably wrong m_uiFlameBreathTimer = 11000; - m_uiBurningAdrenalineCasterTimer = 15000; - m_uiBurningAdrenalineTankTimer = 45000; + m_uiBurningAdrenalineTimer = 15000; + m_uiBurningAdrenalineTarget = 0; m_uiFireNovaTimer = 5000; m_uiTailSweepTimer = 20000; m_bHasYelled = false; @@ -171,6 +171,29 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI } } + Unit *GetManaUserForBA() + { + std::vector vManaPlayers; + + // Scan for mana targets in threat list + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + vManaPlayers.reserve(tList.size()); + for (ThreatList::const_iterator iter = tList.begin();iter != tList.end(); ++iter) + { + Unit* pTempTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid()); + + if (pTempTarget && pTempTarget->getPowerType() == POWER_MANA && pTempTarget->GetTypeId() == TYPEID_PLAYER) + vManaPlayers.push_back(pTempTarget); + } + + if (!vManaPlayers.empty()) + { + return vManaPlayers[urand(0, vManaPlayers.size() - 1)]; + } + + return NULL; + } + void UpdateAI(const uint32 uiDiff) { if (m_uiIntroTimer) @@ -257,7 +280,7 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI if (m_uiCleaveTimer < uiDiff) { if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK) - m_uiCleaveTimer = 15000; + m_uiCleaveTimer = 6000; } else m_uiCleaveTimer -= uiDiff; @@ -272,43 +295,29 @@ struct MANGOS_DLL_DECL boss_vaelastraszAI : public ScriptedAI m_uiFlameBreathTimer -= uiDiff; // Burning Adrenaline Caster Timer - if (m_uiBurningAdrenalineCasterTimer < uiDiff) + if (m_uiBurningAdrenalineTimer < uiDiff) { - std::vector vManaPlayers; + Unit * pTarget = NULL; - // Scan for mana targets in threat list - ThreatList const& tList = m_creature->getThreatManager().getThreatList(); - vManaPlayers.reserve(tList.size()); - for (ThreatList::const_iterator iter = tList.begin();iter != tList.end(); ++iter) + if (m_uiBurningAdrenalineTarget < 2) { - Unit* pTempTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid()); - - if (pTempTarget && pTempTarget->getPowerType() == POWER_MANA && pTempTarget->GetTypeId() == TYPEID_PLAYER) - vManaPlayers.push_back(pTempTarget); + pTarget = GetManaUserForBA(); + } else { + pTarget = m_creature->getVictim(); } - if (vManaPlayers.empty()) - return; - - Unit* pTarget = vManaPlayers[urand(0, vManaPlayers.size() - 1)]; - pTarget->CastSpell(pTarget, SPELL_BURNING_ADRENALINE, true, NULL, NULL, m_creature->GetObjectGuid()); - - m_uiBurningAdrenalineCasterTimer = 15000; - } - else - m_uiBurningAdrenalineCasterTimer -= uiDiff; - - // Burning Adrenaline Tank Timer - if (m_uiBurningAdrenalineTankTimer < uiDiff) - { - // have the victim cast the spell on himself otherwise the third effect aura will be applied - // to Vael instead of the player - m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_BURNING_ADRENALINE, true, NULL, NULL, m_creature->GetObjectGuid()); + if (pTarget) + { + // have the victim cast the spell on himself otherwise the third effect aura will be applied + // to Vael instead of the player + pTarget->CastSpell(pTarget, SPELL_BURNING_ADRENALINE, true, NULL, NULL, m_creature->GetObjectGuid()); + } - m_uiBurningAdrenalineTankTimer = 45000; + m_uiBurningAdrenalineTimer = 15000; + m_uiBurningAdrenalineTarget = (m_uiBurningAdrenalineTarget + 1) % 3; } else - m_uiBurningAdrenalineTankTimer -= uiDiff; + m_uiBurningAdrenalineTimer -= uiDiff; // Fire Nova Timer if (m_uiFireNovaTimer < uiDiff)