Advertisement
skillz79

Untitled

May 11th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.07 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. #define MSG1 100001
  4. #define MSG2 100002
  5.  
  6. bool GossipHello_custom_npc_doctor(Player *player, Creature *_creature)
  7. {
  8. if (player->isInCombat())
  9. {
  10. player->CLOSE_GOSSIP_MENU();
  11. _creature->MonsterWhisper("You are in combat. Come back later!", player->GetGUID());
  12. return true;
  13. }
  14.  
  15. player->SEND_GOSSIP_MENU(MSG1, _creature->GetGUID());
  16.  
  17. player->ADD_GOSSIP_ITEM(5, "Restore Health", GOSSIP_SENDER_MAIN, 7001);
  18. player->ADD_GOSSIP_ITEM(5, "Restore Mana", GOSSIP_SENDER_MAIN, 7002);
  19. player->ADD_GOSSIP_ITEM(5, "Remove Cooldown", GOSSIP_SENDER_MAIN, 7003);
  20. if ( player->GetTeam() == ALLIANCE )
  21. {
  22. player->ADD_GOSSIP_ITEM(5, "Remove Exhaustion", GOSSIP_SENDER_MAIN, 7004);
  23. }
  24. if ( player->GetTeam() == HORDE )
  25. {
  26. player->ADD_GOSSIP_ITEM(5, "Remove Sated", GOSSIP_SENDER_MAIN, 7005);
  27. }
  28. player->ADD_GOSSIP_ITEM(7, "Buffs", GOSSIP_SENDER_MAIN, 7006);
  29. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  30. return true;
  31. }
  32.  
  33. void SendDefaultMenu_custom_npc_doctor(Player *player, Creature *_creature, uint32 action )
  34. {
  35. switch(action)
  36. {
  37.  
  38. case 7000: //Menu - Main
  39. player->SEND_GOSSIP_MENU(MSG1, _creature->GetGUID());
  40.  
  41. player->ADD_GOSSIP_ITEM(5, "Restore Health", GOSSIP_SENDER_MAIN, 7001);
  42. player->ADD_GOSSIP_ITEM(5, "Restore Mana", GOSSIP_SENDER_MAIN, 7002);
  43. player->ADD_GOSSIP_ITEM(5, "Remove Cooldown", GOSSIP_SENDER_MAIN, 7003);
  44. if ( player->GetTeam() == ALLIANCE )
  45. {
  46. player->ADD_GOSSIP_ITEM(5, "Remove Exhaustion", GOSSIP_SENDER_MAIN, 7004);
  47. }
  48. if ( player->GetTeam() == HORDE )
  49. {
  50. player->ADD_GOSSIP_ITEM(5, "Remove Sated", GOSSIP_SENDER_MAIN, 7005);
  51. }
  52. player->ADD_GOSSIP_ITEM(11, "Buffs", GOSSIP_SENDER_MAIN, 7006);
  53. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  54. break;
  55. case 7001: //Restore Health
  56. player->CLOSE_GOSSIP_MENU();
  57. player->SetHealth(player->GetMaxHealth());
  58. player->CastSpell(player,61456,false);
  59. _creature->MonsterWhisper("Your Health has been restored.", player->GetGUID());
  60. break;
  61. case 7002: //Restore Mana
  62. player->CLOSE_GOSSIP_MENU();
  63. player->SetPower(POWER_MANA, player->GetMaxPower(POWER_MANA));
  64. player->CastSpell(player,61456,false);
  65. _creature->MonsterWhisper("Your Mana has been restored.", player->GetGUID());
  66. break;
  67. case 7003: //Remove Cooldown
  68. player->CLOSE_GOSSIP_MENU();
  69. player->RemoveAllSpellCooldown();
  70. player->CastSpell(player,75459,false);
  71. _creature->MonsterWhisper("Your cooldowns have been removed.", player->GetGUID());
  72. break;
  73. case 7004: //Remove Exhaustion
  74. player->CLOSE_GOSSIP_MENU();
  75. player->RemoveAurasDueToSpell(57723);
  76. player->CastSpell(player,61456,false);
  77. _creature->MonsterWhisper("Exhaustion has been removed.", player->GetGUID());
  78. break;
  79. case 7005: //Remove Sated
  80. player->CLOSE_GOSSIP_MENU();
  81. player->RemoveAurasDueToSpell(57724);
  82. player->CastSpell(player,61456,false);
  83. _creature->MonsterWhisper("Sated has been removed.", player->GetGUID());
  84. break;
  85. case 7006:
  86. player->SEND_GOSSIP_MENU(MSG2, _creature->GetGUID());
  87. player->ADD_GOSSIP_ITEM(5, "Arcane Intellect", GOSSIP_SENDER_MAIN, 9001);
  88. player->ADD_GOSSIP_ITEM(5, "Mark of the Wild", GOSSIP_SENDER_MAIN, 9002);
  89. player->ADD_GOSSIP_ITEM(5, "Thorns", GOSSIP_SENDER_MAIN, 9003);
  90. player->ADD_GOSSIP_ITEM(5, "Greater Blessing of Sanctuary", GOSSIP_SENDER_MAIN, 9004);
  91. player->ADD_GOSSIP_ITEM(5, "Greater Blessing of Might", GOSSIP_SENDER_MAIN, 9005);
  92. player->ADD_GOSSIP_ITEM(5, "Greater Blessing of Kings", GOSSIP_SENDER_MAIN, 9006);
  93. player->ADD_GOSSIP_ITEM(5, "Greater Blessing of Wisdom", GOSSIP_SENDER_MAIN, 9007);
  94. player->ADD_GOSSIP_ITEM(5, "Divine Spirit", GOSSIP_SENDER_MAIN, 9008);
  95. player->ADD_GOSSIP_ITEM(5, "Shadow Protection", GOSSIP_SENDER_MAIN, 9009);
  96. player->ADD_GOSSIP_ITEM(5, "Power Word: Fortitude", GOSSIP_SENDER_MAIN, 9010);
  97. player->ADD_GOSSIP_ITEM(11, "<- Back to Main Page", GOSSIP_SENDER_MAIN, 7000);
  98. player->ADD_GOSSIP_ITEM(11, "Close menu", GOSSIP_SENDER_MAIN, 9011);
  99. player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, _creature->GetGUID());
  100. break;
  101. case 9001: // Buff me Arcane Intellect
  102. player->CLOSE_GOSSIP_MENU();
  103. _creature->CastSpell(player,42995,false);
  104. break;
  105. case 9002: // Buff me Mark of the Wild
  106. player->CLOSE_GOSSIP_MENU();
  107. _creature->CastSpell(player,48469,false);
  108. break;
  109. case 9003: // Buff me Thorns
  110. player->CLOSE_GOSSIP_MENU();
  111. _creature->CastSpell(player,53307,false);
  112. break;
  113. case 9004: // Buff me Greater Blessing of Sanctuary
  114. player->CLOSE_GOSSIP_MENU();
  115. _creature->CastSpell(player,25899,false);
  116. break;
  117. case 9005: // Buff me Greater Blessing of Might
  118. player->CLOSE_GOSSIP_MENU();
  119. _creature->CastSpell(player,48934,false);
  120. break;
  121. case 9006: // Buff me Greater Blessing of Kings
  122. player->CLOSE_GOSSIP_MENU();
  123. _creature->CastSpell(player,25898,false);
  124. break;
  125. case 9007: // Buff me Greater Blessing of Wisdom
  126. player->CLOSE_GOSSIP_MENU();
  127. _creature->CastSpell(player,48938,false);
  128. break;
  129. case 9008: // Buff me Divine Spirit
  130. player->CLOSE_GOSSIP_MENU();
  131. _creature->CastSpell(player,48073,false);
  132. break;
  133. case 9009: // Buff me Power Word: Fortitude
  134. player->CLOSE_GOSSIP_MENU();
  135. _creature->CastSpell(player,48169,false);
  136. break;
  137. case 9010: // Buff me Shadow Protection
  138. player->CLOSE_GOSSIP_MENU();
  139. _creature->CastSpell(player,48161,false);
  140. break;
  141. case 9011: //Close menu
  142. player->CLOSE_GOSSIP_MENU();
  143. break;
  144. default:
  145. break;
  146. }
  147.  
  148. }
  149.  
  150. bool GossipSelect_custom_npc_doctor(Player *player, Creature *_creature, uint32 sender, uint32 action)
  151. {
  152.  
  153. if (player->isInCombat())
  154. {
  155. player->CLOSE_GOSSIP_MENU();
  156. _creature->MonsterWhisper("You are in combat. Come back later!", player->GetGUID());
  157. return true;
  158. }
  159.  
  160. // Main menu
  161. if (sender == GOSSIP_SENDER_MAIN)
  162. SendDefaultMenu_custom_npc_doctor( player, _creature, action );
  163.  
  164. return true;
  165. }
  166.  
  167. void AddSC_custom_npc_doctor(){
  168. Script *newscript;
  169. newscript = new Script;
  170. newscript->Name = "custom_npc_doctor";
  171. newscript->pGossipHello = &GossipHello_custom_npc_doctor;
  172. newscript->pGossipSelect = &GossipSelect_custom_npc_doctor;
  173. newscript->RegisterSelf();
  174. newscript->pItemHello = NULL;
  175. newscript->pGOHello = NULL;
  176. newscript->pAreaTrigger = NULL;
  177. newscript->pItemQuestAccept = NULL;
  178. newscript->pGOQuestAccept = NULL;
  179. newscript->pGOChooseReward = NULL;
  180. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement