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

3 locations NPC (2 normal, 1 quest) + check if isPlayer in frompos topos

breadmaker

New Member
Joined
Jul 16, 2010
Messages
160
Reaction score
3
Hello,
i need one NPC (TFS 0.36.pl1)

The NPC will teleport player to 2 locations:
- earth - X,Y,Z
- thais - X,Y,Z

And one special Quest Location (if the player dont have required storage he CAN enter if he got storage, he cannot enter):
- quest - X,Y,Z
+ check if is player in X,Y,Z (frompos, topos) if here an player in the area the player who talking to NPC cannot enter until the player in area dissapear.

- quest
- Do you really want go to quest place ?
- yes (if he NOT have storage), npc teleports to X,Y,Z (if in X,Y,Z area is clean [if not players are in X,Y,Z])

Anyone can write it for me ?
Please, reppp
 
Last edited:
data/npc
create file .xml and pase this
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="NPC NAME" script="data/npc/scripts/TP/name.lua" walkinterval="0" floorchange="0">
    <health now="100" max="100"/>
    <look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>   --- you are free edit look type
    <parameters>
        <parameter key="message_greet" value="Welcome on board, Sir |PLAYERNAME|. If you want to know where you can go please say {destination}. Where can I sail you today?"/>
        <parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service."/>
    </parameters>
</npc>

now goto data/npc/scripts
create file.lua and paste this
LUA:
--[[
   Script by Cronox
]]--
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

keywordHandler:addKeyword({'name city'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=posx, y=posy, z=posz} })

keywordHandler:addKeyword({'name city'}, StdModule.travel, {npcHandler = npcHandler, level = 1, cost = 0, destination = {x=posx, y=posy, z=posz} })

keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'name city\', \'name city\'  just a small fee.'})

npcHandler:addModule(FocusModule:new())

Only edit.. Position X Y Z in script
 
And one special Quest Location (if the player dont have required storage he CAN enter if he got storage, he cannot enter):
- quest - X,Y,Z
+ check if is player in X,Y,Z (frompos, topos) if here an player in the area the player who talking to NPC cannot enter until the player in area dissapear.
- quest
- Do you really want go to quest place ?
- yes (if he NOT have storage), npc teleports to X,Y,Z (if in X,Y,Z area is clean [if not players are in X,Y,Z])

~bump.
 
Back
Top