Advertisement
SymbolixDEV

SymbolixDEV NPC

Mar 18th, 2014
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 9.80 KB | None | 0 0
  1. /*
  2. Made by: SymboliXDEV
  3. Edited by: Rochet2
  4. Work %: 100%
  5. Compile: Success
  6. */
  7. //SymbolixDEV - Start
  8. #include "ScriptPCH.h"
  9. #include "ScriptMgr.h"
  10. #include "ScriptedCreature.h"
  11. #include "ScriptedGossip.h"
  12.  
  13. static const uint32 buffIdstools[] = { 48162, 48074, 48170, 43223, 36880, 48469, 53307, 25898, 25899, 48932, 48161 };
  14.  
  15. class symbolixdev_npc : public CreatureScript
  16. {
  17. public:
  18.     symbolixdev_npc() : CreatureScript("symbolixdev_npc") { }
  19.  
  20.     bool OnGossipHello(Player* player, Creature* creature)
  21.     {
  22.         if (player->IsInCombat())
  23.             if (player->IsInFlight())
  24.         {
  25.             player->GetSession()->SendNotification("You are in Combat");
  26.             return true;
  27.         }
  28.  
  29.         // Placeholders for teleports
  30.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cffFF0000 Teleporter", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+110);
  31.         // Player Service Menu
  32.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cffFF0000 Player Tools", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+136);
  33.         // Exchanger Service Menu
  34.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cffFF0000 Exchanger Service", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  35.         // Morph Service Menu
  36.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cffFF0000 Morph Service", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  37.         //script info
  38.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cffFF0000 Script by : SymbolixDEV", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+22222);
  39.         player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
  40.         return true;
  41.     }
  42.     bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32  actions)
  43.     {
  44.         player->PlayerTalkClass->ClearMenus();
  45.  
  46.         if (sender != GOSSIP_SENDER_MAIN || actions <= GOSSIP_ACTION_INFO_DEF)
  47.         {
  48.             player->CLOSE_GOSSIP_MENU();
  49.             return true;
  50.         }
  51.  
  52.         switch (sender,actions)
  53.         {
  54.         case GOSSIP_ACTION_INFO_DEF+110:
  55.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Teleport me to Mall", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+111);
  56.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Teleport me to Duel Zone", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+112);
  57.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Teleport me to Profession Place", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+113);
  58.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Teleport me to Arena Que Zone", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+114);
  59.         player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
  60.         }else{
  61.         case GOSSIP_ACTION_INFO_DEF+1:
  62.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff 100 Arena points --> 10000 Honor Points", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10);
  63.         //player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "10000 Honor Points --> 100 Arena points", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11);
  64.         player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,creature->GetGUID());
  65.         break;
  66.  
  67.         case GOSSIP_ACTION_INFO_DEF+136:
  68.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Buff me", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
  69.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Reset my Talents", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
  70.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Remove my Sickness", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
  71.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Reset my Cooldowns", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
  72.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Repair Items", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7);
  73.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Clear Combat", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8);
  74.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Reset Instances", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9);
  75.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Change my Faction", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+233);
  76.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Change my Race", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+234);
  77.         player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
  78.         break;
  79.  
  80.         case GOSSIP_ACTION_INFO_DEF+2:
  81.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Gnome - Male", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12);
  82.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Gnome - Female", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13);
  83.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Human - Male", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14);
  84.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Human - Female", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15);
  85.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Tauren - Male", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16);
  86.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Tauren - Female", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+17);
  87.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Blood Elf - Male", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+18);
  88.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Blood Elf - Female", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+19);
  89.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Pirate - Male", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
  90.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "|cff0000ff Remove my morph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20);
  91.         player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE,creature->GetGUID());
  92.         break;
  93.         return false;
  94.  
  95.         case GOSSIP_ACTION_INFO_DEF+3:
  96.             for (int i = 0; i < sizeof(buffIdstools) / sizeof(*buffIdstools); ++i)
  97.                 player->CastSpell(player, buffIdstools[i]);
  98.             break;
  99.  
  100.         case GOSSIP_ACTION_INFO_DEF+4: // Reset Talents
  101.             player->resetTalents(true);
  102.             player->SendTalentsInfoData(false);
  103.             break;
  104.  
  105.         case GOSSIP_ACTION_INFO_DEF+5: //Remove my siccness
  106.        if (player->HasAura(15007))
  107.            player->RemoveAura(15007);
  108.         break;
  109.  
  110.         case GOSSIP_ACTION_INFO_DEF+6: // reset my CD'S
  111.             player->RemoveAllSpellCooldown();
  112.             break;
  113.  
  114.         case GOSSIP_ACTION_INFO_DEF+7: // repair my items
  115.             player->DurabilityRepairAll(false, 0, false);
  116.             break;
  117.  
  118.         case GOSSIP_ACTION_INFO_DEF+8: // Clear Combat
  119.             player->CombatStop();
  120.             break;
  121.  
  122.         case GOSSIP_ACTION_INFO_DEF+9: // Reset all Instances For PvE
  123.             for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
  124.             {
  125.                 Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
  126.                 for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
  127.                 {
  128.                     player->UnbindInstance(itr, Difficulty(i));
  129.                 }
  130.             }
  131.             break;
  132.  
  133.         case GOSSIP_ACTION_INFO_DEF+10:
  134.            if (player->GetArenaPoints () >= 100)
  135.            {
  136.                     player->CLOSE_GOSSIP_MENU();
  137.                     player->ModifyArenaPoints(-100);
  138.                     player->ModifyHonorPoints(+10000);
  139.            }
  140.           break;
  141.  
  142.         case GOSSIP_ACTION_INFO_DEF+12://Gnome - Male
  143.           player->CLOSE_GOSSIP_MENU();
  144.           player->SetDisplayId(20580);
  145.           break;
  146.  
  147.       case GOSSIP_ACTION_INFO_DEF+13://Gnome - Female
  148.           player->CLOSE_GOSSIP_MENU();
  149.           player->SetDisplayId(20581);
  150.      
  151.           break;
  152.       case GOSSIP_ACTION_INFO_DEF+14://Human - Male
  153.           player->CLOSE_GOSSIP_MENU();
  154.           player->SetDisplayId(19723);
  155.           break;
  156.  
  157.       case GOSSIP_ACTION_INFO_DEF+15://Tauren - Male
  158.           player->CLOSE_GOSSIP_MENU();
  159.           player->SetDisplayId(20585);
  160.           break;
  161.  
  162.       case GOSSIP_ACTION_INFO_DEF+16://Tauren - Female
  163.           player->CLOSE_GOSSIP_MENU();
  164.           player->SetDisplayId(20584);
  165.           break;
  166.  
  167.       case GOSSIP_ACTION_INFO_DEF+17://Blood Elf - Male
  168.           player->CLOSE_GOSSIP_MENU();
  169.           player->SetDisplayId(20578);
  170.           break;
  171.  
  172.       case GOSSIP_ACTION_INFO_DEF+18://Blood Elf - Female
  173.           player->CLOSE_GOSSIP_MENU();
  174.           player->SetDisplayId(20579);
  175.           break;
  176.  
  177.       case GOSSIP_ACTION_INFO_DEF+19://Pirate - Male
  178.           player->CLOSE_GOSSIP_MENU();
  179.           player->SetDisplayId(4620);
  180.           break;
  181.  
  182.        case GOSSIP_ACTION_INFO_DEF+20://Demorph
  183.           player->CLOSE_GOSSIP_MENU();
  184.           player->DeMorph();
  185.           break;
  186.  
  187.         case GOSSIP_ACTION_INFO_DEF+233:
  188.         {
  189.             player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
  190.             player->PlayerTalkClass->SendCloseGossip();
  191.         }
  192.         break;
  193.  
  194.         case GOSSIP_ACTION_INFO_DEF+234:
  195.         {
  196.             player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
  197.             player->PlayerTalkClass->SendCloseGossip();
  198.         }
  199.         break;
  200.  
  201.         case GOSSIP_ACTION_INFO_DEF+111:
  202.              player->TeleportTo(571, 5804.149902f, 624.770996f,648.747009f, 1.640000f);
  203.              player->PlayerTalkClass->SendCloseGossip();
  204.         break;
  205.  
  206.         case GOSSIP_ACTION_INFO_DEF+112:
  207.              player->TeleportTo(0, -4248.310059f, -3325.095459f, 231.959869f, 4.653796f);
  208.              player->PlayerTalkClass->SendCloseGossip();
  209.         break;
  210.  
  211.         case GOSSIP_ACTION_INFO_DEF+113:
  212.              player->TeleportTo(1, -6933.288086f, -4915.037598f, 0.714902f, 4.708452f);
  213.              player->PlayerTalkClass->SendCloseGossip();
  214.         break;
  215.  
  216.         case GOSSIP_ACTION_INFO_DEF+114:
  217.              player->TeleportTo(530, -855.770020f, 6997.636230f, 34.994953f, 1.067743f);
  218.              player->PlayerTalkClass->SendCloseGossip();
  219.         break;
  220.  
  221.  
  222.  
  223.         default: // Close
  224.             player->CLOSE_GOSSIP_MENU();
  225.             return true;
  226.         }
  227.  
  228.         OnGossipHello(player, creature);
  229.         return true; //SymboliXDEV - END
  230.     }
  231. };
  232.  
  233. void AddSC_symbolixdev_npc()
  234. {
  235.     new symbolixdev_npc;
  236. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement