Liche
New Member
Hello,
I have a little problem, I am using the latest TFS. I wanted to use the NPC: The Mermaid Marina. It has the looktype of an item, so I searched the forum and found out that you have to do it like this:
(ID:5811 is the mermaid rock.)
I Did that and now my NPC looks like this:
NPC:
NPC/Script:
The problem is that it won't work as an NPC, I can't talk to it or even see it in my battlewindow, it just looks like an item.
Have I forgotten something? Do I need to add an UID in the mapeditor?
Thanks to everyone trying to help me,
Liche
If your answer helped me, I'll rep you :thumbup:
P.S. Sorry for not tabbing it, don't know how to do it
I have a little problem, I am using the latest TFS. I wanted to use the NPC: The Mermaid Marina. It has the looktype of an item, so I searched the forum and found out that you have to do it like this:
(ID:5811 is the mermaid rock.)
Code:
<look typeex="5811" corpse="0"/>
I Did that and now my NPC looks like this:
NPC:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Mermaid Marina" script="data/npc/scripts/mermaid.lua" walkinterval="0" floorchange="0">
<health now="100" max="100"/>
<look typeex="5811" corpse="0"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Welcome!"/>
</parameters>
</npc>
NPC/Script:
Code:
local talk_state = 0
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
function creatureSayCallback(cid, type, msg)
if msgcontains(msg, 'silk yarn') then
if getPlayerItemCount(cid,5879) >= 10 then
if doPlayerRemoveItem(cid,5879,10) == 1 then
selfSay('Ew... gooey... there you go. .')
doPlayerAddItem(cid,5886,1)
end
else
selfSay('Ew... gooey... you dont have required items. ')
talk_state = 0
end
elseif msgcontains(msg, 'no') then
selfSay('Ok.. Good bye then!!')
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
The problem is that it won't work as an NPC, I can't talk to it or even see it in my battlewindow, it just looks like an item.
Have I forgotten something? Do I need to add an UID in the mapeditor?
Thanks to everyone trying to help me,
Liche
If your answer helped me, I'll rep you :thumbup:
P.S. Sorry for not tabbing it, don't know how to do it
Last edited: