casucristy

Untitled

Jul 14th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.99 KB | None | 0 0
  1. From 6b887bfed2acd572e07f3768d3941a47762941b2 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Sat, 14 Jul 2012 22:38:59 +0300
  4. Subject: [PATCH] Fix Quest Defending the Wyrmrest Temple
  5.  
  6. ---
  7.  src/server/scripts/Northrend/dragonblight.cpp |   96 +++++++++++++++++++++++++
  8.  1 file changed, 96 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp
  11. index 1b339b2..fc67884 100644
  12. --- a/src/server/scripts/Northrend/dragonblight.cpp
  13. +++ b/src/server/scripts/Northrend/dragonblight.cpp
  14. @@ -69,6 +69,98 @@ public:
  15.      }
  16.  };
  17.  
  18. +/*########
  19. +### Support for quest Defending the WirmRest Temple
  20. +###################*/
  21. +
  22. +#define GOSSIP_ITEM_FLIGHT   "We need to get into the flight. Are you ready?"
  23. +
  24. +enum DefendingWyrmrestEntries
  25. +{
  26. +   QUEST_DEFEND_WYRMREST_TEMPLE    = 12372,
  27. +   NPC_DEFENDING_WRM_KILL_CREDIT   = 27698,
  28. +   SPELL_SUMMON_WYRMREST_DEFENDER  = 49207,
  29. +   SPELL_DESTABILIZE_DRAGONSHIRE   = 49367,
  30. +   ZONE_AZURE_DRAGONSHIRE          = 4183
  31. +};
  32. +
  33. +class npc_wyrmrest_defender : public CreatureScript
  34. +{
  35. +public:
  36. +    npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { }
  37. +
  38. +    bool OnGossipHello(Player* player, Creature* creature)
  39. +    {
  40. +        if (player->GetQuestStatus(QUEST_DEFEND_WYRMREST_TEMPLE)==QUEST_STATUS_INCOMPLETE)
  41. +            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  42. +
  43. +        player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
  44. +        return true;
  45. +    }
  46. +
  47. +    bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
  48. +    {
  49. +        player->PlayerTalkClass->ClearMenus();
  50. +        if (action == GOSSIP_ACTION_INFO_DEF+1)
  51. +        {
  52. +            player->CLOSE_GOSSIP_MENU();
  53. +           player->CastSpell(player,SPELL_SUMMON_WYRMREST_DEFENDER);
  54. +        }
  55. +
  56. +        return true;
  57. +    }
  58. +};
  59. +
  60. +class spell_destabilize_dragonshire : public SpellScriptLoader
  61. +{
  62. +public:
  63. +    spell_destabilize_dragonshire() : SpellScriptLoader("spell_destabilize_dragonshire") {}
  64. +
  65. +    class spell_destabilize_dragonshire_SpellScript : public SpellScript
  66. +    {
  67. +        PrepareSpellScript(spell_destabilize_dragonshire_SpellScript)
  68. +
  69. +        bool Validate(SpellInfo const* /*spell*/)
  70. +        {
  71. +            if (!sSpellMgr->GetSpellInfo(SPELL_DESTABILIZE_DRAGONSHIRE))
  72. +                return false;
  73. +            return true;
  74. +        }
  75. +
  76. +       SpellCastResult CheckIfInZone()
  77. +        {
  78. +            Unit* caster = GetCaster();
  79. +
  80. +           if(caster->GetAreaId()==ZONE_AZURE_DRAGONSHIRE)
  81. +               return SPELL_CAST_OK;
  82. +            else
  83. +                return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
  84. +        }
  85. +
  86. +        void HandleBombEffect()
  87. +        {
  88. +            Unit* caster = GetCaster();
  89. +           Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself();
  90. +
  91. +           if (player && (player->GetQuestStatus(QUEST_DEFEND_WYRMREST_TEMPLE)==QUEST_STATUS_INCOMPLETE))
  92. +           {
  93. +                    player->KilledMonsterCredit(NPC_DEFENDING_WRM_KILL_CREDIT,0);      
  94. +           }
  95. +       }
  96. +        void Register()
  97. +        {
  98. +            OnCheckCast += SpellCheckCastFn(spell_destabilize_dragonshire_SpellScript::CheckIfInZone);
  99. +            OnCast += SpellCastFn(spell_destabilize_dragonshire_SpellScript::HandleBombEffect);//, EFFECT_0, SPELL_EFFECT_DUMMY); 
  100. +        }
  101. +                              
  102. +    };
  103. +
  104. +    SpellScript* GetSpellScript() const
  105. +    {
  106. +        return new spell_destabilize_dragonshire_SpellScript();
  107. +    }
  108. +};
  109. +
  110.  /*######
  111.  ## Quest Strengthen the Ancients (12096|12092)
  112.  ######*/
  113. @@ -134,6 +226,8 @@ public:
  114.      }
  115.  };
  116.  
  117. +
  118. +
  119.  class spell_q12096_q12092_bark : public SpellScriptLoader // Bark of the Walkers
  120.  {
  121.  public:
  122. @@ -171,4 +265,6 @@ void AddSC_dragonblight()
  123.      new npc_alexstrasza_wr_gate;
  124.      new spell_q12096_q12092_dummy;
  125.      new spell_q12096_q12092_bark;
  126. +   new spell_destabilize_dragonshire;
  127. +   new npc_wyrmrest_defender;
  128.  }
  129. --
  130. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment