From d7fa310ebe1b32adca1b0bc43815ffac9608d122 Mon Sep 17 00:00:00 2001 From: Charles A Edwards Date: Fri, 2 Sep 2016 09:16:33 +0100 Subject: [PATCH] Script added - npc_kharan_mighthammer Script added - npc_kharan_mighthammer --- src/modules/SD3/include/sc_creature.cpp | 5 +- .../blackrock_depths/blackrock_depths.cpp | 99 ++++++++++- .../molten_core/molten_core.cpp | 6 +- .../kalimdor/ruins_of_ahnqiraj/boss_moam.cpp | 5 - .../SD3/scripts/northrend/borean_tundra.cpp | 161 ++++++++++++++++-- .../auchindoun/mana_tombs/mana_tombs.cpp | 1 + .../SD3/scripts/outland/shadowmoon_valley.cpp | 4 +- 7 files changed, 250 insertions(+), 31 deletions(-) diff --git a/src/modules/SD3/include/sc_creature.cpp b/src/modules/SD3/include/sc_creature.cpp index 647cf12a0..b15f5c76b 100644 --- a/src/modules/SD3/include/sc_creature.cpp +++ b/src/modules/SD3/include/sc_creature.cpp @@ -58,9 +58,8 @@ bool ScriptedAI::IsVisible(Unit* pWho) const { return false; } - - // return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->IsVisibleForOrDetect(m_creature, m_creature, true); 166.0f - return m_creature->IsWithinDist(pWho, 166.0f) && pWho->IsVisibleForOrDetect(m_creature, m_creature, true); + + return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->IsVisibleForOrDetect(m_creature, m_creature, true); } /** diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp index 1e6246bfc..eb65c3b93 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/blackrock_depths/blackrock_depths.cpp @@ -28,7 +28,7 @@ * ScriptData * SDName: Blackrock_Depths * SD%Complete: 80 - * SDComment: Quest support: 4322, 7604, 9015. + * SDComment: Quest support: 4001, 4322, 4342, 7604, 9015. * SDCategory: Blackrock Depths * EndScriptData */ @@ -39,6 +39,7 @@ * go_relic_coffer_door * at_ring_of_law * npc_grimstone + * npc_kharan_mighthammer * npc_marshal_windsor * npc_dughal_stormwing * npc_tobias_seecher @@ -1129,6 +1130,100 @@ struct boss_doomrel : public CreatureScript } }; + +/*###### +## npc_kharan_mighthammer +######*/ +enum +{ + QUEST_WHAT_IS_GOING_ON = 4001, + QUEST_KHARANS_TALE = 4342 +}; + +#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" +#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" + +#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." +#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." +#define GOSSIP_ITEM_KHARAN_5 "So what happened?" +#define GOSSIP_ITEM_KHARAN_6 "Continue..." +#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" +#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." +#define GOSSIP_ITEM_KHARAN_9 "Indeed." +#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." + +struct npc_kharan_mighthammer : public CreatureScript +{ + npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") {} + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) override + { + if (pCreature->IsQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetObjectGuid()); + + if (pPlayer->GetQuestStatus(QUEST_WHAT_IS_GOING_ON) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestStatus(QUEST_KHARANS_TALE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + if (pPlayer->GetTeam() == HORDE) + pPlayer->SEND_GOSSIP_MENU(2473, pCreature->GetObjectGuid()); + else + pPlayer->SEND_GOSSIP_MENU(2474, pCreature->GetObjectGuid()); + + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) override + { + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2475, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2476, pCreature->GetObjectGuid()); + break; + + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(2477, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(2478, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(2479, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(2480, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + pPlayer->SEND_GOSSIP_MENU(2481, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + pPlayer->SEND_GOSSIP_MENU(2482, pCreature->GetObjectGuid()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pPlayer->GetTeam() == HORDE) + pPlayer->AreaExploredOrEventHappens(QUEST_WHAT_IS_GOING_ON); + else + pPlayer->AreaExploredOrEventHappens(QUEST_KHARANS_TALE); + break; + } + return true; + } +}; + void AddSC_blackrock_depths() { Script *s; @@ -1155,6 +1250,8 @@ void AddSC_blackrock_depths() s->RegisterSelf(); s = new boss_doomrel(); s->RegisterSelf(); + s = new npc_kharan_mighthammer(); + s->RegisterSelf(); //pNewScript = new Script; //pNewScript->Name = "go_shadowforge_brazier"; diff --git a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp index 5cac04c6f..21f552e2c 100644 --- a/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp +++ b/src/modules/SD3/scripts/eastern_kingdoms/blackrock_mountain/molten_core/molten_core.cpp @@ -35,14 +35,14 @@ /** * ContentData -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) || defined(CATA) * go_molten_core_rune #endif * EndContentData */ #include "precompiled.h" -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) || defined(CATA) #include "molten_core.h" /*###### @@ -74,7 +74,7 @@ struct go_molten_core_rune : public GameObjectScript #endif void AddSC_molten_core() { -#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) +#if defined (CLASSIC) || defined (TBC) || defined(WOTLK) || defined(CATA) Script* s; s = new go_molten_core_rune(); s->RegisterSelf(); diff --git a/src/modules/SD3/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp b/src/modules/SD3/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp index 74358588c..8a4501503 100644 --- a/src/modules/SD3/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp +++ b/src/modules/SD3/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp @@ -82,12 +82,7 @@ struct boss_moam : public CreatureScript void Aggro(Unit* /*pWho*/) override { DoScriptText(EMOTE_AGGRO, m_creature); -#if defined (CLASSIC) || defined (TBC) || defined (WOTLK) m_creature->SetMaxPower(POWER_MANA, m_creature->GetCreatureInfo()->MaxLevelMana); -#endif -#if defined (CATA) - m_creature->SetMaxPower(POWER_MANA, m_creature->GetCreatureInfo()->MaxLevelMana);// TODO MaxLevelHealth); -#endif } void UpdateAI(const uint32 uiDiff) override diff --git a/src/modules/SD3/scripts/northrend/borean_tundra.cpp b/src/modules/SD3/scripts/northrend/borean_tundra.cpp index 8e51c8ab6..18a7e0516 100644 --- a/src/modules/SD3/scripts/northrend/borean_tundra.cpp +++ b/src/modules/SD3/scripts/northrend/borean_tundra.cpp @@ -1,4 +1,11 @@ -/* Copyright (C) 2006 - 2013 ScriptDev2 +/** + * ScriptDev3 is an extension for mangos providing enhanced features for + * area triggers, creatures, game objects, instances, items, and spells beyond + * the default database scripting in mangos. + * + * Copyright (C) 2006-2013 ScriptDev2 + * Copyright (C) 2014-2016 MaNGOS + * * 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 @@ -17,23 +24,28 @@ * and lore are copyrighted by Blizzard Entertainment, Inc. */ -/* ScriptData -SDName: Borean_Tundra -SD%Complete: 100 -SDComment: Quest support: 11570, 11590, 11673, 11728, 11865, 11889, 11897, 11919, 11940 -SDCategory: Borean Tundra -EndScriptData */ +/** + * ScriptData + * SDName: Borean_Tundra + * SD%Complete: 100 + * SDComment: Quest support: 11570, 11590, 11673, 11728, 11865, 11889, 11897, 11919, 11940 + * SDCategory: Borean_Tundra + * EndScriptData + */ -/* ContentData -npc_nesingwary_trapper -npc_sinkhole_kill_credit -npc_lurgglbr -npc_beryl_sorcerer -npc_captured_beryl_sorcerer -npc_nexus_drake_hatchling -npc_scourged_flamespitter -npc_bonker_togglevolt -EndContentData */ +/** + * ContentData + * npc_nesingwary_trapper + * npc_sinkhole_kill_credit + * npc_lurgglbr + * npc_beryl_sorcerer + * npc_captured_beryl_sorcerer + * npc_nexus_drake_hatchling + * npc_scourged_flamespitter + * npc_bonker_togglevolt + * npc_jenny + * EndContentData + */ #include "precompiled.h" #include "escort_ai.h" @@ -1128,6 +1140,119 @@ struct npc_bonker_togglevolt : public CreatureScript } }; +/*###### +## npc_jenny +######*/ + +enum +{ + SPELL_CREATES_CARRIED = 46340, + SPELL_DROP_CRATE = 46342, + SPELL_JENNY_CREDIT = 46358, + + NPC_FEZZIX = 25849, + + QUEST_ID_LOADER_UP = 11881, +}; + +struct npc_jenny : public CreatureScript +{ + npc_jenny() : CreatureScript("npc_jenny") {} + + struct npc_jennyAI : public FollowerAI + { + npc_jennyAI(Creature* pCreature) : FollowerAI(pCreature) + { + m_bFollowStarted = false; + m_bEventComplete = false; + Reset(); + } + + bool m_bEventComplete; + bool m_bFollowStarted; + + uint32 m_uiDropDelayTimer; + + void Reset() override + { + m_uiDropDelayTimer = 0; + } + + void AttackedBy(Unit* pAttacker) override + { + if (!m_uiDropDelayTimer) + { + if (DoCastSpellIfCan(m_creature, SPELL_DROP_CRATE) == CAST_OK) + { + m_creature->RemoveAuraHolderFromStack(SPELL_CREATES_CARRIED); + m_uiDropDelayTimer = 10000; + + // check if all crates are dropped + if (!m_creature->HasAura(SPELL_CREATES_CARRIED)) + { + FollowerAI::JustDied(pAttacker); + m_creature->ForcedDespawn(); + } + } + } + } + + void AttackStart(Unit* pWho) override { } + + void MoveInLineOfSight(Unit* pWho) override + { + if (m_bEventComplete) + return; + + if (pWho->GetEntry() == NPC_FEZZIX && m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + if (DoCastSpellIfCan(m_creature, SPELL_JENNY_CREDIT) == CAST_OK) + { + SetFollowComplete(true); + + float fX, fY, fZ; + pWho->GetContactPoint(m_creature, fX, fY, fZ); + m_creature->GetMotionMaster()->MovePoint(0, fX, fY, fZ); + m_creature->ForcedDespawn(15000); + + m_bEventComplete = true; + } + } + } + + void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_bFollowStarted) + { + if (Player* pSummoner = m_creature->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + StartFollow(pSummoner, pSummoner->getFaction(), GetQuestTemplateStore(QUEST_ID_LOADER_UP)); + + if (DoCastSpellIfCan(m_creature, SPELL_CREATES_CARRIED) == CAST_OK) + m_bFollowStarted = true; + } + } + + if (m_uiDropDelayTimer) + { + if (m_uiDropDelayTimer <= uiDiff) + m_uiDropDelayTimer = 0; + else + m_uiDropDelayTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + } + + }; + + CreatureAI* GetAI(Creature* pCreature) override + { + return new npc_jennyAI(pCreature); + } +}; + void AddSC_borean_tundra() { Script* s; @@ -1146,6 +1271,8 @@ void AddSC_borean_tundra() s->RegisterSelf(); s = new npc_bonker_togglevolt(); s->RegisterSelf(); + s = new npc_jenny(); + s->RegisterSelf(); s = new spell_throw_wolf_batt(); s->RegisterSelf(); diff --git a/src/modules/SD3/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp b/src/modules/SD3/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp index f6b79f0b5..55b8f65ca 100644 --- a/src/modules/SD3/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp +++ b/src/modules/SD3/scripts/outland/auchindoun/mana_tombs/mana_tombs.cpp @@ -315,6 +315,7 @@ struct npc_shaheen : public CreatureScript void AddSC_mana_tombs() { Script* s; + s = new npc_shaheen(); s->RegisterSelf(); } diff --git a/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp b/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp index eef58b187..a308fef02 100644 --- a/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp +++ b/src/modules/SD3/scripts/outland/shadowmoon_valley.cpp @@ -1628,7 +1628,7 @@ struct spell_totem_of_spirits : public SpellScript } }; -#if defined (TBC) || defined (WOTLK) +#if defined (TBC) || defined (WOTLK) || defined(CATA) struct aura_elemental_sieve : public AuraScript { aura_elemental_sieve() : AuraScript("aura_elemental_sieve") {} @@ -2333,7 +2333,7 @@ void AddSC_shadowmoon_valley() s->RegisterSelf(); s = new spell_totem_of_spirits(); s->RegisterSelf(); -#if defined (TBC) || defined (WOTLK) +#if defined (TBC) || defined (WOTLK) || defined(CATA) s = new aura_elemental_sieve(); s->RegisterSelf(); #endif