• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

Problem z NPC teleportuj?cym

Status
Zamknięty.

Magmaruss

Active User
Dołączył
Czerwiec 5, 2009
Posty
68
Liczba reakcji
5
Witam.Mam problem z NPC teleportuj?cym.Wpisa?em w scrypcie wsp??rz?dne na expowiska itp.Odpali?em OTSa by sprawdzi? czy dzia?a.Napisa?em "Hi" "travel" i gdy p??niej pisz? miejsce gdzie chc? si? przeteleportowa? NPC nic nie robi.Prosz? o pomoc.
 
Odp: Problem z NPC teleportuj?cym

Daj skrypt kt?rego u?ywa ten npc bo inaczej to nic nie wymy?limy.
 
Odp: Problem z NPC teleportuj?cym

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nimral" script="default.lua" walkinterval="0" floorchange="0">
<health now="150" max="150"/>
<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="module_travel" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. If you don't know where to flow, say {travel}."/>
<parameter key="travel_destinations" value="Dragony,978,1115,7,0;Hydry,1138,1102,7,1;Ferumbras,1560,1506,7,1;Demony,1455,1566,10,1;Warlock,1541,1462,12,1;Zolwie,1203,1187,7,1;Fury,900,1298,7,1;Undead Dragon,1103,746,7,1;Dragon Lord,846,917,7,1;Orshabaal,792,733,7,1;Dark Torturer,839,1090,7,1;"/>
</parameters>
</npc>
 
Odp: Problem z NPC teleportuj?cym

Podaj to co masz w pliku LUA a nie w pliku XML.
 
Odp: Problem z NPC teleportuj?cym

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

npcHandler:addModule(FocusModule:new())
 
Odp: Problem z NPC teleportuj?cym

no tak napisa?em jak poprawi?e?, ale nie w tym rzecz.

To jak, g?owi si? kto? z tym?Bo nie wiem czy czeka? na odpowied?.
 
Odp: Problem z NPC teleportuj?cym

Kod:
<?xml version="1.0"?>

<npc name="Azura Boat" script="data/npc/scripts/boat.lua" access="3" lookdir="2" walkinterval="2000">
	<mana now="800" max="800"/>
	<health now="200" max="200"/>
<look type="151" head="114" body="114" legs="114" feet="0" addons="3"/>
</npc>

Kod:
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({'karmia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Karmia for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=454, y=480, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'inferno'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Inferno for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=518, y=439, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=431, y=420, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
	local travelNode = keywordHandler:addKeyword({'folda'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Folda for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=268, y=316, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'desert'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Desert for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=401, y=481, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'premium'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Premium for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=435, y=621, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'libert bay'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Libert Bay for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=568, y=696, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

	local travelNode = keywordHandler:addKeyword({'tiquanda'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Tiquanda for 100 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=558, y=460, z=6} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
        
        keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to karmia, Inferno, Venore, Folda, Desert, Premium, Libert Bay, Tiquanda.'})
        keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can only take you to Karmia, Inferno, Venore, Folda, Desert, Premium, Libert Bay, Tiquanda.'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())

to jest moj npc do teleportowania... teraz sobie go mozesz przerobic :D ten dziala na 100%
 
Ostatnia edycja:
Odp: Problem z NPC teleportuj?cym

Dzi?ki ziomek.Scrypt zajefajny i co najwa?niejsze dzia?a :)
 
Status
Zamknięty.
Do góry