• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[HELP]rebirth scirpt

tsb0314

New Member
Joined
Oct 21, 2009
Messages
220
Reaction score
4
Hi i have been looking for a rebirth scrpt for a very long time and still havent found one that works. can someone give me a link or a script that i can use. i want a talkaction that when you say !rebirth it will reset you to level 8 and your health and mana and items,magic level stay the same. i would also like when someone rebirths that when you look at them it would be like this

You see (Player name).....and so on......then to the end it will be like this........he has 1 rebirth.

please help.. i will rep for answer that works
 
Work off of this..

Code:
  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, 'rebirth')) then
                selfSay('Ready for me to rebirth you?', cid)
                talkState[talkUser] = 1

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

        local level     = 60000         -- Put here the level to rebirth
        local cost      = 5000000000         -- Put here the cost to rebirth in GP (20000 = 20k)

        local id = getPlayerGUID(cid)
        local name = getCreatureName(cid)
        local vocation = getPlayerVocation(cid)

                if getPlayerLevel(cid) >= level then
                        if doPlayerRemoveItem(cid,2157,5000) == TRUE then
				if(isInArray({9,10,11,12,25,26,27,28}, getPlayerVocation(cid)) == TRUE) then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 9 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 10 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 11 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 12 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")

                                else
                                        selfSay('Not a valid vocation. Contact administrator.', cid)
                                        talkState[talkUser] = 0
                                end
							else
								selfSay('You need 5,000 GN to Reborn.', cid)
							end 
						end
        elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
                talkState[talkUser] = 0
                selfSay('Okey come back when you are ready.', cid)
        
                                end
        return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Make sure to set the promotion #, and wich vocations ids you want. You can remove the excess elsif parts if u do dot wish to customize each vocations different HP/MP stats.
A good rebirth system is to make the next vocation have -66% or -33% exp rates but bonus 66% or 33% attributes like hp/mp, atk speed, and damage..
 
1 sec lol

pointless post,

anyways..

LUA:
local t = {
	level=xxx, -- level required for rebirth
	RemainingLvl=8, -- {8} = level(normal) level you become after the rebirth
	skull=true, -- players with white skull can rebirth?
	redskull=true, -- players with red skull can rebirth?
	prot=true, -- players must be in protection zone to rebirth?
	bat=true -- players must not have battle condition to rebirth?
}
 
local function getResets(cid)
	return math.max(0, getPlayerStorageValue(cid, 1020))
end
 
function onSay(cid, words, param)
	local skull = getCreatureSkullType(cid)
	if (not t.skull and skull == SKULL_WHITE) or (not t.redskull and skull == SKULL_RED) then
		doPlayerSendTextMessage(cid, 22, 'You cannot rebirth with a ' .. (skull == SKULL_WHITE and 'white' or 'red') .. ' skull.')
	end
 
	local pos = getThingPos(cid)
	if t.prot and not getTileInfo(pos).protection then
		return doPlayerSendTextMessage(cid, 22, 'You must be in a protection zone to rebirth.')
	elseif t.bat and hasCondition(cid, CONDITION_INFIGHT) then
		return doPlayerSendTextMessage(cid, 22, 'You must lose your battle sign to rebirth.')
	end
 
	local lvl = getPlayerLevel(cid)
	if lvl >= t.level then
		local new, newLvl = getResets(cid) + 1, math.max(t.RemainingLvl, t.RemainingLvl + lvl - t.level)
		setPlayerStorageValue(cid, 1020, new)
		doPlayerSetSpecialDescription(cid, '. ' .. (getPlayerSex(cid) == 0 and 'Sh' or 'H') .. 'e is on rebirth # ' .. new)
		doPlayerPopupFYI(cid, 'You have rebirthed, and you now have ' .. new .. ' reset' .. (new == 1 and '' or 's') .. ' in total.')
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		local pid, hp, mana = getPlayerGUID(cid), math.ceil(getCreatureMaxHealth(cid) * (1.0 * new)), math.ceil(getCreatureMaxMana(cid) * (1.0 * new))
		doRemoveCreature(cid)
		db.executeQuery('UPDATE `players` SET `level` = ' .. newLvl .. ', `experience` = ' .. getExperienceForLevel(newLvl) .. ', `promotion` = 0, `health` = ' .. hp ..', `healthmax` = ' .. hp .. ', `mana` = ' .. mana .. ', `manamax` = ' .. mana .. ' WHERE `id` = ' .. pid .. ' LIMIT 1;')
	else
		doPlayerSendCancel(cid, 'You need to reach level ' .. t.level .. ' or higher to rebirth.')
		doSendMagicEffect(pos, CONST_ME_POFF)
	end
	return true
end
 
Work off of this..

Code:
  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, 'rebirth')) then
                selfSay('Ready for me to rebirth you?', cid)
                talkState[talkUser] = 1

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

        local level     = 60000         -- Put here the level to rebirth
        local cost      = 5000000000         -- Put here the cost to rebirth in GP (20000 = 20k)

        local id = getPlayerGUID(cid)
        local name = getCreatureName(cid)
        local vocation = getPlayerVocation(cid)

                if getPlayerLevel(cid) >= level then
                        if doPlayerRemoveItem(cid,2157,5000) == TRUE then
				if(isInArray({9,10,11,12,25,26,27,28}, getPlayerVocation(cid)) == TRUE) then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 9 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 10 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 11 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")
                                elseif vocation == 12 then
                                        doRemoveCreature(cid)
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 250, `manamax` = 250, `promotion` = 3 WHERE `id` ='"..id.."';")
                                        db.executeQuery("UPDATE `players` SET `name` = '¥ "..name.."' WHERE `id` ='"..id.."';")

                                else
                                        selfSay('Not a valid vocation. Contact administrator.', cid)
                                        talkState[talkUser] = 0
                                end
							else
								selfSay('You need 5,000 GN to Reborn.', cid)
							end 
						end
        elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
                talkState[talkUser] = 0
                selfSay('Okey come back when you are ready.', cid)
        
                                end
        return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
He wanted a talkaction, not an NPC.
 
Back
Top