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

An NPC with quest&teleport and player check area.

Laron25

New Member
Joined
Mar 28, 2010
Messages
127
Reaction score
2
Hello
Anyone can make for me an NPC, who normally teleports you to another location if you say "meteo" (X,Y,Z) and "maron" (X,Y,Z).
If you have premium you can do quest with this npc.
If you say "quest" to npc and you dont have premium:
"You need premium account to begin this quest."
If you have premium and say quest the npc teleport you to X,Y,Z.
If other person is in X,Y,Z (where Npc tp's you.. = quest zone) the npc will respond:
"Sorry another player is doing that quest. Come back later..."

Rep++
 
Something like this maybe?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Laron" script="data/npc/scripts/Laron.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
<look type="129" head="19" body="113" legs="95" feet="115" addons="0"/>
    <parameters>
        <parameter key="message_greet" value="Welcome, |PLAYERNAME|. Do you want to start ur mission? Type {Quest}?"/>
        <parameter key="message_farewell" value="Good Bye!"/>
 
		<parameter key="module_travel" value="1"/>
		<parameter key="travel_destinations" value="Quest,X,Y,Z,PRICE;"/>
        <parameter key="keywords" value="captain;travel;" />
        <parameter key="keyword_reply1" value="are you ready to go on a mission? EDIT THIS TO WATEVER U LIKE TO." />
        <parameter key="keyword_reply2" value="I can teleport you to the quest edit this to whatever u like to" />
    </parameters>
</npc>


Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
 
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
	elseif msgcontains(msg, 'quest') then
		selfSay('Do you want to be teleported to the quest?', cid)
		Topic[cid] = 1
	elseif Topic[cid] == 1 then
		if msgcontains(msg, 'yes') then
			if isPremium(cid) then
				if not isPlayerPzLocked(cid) then
					local pos = math.random(10) == 5 and {x=, y=, z=}
					selfSay('Alright Lets go!', cid)
					npcHandler:releaseFocus(cid)
					doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
					doTeleportThing(cid, pos)
					doSendMagicEffect(pos, CONST_ME_TELEPORT)
				else
					selfSay('First get rid of those blood stains! You are not going to ruin my vehicle!', cid)
				end
			else
				selfSay('I\'m sorry, but you need a premium account to do this quest.', cid)
			end
		else
			selfSay('We would like to serve you some time.', cid)
		end
		Topic[cid] = 0
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())



if ur lazy just dl here
View attachment Laron.rar
 
Yes but, if another player is in certain area npc say: "Another player is doing that quest now" and you cannot teleport (another player must quit the quest).
 
Back
Top Bottom