• 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 The Mermaid Marina

Liche

New Member
Joined
Oct 19, 2008
Messages
14
Reaction score
0
Location
The Netherlands
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.)

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:
can you tell us how to do?

<?xml version="1.0"?>

<npc name="Marina" script="data/npc/scripts/marina.lua" speed="0" access="3" floorchange="0" walkinterval="0">
<health now="1000" max="1000"/>
<look typeex="5811" corpse="3128"/>
<parameters>
<parameter key="message_greet" value="Greetings!" />
</parameters>
</npc>



100% work ^^
 
Back
Top