Guest User

Untitled

a guest
Aug 24th, 2014
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.12 KB | None | 0 0
  1. #include <ScriptPCH.h>
  2. static const uint32 lowguid = 165298;
  3. static const uint32 lowguid2 = 165299;
  4. static const uint32 lowguid3 = 165300;
  5. static const uint32 lowguid4 = 165301;
  6.  
  7. enum ReusableObjects{
  8.     Obj_Fireworks = 181886,
  9.     Obj_Flag_Horde = 192688,
  10.     Obj_Flag_Alliance = 192686,
  11. };
  12. class GuildCurrency_T : public CreatureScript
  13. {
  14. public:
  15.     GuildCurrency_T() : CreatureScript("GuildCurrency_T") { }
  16.  
  17.     bool OnGossipHello(Player* player, Creature* creature){
  18.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I wish to sport my faction colors at the entrances to all buildings!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
  19.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I want something to liven the place up a bit. Something say....Sparkly...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
  20.         player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I wish to pay for merchants to visit here.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
  21.         if (player->IsGameMaster()){
  22.             //Nope
  23.         }
  24.         player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
  25.         return true;
  26.     }
  27.     bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action){
  28.         player->PlayerTalkClass->ClearMenus();
  29.         if (sender != GOSSIP_SENDER_MAIN)
  30.             return false;
  31.         switch (action){
  32.         case GOSSIP_ACTION_INFO_DEF + 1:
  33.             if (player->HasItemCount(37742, 5, false)){
  34.                 if (player->GetTeam() == HORDE){
  35.                     if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
  36.                     if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
  37.                     if (!go->isSpawned())
  38.                         go->SetRespawnTime(600000000);
  39.                     if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid3))
  40.                     if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
  41.                     if (!go->isSpawned())
  42.                         go->SetRespawnTime(600000000);
  43.                     //  creature->SummonGameObject(Obj_Flag_Horde, -10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
  44.                     //creature->SummonGameObject(Obj_Flag_Horde, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
  45.                     //player->RemoveItem(37742, 5, true);
  46.                     player->PlayerTalkClass->SendCloseGossip();
  47.                     break;
  48.                 }
  49.                 else if (player->GetTeam() == ALLIANCE){
  50.                     if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid2))
  51.                     if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
  52.                     if (!go->isSpawned())
  53.                         go->SetRespawnTime(600000000);
  54.                     if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid4))
  55.                     if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
  56.                     if (!go->isSpawned())
  57.                         go->SetRespawnTime(600000000);
  58.  
  59.                     //creature->SummonGameObject(Obj_Flag_Alliance, 10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
  60.                     //creature->SummonGameObject(Obj_Flag_Alliance, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
  61.                     //player->RemoveItem(37742, 5, true);
  62.                     player->PlayerTalkClass->SendCloseGossip();
  63.                     break;
  64.                 }
  65.                 else if (!player->HasItemCount(37742, 5, false)){
  66.                     //TODO: Error message.
  67.                     break;
  68.                 }
  69.                 break;
  70.         case GOSSIP_ACTION_INFO_DEF + 2:
  71.             if (player->HasItemCount(37742, 5, false)){
  72.                 creature->SummonGameObject(Obj_Fireworks, -10743.955078, 2461.408447, 6.232886, 4.787787, 0, 0, 0, 0, 6000000000);
  73.                 creature->SummonGameObject(Obj_Fireworks, -10730.602539, 2458.209229, 7.478404, 4.526253, 0, 0, 0, 0, 6000000000);
  74.                 player->RemoveItem(37742, 5, true);
  75.                 player->PlayerTalkClass->SendCloseGossip();
  76.                 break;
  77.             }
  78.             else{
  79.                 //TODO: Error message.
  80.             }
  81.         case GOSSIP_ACTION_INFO_DEF + 3:
  82.             if (player->HasItemCount(37742, 3, false)){
  83.                 creature->SummonCreature(14337, -10709.791016, 2478.546875, 7.922036, 2.071496, TEMPSUMMON_MANUAL_DESPAWN, 30000000000000);
  84.                 player->RemoveItem(37742, 5, true);
  85.                 player->PlayerTalkClass->SendCloseGossip();
  86.                 break;
  87.                 }
  88.             }
  89.         }
  90.         return true;
  91.     }
  92. };
  93.  
  94. void AddSC_GuildCurrency_T(){
  95.     new GuildCurrency_T();
  96. }
Advertisement
Add Comment
Please, Sign In to add comment