• 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] Kick of 'boat'

Status
Not open for further replies.

Kamil901123

Producer
Joined
Nov 17, 2009
Messages
180
Reaction score
1
Location
Poland/KKS
Hello,
i need script for kick of 'boat' player say kick -> yes and NPC kick players to random pos (min pos. 100,100,7 max pos. 107,104,7)
 
PHP:
local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        
        
        
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
        
        
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'raider'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Raider Camp for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32243, y=31429, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'helheim'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Helheim for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32552, y=31228, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'tyrsung'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Tyrsung for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32423, y=31281, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'okolnir'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Okolnir for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32315, y=31435, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'coldir'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Coldir for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32888, y=31356, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Tibia? Ahh yes!*HICKS* Do you want to go to Svargrond for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32346, y=31251, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

               local travelNode = keywordHandler:addKeyword({'barbarian'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Raider Camp for 0 cold pieces?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32243, y=31429, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})






        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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 kick(cid, message, keywords, parameters, node)
	if(not npcHandler:isFocused(cid)) then
		return false
	end

	npcHandler:releaseFocus(cid)
	local tmp, new = getThingPos(cid), {x = math.random(100, 107), y = math.random(100, 104), z = 7}
	doTeleportThing(cid, new)
	doSendMagicEffect(tmp, CONST_ME_TELEPORT)
	doSendMagicEffect(new, CONST_ME_TELEPORT)

	return true
end

	keywordHandler:addKeyword({'kick'}, kick, {})

	local travelNode = keywordHandler:addKeyword({'raider'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Raider Camp for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32243, y=31429, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
	
	local travelNode = keywordHandler:addKeyword({'helheim'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Helheim for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32552, y=31228, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
	
	local travelNode = keywordHandler:addKeyword({'tyrsung'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Tyrsung for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32423, y=31281, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'okolnir'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Okolnir for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32315, y=31435, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'coldir'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Coldir for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32888, y=31356, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'svargrond'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Tibia? Ahh yes!*HICKS* Do you want to go to Svargrond for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32346, y=31251, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'barbarian'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where are we at the moment? Is this Svargrond? Ahh yes!*HICKS* Do you want to go to Raider Camp for 0 cold pieces?'})
		travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32243, y=31429, z=7} })
		travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

npcHandler:addModule(FocusModule:new())
 
Status
Not open for further replies.
Back
Top