Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From c56724e959647781356bb9de8b3b7e529264f52f Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Tue, 24 Jul 2012 01:17:29 +0300
- Subject: [PATCH] Fix quest Imposing Confrontation
- ---
- src/server/scripts/Maelstrom/deepholm.cpp | 167 +++++++++++++++++++++++++++++
- 1 file changed, 167 insertions(+)
- diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
- index ed3451d..55c3260 100644
- --- a/src/server/scripts/Maelstrom/deepholm.cpp
- +++ b/src/server/scripts/Maelstrom/deepholm.cpp
- @@ -1217,6 +1217,171 @@ class npc_dormant_stonebound_elemental : public CreatureScript
- }
- };
- +/*####
- +## Quest fix support for quest Imposing Confrontation
- +###############*/
- +
- +enum eImposingConfrontationEntries
- +{
- + QUEST_IMPOSING_CONFRONTATION = 26315,
- + SPELL_EARTHEN_RING_PROCLAMATION = 79715,
- + NPC_BODEN_THE_IMPOSING = 42471,
- + QUEST_IMPOSING_CREDIT = 42731,
- + SPELL_KNOCK_BACK = 65873,
- +};
- +
- +#define BODEN_YELL_01 "Hah! Did you mistake me for Diamant, $R? Or perhaps some other whimpering, complaint stone trogg who cares?"
- +#define BODEN_YELL_02 "If you seek peace, relinquish the World Pillar and leave Deepholm. This is our realm. Your only welcome here shall be found underneath my stone foot."
- +
- +#define BODEN_PLAYER_SAY_01 "Boden the Imposing. I come on behalf of the Earthen Ring. We wish your kind no harm. We seek to repair the rift between our worlds. Why do you attack us?"
- +
- +class npc_boden_the_imposing : public CreatureScript
- +{
- + public:
- + npc_boden_the_imposing() : CreatureScript("npc_boden_the_imposing") { }
- +
- + struct npc_boden_the_imposingAI : public ScriptedAI
- + {
- + npc_boden_the_imposingAI(Creature* creature) : ScriptedAI(creature)
- + { pQuestOwner = NULL; }
- +
- + bool bOnQuestEventStarted;
- + uint32 m_saytimer;
- + uint32 m_phase;
- + Player* pQuestOwner;
- +
- + void Reset()
- + {
- + me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE+UNIT_FLAG_NOT_SELECTABLE);
- + bOnQuestEventStarted = false;
- + m_saytimer = 2000;
- + m_phase = 0;
- + pQuestOwner = NULL;
- + }
- +
- + void UpdateAI(uint32 const diff)
- + {
- + if(bOnQuestEventStarted)
- + {
- + if(m_saytimer <= diff)
- + {
- + if(pQuestOwner && pQuestOwner->isAlive() && me->GetDistance(pQuestOwner) <= 50.0f)
- + {
- + switch (m_phase)
- + {
- + case 0: pQuestOwner->MonsterSay(BODEN_PLAYER_SAY_01,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
- + case 1: me->MonsterYell(BODEN_YELL_01,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
- + case 2: me->MonsterYell(BODEN_YELL_02,LANG_UNIVERSAL,pQuestOwner->GetGUID());m_phase++;break;
- + default: break;
- + }
- +
- + if(m_phase == 3 && pQuestOwner->isAlive())
- + {
- + pQuestOwner->KilledMonsterCredit(QUEST_IMPOSING_CREDIT,0);
- + pQuestOwner->CastSpell(pQuestOwner,SPELL_KNOCK_BACK);
- + me->GetAI()->Reset();
- + return;
- + }
- +
- + m_saytimer = 4000;
- + }
- + else
- + me->GetAI()->Reset();
- + }
- + else m_saytimer -= diff;
- + }
- +
- + if(!UpdateVictim())
- + return;
- +
- + DoMeleeAttackIfReady();
- + }
- +
- + };
- +
- + CreatureAI* GetAI(Creature *creature) const
- + {
- + return new npc_boden_the_imposingAI(creature);
- + }
- +};
- +
- +class spell_earthen_ring_proclamation : public SpellScriptLoader
- +{
- +public:
- + spell_earthen_ring_proclamation() : SpellScriptLoader("spell_earthen_ring_proclamation") { }
- +
- + class spell_earthen_ring_proclamation_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_earthen_ring_proclamation_SpellScript);
- +
- + bool Validate(SpellInfo const* /*spellEntry*/)
- + {
- + if (!sSpellMgr->GetSpellInfo(SPELL_EARTHEN_RING_PROCLAMATION))
- + return false;
- + return true;
- + }
- +
- + SpellCastResult CheckTarget()
- + {
- + bool result = false;
- + Unit* target = NULL;
- + Player* pCaster = NULL;
- +
- + if(Unit* caster = GetCaster())
- + if(pCaster = caster->ToPlayer())
- + {
- + target = pCaster->GetSelectedUnit();
- + target &&
- + target->GetEntry() == NPC_BODEN_THE_IMPOSING &&
- + target->GetDistance(pCaster) < 25.0f ? result = true : result = false;
- + }
- +
- + if (!result)
- + return SPELL_FAILED_OUT_OF_RANGE;
- + return SPELL_CAST_OK;
- + }
- +
- + void HandleDummy()//SpellEffIndex /*effIndex*/)
- + {
- + Player* player = NULL;
- + Unit* creature = NULL;
- + Creature* pCreature = NULL;
- +
- + if(Unit* caster = GetCaster())
- + player = caster->ToPlayer();
- +
- + if(player && player->GetQuestStatus(QUEST_IMPOSING_CONFRONTATION)==QUEST_STATUS_INCOMPLETE)
- + {
- + if(creature = player->GetSelectedUnit())
- + pCreature = creature->ToCreature();
- + else
- + return;
- +
- + if(pCreature && pCreature->GetEntry() == NPC_BODEN_THE_IMPOSING)
- + {
- + if (npc_boden_the_imposing::npc_boden_the_imposingAI* pBoden = CAST_AI(npc_boden_the_imposing::npc_boden_the_imposingAI, pCreature->AI()))
- + {
- + pBoden->bOnQuestEventStarted = true;
- + pBoden->pQuestOwner = player;
- + pCreature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE+UNIT_FLAG_NOT_SELECTABLE);
- + }
- + }
- + }
- + }
- +
- + void Register()
- + {
- + AfterCast += SpellCastFn(spell_earthen_ring_proclamation_SpellScript::HandleDummy);
- + OnCheckCast += SpellCheckCastFn(spell_earthen_ring_proclamation_SpellScript::CheckTarget);
- + }
- + };
- +
- + SpellScript* GetSpellScript() const
- + {
- + return new spell_earthen_ring_proclamation_SpellScript();
- + }
- +};
- +
- void AddSC_deepholm()
- {
- new npc_lodestone();
- @@ -1240,4 +1405,6 @@ void AddSC_deepholm()
- new spell_smash_chains();
- new npc_therazane();
- new npc_dormant_stonebound_elemental();
- + new npc_boden_the_imposing();
- + new spell_earthen_ring_proclamation();
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment