Advertisement
Guest User

Untitled

a guest
Mar 6th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3. bool GossipHello_npc_dp(Player *pPlayer, Creature *pCreature)
  4. {
  5. pPlayer->ADD_GOSSIP_ITEM(0, "Mennyi a pontom?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  6. pPlayer->SEND_GOSSIP_MENU(1, pCreature->GetGUID());
  7. return true;
  8. }
  9.  
  10. bool GossipSelect_npc_dp(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
  11. {
  12. if(!pPlayer || !pCreature || !action)
  13. return false;
  14.  
  15. Field *fields;
  16. uint32 ID;
  17. QueryResult result;
  18.  
  19. switch(action)
  20. {
  21. case GOSSIP_ACTION_INFO_DEF+1:
  22. result = AuthDatabase.PQuery("SELECT `kredit` FROM `tábla` WHERE `username` = '%u' LIMIT 1", pPlayer->GetSession()->GetAccountId());
  23. if (result)
  24. {
  25. fields = result->Fetch();
  26. uint32 dp = fields[0].GetUInt32();
  27. pCreature->MonsterWhisper("Jelenleg %u dp-d van!", dp, pPlayer->GetGUID());
  28. }
  29. else
  30. pCreature->MonsterWhisper("Nincs dp-d!", pPlayer->GetGUID());
  31.  
  32. pPlayer->CLOSE_GOSSIP_MENU();
  33. break;
  34. }
  35.  
  36. return true;
  37. }
  38.  
  39. void AddSC_npc_innkeeper()
  40. {
  41. Script *newscript;
  42. newscript = new Script;
  43. newscript->Name = "npc_dp";
  44. newscript->pGossipHello = &GossipHello_npc_dp;
  45. newscript->pGossipSelect = &GossipSelect_npc_dp;
  46. newscript->RegisterSelf();
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement