• 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!

reborn system

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,812
Solutions
6
Reaction score
822
i want a reborn system that when u reach the highest level <717127> not sure if this is the highest but when he get the highest he keep everything items skills mana and all but he get level 8 and get a rank ex:First reborn...Second time secondd reborn etc... infinity i want it as an npcs for 0.3.6pl1
REP++
 
Code:
local t = {
	level=700, -- level required for rebirth
	RemainingLvl=8, -- {8} = level(normal) level you become after the rebirth
	skull=true, -- players with white skull can ascend?
	redskull=true, -- players with red skull can ascend?
	prot=true, -- players must be in protection zone to ascend?
	bat=true -- players must not have battle condition to ascend?
}
 
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 ascend 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 ascend.')
	elseif t.bat and hasCondition(cid, CONDITION_INFIGHT) then
		return doPlayerSendTextMessage(cid, 22, 'You must lose your battle sign to ascend.')
	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 Ascension # ' .. new)
		doPlayerPopupFYI(cid, 'You have ascended, 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) * (0.2 * new)), math.ceil(getCreatureMaxMana(cid) * (0.2 * 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 ascend.')
		doSendMagicEffect(pos, CONST_ME_POFF)
	end
	return true
 
Why are you trying to make an carbon copy of my server? :) Delete this thread or I will ban you from my server.

huh? if u check the map tottaly diff!! exp is diff and monster is diff if i added a reborn system would it be a carbon copy LMAO!!

Code:
local t = {
	level=700, -- level required for rebirth
	RemainingLvl=8, -- {8} = level(normal) level you become after the rebirth
	skull=true, -- players with white skull can ascend?
	redskull=true, -- players with red skull can ascend?
	prot=true, -- players must be in protection zone to ascend?
	bat=true -- players must not have battle condition to ascend?
}
 
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 ascend 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 ascend.')
	elseif t.bat and hasCondition(cid, CONDITION_INFIGHT) then
		return doPlayerSendTextMessage(cid, 22, 'You must lose your battle sign to ascend.')
	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 Ascension # ' .. new)
		doPlayerPopupFYI(cid, 'You have ascended, 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) * (0.2 * new)), math.ceil(getCreatureMaxMana(cid) * (0.2 * 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 ascend.')
		doSendMagicEffect(pos, CONST_ME_POFF)
	end
	return true

i sux at this is it npc? o.O
 
Why are you trying to make an carbon copy of my server? :) Delete this thread or I will ban you from my server.

Implying you have copywrite on anything related to a "reborn system" or anything in that matter.
If he is making his own server, I don't think he will care if you ban him or not.

Also, I would just like to say that "Ban Evasion" is not hard at all.
 
any way anyone got it like a command talkactions and rohan i tried to help ur server lol and got some scammer and etc.. but im just 10k killing a fucking panda lol so i didnt play like all the time idc
 
found a npc, here
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('Are you ready to be reborn?', cid) 
                talkState[talkUser] = 1 

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

        local level     =   100000 
        local cost      =   150000000 
         
        ------/CONFIGS------- 
        -----LOCALS----- 
        local id = getPlayerGUID(cid) 
        local name = getCreatureName(cid) 
        local vocation = getPlayerVocation(cid) 
        ----/LOCALS----- 

                if getPlayerLevel(cid) >= level then 
                        if doPlayerRemoveMoney(cid,cost) == TRUE then 
                                if vocation == 5 then 
                                        doRemoveCreature(cid) 
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 500, `manamax` = 500, promotion` = 3 WHERE `id` ='"..id.."';") 
                                        db.executeQuery("UPDATE `players` SET `name` = '¥"..name.."' WHERE `id` ='"..id.."';") 
                                elseif vocation == 6 then 
                                        doRemoveCreature(cid) 
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 500, `manamax` = 500, promotion` = 3 WHERE `id` ='"..id.."';") 
                                        db.executeQuery("UPDATE `players` SET `name` = '¥"..name.."' WHERE `id` ='"..id.."';") 
                                elseif vocation == 7 then 
                                        doRemoveCreature(cid) 
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 400, `healthmax` = 400, `mana` = 350, `manamax` = 350, promotion` = 3 WHERE `id` ='"..id.."';") 
                                        db.executeQuery("UPDATE `players` SET `name` = '¥"..name.."' WHERE `id` ='"..id.."';") 
                                elseif vocation == 8 then 
                                        doRemoveCreature(cid) 
                                        db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 500, `healthmax` = 500, `mana` = 250, `manamax` = 250, promotion` = 3 WHERE `id` ='"..id.."';") 
                                        db.executeQuery("UPDATE `players` SET `name` = '¥"..name.."' WHERE `id` ='"..id.."';") 

                                else 
                                        selfSay('Please talk with forgotten king and promote first.', cid) 
                                        talkState[talkUser] = 0 
                                end 
                        else 
                                selfSay('You dont have enough money. You need to pay 150m to be rebirthed.', cid) 
                                talkState[talkUser] = 0 
                        end 
                else 
                        selfSay('Only characters of level 100000 or higher can be rebirthed.', cid) 
                        talkState[talkUser] = 0 
end 
        elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then 
                selfSay('Okey come back when you are ready.', cid) 
                talkState[talkUser] = 0 
         
                                end 
        return TRUE 
end 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) 
npcHandler:addModule(FocusModule:new())
 
not this, because it make all reborn with all again health and exp i just want lvl alone and without money :/ this one is bad
 
got some buggs :
mysql_real_query(): UPDATE `players` SET `level` = 8, `experience` = 4200, `health` = 250, `healthmax` = 250, `mana` = 500, `manamax` = 500, promotion` = 3 WHERE `id` ='21'; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '` = 3 WHERE `id` ='21'' at line 1 (1064)
 

Similar threads

Back
Top