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

TalkAction Reset System

If you make a script with these features, I would be very appreciated and also rep you:

» When Level X, player can "reborn".
» You "reborn" to level X.
» When reborn, player get a new & a higher vocation (If Master Sorcerer > Wizard)
» To reset, it costs X money.
» You need to have X storage to be able to "reborn".
» Also add the features that you have on your current script (If white/red skull ect)

I hope you will be able to create this script, cuz it really rocks.
 
I have made an npc of this and can publish it if someone wants.
i made it from MraZ script.
it works like this.
a player get to the npc and start talking and if he/she wants to reborn he/she can't have any skull and need to be vocation 1 to 4 and abow lvl req
after reborn the player become lvl 8 with 185 hp and 35 mana 500 cap same skills and mlvl as before. But you get promotion.
You can change the lvl req and lvl/hp/mana/cap after reborn
is someone intrested?
btw its tested for tfs 3.6 PL1
 
If you make a script with these features, I would be very appreciated and also rep you:

» When Level X, player can "reborn".
» You "reborn" to level X.
» When reborn, player get a new & a higher vocation (If Master Sorcerer > Wizard)
» To reset, it costs X money.
» You need to have X storage to be able to "reborn".
» Also add the features that you have on your current script (If white/red skull ect)

I hope you will be able to create this script, cuz it really rocks.
maybe this what ur looking for:
Code:
local config = {
	reqLevel = 100,
	nextLevel = 8,
	nextExp = 8400,
	stReq = 2000,
	reqMoney = 10000
}
local nextVocation = {
	[4] = {voc = 8},
	[5] = {voc = 9},
	[6] = {voc = 10},
	[7] = {voc = 11}
}

local function getStats(cid, value)
	if value == "health" then
		return isKnight(cid) and getPlayerLevel(cid) * 15 + 65 or isPaladin(cid) and getPlayerLevel(cid) * 10 + 105 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 5 + 145
	elseif value == "mana" then
		return isKnight(cid) and getPlayerLevel(cid) * 5 - 5 or isPaladin(cid) and getPlayerLevel(cid) * 15 - 85 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 30 - 205
	end
end

local function getNextVocation(cid)
	local voc_ = nextVocation[getPlayerVocation(cid)]
	return voc_.voc
end

function onSay(cid, words, param, channel)
	if getPlayerLevel(cid) < config.reqLevel then
		return doPlayerSendTextMessage(cid, 27, "You dont have enough level.")
	end
	if getPlayerStorageValue(cid, config.stReq) < 1 then
		return doPlayerSendTextMessage(cid, 27, "You dont have storage.")
	end
	if getPlayerMoney(cid) < config.reqMoney then
		return doPlayerSendTextMessage(cid, 27, "You dont have enough money.")
	end
	db.executeQuery("UPDATE `players` SET `level` = " .. config.nextLevel .. ", exp` = " .. config.nextExp .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
	db.executeQuery("UPDATE `players` SET `healthmax` = " .. getStats(cid, "health")-math.deg(20) .. ", `manamax` " .. getStats(cid, "mana") .. ", `vocation` = " .. getNextVocation(cid) .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), false)
	doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid), false)
end
-
sry
 
Last edited:
maybe this what ur looking for:
Code:
local config = {
	reqLevel = 100,
	nextLevel = 8,
	nextExp = 8400,
	stReq = 2000,
	reqMoney = 10000
}
local nextVocation = {
	[4] = {voc = 8},
	[5] = {voc = 9},
	[6] = {voc = 10},
	[7] = {voc = 11}
}

local function getStats(cid, value)
	if value == "health" then
		return isKnight(cid) and getPlayerLevel(cid) * 15 + 65 or isPaladin(cid) and getPlayerLevel(cid) * 10 + 105 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 5 + 145
	elseif value == "mana" then
		return isKnight(cid) and getPlayerLevel(cid) * 5 - 5 or isPaladin(cid) and getPlayerLevel(cid) * 15 - 85 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 30 - 205
	end
end

local function getNextVocation(cid)
	local voc = nextVocation[getPlayerVocation(cid)]
	return voc.voc
end

function onSay(cid, words, param, channel)
	if getPlayerLevel(cid) < config.reqLevel then
		return doPlayerSendTextMessage(cid, 27, "You dont have enough level.")
	end
	if getPlayerStorageValue(cid, config.stReq) < 1 then
		return doPlayerSendTextMessage(cid, 27, "You dont have storage.")
	end
	if getPlayerMoney(cid) < config.reqMoney then
		return doPlayerSendTextMessage(cid, 27, "You dont have enough money.")
	end
	return db.executeQuery("UPDATE `players` SET `level` = " .. config.nextLevel .. ", `exp` = " .. config.nextExp .. ", `healthmax` = " .. getStats(cid, "health") .. ", `manamax` " .. getStats(cid, "mana") .. ", `vocation` = " .. getNextVocation(cid) .. ";")
end
-
sry

Thank you, rep++!
 
why u do this commands
if palyer have 1st of highscores and don't know what is !reset do he will be lvl 8 and nothing he will win
 
[07/07/2010 03:08:51] [Error - TalkAction Interface]
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:eek:nSay
[07/07/2010 03:08:51] Description:
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:25: attempt to index local 'voc' (a nil value)
[07/07/2010 03:08:51] stack traceback:
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:25: in function 'getNextVocation'
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:38: in function <data/talkactions/scripts/reset.lua:28>
[07/07/2010 03:09:10] mysql_real_query(): UPDATE `players` SET `level` = 8, `exp` = 8400, `healthmax` = 4865, `manamax` 1595, `vocation` = 12; - 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 '1595, `vocation` = 12' at line 1 (1064)
 
maybe this what ur looking for:
Code:
local config = {
	reqLevel = 100,
	nextLevel = 8,
	nextExp = 8400,
	stReq = 2000,
	reqMoney = 10000
}
local nextVocation = {
	[4] = {voc = 8},
	[5] = {voc = 9},
	[6] = {voc = 10},
	[7] = {voc = 11}
}

local function getStats(cid, value)
	if value == "health" then
		return isKnight(cid) and getPlayerLevel(cid) * 15 + 65 or isPaladin(cid) and getPlayerLevel(cid) * 10 + 105 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 5 + 145
	elseif value == "mana" then
		return isKnight(cid) and getPlayerLevel(cid) * 5 - 5 or isPaladin(cid) and getPlayerLevel(cid) * 15 - 85 or (isSorcerer(cid) or isDruid(cid)) and getPlayerLevel(cid) * 30 - 205
	end
end

local function getNextVocation(cid)
	local voc = nextVocation[getPlayerVocation(cid)]
	return voc.voc
end

function onSay(cid, words, param, channel)
	if getPlayerLevel(cid) < config.reqLevel then
		return doPlayerSendTextMessage(cid, 27, "You dont have enough level.")
	end
	if getPlayerStorageValue(cid, config.stReq) < 1 then
		return doPlayerSendTextMessage(cid, 27, "You dont have storage.")
	end
	if getPlayerMoney(cid) < config.reqMoney then
		return doPlayerSendTextMessage(cid, 27, "You dont have enough money.")
	end
	return db.executeQuery("UPDATE `players` SET `level` = " .. config.nextLevel .. ", `exp` = " .. config.nextExp .. ", `healthmax` = " .. getStats(cid, "health") .. ", `manamax` " .. getStats(cid, "mana") .. ", `vocation` = " .. getNextVocation(cid) .. ";")
end
-
sry


iam using this
 
[07/07/2010 03:08:51] [Error - TalkAction Interface]
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:eek:nSay
[07/07/2010 03:08:51] Description:
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:25: attempt to index local 'voc' (a nil value)
[07/07/2010 03:08:51] stack traceback:
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:25: in function 'getNextVocation'
[07/07/2010 03:08:51] data/talkactions/scripts/reset.lua:38: in function <data/talkactions/scripts/reset.lua:28>
[07/07/2010 03:09:10] mysql_real_query(): UPDATE `players` SET `level` = 8, `exp` = 8400, `healthmax` = 4865, `manamax` 1595, `vocation` = 12; - 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 '1595, `vocation` = 12' at line 1 (1064)
fixed
 
Did you make it or did you help making it??
if you made it then show proof and if you helped making it then you're going
to have to discuss that with the thread owner.
 
Can someone post the NPC for reborn/reset system

That would be awesome, I will rep+! :p

What is storage?
It keeps saying, "you don't have storage" when I try to reset, what is storage??
 
Last edited:
Non of the scripts on this thread work


PHP:
--[[ 
	script by Marcryzius D'evil 
	 
	]]-- 
	function onSay(cid, words, param) 
	config = 
	{ 
	level=12, -- level necessario pra reseta. 
	RemainingLvl=8, -- {8} = level(normal) que ficará depois de ser resetado. 
	exper=4200, -- experiencia que ficará depois de ser resetado. 
	pid=getPlayerGUID(cid), -- não mecha 
	skull="yes", -- players com white skull podem resetar? ("yes" or "no"). 
	redskull="yes", -- players com red skull podem resetar? ("yes" or "no"). 
	prot="yes", -- players precisam estar em protection zone pra resetar? ("yes" or "no"). 
	bat="yes" -- players precisam estar sem fight pra resetarem? ("yes" or "no"). 
	} 
	 
	function getResets(cid) 
	reset = getPlayerStorageValue(cid,1020) 
	if reset < 0 then 
	reset = 0 
	end 
	return reset 
	end 
	 
	if(config.skull == "no") and (getCreatureSkullType(cid) == 3) then 
	doPlayerSendTextMessage(cid,22,"apenas players sem white skull podem resetar.") 
	return TRUE 
	end 
	 
	if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then 
	doPlayerSendTextMessage(cid,22,"apenas player sem red skull podem resetar.") 
	return TRUE 
	end 
	 
	if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then 
	doPlayerSendTextMessage(cid,22,"você precisa estar em protection zone pra poder resetar.") 
	return TRUE 
	end 
	 
	if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then 
	doPlayerSendTextMessage(cid,22,"você precisa estar sem battler pra poder resetar.") 
	return TRUE 
	end 
	 
	if(config.RemainingLvl+(getPlayerLevel(cid)-config.level) >= getPlayerLevel(cid))then 
	RemainingLvl=config.RemainingLvl+(getPlayerLevel(cid)-config.level) 
	else 
	RemainingLvl=config.RemainingLvl 
	end 
	 
	if getPlayerLevel(cid) >= config.level then 
	setPlayerStorageValue(cid,1020,getResets(cid)+1) 
	doPlayerSetNameDescription(cid, " Have a "..getResets(cid)+(1).." reset\'s.") 
	doPlayerPopupFYI(cid,"you now was reset, you have "..getResets(cid)+(1).." reset\'s.") 
	doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 
	doRemoveCreature(cid) 
	db.executeQuery("UPDATE `players` SET `level` = "..RemainingLvl..", `experience` = "..config.exper.." WHERE `id` = "..config.pid) 
	else 
	doPlayerSendCancel(cid, "You need to have level "..config.level.." or more you may be reset.") 
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) 
	end 
	 
	return TRUE 
	end

Someone fix this for me? After you reset to level 8, you don't gain any experience after that.
Help!
 
Back
Top