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

Solved how to put npc in tibia

File/Import/Npc
Then place the npc on your map in map editor same way you do Monsters but goto Npc's tab
after i import npc nothing happens

do i have the right scripts ?
Code:
<npc name="Rebirth" script="data/npc/scripts/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 {rebirth} system."/>
        <parameter key="message_farewell" value="Good bye my dear friend."/>
    </parameters>
</npc>
 
If you import the npc in Remere, go to Creature Palette, NPCs to add the npc in the map, add a spawn first and add the npc in the spawn.
TR6EuB2ma.png
 
Did you got an error when you imported the xml file of the NPC? Press f5 to reload or restart Remere if it still doesn't show the NPC.
 
Did you got an error when you imported the xml file of the NPC? Press f5 to reload or restart Remere if it still doesn't show the NPC.
data/creaturescripts/scripts/rebirthdescription.lua:25: in function <data/creaturescripts/scripts/rebirthdescription.lua:1>
thats the error
 
Can you add a picture how you did it? Look in Creature Palette, NPCs if the npc is in the list and make sure to import the xml file of the npc.
 
Rebirth is the npc you imported? I's added in the list.
RHKc7A2hR.png
hey when i do rebirth i am still lvl 717217 how can i make it lvl 8

anyone please help when i do rebrith at lvl 717217 i am still 717217 i need to be lvl 8 when i do rebirth
 
Last edited by a moderator:
Post the script.
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
    if(msgcontains(msg, 'rebirth')) then
        selfSay('Are you ready to rebirth and start a new life?', cid)
        talkState[cid] = 1
    elseif(msgcontains(msg, 'yes') and talkState[cid] == 1) then
        -------CONFIGS-------
        local nuggets = 2
        local level = 717217
        ------/CONFIGS-------
        -----LOCALS-----
       
        ----/LOCALS-----
        if(getPlayerLevel(cid) >= level) then
            local voc = getPlayerVocation(cid)
            if voc >= 5 and voc <= 10 then
                if doPlayerRemoveItem(cid, 2157, nuggets) then
                    local reb = getCreatureStorage(cid, 85989) + 1
                    doCreatureSetStorage(cid, 85989, reb)
                    doBroadcastMessage(getCreatureName(cid).." has rebirthed now he have "..reb.." rebirths", MESSAGE_STATUS_CONSOLE_RED)
                    if voc == 5 then -- MASTER SORCERER
                        setCreatureMaxHealth(cid, 1000000 * reb)
                        setCreatureMaxMana(cid, reb * 12000000)
                    elseif voc == 6 then -- ELDER DRUID
                        setCreatureMaxHealth(cid, 1600000 * reb)
                        setCreatureMaxMana(cid, reb * 14400000)
                    elseif voc == 10 then -- Wizard Of Thor
                        setCreatureMaxHealth(cid, 1 * reb)
                        setCreatureMaxMana(cid, reb * 8640000)
                    elseif voc == 7 then -- ROYAL PALADIN
                        setCreatureMaxHealth(cid, reb * 4000000)
                        setCreatureMaxMana(cid, 35)
                    elseif voc == 8 then -- ELITE KNIGHT
                        setCreatureMaxHealth(cid, reb * 8000000)
                        setCreatureMaxMana(cid, 35)
                    elseif voc == 9 then -- ROUGE KNIGHT
                        setCreatureMaxHealth(cid, reb * 6000000)
                        setCreatureMaxMana(cid, 35)
                    end
                    local id = getPlayerGUID(cid)
                    doRemoveCreature(cid)
                    db.executeQuery("UPDATE `players` SET `level` = 8,`experience` = 4200, `promotion` = 0, `blessings` = 0 WHERE `id` ='"..id.."';")
                else
                    selfSay("You don't have enough gold nuggets you need "..nuggets.." nuggets", cid)
                end
            else
                selfSay("Sorry you must buy promotion before you rebirth", cid)
            end
        else
            selfSay("You don't have enough level you need to be 8M to rebirth", cid)
        end
        talkState[cid] = nil
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top