Ir para conteúdo

Limite Reset


Elfen

Posts Recomendados

Pow Galera ja vi me varios ots sobre limite de reset e de level para free e para vip se algem souber como

coloco limite de reset pra free ex: 100 e pra vip ex: 150

e o levevl a mesma coisa agradeço rep ++

Link para o comentário
Compartilhar em outros sites

OLHA MAN TO POSTANDO O NPC Q E O RESET NO MEU OT

 

 

-- config

minlevel = 60000 -- level para resetar

price = 500000

newlevel = 500 -- level após reset

newexp = 0 -- nova experiencia após reset

-- end config

 

function addReset(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,36874,resets+1)

return true

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,36874)

if resets < 0 then

resets = 0

end

return resets

end

 

 

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, 'reset') then

selfSay('Do you want to reset your character level? Your character will be logged off if you confirm. You must pay '..price..' gold coins to reset.', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerMoney(cid) < price then

selfSay('You must pay '..price..' gold coins to reset.', cid)

elseif getPlayerLevel(cid) < minlevel then

selfSay('You must be at least level '.. minlevel ..' to reset.', cid)

else

doPlayerRemoveMoney(cid,price)

addReset(cid)

playerid = getPlayerGUID(cid)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`="..newexp.." WHERE `players`.`id`= ".. playerid .."")

end

talkState[talkUser] = 0

elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then

talkState[talkUser] = 0

selfSay('Ok.', cid)

elseif msgcontains(msg, 'quant') then

selfSay('You have '..getResets(cid)..' reset(s).', cid)

end

 

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

-- SCRIPT FEITO POR YUNIE

-- config

minlevel = 40000 -- level para resetar

price = 200000

newlevel = 1000 -- level após reset

newexp = 0 -- nova experiencia após reset

-- end config

 

function addReset(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,36874,resets+1)

return true

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,36874)

if resets < 0 then

resets = 0

end

return resets

end

 

 

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, 'reset') then

selfSay('Do you want to reset your character level? Your character will be logged off if you confirm. You must pay '..price..' gold coins to reset.', cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerMoney(cid) < price then

selfSay('You must pay '..price..' gold coins to reset.', cid)

elseif getPlayerLevel(cid) < minlevel then

selfSay('You must be at least level '.. minlevel ..' to reset.', cid)

else

doPlayerRemoveMoney(cid,price)

addReset(cid)

playerid = getPlayerGUID(cid)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`="..newexp.." WHERE `players`.`id`= ".. playerid .."")

end

talkState[talkUser] = 0

elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then

talkState[talkUser] = 0

selfSay('Ok.', cid)

elseif msgcontains(msg, 'quant') then

selfSay('You have '..getResets(cid)..' reset(s).', cid)

end

 

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

troca por isto

 

-- config

minlevel = 60000 -- level para resetar

price = 500000

newlevel = 500 -- level após reset

newexp = 0 -- nova experiencia após reset

-- end config

 

function addReset(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,36874,resets+1)

return true

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,36874)

if resets < 0 then

resets = 0

end

return resets

end

 

 

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, 'reset') then

if getResets(cid) <= maxreset then

selfSay('Do you want to reset your character level? Your character will be logged off if you confirm. You must pay '..price..' gold coins to reset.', cid)

talkState[talkUser] = 1

else

selfSay('você ja atingiu o maximo de resets.', cid)

talkState[talkUser] = 0

end

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerMoney(cid) < price then

selfSay('You must pay '..price..' gold coins to reset.', cid)

elseif getPlayerLevel(cid) < minlevel then

selfSay('You must be at least level '.. minlevel ..' to reset.', cid)

else

doPlayerRemoveMoney(cid,price)

addReset(cid)

playerid = getPlayerGUID(cid)

doRemoveCreature(cid)

db.executeQuery("UPDATE `players` SET `level`="..newlevel..",`experience`="..newexp.." WHERE `players`.`id`= ".. playerid .."")

end

talkState[talkUser] = 0

elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then

talkState[talkUser] = 0

selfSay('Ok.', cid)

elseif msgcontains(msg, 'quant') then

selfSay('You have '..getResets(cid)..' reset(s).', cid)

end

 

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...