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

arturhaddad

Member
Joined
Aug 14, 2010
Messages
217
Reaction score
8
I need help to add 2 features in my Reborn script:
1- When player look to other appear: You see Fulano (level 104). He is sorcerer. Resets: X
2- Premium account players must reborn earlier than facc players. For example, at level 250



Script:
Code:
function onSay(cid, words, param) 
        config = { 
                level = 300, -- level to reborn
                RemainingLvl = 8, -- level after reborn 
                exper = 4200, -- experience after reborn
                pid = getPlayerGUID(cid),  -- Não Mecha 
                skull = "no",  -- skulled players can reborn? yes/no
                redskull = "no",-- red skulled players can reborn? yes/no
                prot = "yes", -- need to be in protect zone to reborn? yes/no
                bat = "yes", -- players with battle can reborn? yes/no
                mana = 35, -- mana after reborn
                health = 185, -- health after reborn
                manaByReset = 200, -- mana bonus for each reborn
                healthByReset = 200 -- health bonus for each reborn
        } 

        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, 24, "Apenas players sem white skull podem resetar.") 
                return TRUE 
        end 
 
        if(config.redskull == "no") and (getCreatureSkullType(cid) == 4) then 
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Apenas player sem red skull podem resetar.") 
                return TRUE 
        end 
 
        if(config.prot == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then 
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"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, MESSAGE_EVENT_DEFAULT, "Você precisa estar sem battle pra poder resetar.") 
                return TRUE 
        end 
 
        if getPlayerLevel(cid) >= config.level then 
                setPlayerStorageValue(cid, 1020, getResets(cid)+1) 
                doPlayerPopupFYI(cid, "You now was reset, you have "..getResets(cid).." reset\'s.") 
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 



                config.mana = config.mana + config.manaByReset*getResets(cid) 
                config.health = config.health + config.healthByReset*getResets(cid)                  
                doRemoveCreature(cid) 
                db.query("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exper..",`manamax` = "..config.mana..",`healthmax` = "..config.health..",`health` = "..config.health..",`mana` = "..config.mana.." WHERE `id` = "..config.pid) 
		

        else 
                doPlayerSendCancel(cid, "Você precisa do level "..config.level.." ou mais para resetar.") 
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) 
        end 
        return TRUE 
end

Mini explanation for who doesn't know how does it works:
When player reachs lvl 300 it can reborn: get back to lvl 8 with 200 bonus mp/hp.
Second reborn bonus = 400 mp/hp.
Third reborn bonus = 600 mp/hp, and so on...
 
Last edited:
Back
Top