Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From a5e582645605a8c4070de39d002db6546f2a1729 Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Sun, 15 Jul 2012 01:43:37 +0300
- Subject: [PATCH] Fix quest Raise the Barricades(ally and horde side).
- ---
- src/server/scripts/Northrend/icecrown.cpp | 71 +++++++++++++++++++++++++++++
- 1 file changed, 71 insertions(+)
- diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp
- index fb2e0f6..8b43cf5 100644
- --- a/src/server/scripts/Northrend/icecrown.cpp
- +++ b/src/server/scripts/Northrend/icecrown.cpp
- @@ -491,6 +491,76 @@ class npc_tournament_training_dummy : public CreatureScript
- };
- +/*###########
- +### Support for quest Raise the Barricades
- +#################*/
- +
- +enum BarricadeData
- +{
- + SPELL_CONSTRUCT_BARRICADE = 59925,
- + SPELL_SUMMON_BARRICADE_A = 59922,
- + SPELL_SUMMON_BARRICADE_B = 59923,
- + SPELL_SUMMON_BARRICADE_C = 59924,
- + NPC_EBON_BLADE_MARKER = 31887,
- + ZONE_FALLEN_HEROES = 4540
- +};
- +
- +
- +class spell_construct_barricade : public SpellScriptLoader
- +{
- +public:
- + spell_construct_barricade() : SpellScriptLoader("spell_construct_barricade") {}
- +
- + class spell_construct_barricade_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_construct_barricade_SpellScript)
- +
- + bool Validate(SpellInfo const * /*spellInfo*/)
- + {
- + if (!sSpellMgr->GetSpellInfo(SPELL_CONSTRUCT_BARRICADE))
- + return false;
- + return true;
- + }
- +
- + SpellCastResult CheckIfInZone()
- + {
- + Unit* caster = GetCaster();
- +
- + if(caster->GetAreaId()==ZONE_FALLEN_HEROES)
- + return SPELL_CAST_OK;
- + else
- + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
- + }
- +
- + void HandleDummy(SpellEffIndex /*effIndex*/)
- + {
- + if (Unit* caster = GetCaster())
- + if (Player* player = caster->ToPlayer())
- + {
- + uint32 SummonBarricadeSpell = 0;
- + switch (urand(1,3))
- + {
- + case 1: SummonBarricadeSpell = SPELL_SUMMON_BARRICADE_A; break;
- + case 2: SummonBarricadeSpell = SPELL_SUMMON_BARRICADE_B; break;
- + case 3: SummonBarricadeSpell = SPELL_SUMMON_BARRICADE_C; break;
- + }
- + player->CastSpell(player, SummonBarricadeSpell, true);
- + player->KilledMonsterCredit(NPC_EBON_BLADE_MARKER, 0);
- + }
- + }
- + void Register()
- + {
- + OnCheckCast += SpellCheckCastFn(spell_construct_barricade_SpellScript::CheckIfInZone);
- + OnEffectHit += SpellEffectFn(spell_construct_barricade_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- + }
- + };
- +
- + SpellScript* GetSpellScript() const
- + {
- + return new spell_construct_barricade_SpellScript();
- + }
- +};
- +
- void AddSC_icecrown()
- {
- new npc_arete;
- @@ -499,4 +569,5 @@ void AddSC_icecrown()
- new npc_guardian_pavilion;
- new npc_vereth_the_cunning;
- new npc_tournament_training_dummy;
- + new spell_construct_barricade;
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment