View difference between Paste ID: XmYHX5gX and 9aRpxhLc
SHOW: | | - or go back to the newest paste.
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-
enum ReusableObjects{
7+
8-
	Obj_Fireworks = 181886,
8+
enum ReusableObjects
9-
	Obj_Flag_Horde = 192688,
9+
10-
	Obj_Flag_Alliance = 192686,
10+
    Obj_Fireworks = 181886,
11
    Obj_Flag_Horde = 192688,
12
    Obj_Flag_Alliance = 192686,
13
};
14
15-
	GuildCurrency_T() : CreatureScript("GuildCurrency_T") { }
15+
16
{
17-
	bool OnGossipHello(Player* player, Creature* creature){
17+
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);
18+
    GuildCurrency_T(): CreatureScript("GuildCurrency_T") {}
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);
19+
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);
20+
    bool OnGossipHello(Player* player, Creature* creature)
21-
		if (player->IsGameMaster()){
21+
    {
22-
			//Nope
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-
		}
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->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
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-
		return true;
25+
        if (player->IsGameMaster())
26-
	}
26+
        {
27-
	bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action){
27+
            //Nope
28-
		player->PlayerTalkClass->ClearMenus();
28+
        }
29-
		if (sender != GOSSIP_SENDER_MAIN)
29+
        player->PlayerTalkClass->SendGossipMenu(1, creature->GetGUID());
30-
			return false;
30+
        return true;
31-
		switch (action){
31+
    }
32-
		case GOSSIP_ACTION_INFO_DEF + 1:
32+
    bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
33-
			if (player->HasItemCount(37742, 5, false)){
33+
    {
34-
				if (player->GetTeam() == HORDE){
34+
        player->PlayerTalkClass->ClearMenus();
35-
					if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
35+
        if (sender != GOSSIP_SENDER_MAIN)
36-
					if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
36+
            return false;
37-
					if (!go->isSpawned())
37+
38-
						go->SetRespawnTime(600000000);
38+
        switch (action)
39-
					if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid3))
39+
        {
40-
					if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
40+
        case GOSSIP_ACTION_INFO_DEF + 1:
41-
					if (!go->isSpawned())
41+
            if (player->HasItemCount(37742, 5, false))
42-
						go->SetRespawnTime(600000000);
42+
            {
43-
					//	creature->SummonGameObject(Obj_Flag_Horde, -10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
43+
                if (player->GetTeam() == HORDE)
44-
					//creature->SummonGameObject(Obj_Flag_Horde, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
44+
                {
45-
					//player->RemoveItem(37742, 5, true);
45+
                    if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
46-
					player->PlayerTalkClass->SendCloseGossip();
46+
                        if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
47-
					break;
47+
                            if (!go->isSpawned())
48-
				}
48+
                                go->SetRespawnTime(600000000);
49-
				else if (player->GetTeam() == ALLIANCE){
49+
                    if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid3))
50-
					if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid2))
50+
                        if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid3, data->id, HIGHGUID_GAMEOBJECT)))
51-
					if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
51+
                            if (!go->isSpawned())
52-
					if (!go->isSpawned())
52+
                                go->SetRespawnTime(600000000);
53-
						go->SetRespawnTime(600000000);
53+
                    //	creature->SummonGameObject(Obj_Flag_Horde, -10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
54-
					if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid4))
54+
                    //creature->SummonGameObject(Obj_Flag_Horde, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
55-
					if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT)))
55+
                    //player->RemoveItem(37742, 5, true);
56-
					if (!go->isSpawned())
56+
                    player->PlayerTalkClass->SendCloseGossip();
57-
						go->SetRespawnTime(600000000);
57+
                }
58
                else if (player->GetTeam() == ALLIANCE)
59-
					//creature->SummonGameObject(Obj_Flag_Alliance, 10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
59+
                {
60-
					//creature->SummonGameObject(Obj_Flag_Alliance, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
60+
                    if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid2))
61-
					//player->RemoveItem(37742, 5, true);
61+
                        if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid2, data->id, HIGHGUID_GAMEOBJECT)))
62-
					player->PlayerTalkClass->SendCloseGossip();
62+
                            if (!go->isSpawned())
63-
					break;
63+
                                go->SetRespawnTime(600000000);
64-
				}
64+
                    if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid4))
65-
				else if (!player->HasItemCount(37742, 5, false)){
65+
                        if (GameObject* go = creature->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid4, data->id, HIGHGUID_GAMEOBJECT)))
66-
					//TODO: Error message.
66+
                            if (!go->isSpawned())
67-
					break;
67+
                                go->SetRespawnTime(600000000);
68-
				}
68+
69-
				break;
69+
                    //creature->SummonGameObject(Obj_Flag_Alliance, 10727.707031, 2472.843262, 7.422600, 3.247260, 0, 0, 0, 0, 600000000);
70-
		case GOSSIP_ACTION_INFO_DEF + 2: 
70+
                    //creature->SummonGameObject(Obj_Flag_Alliance, -10729.45984, 2480.819824, 7.376544, 3.421985, 0, 0, 0, 0, 600000000);
71-
			if (player->HasItemCount(37742, 5, false)){
71+
                    //player->RemoveItem(37742, 5, true);
72-
				creature->SummonGameObject(Obj_Fireworks, -10743.955078, 2461.408447, 6.232886, 4.787787, 0, 0, 0, 0, 6000000000);
72+
                    player->PlayerTalkClass->SendCloseGossip();
73-
				creature->SummonGameObject(Obj_Fireworks, -10730.602539, 2458.209229, 7.478404, 4.526253, 0, 0, 0, 0, 6000000000);
73+
                }
74-
				player->RemoveItem(37742, 5, true);
74+
                else if (!player->HasItemCount(37742, 5, false))
75-
				player->PlayerTalkClass->SendCloseGossip();
75+
                {
76-
				break;
76+
                    //TODO: Error message.
77-
			}
77+
                }
78-
			else{
78+
            }
79-
				//TODO: Error message.
79+
            break;
80-
			}
80+
        case GOSSIP_ACTION_INFO_DEF + 2:
81-
		case GOSSIP_ACTION_INFO_DEF + 3:
81+
            if (player->HasItemCount(37742, 5, false))
82-
			if (player->HasItemCount(37742, 3, false)){
82+
            {
83-
				creature->SummonCreature(14337, -10709.791016, 2478.546875, 7.922036, 2.071496, TEMPSUMMON_MANUAL_DESPAWN, 30000000000000);
83+
                creature->SummonGameObject(Obj_Fireworks, -10743.955078, 2461.408447, 6.232886, 4.787787, 0, 0, 0, 0, 6000000000);
84-
				player->RemoveItem(37742, 5, true);
84+
                creature->SummonGameObject(Obj_Fireworks, -10730.602539, 2458.209229, 7.478404, 4.526253, 0, 0, 0, 0, 6000000000);
85-
				player->PlayerTalkClass->SendCloseGossip();
85+
                player->RemoveItem(37742, 5, true);
86-
				break;
86+
                player->PlayerTalkClass->SendCloseGossip();
87-
				}
87+
            }
88-
			}
88+
            else
89-
		}
89+
            {
90-
		return true;
90+
                //TODO: Error message.
91-
	}
91+
            }
92
            break;
93
        case GOSSIP_ACTION_INFO_DEF + 3:
94-
void AddSC_GuildCurrency_T(){
94+
            if (player->HasItemCount(37742, 3, false))
95-
	new GuildCurrency_T();
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
}