Ir para conteúdo

[ Resolvido ] Opa Chega Ai :d


DevilMoon

Posts Recomendados

ai galera to feliz tava vnedo uns tutorias de scripts botando Elfe . if tals os end aprendi tava fazendo mais de uma hora fazendo um npc reset que eu fiz eu proprio escrevendo olhando tals .... entaum voltando ao assunto o vordkart me fez um scripts que mostra mana , vida , e tals ip e os resets ja como trokei o reset system pelo q o npc vende .... so que eu reseto no npc e nao mostra os resets no !stats vo manda o script do stats e do npc e tentem ajudar pls

 

 

Stats

 

function onSay(cid, words, param)

 

function getResets(cid)

resets = getPlayerStorageValue(cid,1020)

if resets < 0 then

resets = 0

end

return resets

end

 

doPlayerPopupFYI(cid, "Information about player" ..

"\nStatus:" ..

"\nLevel - " .. getPlayerLevel(cid) ..

"\nReset - " .. getResets(cid) ..

"\nHealth - " .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. ", Mana - " .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) ..

"\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "")

return TRUE

end

 

 

Npc Reset

 

 

-- SCRIPT FEITO POR DevilMoon

-- config

minlevel = 25000 -- level para resetar

price = 500000

newlevel = 30 -- level após reset

newexp = 368300 -- 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 = 25000 -- level para resetar

price = 500000

newlevel = 30 -- level após reset

newexp = 368300 -- 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())

 

 

 

Se nao for pedir mt tambem se quando eu do look em alguem aparece os resets dele no look !

 

 

Agradeço desde ja :D

Link para o comentário
Compartilhar em outros sites

Kara isso que voce fez eh ripping =/, o autor desse script eh o yunie:

-- SCRIPT FEITO POR YUNIE

-- config

minlevel = 700 -- level para resetar

price = 50000

newlevel = 8 -- level após reset

newexp = 4200 -- nova experiencia após reset

-- end config

 

function addReset(cid)

resets = getResets(cid)

setPlayerStorageValue(cid,1020,resets+1)

return true

end

 

function getResets(cid)

resets = getPlayerStorageValue(cid,1020)

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('Voce deseja resetar seu char? Isto custará 50k!', cid)

talkState[talkUser] = 1

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

if getPlayerMoney(cid) < price then

selfSay('É Necessario ter 50k para resetar!', cid)

elseif getPlayerLevel(cid) < minlevel then

selfSay('O level minimo para reset é 500!', 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('Voce tem um total de '..getResets(cid)..' reset(s).', cid)

end

 

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Link:http://www.xtibia.com/forum/topic/131714-npc-reseter/

 

Voce ainda colou o script 2 vezes e nao mudou os creditos do segundo ¬¬

Link para o comentário
Compartilhar em outros sites

claro cara o storage value foi modificado...

 

de

resets = getPlayerStorageValue(cid,1020)

para

 

resets = getPlayerStorageValue(cid,36874)

 

 

 

function onSay(cid, words, param)

function getResets(cid)
resets = getPlayerStorageValue(cid,36874)
if resets < 0 then
resets = 0
end
return resets
end

doPlayerPopupFYI(cid, "Information about player" ..
"\nStatus:" ..
"\nLevel - " .. getPlayerLevel(cid) ..
"\nReset - " .. getResets(cid) .. 
"\nHealth - " .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. ", Mana - " .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) ..
"\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "") 
return TRUE
end

Editado por Herok
Link para o comentário
Compartilhar em outros sites

Ok Vlw Herok + Rep :D thanks agora so falta o look !

 

 

@Matheus

 

 

tu nao leu eu sei q é o Yune e outra nao é ripping eu falei foi o primeiro que eu fui fazendo a mao dps de ver as aulas de Scripts q tem ali no tutorias de Script entaum nao ripei so falei que fiz na mao mesmo escrevendo !

Editado por DevilMoon
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...