What's new

npc !!!

cysiu30

Active User
Joined
Jul 13, 2009
Messages
129
Reaction score
1
Prosze o pomoc ... mam b??d

data/npc/scripts/loot.lua:1: attempt to index global 'Loot' (a nil value)
[Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/loot.lua
tu daje scrypt

local keywordHandler = Loot:new()
local npcHandler = Loot:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp),Super Spiked Club (300k).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})
npcHandler:addModule(FocusModule:new())

I jeszcze tego npc jak ktos pomo?e .
scrypt jego:
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
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy dragon hammers(2k), skull staffs(6k), war hammers(1.2k), dragonbone staffs(3k) and daramanian maces(110gp). I also buy amber staffs(8k), sapphire hammers(2k), brutetamer\s staff(1.5k), furry clubs(1k), taurus maces(500gp), lunar staffs(5k), mammoth whoppers(300gp) and diamond sceptres(3k).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy knight axes(2k), dragon lances(9k), fira axes (8k), obsidian lances(500gp), war axes(9k) and daramanian waraxes (1k). I also buy beastslayer axe(1.5k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant swords (17k), poison daggers (50gp), scimiteras (150gp), serpent sword (900gp), fire sword (4k), spike swords(1k), ice rapiers(1k), broad swords(500gp), dragon slayers(15k), wyvern fang(1.5k), silver dagger(500gp) and heavy machetes(90gp).'})
keywordHandler:addKeyword({'wands'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy magic lightwands(30gp), wand of vortexes(100gp), wand of dragonbreaths(200gp), wand of plagues(1k), wand of cosmic energys(2k) and wand if infernoes(3k).'})
keywordHandler:addKeyword({'rods'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy snakebite rods(100gp), moonlight rods(200gp), volcanic rods(1k), quarmire rods(2k) and tempest rods(3k).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy boots of hastes(30k), steel boots(30k), pirate boots(2k) and crocodile boots(1k). I also buy fur boots(2k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy crown armors(12k), blue robes(10k), noble armors(900gp), dark armors(400gp), knight armors(5k), dragon scale mails(40k), golden armors(20k) and pirate scirts(500gp). I also buy mammoth fur capes(6k), leopard armors(1k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy crown legs(12k), knight legs(5k) and pirate knee breeches(200gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy phoenix shields(16k), crown shields(8k), dragon shields(4k), guardian shields(2k), beholder shields(1.2k), ancient shields(900gp), black shields, tower shields(8k), vampire shields(15k), demon shields(30k), medusa shields(9k), castle shields(5k), scarab shields(2k), dark shields(400gp), tortoise shields(150gp) and bone shields(80gp).'})
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal(30k), crusader(6k), crown(2.5k), dark(250gp), strange(500gp), warrior(5k), skull(40k), beholder(7.5k), devil(1k), ragnir(400gp) and krimhorn(200gp). I also buy mystic turbans(150gp) and pirate hats(1k).'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
b?ad:
[18/07/2010 21:00:00] [Error - Npc interface]
[18/07/2010 21:00:00] data/npc/scripts/vip loot.lua
[18/07/2010 21:00:00] Description:
[18/07/2010 21:00:00] data/lib/050-function.lua:222: attempt to index a boolean value
[18/07/2010 21:00:00] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/vip loot.lua

za pomoc w 2 npc + i to wielki!!

Notka moderatorska:
??cz? posty.
 

Sensi89

Advanced User
Joined
May 8, 2010
Messages
209
Reaction score
15
Odp: npc !!!

Zobacz teraz.
PHP:
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
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp),Super Spiked Club (300k).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})
npcHandler:addModule(FocusModule:new())

PHP:
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


-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy dragon hammers(2k), skull staffs(6k), war hammers(1.2k), dragonbone staffs(3k) and daramanian maces(110gp). I also buy amber staffs(8k), sapphire hammers(2k), brutetamer\s staff(1.5k), furry clubs(1k), taurus maces(500gp), lunar staffs(5k), mammoth whoppers(300gp) and diamond sceptres(3k).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy knight axes(2k), dragon lances(9k), fira axes (8k), obsidian lances(500gp), war axes(9k) and daramanian waraxes (1k). I also buy beastslayer axe(1.5k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant swords (17k), poison daggers (50gp), scimiteras (150gp), serpent sword (900gp), fire sword (4k), spike swords(1k), ice rapiers(1k), broad swords(500gp), dragon slayers(15k), wyvern fang(1.5k), silver dagger(500gp) and heavy machetes(90gp).'})
keywordHandler:addKeyword({'wands'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy magic lightwands(30gp), wand of vortexes(100gp), wand of dragonbreaths(200gp), wand of plagues(1k), wand of cosmic energys(2k) and wand if infernoes(3k).'})
keywordHandler:addKeyword({'rods'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy snakebite rods(100gp), moonlight rods(200gp), volcanic rods(1k), quarmire rods(2k) and tempest rods(3k).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy boots of hastes(30k), steel boots(30k), pirate boots(2k) and crocodile boots(1k). I also buy fur boots(2k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy crown armors(12k), blue robes(10k), noble armors(900gp), dark armors(400gp), knight armors(5k), dragon scale mails(40k), golden armors(20k) and pirate scirts(500gp). I also buy mammoth fur capes(6k), leopard armors(1k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy crown legs(12k), knight legs(5k) and pirate knee breeches(200gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy phoenix shields(16k), crown shields(8k), dragon shields(4k), guardian shields(2k), beholder shields(1.2k), ancient shields(900gp), black shields, tower shields(8k), vampire shields(15k), demon shields(30k), medusa shields(9k), castle shields(5k), scarab shields(2k), dark shields(400gp), tortoise shields(150gp) and bone shields(80gp).'})
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal(30k), crusader(6k), crown(2.5k), dark(250gp), strange(500gp), warrior(5k), skull(40k), beholder(7.5k), devil(1k), ragnir(400gp) and krimhorn(200gp). I also buy mystic turbans(150gp) and pirate hats(1k).'})
npcHandler:addModule(FocusModule:new())
 
Last edited:

cysiu30

Active User
Joined
Jul 13, 2009
Messages
129
Reaction score
1
Odp: npc !!!

[Error - LuaScriptInterface::loadFile] data/npc/scripts/loot.lua:16: unfinished string near ''I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).}) '
[Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/loot.lua
data/npc/scripts/loot.lua:16: unfinished string near ''I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).}) '
[Warning] NpcSystem:
Parameter(s) missing for item:
throwing knife2410
25


[Error - Npc interface]
data/npc/scripts/vip loot.lua
Description:
data/lib/050-function.lua:222: attempt to index a boolean value
[Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/vip loot.lua
data/npc/scripts/loot.lua:16: unfinished string near ''I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).}) '

wpisalem 1 kod do loot a 2 do vip loot i to mi wskoczylo .
 

Sensi89

Advanced User
Joined
May 8, 2010
Messages
209
Reaction score
15
Odp: npc !!!

A zobacz czy to b?dzie dzia?a?o:

Soya.xml

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Soya" script="data/npc/scripts/loot.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="139" head="132" body="79" legs="97" feet="132" corpse="2212"/>
	<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy swords, clubs, axes, helmets, boots, legs, shields and armors."/>
		<parameter key="shop_sellable" value="royal helmet,2498,40000;warrior helmet,2475,6000;crusader helmet,2497,9000;crown helmet,2491,5000;devil helmet,2462,4000;mystic turban,2663,500;chain helmet,2458,35;iron helmet,2459,30;steel boots,2645,400000;boots of haste,2195,40000;golden boots,2646,100000;magic plate armor,2472,100000;dragon scale mail,2492,60000;demon armor,2494,90000;golden armor,2466,30000;crown armor,2487,20000;knight armor,2476,5000;blue robe,2656,15000;lady armor,2500,2500;plate armor,2463,400;brass armor,2465,200;chain armor,2464,100;golden legs,2470,80000;crown legs,2488,15000;knight legs,2477,6000;plate legs,2647,500;brass legs,2487,100;mastermind shield,2514,80000;demon shield,2520,40000;blessed shield,2523,150000;great shield,2522,100000;vampire shield,2534,25000;medusa shield,2536,8000;amazon shield,2537,4000;crown shield,2519,5000;tower shield,2528,4000;guardian shield,2515,200;beholder shield,2518,1500;dwarven shield,2525,100;magic longsword,2390,150000;warlord sword,2408,100000;magic sword,2400,90000;giant sword,2393,10000;bright sword,2407,6000;ice rapier,2396,4000;fire sword,2392,3000;serpent sword,2409,1500;spike sword,2383,800;two handed sword,2377,400;broad sword,2413,70;short sword,2406,30;sword,2376,25;dragon lance,2414,10000;stonecutter axe,2431,90000;guardian halberd,2427,7500;fire axe,2432,10000;knight axe,2430,2000;double axe,2387,200;halberd,2381,200;battle axe,2378,100;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,1000;dragon hammer,2434,2000;clerical mace,2423,200;battle hammer,2417,60;mace,2398,30;"/>
	</parameters>
</npc>

loot.lua

PHP:
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

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

npcHandler:addModule(FocusModule:new())
 

cysiu30

Active User
Joined
Jul 13, 2009
Messages
129
Reaction score
1
Odp: npc !!!

[18/07/2010 21:22:15] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/Loot.xml).
[18/07/2010 21:22:15] Info: failed to load external entity "data/npc/Loot.xml"

to mi wyskoczylo ...
 

Sensi89

Advanced User
Joined
May 8, 2010
Messages
209
Reaction score
15
Odp: npc !!!

?ci?gnij to i podmie? z twoim npc systemem czyli npc/lib

Code:
http://www.speedyshare.com/files/23426868/lib.zip

Zobacz czy b?dzie dzia?a?o a jak nie to b?dziemy dalej kombinowa?.
 

cysiu30

Active User
Joined
Jul 13, 2009
Messages
129
Reaction score
1
Odp: npc !!!

npc loot dziala ale vip loot jeszcze trzeba zrobic .
 
Last edited:
Top