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

CreatureEvent Best Rebirth System Mysql By mlody.1039 With Gesior Script

Im not shure but try:
Code:
INSERT INTO "accounts" ("rebirths");
Of course we help each others but it takes a while sometimes
 
ok now i use phpmyadmin buti get an error its say

[Error - Npc interface]
[05/11/2013 16:55:48] data/npc/scripts/rebirth.lua:eek:nCreatureSay
[05/11/2013 16:55:48] Description:
[05/11/2013 16:55:48] data/npc/scripts/rebirth.lua:69: attempt to call global 'getPlayerRebirth' (a nil value)
[05/11/2013 16:55:48] stack traceback:
[05/11/2013 16:55:49] data/npc/scripts/rebirth.lua:69: in function <data/npc/scripts/rebirth.lua:61>

are you sure you have this function in lib/function.lua ?
getPlayerRebirth :)
not registered as a function
 
!rebirth Talkactions

Code:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
    if getPlayerLevel(cid) >= level then
        local guid = getPlayerGUID(cid)
        doRemoveCreature(cid)
        db.executeQuery("UPDATE `players` SET `Rebirths` = `Rebirths` + 1, `level` = 8, `experience` = 4200, `health` = 2000, `healthmax` = 2000, `mana` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` = " .. guid)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
    end
    return true
end


This Script is fixed by
Ninja and Himii

Hope when I will make my server we will get some tibia community back )

Thank You Again for great support :)

Best Regards
mlody.1039
 
Last edited:
Code:
`health` = 2000, `healthmax` = 2000, `mana` = 2000, `manamax` = 2000, `promotion` = 0

:) I think most of players will hate rest health and mana :p also I prefer to delete promotion field to keep promotion :p

also this script need a little edit :D
to check max rebirth :)
 
Hello.

so I remove health and mana and promotion :)

Code:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
    if getPlayerLevel(cid) >= level then
        local guid = getPlayerGUID(cid)
        doRemoveCreature(cid)
        db.executeQuery("UPDATE `players` SET `Rebirths` = `Rebirths` + 1, `level` = 8, `experience` = 4200 WHERE `id` = " .. guid)
    else
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
    end
    return true
end

Best Regards
mlody.1039
 
Could you add another line to this script i cant get it to work..
I want it to show Prestiges and Legend Prestiges.
This is my legend prestige function. Thanks
Code:
function getPlayerLPrestiges(cid)
    local Info = db.getResult("SELECT `LPrestiges` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1")
        if Info:getID() ~= LUA_ERROR then
        local Lpres= Info:getDataInt("LPrestiges")
        Info:free()
        return Lpres
    end
    return LUA_ERROR
end

Code:
function onLook(cid, thing, position, lookDistance)
    if(isPlayer(thing.uid) and thing.uid ~= cid and getPlayerRebirth(thing.uid) ~= -1) then
        doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and ".\nShe" or ".\nHe") .. " has " .. getPlayerRebirth(thing.uid) .. " " .. (getPlayerRebirth(thing.uid) == 1 and "rebirths" or "rebirth"))
    elseif(thing.uid == cid and getPlayerRebirth(cid) ~= -1) then
        local message = "You see yourself."
        if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then
            message = message .. " You are " .. getPlayerGroupName(cid) .. "."
        elseif(getPlayerVocation(cid) ~= 0) then
            message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. "."
        else
            message = message .. " You have no vocation."
        end
        if(getPlayerByName(getPlayerPartner(cid), false, false) ~= nil) then
            message = message .. " You are " .. (getPlayerSex(cid) == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerByName(getPlayerPartner(cid)) .. "."
        end
        if(getPlayerGuildId(cid) > 0) then
            message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid)
            message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "."
        end
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then
            message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]."
            message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "."
        end
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]."
        end
        return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \nYou have " .. getPlayerRebirth(cid) .. " " .. (getPlayerRebirth(cid) == 1 and "rebirths." or "rebirth."))
    end
    return true
end
 
Code:
function onLook(cid, thing, position, lookDistance)
    if(isPlayer(thing.uid) and thing.uid ~= cid and getPlayerRebirth(thing.uid) ~= -1) then
        doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and ".\nShe" or ".\nHe") .. " has " .. getPlayerRebirth(thing.uid) .. " " .. (getPlayerRebirth(thing.uid) == 1 and "rebirths" or "rebirth"))
    elseif(thing.uid == cid and getPlayerRebirth(cid) ~= -1) then
        local message = "You see yourself."
        if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then
            message = message .. " You are " .. getPlayerGroupName(cid) .. "."
        elseif(getPlayerVocation(cid) ~= 0) then
            message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. "."
        else
            message = message .. " You have no vocation."
        end
        if(getPlayerByName(getPlayerPartner(cid), false, false) ~= nil) then
            message = message .. " You are " .. (getPlayerSex(cid) == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerByName(getPlayerPartner(cid)) .. "."
        end
        if(getPlayerGuildId(cid) > 0) then
            message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid)
            message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "."
        end
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then
            message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]."
            message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. "."
        end
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]."
        end
        return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \nYou have " .. getPlayerRebirth(cid) .. " " .. (getPlayerRebirth(cid) == 1 and "rebirths." or "rebirth."))
        end
        return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \and " .. getPlayerLPrestiges(cid) .. " " .. (getPlayerLPrestiges(cid) == 1 and "legend rebirths." or "legend rebirth."))
    end
    return true
end

Shuld work
 
get this error :

[20:21:31.978] [Error - NpcScript Interface]
[20:21:31.978] data/npc/scripts/rebirth.lua:eek:nThink
[20:21:31.978] Description:
[20:21:31.978] data/npc/scripts/rebirth.lua:120: attempt to call global 'getDistanceTo' (a nil value)

[20:21:31.978] stack traceback:
[20:21:31.978] data/npc/scripts/rebirth.lua:120: in function <data/npc/scripts/rebirth.lua:115>
 
get this error :

[20:21:31.978] [Error - NpcScript Interface]
[20:21:31.978] data/npc/scripts/rebirth.lua:eek:nThink
[20:21:31.978] Description:
[20:21:31.978] data/npc/scripts/rebirth.lua:120: attempt to call global 'getDistanceTo' (a nil value)

[20:21:31.978] stack traceback:
[20:21:31.978] data/npc/scripts/rebirth.lua:120: in function <data/npc/scripts/rebirth.lua:115>
Can you tell me wich server version you are using, and try to change your npc libs otherwise
 
Back
Top