• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Please i need help with Prestige System (prestige npc)

jogefur

New Member
Joined
Jan 9, 2010
Messages
1
Reaction score
0
Could someone please help me! I really need to do so when your 700k you can do prestige to get level 1 but still have the hp from lvl 700k. Please help!
 
Rebirth King

if you still need the help here u go

data/npc Rebirth King.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rebirth King" script="reset.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="332" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>

data/npc/scripts reset.lua
Code:
local config = {

	storage = 72345 -- Player storage rebirth count is kept on.

	}
 
local focuses = {}
local function isFocused(cid)
	for i, v in pairs(focuses) do
		if(v == cid) then
			return true
		end
	end
	return false
end
 
local function addFocus(cid)
	if(not isFocused(cid)) then
		table.insert(focuses, cid)
	end
end
local function removeFocus(cid)
	for i, v in pairs(focuses) do
		if(v == cid) then
			table.remove(focuses, i)
			break
		end
	end
end
local function lookAtFocus()
	for i, v in pairs(focuses) do
		if(isPlayer(v)) then
			doNpcSetCreatureFocus(v)
			return
		end
	end
	doNpcSetCreatureFocus(0)
end
 
function onCreatureDisappear(cid)
	if(isFocused(cid)) then
		selfSay("Goodbye.")
		removeFocus(cid)
	end
end
 
function onCreatureSay(cid, type, msg)
	if((msg == "hi") and not (isFocused(cid))) then
		selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, true)
		selfSay("I can {rebirth} you!", cid)
		addFocus(cid)
		status = 1
	elseif((isFocused(cid)) and (msg == "rebirth") and (status == 1)) then
		if (getCreatureStorage(cid, config.storage) < 90) then
			storage = getCreatureStorage(cid, config.storage)
			rebirthLevel = 800      <!--  This is the value you set for level for rebirth eg if you want lvl 715212 then change to 715212 -->
			if (getPlayerLevel(cid) >= rebirthLevel) then
				money = 150000 + (50000 * storage)
				if (getPlayerMoney(cid) >= money) then
					selfSay("I can rebirth you for " .. money .. " gold.", cid)
					selfSay("Do you want me to rebirth you?", cid)
					status = 2
				else
					selfSay("You need at least " .. money .. " gold before you can rebirth.", cid)
					status = 1
				end
			else
				selfSay("You need to be at least level " .. rebirthLevel .. " before you can rebirth.", cid)
				status = 1
			end
		else
			selfSay("It seems you can not rebirth anymore.", cid)
			status = 1
		end
	elseif((isFocused(cid)) and (msg == "yes") and (status == 2)) then
		selfSay("Ok then i will rebirth you.", cid)
		selfSay("You will now be logged out.", cid)
		doPlayerRemoveMoney(cid, money)
		addEvent(doRebirthPlayer, 2000, {cid=cid})
		removeFocus(cid)
	elseif((isFocused(cid)) and (msg == "no") and (status == 2)) then
		selfSay("Maybe one day you will wise up and change your mind!", cid)
		status = 1
	elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then
		selfSay("Goodbye!", cid, true)
		removeFocus(cid)
	end
end
 
function onPlayerCloseChannel(cid)
	if(isFocused(cid)) then
		selfSay("Goodbye.")
		removeFocus(cid)
	end
end
 
function onThink()
	for i, focus in pairs(focuses) do
		if(not isCreature(focus)) then
			removeFocus(focus)
		else
			local distance = getDistanceTo(focus) or -1
			if((distance > 4) or (distance == -1)) then
				selfSay("Goodbye.")
				removeFocus(focus)
			end
		end
	end
	lookAtFocus()
end
 
function doRebirthPlayer(cid)
	cid = cid.cid
	if (cid == nil) then
		return true
	end
 

	local guid = getPlayerGUID(cid)
	local setlevel = 8          <!-- Set capacity for player upon rebirth -->
	local setcap = 750        <!-- Set New capacity for rebirthed player -->
	local setx = 32369        <!-- Set temple position (MUST BE SAME AS CONFIG.LUA TEMPLE POSITION) -->
	local sety = 32241        <!-- Set temple position (MUST BE SAME AS CONFIG.LUA TEMPLE POSITION) --> 
	local setz = 7               <!-- Set temple position (MUST BE SAME AS CONFIG.LUA TEMPLE POSITION) -->

	doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) + 1)
	doRemoveCreature(cid, true)
	db.getResult("UPDATE `players` SET `level` = "..setlevel.." WHERE `id` = "..guid..";")
	db.getResult("UPDATE `players` SET `cap` = "..setcap.. " WHERE `id` = "..guid..";")
	db.getResult("UPDATE `players` SET `posx` = "..setx.. " WHERE `id` = "..guid..";")
	db.getResult("UPDATE `players` SET `posy` = "..sety.. " WHERE `id` = "..guid..";")
	db.getResult("UPDATE `players` SET `posz` = "..setz.. " WHERE `id` = "..guid..";")
 
	return true
end

please rep if this helped you. repost and give credit to Pirocona
 
What does this script do, i mean whats its purpose ive heard of rebirth but i have no clue what it means or does. explain please
 
Back
Top