• 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 help

Thinkey

New Member
Joined
Jul 5, 2010
Messages
33
Reaction score
0
Hey guys, i added a npc to my server but it seems it wont work...

This is the npc script:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Soya" script="all.lua" walkinterval="2000" floorchange="0">
<health now="185" max="185"/>
<look type="142" addons="3" head="79" body="84" legs="93" feet="33" corpse="2317"/>
<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="message_greet" value="Welcome! I Buy All {Armors}, {Legs}, {Boots}, {Helmets} And {Shields}."/>
<parameter key="message_farewall" value="Bye..."/>
<parameter key="message_walkaway" value="How rude!"/>
<parameter key="shop_sellable" value="helmet of the ancient,2343,35000;steel helmet,2457,300;chain helmet,2458,50;iron helmet,2459,150;brass helmet,2460,30;leather helmet,2461,10;devil helmet,2462,1000;golden helmet,2471,120000;viking helmet,2473,70;winged helmet,2474,80000;warrior helmet,2475,5000;strange helmet,2479,500;legion helmet,2480,60;soldier helmet,2481,20;studded helmet,2482,5;dark helmet,2490,250;crown helmet,2491,2000;demon helmet,2493,150000;horned helmet,2496,130000;crusader helmet,2497,6000;royal helmet,2498,30000;amazon helmet,2499,70000;ceremonial mask,2501,12000;dwarven helmet,2502,75000;dragon scale helmet,2506,150000;magician hat,2323,20000;mystic turban,2663,2000;tribal mask,3967,250;horseman helmet,3969,400;feather headdress,3970,2000;charmer tiara,3971,5000;beholder helmet,3972,10000;helmet of the deep,5461,5000;santa hat,6531,300;skull helmet,5741,40000;pirate hat,6096,1000;krimhorn helmet,7461,200;ragnir helmet,7462,400;fur cap,7458,75000;terra hood,7903,1000;lightning headband,7901,1500;glacier mask,7902,1000;magma monocle,7900,2500;mining helmet,7939,400;jester hat,7957,1000;bandana,5917,100;party hat,6578,200;mage hat,8820,150;yalahari mask,9778,15000;studded legs,2468,60;dragon scale legs,2469,120000;golden legs,2470,80000;knight legs,2477,5000;brass legs,2478,90;crown legs,2488,12000;demon legs,2495,150000;dwarven legs,2504,60000;elven legs,2507,70000;plate legs,2647,200;chain legs,2648,30;leather legs,2649,10;mammoth fur shorts,7464,100;terra legs,7885,100000;magma legs,7894,30000;lightning legs,7895,5000;glacier kilt,7896,5000;pirate knee breeches,5918,200;bast skirt,3983,1000;blue legs,7730,15000;ranger legs,8923,70000;yalahari leg piece,9777,80000;boots of haste,2195,30000;crocodile boots,3982,1000;fur boots,7457,2000;glacier shoes,7892,1000;golden boots,2646,100000;leather boots,2643,2;lightning boots,7893,5000;magma boots,7891,3000;pirate boots,5462,3000;soft boots,6132,250000;steel boots,2645,30000;terra boots,7886,100000;firewalker boots,9933,300000;plate armor,2463,400;chain armor,2464,80;brass armor,2465,100;golden armor,2466,20000;leather armor,2467,10;magic plate armor,2472,250000;knight armor,2476,5000;scale armor,2483,40;studded armor,2484,25;noble armor,2486,1000;crown armor,2487,12000;dark armor,2489,400;dragon scale mail,2492,40000;demon armor,2494,400000;amazon armor,2500,250000;dwarven armor,2503,100000;elven armor,2505,160000;native armor,2508,80000;blue robe,2656,11000;hidden turbant,2660,60000;cowl,2664,50000;leopard armor,3968,1000;pirate shirt,6095,500;mammoth fur cape,7463,6000;terra mantle,7884,5000;glacier robe,7897,5000;lightning robe,7897,5000;magma coat,7899,40000;dark lords cape,8865,200000;serpent coat,8866,40000;dragon robe,8867,70000;greenwood coat,8869,70000;spirit cloak,8870,400;focus cape,8871,4000;belted cape,8872,200;hibiscus dress,8873,5000;lavos armor,8877,80000;crystalline armor,8878,70000;voltage armor,8879,70000;swamplair armor,8880,70000;fireborn giant armor,8881,400000;earthborn titan armor,8882,400000;windborn colossus armor,8883,400000;oceanborn leviathan armor,8884,400000;divine plate,8885,70000;molten plate,8886,70000;frozen plate,8887,70000;master archers armor,8888,400000;skullcracker armor,8889,100000;robe of the underworld,8890,400000;paladin armor,8891,50000;ethno coat,8892,400;magicians robe,8819,100;yalahari armor,9776,100000;steel shield,2509,80;plate shield,2510,110;brass shield,2511,110;wooden shield,2512,70;battle shield,2513,95;mastermind shield,2514,80000;guardian shield,2515,2000;dragon shield,2516,4000;shield of honour,2517,100000;beholder shield,2518,1000;crown shield,2519,8000;demon shield,2520,30000;dark shield,2521,400;great shield,2522,250000;blessed shield,2523,350000;ornamented shield,2524,2000;dwarven shield,2525,100;studded shield,2526,60;rose shield,2527,80000;tower shield,2528,8000;black shield,2829,1000;copper shield,2530,150;viking shield,2531,80;ancient shield,2532,900;griffin shield,2533,1000;vampire shield,2534,15000;castle shield,2535,25000;medusa shield,2536,9000;amazon shield,2537,90000;eagle shield,2538,70000;phoenix shield,2539,100000;scarab shield,2540,2000;bone shield,2541,80;tempest shield,2542,110000;tusk shield,3973,850;sentinel shield,3974,500;salamander shield,3975,300;tortoise shield,6131,150;nightmare shield,6391,750000;necromancer shield,6433,750000;norse shield,7460,1000;rainbow shield,8905,60000;fiery rainbow shield,8906,60000;icy rainbow shield,8907,60000;sparking rainbow shield,8908,60000;terran rainbow shield,8909,60000;"/>
</parameters>
</npc>

and then the script:

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())


When i try to spawn it ingame i get this message in console:
[27/02/2011 13:12:54] [Warning - NpcScript::NpcScript] Can not load script: all.lua
[27/02/2011 13:12:54] cannot open all.lua: No such file or directory


Please help me out here guys!!
 
data/npc/Soya.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Soya" script="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,40000;boots of haste,2195,10000;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;dwarven helmet,2502,200000;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,100000;demon shield,2520,60000;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;horned helmet,2496,80000;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,10000;dragon hammer,2434,2000;clerical mace,2423,200;sapphire hammer,7437,7000;mace,2398,30;"/>
	</parameters>
</npc>
data/npc/scripts/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())

rep if i helped
 
Back
Top