• 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 that leaves his place? Is it possible?

CuGaT92

New Member
Joined
Nov 10, 2013
Messages
18
Reaction score
1
Location
Barcelona
Hello! I think I'm a bit mad but... I want to do a NPC (let's call him Argor) that gives a quest "Rescue Argor". He's kidnaped on a prison and we need to give him a key that we will find first. Then we go to Argor and he say us thanks and give us some gold.
But... I want that NPC only can be seen by the players who doesn't finished the quest, because the other people gift him the key and he could scape.

Is it possible? Thanks! xD
 
networkmessage and creating illusions or teleporting players to different versions of area depending on quest state
 
There's a NPC who teleport players to the island where Argor gives us the quest. Maybe that way...?

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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 storage = 5001          -- ( ARGOR QUEST STORAGE NUMBER )
local pos1 = {x=974, y=912, z=7}
local pos2 = {x=674, y=612, z=7}
function creatureSayCallback(cid, type, msg)
     if not npcHandler:isFocused(cid) then
         return false
     end
     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

     if msgcontains(msg, "teleport") then
          if getPlayerStorageValue(cid, storage) == 5 then          -- ( ARGOR QUEST STORAGEVALUE_5 = FINISHED QUEST )
               doTeleportThing(cid, pos1)
          else
               doTeleportThing(cid, pos2)
          end
     return true
     end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Ummx,... I see a problem. If someone wants to help his friend on that quest and they try to go together... the first one (who did the quest) will go to different location as the other player (who did not the quest yet). :(
 
Back
Top