Hbraveq
Active Member
- Joined
- Nov 11, 2012
- Messages
- 167
- Reaction score
- 40
Hello everyone! I'm using othire 0.0.3 and I want to remake npc to travel to "x y z, not to "BOATPOS_TIBIA~~"
Here is script on my npc, I tried a lot, rly![Stick Out Tongue :p :p](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Here is script on my npc, I tried a lot, rly
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
local function addTravelKeyword(keyword, cost, destination, action)
local travelKeyword = keywordHandler:addKeyword({keyword}, StdModule.say, {npcHandler = npcHandler, text = 'Friends of Dalbrect are my friends too! So you are looking for a passage to the continent for |TRAVELCOST|?', cost = cost, discount = 'postman'})
travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = cost, destination = destination })
travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'We would like to serve you some time.', reset = true})
end
addTravelKeyword('continent', 20, BOATPOS_TIBIA)
addTravelKeyword('tibia', 20, BOATPOS_TIBIA)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())