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

NPC not talking

LeOnArd0

Member
Joined
Jan 24, 2010
Messages
76
Reaction score
14
Hello, good evening!

I've got this issue that's been bugging me, and I still can't figure out why. I created an NPC that teleports the player if they meet a certain condition, and everything seems to be working fine. The major problem is that when I add the NPC in the RME, it shows up in the game but doesn't respond to anything.

If I use /reload npcs, it still doesn't respond. However, if I summon a new one using /s, it responds and works just fine (???). I can't wrap my head around it. Can anyone shed some light on this?

TFS 1.5

Codes:

Lua:
<?xml version="1.0"?>
<npc name="NAME" script="NAME.lua" access="3" floorchange="0" walkinterval="0">
<health now="1000" max="1000"/>  
<look type="390" head="0" body="0" legs="0" feet="1" addons="0"/>
<parameters>
</parameters>                        
</npc>

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function greetCallback(cid)
    local player = Player(cid)
    if player:getCondition(CONDITION_ENERGY) then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Venture the path of decay!")
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:teleportTo(Position(32826, 32393, 8))
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return false
    else
        npcHandler:say("Begone! Your body doesn't have enough energy.", cid)
        return false
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())

Also, keep in mind that this doesn't happen with all NPCs, only a few exceptions.

Thanks!!
 
Last edited:
Hello, good evening!

I've got this issue that's been bugging me, and I still can't figure out why. I created an NPC that teleports the player if they meet a certain condition, and everything seems to be working fine. The major problem is that when I add the NPC in the RME, it shows up in the game but doesn't respond to anything.

If I use /reload npcs, it still doesn't respond. However, if I summon a new one using /s, it responds and works just fine (???). I can't wrap my head around it. Can anyone shed some light on this?

TFS 1.5

Codes:

Lua:
<?xml version="1.0"?>
<npc name="NAME" script="NAME.lua" access="3" floorchange="0" walkinterval="0">
<health now="1000" max="1000"/> 
<look type="390" head="0" body="0" legs="0" feet="1" addons="0"/>
<parameters>
</parameters>                       
</npc>

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function greetCallback(cid)
    local player = Player(cid)
    if player:getCondition(CONDITION_ENERGY) then
        player:sendTextMessage(MESSAGE_STATUS_WARNING, "Venture the path of decay!")
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:teleportTo(Position(32826, 32393, 8))
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return false
    else
        npcHandler:say("Begone! Your body doesn't have enough energy.", cid)
        return false
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())

Also, keep in mind that this doesn't happen with all NPCs, only a few exceptions.

Thanks!!
In rme, you might have some 'old version' of the npc that is being spawned.

Try re-importing the npc's and replacing them on the map.
 
In rme, you might have some 'old version' of the npc that is being spawned.

Try re-importing the npc's and replacing them on the map.

I took the test, created a new NPC from scratch, imported it into RME, and it didn't work. I changed the RME version, went through the same process, and still no success. It follows the same pattern; when I open the server, it doesn't work. However, if I summon a new one with /s, it works normally. :(

@Xikini Idk what's happening.
 
search for your NPC in the _spawns.xml file in the world folder. Paste here the spawn xml node for the NPC

Here are two examples:

Lua:
    <spawn centerx="32832" centery="32389" centerz="8" radius="2">
        <npc name="The Reaper" x="0" y="-1" z="8" spawntime="150" direction="2" />
    </spawn>

Lua:
    <spawn centerx="33290" centery="32479" centerz="7" radius="1">
        <npc name="Petros" x="-1" y="0" z="7" spawntime="150" direction="2" />
    </spawn>
 
Yes, see:

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Petros" script="barco_darashia.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="79" body="10" legs="127" feet="127" addons="0"/>
<voices>
<voice text="Passages to Venore, Port Hope and Ankrahmun." interval2="100" margin="1" yell="no"/>
</voices>
<parameters>
<parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service." />
<parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service." />
 <parameter key="module_keywords" value="1" />
 <parameter key="keywords" value="name;darashia;" />
 <parameter key="keyword_reply1" value="My name is Petros from the Royal Tibia Line." />
 <parameter key="keyword_reply2" value="This is Darashia. Where do you want to go?" />
 <parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I sail you today?"/>
</parameters>
</npc>

Lua:
--------------------By Jpkulik!---------------------------- 
local keywordHandler = KeywordHandler:new() 
local npcHandler = NpcHandler:new(keywordHandler) 
NpcSystem.parseParameters(npcHandler) 



-- OTServ event handling functions start 
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 
-- Set the greeting message. 
npcHandler:setMessage(MESSAGE_GREET, HelloText) 
function onThink()                         npcHandler:onThink() end 
-- OTServ event handling functions end 
local function creatureSayCallback(cid, type, msg)
    
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    
    if (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'venore') and (not npcHandler:isFocused(cid))) then
        if doPlayerRemoveMoney(cid, 60) == TRUE then
        doTeleportThing(cid,{x=32954, y=32022, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end
    elseif (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'ankrahmun') and (not npcHandler:isFocused(cid))) then
        if doPlayerRemoveMoney(cid, 150) == TRUE then
        doTeleportThing(cid,{x=33092, y=32884, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end
    elseif (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'ab\'dendriel') and (not npcHandler:isFocused(cid))) then
        if doPlayerRemoveMoney(cid, 90) == TRUE then
        doTeleportThing(cid,{x=32734, y=31669, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end        
    elseif (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'thais') and (not npcHandler:isFocused(cid))) then
        if doPlayerRemoveMoney(cid, 170) == TRUE then
        doTeleportThing(cid,{x=32313, y=32212, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end
    elseif (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'carlin') and (not npcHandler:isFocused(cid))) then
        if doPlayerRemoveMoney(cid, 130) == TRUE then
        doTeleportThing(cid,{x=32388, y=31821, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end
    elseif (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'port') and msgcontains(msg, 'hope') and (not npcHandler:isFocused(cid))) then
    if isPremium(cid) == TRUE then
        if doPlayerRemoveMoney(cid, 180) == TRUE then
        doTeleportThing(cid,{x=32532, y=32784, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end
       end        
    elseif (msgcontains(msg, 'bring') and msgcontains(msg, 'me') and msgcontains(msg, 'to') and msgcontains(msg, 'edron') and (not npcHandler:isFocused(cid))) then
        if doPlayerRemoveMoney(cid, 40) == TRUE then
        doTeleportThing(cid,{x=33176, y=31764, z=7})
        npcHandler:addFocus(cid)
        else 
         selfSay('Sorry, you don\'t have enough money.') 
        end
    end
    return true
end    
---------------------------------------MENSAGES CONFIG-------------------------------------------- 
local HelloText = 'Hello |PLAYERNAME|. Welcome to my Boat!' 
local HelpText = 'Do you need help?I can tell you some {destinations}.' 
local DestinationText = 'I can take you to {Carlin}, {Ab\'Dendriel}, {Thais}, {Venore}, {Edron} and {Ankrahmun}.'            
local CitysText = 'I can take you to {Carlin}, {Ab\'Dendriel}, {Kazordoon}, {Thais}, {Venore}, {Edron} and {Ankrahmun}.'  
local JobText = 'Im an Captain, and this is my Boat.'                                                                  
---------------------------------------END MENSAGES CONFIG---------------------------------------- 



---------------------------------------CARLIN CONFIG---------------------------------------------- 
local CarlinPosition = {x=32388, y=31821, z=7}              ----> Destination from Carlin Boat <---- 
local CarlinCost = 130                          ----> Cost to Travel for Carlin    <---- 
carlin = true                                            ---->TRUE:Working/FALSE:Not Working<---- 
---------------------------------------END CARLIN CONFIG------------------------------------------ 



---------------------------------------AB'DENDRIEL CONFIG----------------------------------------- 
local AbDendrielPosition = {x=32734, y=31669, z=7}     ----> Destination from Ab\'Dendriel Boat <---- 
local AbDendrielCost = 90                     ----> Cost to Travel for Ab\'Dendriel    <---- 
AbDendriel = true                                 ----> TRUE:Working/FALSE:Not Working    <---- 
---------------------------------------END AB'DENDRIEL CONFIG------------------------------------- 



---------------------------------------VENORE CONFIG---------------------------------------------- 
local VenorePosition = {x=32954, y=32022, z=7}              ----> Destination from Venore Boat <---- 
local VenoreCost = 10                          ----> Cost to Travel for Venore    <---- 
Venore = true                                          ----> TRUE:Working/FALSE:Not Working<--- 
---------------------------------------END VENORE CONFIG------------------------------------------ 



---------------------------------------THAIS CONFIG----------------------------------------------- 
local ThaisPosition = {x=32313, y=32212, z=7}                ----> Destination from Thais Boat <---- 
local ThaisCost = 170                           ----> Cost to Travel for Thais    <---- 
Thais = true                                           ---->TRUE:Working/FALSE:Not Working<--- 
---------------------------------------END THAIS CONFIG------------------------------------------- 


---------------------------------------EDRON CONFIG----------------------------------------------- 
local EdronPosition = {x=33176, y=31764, z=7}                ----> Destination from Edron Boat <---- 
local EdronCost = 40                                          ----> Cost to Travel for Edron    <---- 
Edron = true                                           ----> TRUE:Working/FALSE:Not Working<-- 
---------------------------------------END EDRON CONFIG------------------------------------------- 


---------------------------------------DARASHIA CONFIG-------------------------------------------- 
local DarashiaPosition = {x=33290, y=32481, z=7}          ----> Destination from Darashia Boat <---- 
local DarashiaCost = 60

                    ----> Cost to Travel for Darashia    <---- 
Darashia = true                                        ----> TRUE:Working/FALSE:Not Working <---- 
---------------------------------------END DARASHIA CONFIG---------------------------------------- 


---------------------------------------PORT HOPE CONFIG------------------------------------------- 
local PortHopePosition = {x=32532, y=32784, z=7}         ----> Destination from Port Hope Boat <---- 
local PortHopeCost = 160                                      ----> Cost to Travel for Port Hope    <---- 
PortHope = false                                      ----> TRUE:Working/FALSE:Not Working  <---- 
---------------------------------------END PORT HOPE CONFIG--------------------------------------- 


---------------------------------------ANKRAHMUN CONFIG------------------------------------------- 
local AnkPosition = {x=33092, y=32884, z=7}              ----> Destination from Ankrahmun Boat <---- 
local AnkCost = 150                                  ----> Cost to Travel for Ankrahmun    <---- 
Ank = true                                       ----> TRUE:Working/FALSE:Not Working  <---- 
---------------------------------------END ANKRAHMUN CONFIG--------------------------------------- 


---CARLIN----------------------------------------------------------------------------------------------------------------------------------------- 
local CarlinText = 'Do you want to Travel to Carlin for 130 gold coins?' 
local CarlinTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local CarlinLvl = 8 
local CarlinPremium = false --True/false 

--Carlin-- 
if carlin == true then 
local travelNode = keywordHandler:addKeyword({'carlin'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = CarlinText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = CarlinPremium, level = CarlinLvl, cost = CarlinCost, destination = CarlinPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = CarlinTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'carlin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Carlin-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 



---Venore----------------------------------------------------------------------------------------------------------------------------------------- 
local VenoreText = 'Do you want to Travel to Venore for 10 gold coins?' 
local VenoreTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local VenoreLvl = 8 
local VenorePremium = false --True/false 

--Venore-- 
if Venore == true then 
local travelNode = keywordHandler:addKeyword({'venore'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = VenoreText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = VenorePremium, level = VenoreLvl, cost = VenoreCost, destination = VenorePosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = VenoreTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Venore-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Kazordoon----------------------------------------------------------------------------------------------------------------------------------------- 
local KazordoonText = 'Do you want to Travel to Kazordoon for 10 gold coins?' 
local KazordoonTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local KazordoonLvl = 8 
local KazordoonPremium = false --True/false 

--Kazordoon-- 
if Kazordoon == true then 
local travelNode = keywordHandler:addKeyword({'kazordoon'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = KazordoonText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = KazordoonPremium, level = KazordoonLvl, cost = KazordoonCost, destination = KazordoonPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = KazordoonTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Venore-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Thais----------------------------------------------------------------------------------------------------------------------------------------- 
local ThaisText = 'Do you want to Travel to Thais for 170 gold coins?' 
local ThaisTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local ThaisLvl = 8 
local ThaisPremium = false --True/false 

--Thais-- 
if Thais == true then 
local travelNode = keywordHandler:addKeyword({'thais'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = ThaisText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = ThaisPremium, level = ThaisLvl, cost = ThaisCost, destination = ThaisPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = ThaisTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Thais-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---AbDendriel----------------------------------------------------------------------------------------------------------------------------------------- 
local AbDendrielText = 'Do you want to Travel to Ab\'Dendriel for 90 gold coins?' 
local AbDendrielTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local AbDendrielLvl = 8 
local AbDendrielPremium = false --True/false 

--AbDendriel-- 
if AbDendriel == true then 
local travelNode = keywordHandler:addKeyword({'ab\'dendriel'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = AbDendrielText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = AbDendrielPremium, level = AbDendrielLvl, cost = AbDendrielCost, destination = AbDendrielPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = AbDendrielTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'ab\'dendriel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End AbDendriel-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Edron----------------------------------------------------------------------------------------------------------------------------------------- 
local EdronText = 'Do you want to Travel to Edron for 40 gold coins?' 
local EdronTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local EdronLvl = 8 
local EdronPremium = false --True/false 

--Edron-- 
if Edron == true then 
local travelNode = keywordHandler:addKeyword({'edron'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = EdronText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = EdronPremium, level = EdronLvl, cost = EdronCost, destination = EdronPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = EdronTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'edron'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End AbDendriel-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Darashia----------------------------------------------------------------------------------------------------------------------------------------- 
local DarashiaText = 'Do you want to Travel to Darashia for 60 gold coins?' 
local DarashiaTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local DarashiaLvl = 8 
local DarashiaPremium = false --True/false 

--Darashia-- 
if Darashia == true then 
local travelNode = keywordHandler:addKeyword({'darashia'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = DarashiaText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = DarashiaPremium, level = DarashiaLvl, cost = DarashiaCost, destination = DarashiaPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = DarashiaTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'darashia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Darashia-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Port Hope----------------------------------------------------------------------------------------------------------------------------------------- 
local PortHopeText = 'Do you want to Travel to Port Hope for 160 gold coins?' 
local PortHopeTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local PortHopeLvl = 8 
local PortHopePremium = false --True/false 

--Port Hope-- 
if PortHope == true then 
local travelNode = keywordHandler:addKeyword({'port hope'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = PortHopeText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = PortHopePremium, level = PortHopeLvl, cost = PortHopeCost, destination = PortHopePosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = PortHopeTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'port hope'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Port Hope-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Liberty Bay----------------------------------------------------------------------------------------------------------------------------------------- 
local LibertyBayText = 'Do you want to Travel to Liberty Bay for 10 gold coins?' 
local LibertyBayTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local LibertyBayLvl = 8 
local LibertyBayPremium = false --True/false 

--Liberty Bay-- 
if LibertyBay == true then 
local travelNode = keywordHandler:addKeyword({'liberty bay'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = LibertyBayText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = LibertyBayPremium, level = LibertyBayLvl, cost = LibertyBayCost, destination = LibertyBayPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = LibertyBayTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'liberty bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Liberty Bay-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Ankrahmun----------------------------------------------------------------------------------------------------------------------------------------- 
local AnkText = 'Do you want to Travel to Ankrahmun for 150 gold coins?' 
local AnkTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local AnkLvl = 8 
local AnkPremium = false --True/false 

--Ankrahmun-- 
if Ank == true then 
local travelNode = keywordHandler:addKeyword({'ankrahmun'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = AnkText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = AnkPremium, level = AnkLvl, cost = AnkCost, destination = AnkPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = AnkTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'ankrahmun'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End Ankrahmun-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 


---Svargrond----------------------------------------------------------------------------------------------------------------------------------------- 
local SvargrondText = 'Do you want to Travel to Svargrond for 10 gold coins?' 
local SvargrondTextNo = 'Ok, come back when you want then!' 
local NoTravel = 'Sorry, i do not travel to this city..' 
local SvargrondCost = 10 
local SvargrondPremium = false --True/false 

--Svargrond-- 
if Svargrond == true then 
local travelNode = keywordHandler:addKeyword({'svargrond'},  
StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = SvargrondText }) 
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = SvargrondPremium, level = SvargrondLvl, cost = SvargrondCost, destination = SvargrondPosition }) 
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = SvargrondTextNo }) 
else 
local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = NoTravel }) 
end 
--End AbDendriel-- 


--------------------------------------------------------------------------------------------------------------------------------------------------- 



keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = DestinationText }) 
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = JobText }) 
keywordHandler:addKeyword({'citys'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = CityText }) 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = HelpText }) 

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)  
npcHandler:addModule(FocusModule:new())
 
I tested with your NPC, everything is working fine. I summoned the NPC and placed it on the map, started the server, and interacted with the NPC. It's working perfectly. There might be some confusion... for instance, in the NPC's XML file, you see the name as Rafael, but when you open the XML, the name is different. You need to check into that. Finding where this issue originates in the NPC and correcting it could be the solution.
 
Go to windows explorer and enter:
%appdata%/Remere's Map Editor/data/

choose your client version, i.e 7.6 is 760 folder

in there, open up creatures.xml, and check for Petros. Paste here the code for the line
 
Go to windows explorer and enter:
%appdata%/Remere's Map Editor/data/

choose your client version, i.e 7.6 is 760 folder

in there, open up creatures.xml, and check for Petros. Paste here the code for the line

This is Petros line on the path he indicated.

Lua:
<creature name="Petros" type="npc" looktype="128" lookitem="0" lookaddon="0" lookhead="79" lookbody="10" looklegs="127" lookfeet="127" />

One thing I noticed is that the Npcs.xml in that folder is empty.

Lua:
<?xml version="1.0"?>
<npcs />
 
This is Petros line on the path he indicated.

Lua:
<creature name="Petros" type="npc" looktype="128" lookitem="0" lookaddon="0" lookhead="79" lookbody="10" looklegs="127" lookfeet="127" />

One thing I noticed is that the Npcs.xml in that folder is empty.

Lua:
<?xml version="1.0"?>
<npcs />
Yeah, not sure why it's like that to be honest, but its fine if NPC's are in creatures.xml, as you can see they have a "type" attribute to distinguish between monster and npc.

Not sure if there is anything else in appdata to check, but everything looks fine to me. Not sure how else I can help unless you want me to take a look via teamviewer/anydesk.
 
Back
Top