casucristy

hwqeryw

Jul 15th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.64 KB | None | 0 0
  1. From 262d8bdfc040819969dafcf82c738831f2463660 Mon Sep 17 00:00:00 2001
  2. From: unknown <cristi@cristis-PC.(none)>
  3. Date: Sun, 15 Jul 2012 23:26:51 +0300
  4. Subject: [PATCH] Fix quest Elementary!
  5.  
  6. ---
  7.  src/server/scripts/World/npcs_special.cpp |   62 +++++++++++++++++++++++++++++
  8.  1 file changed, 62 insertions(+)
  9.  
  10. diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
  11. index b295267..f6325aa 100644
  12. --- a/src/server/scripts/World/npcs_special.cpp
  13. +++ b/src/server/scripts/World/npcs_special.cpp
  14. @@ -3461,6 +3461,67 @@ public:
  15.      }
  16.  };
  17.  
  18. +/*##########
  19. +####   Npc Crucible of Earth/Air/Fire/Water
  20. +###########*/
  21. +
  22. +enum QuestElementaryEntries
  23. +{
  24. +   NPC_CRUCIBLE_OF_AIR      = 39736,
  25. +   NPC_CRUCIBLE_OF_EARTH    = 39737,
  26. +   NPC_CRUCIBLE_OF_FIRE     = 39730,
  27. +   NPC_CRUCIBLE_OF_WATER    = 39738,
  28. +   CREDIT_CRUCIBLE_OF_AIR   = 39739,
  29. +   CREDIT_CRUCIBLE_OF_EARTH = 39741,
  30. +   CREDIT_CRUCIBLE_OF_WATER = 39740,
  31. +   CREDIT_CRUCIBLE_OF_FIRE  = 39727,
  32. +   QUEST_ELEMENTARY         = 25303
  33. +};
  34. +
  35. +#define GOSSIP_NPC_ACTIVATE        "Activate now..."
  36. +
  37. +class npc_crucible_of : public CreatureScript
  38. +{
  39. +public:
  40. +    npc_crucible_of() : CreatureScript("npc_crucible_of") { }
  41. +
  42. +    bool OnGossipHello(Player* player, Creature* creature)
  43. +    {
  44. +        if (player->GetQuestStatus(QUEST_ELEMENTARY)==QUEST_STATUS_INCOMPLETE)
  45. +            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NPC_ACTIVATE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  46. +       player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
  47. +
  48. +        return true;
  49. +    }
  50. +
  51. +    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
  52. +    {
  53. +        player->PlayerTalkClass->ClearMenus();
  54. +        if (action == GOSSIP_ACTION_INFO_DEF+1)
  55. +        { 
  56. +           uint64 uCredit = 0;
  57. +
  58. +           player->CLOSE_GOSSIP_MENU();
  59. +
  60. +           switch (creature->GetEntry()) {
  61. +               case NPC_CRUCIBLE_OF_AIR   : uCredit = CREDIT_CRUCIBLE_OF_AIR; break;
  62. +               case NPC_CRUCIBLE_OF_EARTH : uCredit = CREDIT_CRUCIBLE_OF_EARTH; break;
  63. +               case NPC_CRUCIBLE_OF_FIRE  : uCredit = CREDIT_CRUCIBLE_OF_FIRE; break;
  64. +               case NPC_CRUCIBLE_OF_WATER : uCredit = CREDIT_CRUCIBLE_OF_WATER; break;
  65. +               default: break;
  66. +           }
  67. +          
  68. +           if(uCredit!=0)
  69. +           {
  70. +               player->KilledMonsterCredit(uCredit,0);
  71. +               creature->DespawnOrUnsummon();
  72. +           }
  73. +        }
  74. +
  75. +        return true;
  76. +    }
  77. +};
  78. +
  79.  void AddSC_npcs_special()
  80.  {
  81.      new npc_air_force_bots;
  82. @@ -3498,4 +3559,5 @@ void AddSC_npcs_special()
  83.      new npc_frostfire_orb;
  84.      new npc_power_word_barrier;
  85.      new npc_shadowy_apparition;
  86. +   new npc_crucible_of();
  87.  }
  88. --
  89. 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment