casucristy

gqweqwe

Jul 14th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.40 KB | None | 0 0
  1. From 9ae0b72bee006b971cac9a9f81118caa52cbdf6b Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Sat, 14 Jul 2012 15:25:22 +0300
  4. Subject: [PATCH] Fix for quests BombThemAgain/Bombing Run
  5.  
  6. ---
  7.  .../scripts/Outland/blades_edge_mountains.cpp      |   69 +++++++++++++++++++-
  8.  1 file changed, 68 insertions(+), 1 deletion(-)
  9.  
  10. diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp
  11. index c46757a..2204c7a 100644
  12. --- a/src/server/scripts/Outland/blades_edge_mountains.cpp
  13. +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp
  14. @@ -1124,7 +1124,6 @@ class go_apexis_relic : public GameObjectScript
  15.              if (player->HasItemCount(ITEM_APEXIS_SHARD, large ? 35 : 1))
  16.              {
  17.                  player->CastSpell(player, large ? SPELL_TAKE_REAGENTS_GROUP : SPELL_TAKE_REAGENTS_SOLO, false);
  18. -
  19.                  if (Creature* bunny = player->SummonCreature(NPC_SIMON_BUNNY, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()))
  20.                      bunny->AI()->SetGUID(player->GetGUID(), large);
  21.              }
  22. @@ -1133,6 +1132,73 @@ class go_apexis_relic : public GameObjectScript
  23.          }
  24.  };
  25.  
  26. +/*#########
  27. +### Support for quests Bombing Run/Bomb them again
  28. +###############*/
  29. +
  30. +#define FEL_CANONBALL          185861
  31. +#define SPELL_THROW_BOMB       40160
  32. +
  33. +#define QUEST_BOMBING_RUN_A        11102
  34. +#define QUEST_BOMBING_RUN_H        11010
  35. +#define QUEST_BOMB_THEM_AGAIN  11023
  36. +
  37. +#define QUEST_CREDIT           23118
  38. +
  39. +#define ZONE_FORGE_CAMP    3785
  40. +
  41. +class spell_throw_bomb : public SpellScriptLoader
  42. +{
  43. +public:
  44. +    spell_throw_bomb() : SpellScriptLoader("spell_throw_bomb") {}
  45. +
  46. +    class spell_throw_bomb_SpellScript : public SpellScript
  47. +    {
  48. +        PrepareSpellScript(spell_throw_bomb_SpellScript)
  49. +
  50. +        bool Validate(SpellInfo const* /*spell*/)
  51. +        {
  52. +            if (!sSpellMgr->GetSpellInfo(SPELL_THROW_BOMB))
  53. +                return false;
  54. +            return true;
  55. +        }
  56. +
  57. +       SpellCastResult CheckIfInZone()
  58. +        {
  59. +            Unit* caster = GetCaster();
  60. +
  61. +           if(caster->GetAreaId()==ZONE_FORGE_CAMP)
  62. +               return SPELL_CAST_OK;
  63. +            else
  64. +                return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
  65. +        }
  66. +
  67. +        void HandleBombEffect(SpellEffIndex effIndex)
  68. +        {
  69. +            Unit* caster = GetCaster();
  70. +           Player* player = caster->ToPlayer();
  71. +
  72. +           if (player && (player->GetQuestStatus(QUEST_BOMBING_RUN_A)==QUEST_STATUS_INCOMPLETE
  73. +                      || player->GetQuestStatus(QUEST_BOMBING_RUN_H)==QUEST_STATUS_INCOMPLETE
  74. +                      || player->GetQuestStatus(QUEST_BOMB_THEM_AGAIN)==QUEST_STATUS_INCOMPLETE))
  75. +                    player->KilledMonsterCredit(QUEST_CREDIT,0);      
  76. +        }
  77. +
  78. +        void Register()
  79. +        {
  80. +            OnCheckCast += SpellCheckCastFn(spell_throw_bomb_SpellScript::CheckIfInZone);
  81. +            OnEffectHit += SpellEffectFn(spell_throw_bomb_SpellScript::HandleBombEffect, EFFECT_0, SPELL_EFFECT_DUMMY);   
  82. +        }
  83. +                              
  84. +    };
  85. +
  86. +    SpellScript* GetSpellScript() const
  87. +    {
  88. +        return new spell_throw_bomb_SpellScript();
  89. +    }
  90. +};
  91. +
  92. +
  93.  void AddSC_blades_edge_mountains()
  94.  {
  95.      new mobs_bladespire_ogre();
  96. @@ -1147,4 +1213,5 @@ void AddSC_blades_edge_mountains()
  97.      new npc_simon_bunny();
  98.      new go_simon_cluster();
  99.      new go_apexis_relic();
  100. +   new spell_throw_bomb();
  101.  }
  102. --
  103. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment