kimokimo
Kimo
i need a reset npc that when you reach lvl .... you go down to 8 again with same hp and mp and skills withouting changing vocation.
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local voc = {}
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') or msgcontains(msg, 'downgadate')) then
selfSay('Would you like to reset your fuckin level to 8 ?! Nasty fresh chicken...', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if isPremium(cid) == TRUE then
if getPlayerLevel(cid) >= 350 then
if doPlayerRemoveMoney(cid, 3000000) == TRUE then
selfSay('Ok. Go Go exp and have fun with this fucking OT.', cid)
talkState[talkUser] = 2
else
selfSay('Sorry, you don\'t have enough gold.', cid)
talkState[talkUser] = 0
end
else
selfSay('Only characters of level 350 or higher can be reseted.', cid)
talkState[talkUser] = 0
end
else
selfSay('Only premium account players may be reseted.', cid)
talkState[talkUser] = 0
end
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 3 then
local name = getCreatureName(cid)
doRemoveCreature(cid)
db.executeQuery("UPDATE players SET level = 8, experience = 4200, WHERE name ='"..name.."';")
elseif msgcontains(msg, 'no') and talkState[talkUser] == 3 then
selfSay('Well, you are fuckin chicken ?!', cid)
talkState[talkUser] = 2
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Go out son of a bitch.', cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())