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

TalkAction Reborn System - w/ stages and look

be added to this script every time you reset, you will add hp and mana?
example:
190 hp + 1 reset = 205 hp
35 mana + 1 reset = 95 mana

try this

Code:
    for _, k in ipairs(stage) do
        if getReborns(cid) <= k.reborn then
            if getPlayerLevel(cid) >= k.level then
               setPlayerStorageValue(cid, 1020, getReborns(cid)+1)
               doPlayerPopupFYI(cid, "You now was reborn, you have "..getReborns(cid)+(1).." reborn\'s.")
               doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
               local hp,mana = (getCreatureMaxHealth(cid)+10),(getCreatureMaxMana(cid)+15)
               doRemoveCreature(cid)
               db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exp..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.pid)
            else
               doPlayerSendCancel(cid, "You need to have level "..k.level.." or more you may be reborn.")
               doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            end
        end
    end

local hp,mana = (getCreatureMaxHealth(cid)+10),(getCreatureMaxMana(cid)+15)

+10 hp points
+15 mana points
 
if i using comand !reborn, the character is not reset in mana and hp, and also keeps added bonus.
 
no errors on the console, just not reset the hp and mana, but if you add the bonus reborn.
 
But not reset hp and mana,it only adds hp and mana points

to reset try
Code:
    for _, k in ipairs(stage) do
        if getReborns(cid) <= k.reborn then
            if getPlayerLevel(cid) >= k.level then
               setPlayerStorageValue(cid, 1020, getReborns(cid)+1)
               doPlayerPopupFYI(cid, "You now was reborn, you have "..getReborns(cid)+(1).." reborn\'s.")
               doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
               local hp,mana = 245,45
               doRemoveCreature(cid)
               db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exp..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.pid)
            else
               doPlayerSendCancel(cid, "You need to have level "..k.level.." or more you may be reborn.")
               doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            end
        end
    end
 
work, but may be added for each reborn more health points and more mana points.
example:
first reborn: 200 health and 45 mana potions.
second reborn: 250 health and 90 mana potions.
third reborn: 350 health and 120 mana potions.
fourth reborn: 400 health and 180 mana potions.

is it possible?

I think this will work, but how could add me to the script?
PHP:
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
 
work, but may be added for each reborn more health points and more mana points.
example:
first reborn: 200 health and 45 mana potions.
second reborn: 250 health and 90 mana potions.
third reborn: 350 health and 120 mana potions.
fourth reborn: 400 health and 180 mana potions.

is it possible?

I think this will work, but how could add me to the script?
PHP:
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

is it possible?

Yes.

bonus with stages?
 
hmmmm good function

use with function:

Code:
    for _, k in ipairs(stage) do
        if getReborns(cid) <= k.reborn then
            if getPlayerLevel(cid) >= k.level then
               setPlayerStorageValue(cid, 1020, getReborns(cid)+1)
               doPlayerPopupFYI(cid, "You now was reborn, you have "..getReborns(cid)+(1).." reborn\'s.")
               doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
               local hp,mana = getStats(cid, "health"),getStats(cid, "mana")
               doRemoveCreature(cid)
               db.executeQuery("UPDATE `players` SET `level` = "..config.RemainingLvl..", `experience` = "..config.exp..",`manamax` = "..mana..",`healthmax` = "..hp..",`health` = "..hp..",`mana` = "..mana.." WHERE `id` = "..config.pid)
            else
               doPlayerSendCancel(cid, "You need to have level "..k.level.." or more you may be reborn.")
               doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
            end
        end
    end
 
Back
Top