Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ScriptPCH.h>
- static const uint32 lowguid = 165298;
- static const uint32 lowguid2 = 165299;
- static const uint32 lowguid3 = 165300;
- static const uint32 lowguid4 = 165301;
- enum ReusableObjects
- {
- Obj_Fireworks = 181886,
- Obj_Flag_Horde = 192688,
- Obj_Flag_Alliance = 192686,
- };
- class GuildCurrency_T : public CreatureScript
- {
- public:
- GuildCurrency_T(): CreatureScript("GuildCurrency_T") {}
- bool OnGossipHello(Player* player, Creature* creature)
- {
- 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);
- 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);
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I wish to pay for merchants to visit here.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
- if (player->IsGameMaster())
- {
- //Nope
- }
- player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
- if (sender != GOSSIP_SENDER_MAIN)
- return false;
- switch (action)
- {
- case GOSSIP_ACTION_INFO_DEF + 1:
- if (player->HasItemCount(37742, 5, false))
- {
- if (player->GetTeam() == HORDE)
- {
- if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
- if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
- if (!go->isSpawned())
- go->SetRespawnTime(600000000);
- if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid3))
- if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid3, data->id, HIGHGUID_GAMEOBJECT)))
- if (!go->isSpawned())
- go->SetRespawnTime(600000000);
- // creature->SummonGameObject(Obj_Flag_Horde, -10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
- //creature->SummonGameObject(Obj_Flag_Horde, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
- //player->RemoveItem(37742, 5, true);
- player->PlayerTalkClass->SendCloseGossip();
- }
- else if (player->GetTeam() == ALLIANCE)
- {
- if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid2))
- if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid2, data->id, HIGHGUID_GAMEOBJECT)))
- if (!go->isSpawned())
- go->SetRespawnTime(600000000);
- if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid4))
- if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid4, data->id, HIGHGUID_GAMEOBJECT)))
- if (!go->isSpawned())
- go->SetRespawnTime(600000000);
- //creature->SummonGameObject(Obj_Flag_Alliance, 10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
- //creature->SummonGameObject(Obj_Flag_Alliance, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
- //player->RemoveItem(37742, 5, true);
- player->PlayerTalkClass->SendCloseGossip();
- }
- else if (!player->HasItemCount(37742, 5, false))
- {
- //TODO: Error message.
- }
- }
- break;
- case GOSSIP_ACTION_INFO_DEF + 2:
- if (player->HasItemCount(37742, 5, false))
- {
- creature->SummonGameObject(Obj_Fireworks, -10743.955078, 2461.408447, 6.232886, 4.787787, 0, 0, 0, 0, 6000000000);
- creature->SummonGameObject(Obj_Fireworks, -10730.602539, 2458.209229, 7.478404, 4.526253, 0, 0, 0, 0, 6000000000);
- player->RemoveItem(37742, 5, true);
- player->PlayerTalkClass->SendCloseGossip();
- }
- else
- {
- //TODO: Error message.
- }
- break;
- case GOSSIP_ACTION_INFO_DEF + 3:
- if (player->HasItemCount(37742, 3, false))
- {
- creature->SummonCreature(14337, -10709.791016, 2478.546875, 7.922036, 2.071496, TEMPSUMMON_MANUAL_DESPAWN, 30000000000000);
- player->RemoveItem(37742, 5, true);
- player->PlayerTalkClass->SendCloseGossip();
- }
- break;
- }
- return true;
- }
- };
- void AddSC_GuildCurrency_T()
- {
- new GuildCurrency_T();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement