eu ja tenho a scritp, tudo certinho, só um detalhe importante que eu nao consegui resolver, achei que aki poderia resolver o meu probleminha ;/
Tipo o npc ttroca itens por vocations, mais ele nao remove os itens que declaro, tentei de tudo , nao consegui ;/
vou por a script e ai vcs deem uma olhada ter uma noçao, deem uma ajuda, fale onde tenho que por , onde errei por favor, Deis de aj agradeço
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 promotion(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local config = {
money = 10000,
requirements = {
{itemid = 5879, count = 20},
{itemid = 5878, count = 20},
},
}
if isPremium(cid) then
if(getPlayerPromotionLevel(cid) >= parameters.promotion) then
npcHandler:say('You are already promoted!', cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say('I am sorry, but I can only promote you
once you have reached level ' .. parameters.level .. '.', cid)
elseif getPlayerMoney(cid) < config.money then
npcHandler:say('You do not have enough money!', cid)
else
for k, v in pairs (config.requirements) do
if getPlayerItemCount(cid, v.itemid) < v.count
then
npcHandler:say("You don't have the all
of the items I need.", cid)
return true
end
end
setPlayerPromotionLevel(cid, parameters.promotion)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get
promoted.", cid)
end
npcHandler:resetNpc()
return true
end
function promotion(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local config = {
money = 20000,
requirements = {
{itemid = 4852, count = 50},
{itemid = 2337, count = 35},
},
}
if isPremium(cid) then
if(getPlayerPromotionLevel(cid) >= parameters.promotion) then
npcHandler:say('You are already promoted!', cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say('I am sorry, but I can only promote you
once you have reached level ' .. parameters.level .. '.', cid)
elseif getPlayerMoney(cid) < config.money then
npcHandler:say('You do not have enough money!', cid)
else
for k, v in pairs (config.requirements) do
if getPlayerItemCount(cid, v.itemid) < v.count
then
npcHandler:say("You don't have the all
of the items I need.", cid)
return true
end
end
setPlayerPromotionLevel(cid, parameters.promotion)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get
promoted.", cid)
end
npcHandler:resetNpc()
return true
end
function promotion(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local config = {
money = 30000,
requirements = {
{itemid = 6500, count = 60},
{itemid = 2328, count = 50},
{itemid = 5880, count = 40},
{itemid = 2338, count = 30},
{itemid = 6546, count = 25},
},
}
if isPremium(cid) then
if(getPlayerPromotionLevel(cid) >= parameters.promotion) then
npcHandler:say('You are already promoted!', cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say('I am sorry, but I can only promote you
once you have reached level ' .. parameters.level .. '.', cid)
elseif getPlayerMoney(cid) < config.money then
npcHandler:say('You do not have enough money!', cid)
else
for k, v in pairs (config.requirements) do
if getPlayerItemCount(cid, v.itemid) < v.count
then
npcHandler:say("You don't have the all
of the items I need.", cid)
return true
end
end
setPlayerPromotionLevel(cid, parameters.promotion)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get
promoted.", cid)
end
npcHandler:resetNpc()
return true
end
function promotion(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local config = {
money = 40000,
requirements = {
{itemid = 4852, count = 70},
{itemid = 6500, count = 60},
{itemid = 2328, count = 50},
{itemid = 2336, count = 30},
{itemid = 5883, count = 40},
},
}
if isPremium(cid) then
if(getPlayerPromotionLevel(cid) >= parameters.promotion) then
npcHandler:say('You are already promoted!', cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say('I am sorry, but I can only promote you
once you have reached level ' .. parameters.level .. '.', cid)
elseif getPlayerMoney(cid) < config.money then
npcHandler:say('You do not have enough money!', cid)
else
for k, v in pairs (config.requirements) do
if getPlayerItemCount(cid, v.itemid) < v.count
then
npcHandler:say("You don't have the all
of the items I need.", cid)
return true
end
end
setPlayerPromotionLevel(cid, parameters.promotion)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get
promoted.", cid)
end
npcHandler:resetNpc()
return true
end
function promotion(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local config = {
money = 20000,
requirements = {
{itemid = 2157, count = 5},
{itemid = 2158, count = 5},
},
}
if isPremium(cid) then
if(getPlayerPromotionLevel(cid) >= parameters.promotion) then
npcHandler:say('You are already promoted!', cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say('I am sorry, but I can only promote you
once you have reached level ' .. parameters.level .. '.', cid)
elseif getPlayerMoney(cid) < config.money then
npcHandler:say('You do not have enough money!', cid)
else
for k, v in pairs (config.requirements) do
if getPlayerItemCount(cid, v.itemid) < v.count
then
npcHandler:say("You don't have the all
of the items I need.", cid)
return true
end
end
setPlayerPromotionLevel(cid, parameters.promotion)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get
promoted.", cid)
end
npcHandler:resetNpc()
return true
end
function promotion(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local config = {
money = 20000,
requirements = {
{itemid = 2157, count = 5},
{itemid = 2158, count = 5},
},
}
if isPremium(cid) then
if(getPlayerPromotionLevel(cid) >= parameters.promotion) then
npcHandler:say('You are already promoted!', cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say('I am sorry, but I can only promote you
once you have reached level ' .. parameters.level .. '.', cid)
elseif getPlayerMoney(cid) < config.money then
npcHandler:say('You do not have enough money!', cid)
else
for k, v in pairs (config.requirements) do
if getPlayerItemCount(cid, v.itemid) < v.count
then
npcHandler:say("You don't have the all
of the items I need.", cid)
return true
end
end
setPlayerPromotionLevel(cid, parameters.promotion)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get
promoted.", cid)
end
npcHandler:resetNpc()
return true
end
local node1 = keywordHandler:addKeyword({'squire elite knight'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce
deseja realmente virar um Squire Elite Knight, Presisa ser lvl 280.'})
node1:addChildKeyword({'yes'}, promotion, {npcHandler = npcHandler,
cost = 10, level = 280, promotion = 2, text = 'Gz Man You are
Promoted'})
node1:addChildKeyword({'no'}, promotion, {npcHandler = npcHandler,
onlyFocus = true, text = 'Alright then, come back when you are ready.',
reset = true})
local node2 = keywordHandler:addKeyword({'gg elite knight'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce
deseja realmente virar um fire Elite Knight, Presisa ser lvl 380.'})
node2:addChildKeyword({'yes'}, promotion, {npcHandler = npcHandler,
cost = 10, level = 380, promotion = 3, text = 'Gz Man You are
Promoted'})
node2:addChildKeyword({'no'}, promotion, {npcHandler = npcHandler,
onlyFocus = true, text = 'Alright then, come back when you are ready.',
reset = true})
local node3 = keywordHandler:addKeyword({'gg elite knight'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce
deseja realmente virar um suprema elite knight, Presisa ser lvl 480
.'})
node3:addChildKeyword({'yes'}, promotion, {npcHandler = npcHandler,
cost = 10, level = 480, promotion = 4, text = 'Gz Man You are
Promoted'})
node3:addChildKeyword({'no'}, promotion, {npcHandler = npcHandler,
onlyFocus = true, text = 'Alright then, come back when you are ready.',
reset = true})
local node4 = keywordHandler:addKeyword({'gg elite knight'},
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce
deseja realmente virar um lengendary bronze elite knight, Presisa ser
lvl 550.'})
node4:addChildKeyword({'yes'}, promotion, {npcHandler = npcHandler,
cost = 10, level = 550, promotion = 5, text = 'Gz Man You are
Promoted'})
node4:addChildKeyword({'no'}, promotion, {npcHandler = npcHandler,
onlyFocus = true, text = 'Alright then, come back when you are ready.',
reset = true})
local node5 = keywordHandler:addKeyword({'ffd2fds'}, StdModule.say,
{npcHandler = npcHandler, onlyFocus = true, text = 'Voce deseja
realmente virar um lengendary silver elite knight, Presisa ser lvl
350.'})
node5:addChildKeyword({'yes'}, promotion, {npcHandler = npcHandler,
cost = 0, level = 350, promotion = 6, text = 'Gz Man You are
Promoted'})
node5:addChildKeyword({'no'}, promotion, {npcHandler = npcHandler,
onlyFocus = true, text = 'Alright then, come back when you are ready.',
reset = true})
local node6 = keywordHandler:addKeyword({'ds1dsad'}, StdModule.say,
{npcHandler = npcHandler, onlyFocus = true, text = 'Voce deseja
realmente virar um lengendary gold elite knight, Presisa ser lvl
350.'})
node6:addChildKeyword({'yes'}, promotion, {npcHandler = npcHandler,
cost = 20000, level = 350, promotion = 7, text = 'Gz Man You are
Promoted'})
node6:addChildKeyword({'no'}, promotion, {npcHandler = npcHandler,
onlyFocus = true, text = 'Alright then, come back when you are ready.',
reset = true})
npcHandler:addModule(FocusModule:new())