• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Easy way to config free travel for NPC's

Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
188
Location
Venezuela
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:
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
 
Back
Top