Advertisement
Rochet2

Untitled

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