Hey there.
I am trying to make a vendor who sells reputation to the different factions.
However I would like it to cost gold. What set of commands should I use in order to make the Vendor (Made in Lua) take money from the user? And if the user doesn't have the required money, then deny and do nothing?
We can use this as an example:
Code:
function On_Gossip (pUnit, event, player)
pUnit:GossipCreateMenu(100, player)
pUnit:GossipMenuAddItem(player, 0, "Alliance Reputation", 1, 0)
pUnit:GossipSendMenu(player)
end
function Gossip_Submenus (pUnit, event, player, id, intid, code)
if(intid == 1) then
pUnit:GossipCreateMenu(99, player)
pUnit:GossipMenuAddItem(player, 5, "Stormwind", 14, 0)
pUnit:MenuSendToPlayer(player)
end
if(intid == 14) then
The help I ask for goes here xD
end
I know that its something like player:SetReputation(faction,value) (I think) and then I need it to check if the person got the gold asked for, and if not display a message.
The only think I really need to know is how you make the NPC reach down in the pocket of the player checks for the amount of gold, and takes it if the player got what it takes :b
I will of course give +Rep to the person who can give me the right answer ^^
Thanks in advance.