A friend ask me if there is a easy way to config free travel or not for NPC's...
Here i give you a easy way to enable or disable free travel(Tested and working in TFS 0.3.6):
Go to data/npc/lib/npcsystem/modules.lua
After:
Add:
After:
Add:
After:
Add:
After:
Add:
Now add this to config.lua:
Here i give you a easy way to enable or disable free travel(Tested and working in TFS 0.3.6):
Go to data/npc/lib/npcsystem/modules.lua
After:
LUA:
local storage, pzLocked = parameters.storageValue or (EMPTY_STORAGE + 1), parameters.allowLocked or false
Add:
LUA:
if getConfigInfo('freeTravel') then
parameters.cost = 0
end
After:
LUA:
function TravelModule.travel(cid, message, keywords, parameters, node)
local module = parameters.module
if(not module.npcHandler:isFocused(cid)) then
return false
end
Add:
LUA:
if getConfigInfo('freeTravel') then
parameters.cost = 0
end
After:
LUA:
function TravelModule.onConfirm(cid, message, keywords, parameters, node)
local module = parameters.module
if(not module.npcHandler:isFocused(cid)) then
return false
end
local parent = node:getParent():getParameters()
Add:
LUA:
if getConfigInfo('freeTravel') then
parameters.cost = 0
end
After:
LUA:
function TravelModule.bring(cid, message, keywords, parameters, node)
local module = parameters.module
if(not module.npcHandler:isFocused(cid)) then
return false
end
Add:
LUA:
if getConfigInfo('freeTravel') then
parameters.cost = 0
end
Now add this to config.lua:
LUA:
freeTravel = false