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

Reset/Reborn System, whatever you call it.

Aurolio

New Member
Joined
Aug 26, 2018
Messages
45
Reaction score
3
Hi, I am trying to implement a reborn system to my ots, but I don't know how to increase dmg by certain percentage with every single reborn player makes.

This is the code I am using:

Lua:
function onSay(cid, words, param)
config = {
level=450, -- level necessary to reset.
RemainingLvl=8, -- that level will be reset after.
exper=4200, -- experience that will be reset after.
pid=getPlayerGUID(cid),
skull="yes", -- players with white skull can reset? ("yes" or "no").
redskull="yes", -- players with red skull can reset? ("yes" or "no").
prot="yes", -- players need to be in protection zone to reset? ("yes" or "no").
bat="yes" --Players must be no fight to reset ("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,"only players without white skull can reset.")
return TRUE
end

if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"only player without red skull can reset.")
return TRUE
end

if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"you need stay in PZ to reset.")
return TRUE
end

if(config.bat == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"players without battle can reset.")
return TRUE
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` = "..config.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(getPlayerPosition(cid), CONST_ME_POFF)
end

return TRUE
end


Also, when I run this script, instead of updating the reset description "Have x resets", it just adds another description so it looks like : Have 2 resets. Have 3 resets. Have 4 resets and so on.
 
Isn't reborn system transforms you to another vocation id, so thats how you increase the damage after reborn. So if you are vocation id 1after reborn you become vocation id 2 so you just increase <formula meleeDamage="5.5" to vocation id 2 and thats it, thats how transform system suppose to work. [1] = {newVocation = 2, newLooktype = 10}
 
Well, let's call it reset system then. What I am trying to achieve is increase dmg of everything, spells, runes etc. I know exactly what you're talking about, but this applies if you want to have only 1 reborn.
 
Last edited:
Back
Top