View difference between Paste ID: a7GsAaUx and QwqsrsMr
SHOW: | | - or go back to the newest paste.
1-
class LoveBoat_Gossip : public GossipScript
1+
class LoveBoat_Gossip : public CreatureScript
2
{
3
public:
4-
      void GossipHello(Object* pObject, Player * plr, bool AutoSend)
4+
    LoveBoat_Gossip() : CreatureScript("LoveBoat_Gossip") { }
5-
      {
5+
6-
         GossipMenu *Menu;
6+
    bool OnGossipHello(Player* player, Creature* creature)
7-
         objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 40002, plr);
7+
8-
         Menu->AddItem( 0, "Fly to the Chimaera spot", 1 );
8+
        player->ADD_GOSSIP_ITEM(0, "Fly to the Chimaera spot", GOSSIP_SENDER_MAIN, 1); // See http://www.trinitycore.org/f/topic/6320-single-gossip-item/#entry46494 on how to make single gossip menu item work
9-
         if(AutoSend)
9+
        player->ADD_GOSSIP_ITEM(0, "asd", GOSSIP_SENDER_MAIN, 0); // using 2 for now.
10-
             Menu->SendTo(plr);
10+
        player->SEND_GOSSIP_MENU(40002, creature->GetGUID()); // 40002 was textID right?
11-
      }
11+
12-
void GossipSelectOption(Object* pObject, Player * plr, uint32 Id, uint32 IntId, const char * Code)
12+
        return true;
13
    }
14-
Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
14+
15-
       if(pCreature==NULL)
15+
    bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
16-
        return;
16+
17-
     switch(IntId)
17+
        player->PlayerTalkClass->ClearMenus();
18-
	 {
18+
        switch(action)
19
        {
20
        case 0:
21-
                 objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
21+
            player->CLOSE_GOSSIP_MENU(); break;
22-
                if (Plr->getClass() == 2||Plr->getClass() == 3||Plr->getClass() == 4||Plr->getClass() == 5||Plr->getClass() == 6||Plr->getClass() == 7||Plr->getClass() == 8||Plr->getClass() == 9||Plr->getClass() == 10||Plr->getClass() == 11)  // Gets the class WARRIOR
22+
23-
                     Menu->AddItem(2, "You must be a Warrior to learn Warrior spells.");
23+
            {
24-
				     else
24+
                if (player->getClass() != CLASS_WARRIOR)  // Gets the class WARRIOR
25-
				{Menu->AddItem(0, "Teach me my spells!", 2);}  // Warrior Spells Only
25+
                    player->ADD_GOSSIP_ITEM(2, "You must be a Warrior to learn Warrior spells.", GOSSIP_SENDER_MAIN, 0);
26-
                 Menu->SendTo(Plr);
26+
                else
27-
                                
27+
                    player->ADD_GOSSIP_ITEM(0, "Teach me my spells!", GOSSIP_SENDER_MAIN, 2); // Warrior Spells Only
28-
        }break;
28+
                player->ADD_GOSSIP_ITEM(0, "asd", GOSSIP_SENDER_MAIN, 0); // using 2 for now.
29
                player->SEND_GOSSIP_MENU(1, creature->GetGUID());
30-
	 }
30+
            }break;
31-
}
31+
32-
    void Destroy()
32+
        }
33
	return true;
34-
        delete this;
34+
35
};
36-
};
36+
37
void AddSC_YourScript()
38
{
39
    new LoveBoat_Gossip();
40
}