Eu gostaria que concertassem meu npc ou simplesmente tem como liberar todos os addons para todo mundo?
Meu npc de addon. Ele fala tudo certinho vende o addon, so que nao aparece para o personagem.
*Varkhal
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Varkhal" script="addons.lua" walkinterval="2000" floorchange="0" skull="green">
<health now="100" max="100"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>
*Addons.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'first') or msgcontains(msg, 'first addon')) then
if isPremium(cid) then
if getPlayerItemCount(cid, 2160) >= 1 then
selfSay('Did you buy first addons for 10k?', cid)
talkState[talkUser] = 1
else
selfSay('Come back when you have 10k.', cid)
end
else
selfSay('Sorry, you need a premium account to get addons.', cid)
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerItemCount(cid, 2160) >= 1 or getPlayerItemCount(cid, 2152) >= 100 or getPlayerItemCount(cid, 2148) >= 10000 then
if doPlayerTakeItem(cid, 2160, 1) or doPlayerTakeItem(cid, 2152, 100) or doPlayerTakeItem(cid, 2148, 10000) == 0 then
selfSay('Thank you. Here you are oaddon.', cid)
doPlayerAddOutfit(cid, femaleOutfits, 1)
doPlayerAddOutfit(cid, maleOutfits, 1)
end
else
selfSay(addonItem, cid)
end
talkState[talkUser] = 0
elseif (msgcontains(msg, 'second') or msgcontains(msg, 'second addon')) then
if isPremium(cid) then
if getPlayerItemCount(cid,2160) >= 2 or getPlayerItemCount(cid,2152) >= 200 or getPlayerItemCount(cid,2148) >= 20000 then
selfSay('Did you bring me the 20k?', cid)
talkState[talkUser] = 4
else
selfSay('Come back when you have the 20k.', cid)
end
else
selfSay('Sorry, you need a premium account to get addons.', cid)
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
if getPlayerItemCount(cid,2160) >= 2 or getPlayerItemCount(cid,2152) >= 200 or getPlayerItemCount(cid,2148) >= 20000 then
if doPlayerTakeItem(cid,2160,1) or doPlayerTakeItem(cid,2152,100) or doPlayerTakeItem(cid,2148,10000) == 0 then
selfSay('Thank you. Here you are oaddon.', cid)
doPlayerAddOutfit(cid, femaleOutfits, 2)
doPlayerAddOutfit(cid, maleOutfits, 2)
end
else
selfSay(addonItem, cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
talkState[talkUser] = 0
selfSay('Ok then.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Lembrando que se alguem souber simplesmente como liberar addons para todos, esta otimo =D