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

Rebirth Npc TFS 1.2

God Mythera

Veteran OT User
Joined
Aug 11, 2012
Messages
2,048
Solutions
2
Reaction score
256
Location
United States
So when i try to rebirth on a character with the level (150) it doesnt do anything and gives this error:

8nVOXAi.png


This is also the npc & script:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Prestige Npc" script="rebirth.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
<look type="73" head="78" body="88" legs="0" feet="88" addons="3"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Im in charge of the 'Prestige' system."/>
        <parameter key="message_farewell" value="Good bye my dear friend."/>
    </parameters>
</npc>
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end

    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

    if(msgcontains(msg, 'prestige')) then
        selfSay('Are you ready to prestige and start a new life?', cid)
        talkState[talkUser] = 1
    elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
        -------CONFIGS-------
        local level = 150
        local cost = 100000
        ------/CONFIGS-------
        -----LOCALS-----
        local id = getPlayerGUID(cid)
        local name = getCreatureName(cid)
        local vocation = getPlayerVocation(cid)
        local storage = getCreatureStorage(cid, 85987)
        ----/LOCALS-----
        if(getPlayerLevel(cid) >= level) then
            if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                if(isInArray({1, 2, 3, 4, 5, 6, 7, 8}, vocation)) then
                    doCreatureSetStorage(cid, 85987, storage == -1 and 1 or storage + 1)
                    doRemoveCreature(cid)
                    db.query("UPDATE `players` SET `level` = 8, `experience` = 4200, `promotion` = 0 WHERE `id` ='"..id.."';")
                    db.query("UPDATE `players` SET `name` = '"..name.."' WHERE `id` ='"..id.."';")
                else
                    selfSay('Please talk with Forgotten King and promote first.', cid)
                    talkState[talkUser] = 0
                end
            else
                selfSay('You don\'t have enough money. You need to pay 1 gold coin to be rebirthed.', cid)
                talkState[talkUser] = 0
            end
        else
            selfSay('Only characters of level 150 or higher can be rebirthed.', cid)
            talkState[talkUser] = 0
        end
    elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
        selfSay('Okey. Come back when you feel ready.', cid)
        talkState[talkUser] = 0
    end

    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

If anyone can help id really appreciate it :d
 
Using NPC&SCRIPT get this error.

Is it possible to fix&repair?

consolewindow.png

_
__
db.executeQuery("UPDATE players SET level = 8, experience = 4200 WHERE id = "..getPlayerGUID(cid))
db.executeQuery('UPDATE players SET rebirths=rebirths+'.. 1 ..' WHERE id='..getPlayerGUID(cid))



?how to implement above Query
 
@Shadow
[1-/ 10.77

rebirth.zip requires set manually Rebirth in phpadmin
Nope, you can write a code to do a rebirth and it will be simple as a talkaction or npc as you like
Code:
    registerMethod("Player", "getRebirth", LuaScriptInterface::luaPlayerGetRebirth); // rebirth
    registerMethod("Player", "doRebirth", LuaScriptInterface::luaPlayerDoRebirth); // rebirth
note : this part is already implemented in luascripts.cpp
 
Back
Top