What's new

Wyspa

MunOTS

Active User
Joined
Jun 20, 2009
Messages
112
Reaction score
1
Witam.
Zrobilem na swojej mapce now? wyspe i mam taki problem:
Chcial bym zrobic NPC osobny,kt?ry przewiezie mnie na t? wyspe l?cznie z powrotem do miasta.Wyspa sie nazywa "Wyspa Smierci" kapitan chce zeby sie nazywal Fuhrer.
Prosze o skrypt na takiego NPC.
Za pomoc rep+ z g?ry dziekuje
 

firos

Active User
Joined
Aug 23, 2008
Messages
100
Reaction score
5
Odp: Wyspa

Ok zaczynamy :) Wejdz do data/NPC i zrob plik o nazwie Fuhrer, a do srodka wklej to:
<npc name="Fuhrer" script="data/npc/scripts/fuhrer.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="128" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Witaj |PLAYERNAME|. Mozesz dostac sie na takie wyspy jak: {Wyspa Smierci}." />
<parameter key="message_decline" value="Nie masz |TOTALCOST| gp. Idz od kogos wyzebrac!"/>
</parameters>
</npc>

Potem wejdz do data/npc/scripts i stworz folder o nazwie Fuhrer oraz wklej to:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end


keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Witaj mozesz poplynac na takie miasta jak {Wyspa Smierci}, {City}.'})

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'wyspa smierci'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Czy masz 100 gp aby poplynac do Wyspy Smierci?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=36, y=79, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})

keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Wyspa Smierci\' for just a small fee.'})

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'city'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Czy masz 100 gp aby wrocic do City?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 2, cost = 100, destination = {x=266, y=32, z=5} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})

keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'City\' for just a small fee.'})

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'I wouldn\'t go there either.'})



-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

Wspolrzedne w jakich ktos ma sie pojawiac
Ile ma brac kasy za travel

Mam nadzieje, ze pomoglem :) Pozdrawiam
 
Last edited:

remiklus

Advanced User
Joined
Jan 24, 2009
Messages
225
Reaction score
7
Odp: Wyspa

data/npc Fuhrer.lua
Code:
<npc name="Fuhrer" script="data/npc/scripts/travel.lua" walkinterval="2000" floorchange="0"> 
<health now="150" max="150"/> 
<look type="151" head="20" body="120" legs="75" feet="13" addons="3" corpse="2212"/> 
<parameters> 
 <parameter key="message_greet" value="Hello |PLAYERNAME|. If you say {travel} to hear my boat offer. " /> 
 <parameter key="module_travel" value="1" /> 
 <parameter key="travel_destinations" value="[COLOR="DarkOrange"]miasto,X,Y,Z,CENA;wyspa smierci,X,Y,Z,CENA[/COLOR]" /> 
 <parameter key="module_keywords" value="1" /> 
 <parameter key="keywords" value="job;name;offer;help;mission;travel" /> 
 <parameter key="keyword_reply1" value="I am the captain of this ship." /> 
 <parameter key="keyword_reply2" value="My name is Fuhrer. Why do you ask?" /> 
 <parameter key="keyword_reply3" value="I offer only the possability to travel to far away cities on this continent." /> 
 <parameter key="keyword_reply4" value="Do I look like a helpful guy to you?" /> 
 <parameter key="keyword_reply5" value="What are you talking about?" /> 
 <parameter key="keyword_reply6" value="I can travel with you to : {WYSPA SMIERCI}, {MIASTO}. So?" /> 
</parameters> 
</npc>
miasto,X,Y,Z,CENA;wyspa smierci,X,Y,Z,CENA W tej linijce pozamieniaj wsp??rz?dne miast i wpisz w miejscu X,Y,Z oraz jaka cena ma byc za podroz.

data/npc/scripts travel.lua
Code:
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
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

dziala.
 
Last edited:

firos

Active User
Joined
Aug 23, 2008
Messages
100
Reaction score
5
Odp: Wyspa

Po co to piszesz jezeli juz ma zrobione? Nabijacz postow? Jeszcze do tego napisales to tak samo jak ja... (Moze skrypty inne) Zenada
 

MunOTS

Active User
Joined
Jun 20, 2009
Messages
112
Reaction score
1
Odp: Wyspa

Po co to piszesz jezeli juz ma zrobione? Nabijacz postow? Jeszcze do tego napisales to tak samo jak ja... (Moze skrypty inne) Zenada


Firos wywala mi bledy w silniku ;/

[09/09/2009 22:27:01] The Forgotten Server, version 0.3.3 (Crying Damson)
[09/09/2009 22:27:01] Sever Disinvolvido por: Elf, Talaturen, Lithium, Kiper, Kornholijo, Jonernm Nightmare, Shynzo, Comedinha & Alissow.
[09/09/2009 22:27:01] Visite o forum para atualiza??es.
[09/09/2009 22:27:01] Alissow Sever ~~ Mapa dorion (Sempre Inovando).

[09/09/2009 22:27:01] >> Checking software version... outdated, please consider updating!
[09/09/2009 22:27:01] > Current version information - version: 0.3.3, patch: 0, build: 1471, timestamp: 1238943873.
[09/09/2009 22:27:01] > Latest version information - version: 0.3.5, patch: 1, build: 2576, timestamp: 1249584126.
[09/09/2009 22:27:03] >> Loading config (config.lua)
[09/09/2009 22:27:03] > Using plaintext passwords
[09/09/2009 22:27:03] >> Loading RSA key
[09/09/2009 22:27:03] >> Starting SQL connection
[09/09/2009 22:27:03] >> Running Database Manager
[09/09/2009 22:27:03] > No tables were optimized.
[09/09/2009 22:27:03] >> Loading items
[09/09/2009 22:27:04] >> Loading vocations
[09/09/2009 22:27:04] >> Loading script systems
[09/09/2009 22:27:05] >> Loading outfits
[09/09/2009 22:27:05] >> Loading experience stages
[09/09/2009 22:27:05] >> Loading monsters
[09/09/2009 22:27:06] >> Loading map and spawns...
[09/09/2009 22:27:10] > Map size: 2245x2892.
[09/09/2009 22:27:10] > Map descriptions:
[09/09/2009 22:27:10] Saved with Remere's Map Editor 1.1.3
[09/09/2009 22:27:10] SimOne MapEditor 0.5.2
[09/09/2009 22:29:15] > Map loading time: 129.453 seconds.
[09/09/2009 22:29:24] [Spawn::addMonster] Cannot find "Animated Pumpkin"
[09/09/2009 22:29:43] > Data loading time: 27.046 seconds.
[09/09/2009 22:29:45] > Unserialization time for houses: 1.641 seconds.
[09/09/2009 22:29:59] > Unserialization time for map: 13.625 seconds.
[09/09/2009 22:29:59] >> Checking world type... PvP
[09/09/2009 22:29:59] >> Initializing game state modules and registering services...

[09/09/2009 22:30:03] Lua Script Error: [Npc interface]
[09/09/2009 22:30:03] data/npc/scripts/fuhrer.lua:eek:nCreatureAppear

[09/09/2009 22:30:03] data/npc/scripts/fuhrer.lua:8: attempt to call global 'npcHandlernCreatureAppear' (a nil value)
[09/09/2009 22:30:04] stack traceback:
[09/09/2009 22:30:04] data/npc/scripts/fuhrer.lua:8: in function <data/npc/scripts/fuhrer.lua:8>
[09/09/2009 22:30:35] > Global address: 127.0.0.1
[09/09/2009 22:30:37] > Local ports:
[09/09/2009 22:30:37] 7171 7172
[09/09/2009 22:30:37] >> All modules were loaded, server starting up...
[09/09/2009 22:30:38] >> Munoria server Online!


[09/09/2009 22:31:13] Lua Script Error: [Npc interface]
[09/09/2009 22:31:13] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:14] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:14] stack traceback:
[09/09/2009 22:31:14] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:15] Lua Script Error: [Npc interface]
[09/09/2009 22:31:15] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:15] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:15] stack traceback:
[09/09/2009 22:31:15] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:16] Lua Script Error: [Npc interface]
[09/09/2009 22:31:16] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:16] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:16] stack traceback:
[09/09/2009 22:31:16] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:16] Lua Script Error: [Npc interface]
[09/09/2009 22:31:16] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:16] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:16] stack traceback:
[09/09/2009 22:31:16] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:17] Lua Script Error: [Npc interface]
[09/09/2009 22:31:17] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:17] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:17] stack traceback:
[09/09/2009 22:31:17] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:18] Lua Script Error: [Npc interface]
[09/09/2009 22:31:18] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:18] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:18] stack traceback:
[09/09/2009 22:31:18] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:18] Lua Script Error: [Npc interface]
[09/09/2009 22:31:18] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:18] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:18] stack traceback:
[09/09/2009 22:31:18] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:19] Lua Script Error: [Npc interface]
[09/09/2009 22:31:19] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:19] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:19] stack traceback:
[09/09/2009 22:31:19] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:19] Lua Script Error: [Npc interface]
[09/09/2009 22:31:19] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:19] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:19] stack traceback:
[09/09/2009 22:31:19] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:20] Lua Script Error: [Npc interface]
[09/09/2009 22:31:20] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:20] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:20] stack traceback:
[09/09/2009 22:31:20] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:21] Lua Script Error: [Npc interface]
[09/09/2009 22:31:21] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:21] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:21] stack traceback:
[09/09/2009 22:31:21] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:21] Lua Script Error: [Npc interface]
[09/09/2009 22:31:21] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:21] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:21] stack traceback:
[09/09/2009 22:31:21] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:22] Lua Script Error: [Npc interface]
[09/09/2009 22:31:22] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:22] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:22] stack traceback:
[09/09/2009 22:31:22] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:23] Lua Script Error: [Npc interface]
[09/09/2009 22:31:23] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:23] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:23] stack traceback:
[09/09/2009 22:31:23] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:23] Lua Script Error: [Npc interface]
[09/09/2009 22:31:23] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:23] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:23] stack traceback:
[09/09/2009 22:31:23] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:24] Lua Script Error: [Npc interface]
[09/09/2009 22:31:24] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:24] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:24] stack traceback:
[09/09/2009 22:31:24] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:25] Lua Script Error: [Npc interface]
[09/09/2009 22:31:25] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:25] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:25] stack traceback:
[09/09/2009 22:31:25] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:25] Lua Script Error: [Npc interface]
[09/09/2009 22:31:25] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:25] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:25] stack traceback:
[09/09/2009 22:31:25] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:26] Lua Script Error: [Npc interface]
[09/09/2009 22:31:26] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:26] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:26] stack traceback:
[09/09/2009 22:31:26] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:27] Lua Script Error: [Npc interface]
[09/09/2009 22:31:27] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:27] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:27] stack traceback:
[09/09/2009 22:31:27] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lua:11>

[09/09/2009 22:31:27] Lua Script Error: [Npc interface]
[09/09/2009 22:31:27] data/npc/scripts/fuhrer.lua:eek:nThink

[09/09/2009 22:31:27] data/npc/scripts/fuhrer.lua:11: attempt to call global 'npcHandlernThink' (a nil value)
[09/09/2009 22:31:27] stack traceback:
[09/09/2009 22:31:27] data/npc/scripts/fuhrer.lua:11: in function <data/npc/scripts/fuhrer.lu
 

ZiomeQ342

Active User
Joined
Oct 9, 2008
Messages
67
Reaction score
0
Odp: Wyspa

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

npcHandler:addModule(FocusModule:new())


U?yj tego :)
 

MunOTS

Active User
Joined
Jun 20, 2009
Messages
112
Reaction score
1
Odp: Wyspa

remikus dla ciebie polecial reput.Twoj skrypt dziala,wielkie dzieki. :thx:
 
Top