Death-Pulse
Owner of Death-Pulse
- Joined
- May 10, 2014
- Messages
- 100
- Reaction score
- 0
I am having issues with my reborn script
When a player reaches 200 reborn is basicly gives them 0/0 mana and hp now i want my reborn to atleast reach 1k because of the stuff that added extra for the higher rebirths so there will be a point of the game..
Everything is the npc script looks fine and it was added when i got the server
0-199 works just fine but then u hit that 200 and u basicly cant use spells u cant do ANYTHING
I need some advice on fixing this issue or atleast some help heres my creature script
When a player reaches 200 reborn is basicly gives them 0/0 mana and hp now i want my reborn to atleast reach 1k because of the stuff that added extra for the higher rebirths so there will be a point of the game..
Everything is the npc script looks fine and it was added when i got the server
0-199 works just fine but then u hit that 200 and u basicly cant use spells u cant do ANYTHING
I need some advice on fixing this issue or atleast some help heres my creature script
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
local reborn = 2500 -- free storage
local spellReborn = {
[1] = 'Reborn1',
[5] = 'Reborn5',
[10] = 'Reborn10',
[25] = 'Reborn25',
[50] = 'Reborn50',
[100] = 'Reborn100',
[250] = 'Reborn250',
[500] = 'Reborn500'
}
local level = 717217
local maxReborns =1000
local toLevel = 100
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 greetCallback(cid)
Topic[cid] = nil
return true
end
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
elseif Topic[cid] then
if msgcontains(msg, 'yes') then
if getCreatureStorage(cid, reborn) < maxReborns then
doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
for k, v in pairs(spellReborn) do
if getCreatureStorage(cid, reborn) == k then
doPlayerLearnInstantSpell(cid, v)
doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
break
end
end
local g = getPlayerGUID(cid)
npcHandler:releaseFocus(cid)
doRemoveCreature(cid)
db.executeQuery('UPDATE players SET level=99,experience=15219400 WHERE id=' .. g)
else
npcHandler:say('You reached maximum amount of reborns.', cid)
end
else
npcHandler:say('Maybe next time.', cid)
end
Topic[cid] = nil
else
if msgcontains(msg, 'reborn') then
if getPlayerLevel(cid) >= level then
npcHandler:say('Are you sure that you want to make reborn?',cid)
Topic[cid] = 1
else
npcHandler:say('You don\'t have enough level. ['..level..']',cid)
Topic[cid] = nil
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())