Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- bool GossipHello_npc_dp(Player *pPlayer, Creature *pCreature)
- {
- pPlayer->ADD_GOSSIP_ITEM(0, "Mennyi a pontom?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->SEND_GOSSIP_MENU(1, pCreature->GetGUID());
- return true;
- }
- bool GossipSelect_npc_dp(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
- {
- if(!pPlayer || !pCreature || !action)
- return false;
- Field *fields;
- uint32 ID;
- QueryResult result;
- switch(action)
- {
- case GOSSIP_ACTION_INFO_DEF+1:
- result = AuthDatabase.PQuery("SELECT `kredit` FROM `tábla` WHERE `username` = '%u' LIMIT 1", pPlayer->GetSession()->GetAccountId());
- if (result)
- {
- fields = result->Fetch();
- uint32 dp = fields[0].GetUInt32();
- pCreature->MonsterWhisper("Jelenleg %u dp-d van!", dp, pPlayer->GetGUID());
- }
- else
- pCreature->MonsterWhisper("Nincs dp-d!", pPlayer->GetGUID());
- pPlayer->CLOSE_GOSSIP_MENU();
- break;
- }
- return true;
- }
- void AddSC_npc_innkeeper()
- {
- Script *newscript;
- newscript = new Script;
- newscript->Name = "npc_dp";
- newscript->pGossipHello = &GossipHello_npc_dp;
- newscript->pGossipSelect = &GossipSelect_npc_dp;
- newscript->RegisterSelf();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement