kusanagy
Respected Member
Hi guys,
wanted to help me with this script, its function is to promote, and I want this script, detects that it has already delivered according promotion account = id of characters.
How can i fix this.
always continues to promote them all.
wanted to help me with this script, its function is to promote, and I want this script, detects that it has already delivered according promotion account = id of characters.
How can i fix this.
always continues to promote them all.
Code:
function NPClevel_Gossip(event, player, unit)
if (player:IsInCombat() == true) then
else
NPClevel_Menu(unit, player)
end
end
function NPClevel_Menu(unit, player)
player:GossipMenuAddItem(4, "|Tinterface/icons/Ability_Mage_LivingBomb:20:20:-13:0|tPromo Nivel 80", 0, 1)
player:GossipMenuAddItem(4, "|Tinterface/icons/Ability_Vehicle_LoadSelfCatapult:20:20:-13:0|tnevermind", 0 , 9)
player:GossipSendMenu(1, unit)
end
function NPClevel_Events(event, player, unit, sender, intid, code)
if (intid == 1) then
local playerGUID = player:GetAccountId()
local result = CharDBQuery("SELECT COUNT(`guid`) FROM characters WHERE account = "..playerGUID)
if (result) then
player:SetLevel(80)
player:SendBroadcastMessage("Congratulations you won the Promotion, one character per account!")
if (player:GetLevel() == 80) then
player:GossipComplete()
end
else
player:PlayDirectSound(1807)
player:SendNotification("you already have this promotion!")
player:GossipComplete()
end
end
if (intid == 9) then
player:GossipComplete()
end
end