Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Made by: aaddss A.K.A Deathsoul
- untested (in game)
- */
- #include "ScriptPCH.h"
- class npc_tool : public CreatureScript
- {
- public:
- npc_tool() : CreatureScript("npc_tool"){}
- bool OnGossipHello(Player * pPlayer, Creature * pCreature)
- {
- pPlayer->ADD_GOSSIP_ITEM(4, " Race Change 5 Tokens", GOSSIP_SENDER_MAIN, 0);
- pPlayer->ADD_GOSSIP_ITEM(4, " Faction Change 10 Tokens", GOSSIP_SENDER_MAIN, 1);
- pPlayer->ADD_GOSSIP_ITEM(4, " customize 1 Tokens", GOSSIP_SENDER_MAIN, 2);
- pPlayer->ADD_GOSSIP_ITEM(4, " rename 1 Tokens", GOSSIP_SENDER_MAIN, 3);
- pPlayer->PlayerTalkClass->SendGossipMenu(9425, pCreature->GetGUID());
- return true;
- }
- bool OnGossipSelect(Player * Player, Creature * Creature, uint32 /*uiSender*/, uint32 uiAction)
- {
- if(!Player)
- return true;
- switch(uiAction)
- {
- case 0:
- if(Player->HasItemCount(12345, 5)) // race change token (12345) you can change it
- {
- Player->DestroyItemCount(12345, 5, true, true); // race change token (12345) you can change it
- Player->DestroyItemCount(12345, 5, true, false); // race change token (12345) you can change it
- Player->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
- CharacterDatabase.PExecute("UPDATe characters Set at_login = at_login | '128' Where guid = %u", Player->GetGUID());
- Player->GetSession()->SendNotification("You need to relog, to change your race!");
- Player->PlayerTalkClass->CloseGossip();
- }
- else
- {
- Player->GetSession()->SendNotification("You need atleast 5 race change token!");
- Player->PlayerTalkClass->CloseGossip();
- }
- break;
- case 1:
- if(Player->HasItemCount(123, 10)) // race change token (123) you can change it
- {
- Player->DestroyItemCount(123, 10, true, true); // race change token (123) you can change it
- Player->DestroyItemCount(123, 10, true, false); // race change token (123) you can change it
- Player->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
- CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '64' WHERE guid = %u", Player->GetGUID());
- Player->GetSession()->SendNotification("You need to relog, to change your faction!");
- Player->PlayerTalkClass->CloseGossip();
- }
- else
- {
- Player->GetSession()->SendNotification("you need atleast 10 faction change token!");
- Player->PlayerTalkClass->CloseGossip();
- }
- break;
- case 2:
- if(Player->HasItemCount(152, 1)) // customize change token (152) you can change it
- {
- Player->DestroyItemCount(152, 1, true, true); // customize change token (152) you can change it
- Player->DestroyItemCount(152, 1, true, false); // customize change token (152) you can change it
- Player->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
- CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = %u", Player->GetGUID());
- Player->GetSession()->SendNotification("you need to relog, to change your customize!");
- Player->PlayerTalkClass->CloseGossip();
- }
- else
- {
- Player->GetSession()->SendNotification("you need atleast 1 customize change token!");
- Player->PlayerTalkClass->CloseGossip();
- }
- break;
- case 3:
- if(Player->HasItemCount(152, 1)) // name change token (1552) you can change it
- {
- Player->DestroyItemCount(1552, 1, true, true); // name change token (1552) you can change it
- Player->DestroyItemCount(1552, 1, true, false); // name change token (1552) you can change it
- Player->SetAtLoginFlag(AT_LOGIN_RENAME);
- CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '8' WHERE guid = %u", Player->GetGUID());
- Player->GetSession()->SendNotification("you need to relog, to change your name!");
- Player->PlayerTalkClass->CloseGossip();
- }
- else
- {
- Player->GetSession()->SendNotification("you need atleast 1 name change token!");
- Player->PlayerTalkClass->CloseGossip();
- }
- break;
- }
- return true;
- }
- };
- void AddSc_npc_tool()
- {
- new npc_tool();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement