GM Praga
Advanced User
Oto Npc Sprzedajacy wszystko powiem co npc sprzedaje/kupuje
Ok no to jedziemy
Data/NPC: AllSeller.xml
Data/NPC/Scripts:All.lua
to moj pierwszy skrypt plis oceniajcie lagodnie 
Kod:
MIECZE
serpent sword
crimson sword
wyvern fang
bright sword
djinn blade
relic sword
giant sword
shenlong sword
ice rapier
AXE
knight axe
obsidian lence
halberd
double axe
dreaded cleaver
vile axe
heroic axe
royal axe
dragon lance
war axe
CLUB
clerical mace
dragon hammer
dragonbone staff
skull staff
crystal mace
lich staff
war hammer
golden mace
hammer of wrath
chaos mace
DYSTANSOWE
crossbow
bow
enchanted spear
royal spear
hunting spear
assassin star
viper star
throwing star
throwing knife
sniper arrow
onyx arrow
shiver arrow
flaming arrow
flash arrow
earth arrow
burst arrow
poison arrow
bolt
power bolt
infernal bolt
WAND & ROD
Wand of vortex
wand of dragonbreath
wand of decay
wand of cosmic energy
wand of inferno
snakebite rod
moonlight rod
necrotic rod
hailstorm rod
ARMOR
dwarven armor
noble armor
blue robe
magma coat
lightning robe
knight armor
amazon armor
crown armor
golden armor
dragon scale mail
magic plate armor
TARCZE
Dragon shield
amazon shield
crown shield
tower shield
medusa shield
vampire shield
phoenix shield
demon shield
mastermind shield
HE?MY
post officers hat
bandana
santa hat
magician hat
mystic turban
party hat
helmet of the deep
dark helmet
amazon helmet
devil helmet
crown helmet
warrior helmet
skull helmet
royal helmet
horned helmet
NOGAWICE
terra legs
pirate knee breeches
brass legs
plate legs
blue legs
lightning legs
crown legs
knight legs
magma legs
golden legs
BUTY
sandals
boots of haste
soft boots
terra boots
lightning boots
magma boots
fur boots
steel boots
FOOD
party cake
blueberry
cherry
strawberry
candy cane
cookie
shrimp
red mushroom
mango
green mushroom
carrot
roll
tomato
egg
brown bread
banana
cheese
grapes
salmon
bread
fish
orange
meat
cream cake (cream)
pumpkin
melon
brown mushroom
dragon ham
fire mushroom
KOSZTOWNO?CI
white pearl
black pearl
small diamond
small sapphire
small ruby
small emerald
small amethyst
talon
gold nugget
AMULETY
amulet of loss
ancient amulet
demonbone amulet
dragon necklace
elven amulet
golden amulet
paw amulet
platinum amulet
protection amulet
scarab amulet
scarf
silver amulet
stone skin amulet
strange talisman
terra amulet
wolf tooth chain
PIER?CIENIE
axe ring
club ring
crystal ring
death ring
dwarven ring
energy ring
gold ring
life ring
might ring
power ring
ring of healing
ring of the sky
stealth ring
sword ring
time ring
wedding ring
Data/NPC: AllSeller.xml
Kod:
<npc name="AllSeller" script="data/npc/scripts/all.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="146" head="114" body="114" legs="114" feet="114" addons="3" corpse="2212"/>
<parameters>
<parameter key="module_shop" value="1" />
<parameter key="shop_sellable" value="fire sword,2392,5000;crossbow,2455,360;bow,2456,200;amulet of loss,2173,10000;ancient amulet,2142,500;demonbone amulet,2136,1000;dragon necklace,2201,900;elven amulet,2198,700;golden amulet,2130,6600;paw amulet,2218,1000;platinum amulet,2171,2000;protection amulet,2200,800;scarab amulet,2135,1100;scarf,2661,300;silver amulet,2170,500;stone skin amulet,2197,350;strange talisman,2161,700;terra amulet,7887,600;wolf tooth chain,2129,100;axe ring,2208,150;club ring,2209,150;crystal ring,2124,500;death ring,6300,100;dwarven ring,2213,1000;energy ring,2167,180;gold ring,2179,500;life ring,2168,200;might ring,2164,170;power ring,2166,150;ring of the sky,2123,100;ring of healing,2214,200;stealth ring,2165,200;sword ring,2207,150;time ring,2169,300;wedding ring,2121,1000;party cake,6280,50;blueberry,2677,1;cherry,2679,3;strawberry,2680,4;candy cane,2688,4;cookie,2687,2;shrimp,2670,4;red mushroom,2788,4;mango,5097,4;green mushroom,2796,4;carrot,2684,4;roll,2690,5;tomato,2685,5;egg,2695,5;brown bread,2691,5;banana,2676,4;cheese,2696,3;grapes,2681,4;salmon,2668,5;cake,6278,10;bread,2689,5;valentine's,6393,30;fish,2667,4;orange,2675,4;decorated,6279,20;meat,2666,4;cream,6394,10;pumpkin,2683,10;melon,2682,5;brown mushroom,2789,6;dragon ham,2672,10;fire mushroom,2795,20;post officers hat,2665,100;bandana,5917,50;ferumbras hat',5903,4000;santa hat,6531,3000;magician hat,2323,1000;mystic turban,2663,150;leather helmet,2461,10;party hat,6578,1000;helmet of the deep,5461,5000;dark helmet,2490,400;amazon helmet,2499,600;devil helmet,2462,600;crown helmet,2491,2000;warrior helmet,2475,4000;skull helmet,5741,5000;royal helmet,2498,40000;horned helmet,2496,100000;terra legs,7885,100;pirate knee breeches,5918,10;brass legs,2478,200;plate legs,2647,500;blue legs,7730,1500;lightning legs,7895,2000;crown legs,2488,2000;knight legs,2477,5000;magma legs,7894,5000;golden legs,2470,80000;sandals,2642,10;boots of haste,2195,30000;soft boots,2640,10000;crocodile boots,3982,200;terra boots,7886,1000;lightning boots,7893,1000;magma boots,7891,1000;fur boots,7457,1000;steel boots,2645,40000;dwarven armor,2503,3000;noble armor,2486,2000;blue robe,2656,10000;magma coat,7899,10000;lightning robe,7898,10000;knight armor,2476,5000;amazon armor,2500,7000;crown armor,2487,20000;golden armor,2466,30000;dragon scale mail,2492,60000;magic plate armor,2472,100000;snakebite rod,2182,500;moonlight rod,2186,1000;necrotic rod,2185,5000;hailstorm rod,2183,15000;wand of vortex,2190,500;wand of dragonbreath,2191,1000;wand of decay,2188,5000;wand of cosmic energy,2189,10000;wand of inferno,2187,15000;sniper arrow,7364,7;infernal bolt,6529,100;bow,2456,400;onyx arrow,7365,10;shiver arrow,7839,10;flaming arrow,7840,10;flash arrow,7838,10;power bolt,2547,6;earth arrow,7850,15;crossbow,2455,360;burst arrow,2546,15;poison arrow,2545,10;bolt,2543,3;throwing knife,2410,25;viper star,7366,45;throwing star,2399,50;hunting spear,3965,50;royal spear,7378,35;enchanted spear,7367,50;assassin star,7368,100;dragon shield,2516,1000;amazon shield,2537,3000;crown shield,2519,5000;tower shield,2528,5000;medusa shield,2536,5000;vampire shield,2534,15000;phoenix shield,2539,16000;demon shield,2520,40000;mastermind shield,2514,80000;serpent sword,2409,2000;crimson sword,7385,2500;wyvern fang,7408,3000;bright sword,2407,20000;djinn blade,2451,30000;relic sword,7383,50000;giant sword,2393,10000;shenlong sword,7405,90000;ice rapier,2396,5000;knight axe,2430,5000;obsidian lance,2425,3000;halberd,2381,800;double axe,2387,800;dreaded cleaver,7419,11000;vile axe,7388,13000;heroic axe,7389,20000;royal axe,7434,50000;dragon lance,2414,10000;war axe,2454,20000;clerical mace,2423,1000;dragon hammer,2434,4000;dragonbone staff,7430,3000;skull staff,2436,6000;crystal mace,2445,60000;lich staff,3961,80000;war hammer,2391,5000;golden mace,2437,17000;hammer of wrath,2444,40000;chaos mace,7427,25000;white pearl,2143,200;orchidalcum pearl,5022,300;black pearl,2144,350;small diamond,2145,150;small sapphire,2146,150;small ruby,2147,300;small emerald,2149,150;small amethyst,2150,150;talon,2151,40;gold nugget,2157,80" />
<parameter key="shop_buyable" value="fire sword,2392,5000;crossbow,2455,360;bow,2456,200;amulet of loss,2173,10000;ancient amulet,2142,500;demonbone amulet,2136,1000;dragon necklace,2201,900;elven amulet,2198,700;golden amulet,2130,6600;paw amulet,2218,1000;platinum amulet,2171,2000;protection amulet,2200,800;scarab amulet,2135,1100;scarf,2661,300;silver amulet,2170,500;stone skin amulet,2197,350;strange talisman,2161,700;terra amulet,7887,600;wolf tooth chain,2129,100;axe ring,2208,150;club ring,2209,150;crystal ring,2124,500;death ring,6300,100;dwarven ring,2213,1000;energy ring,2167,180;gold ring,2179,500;life ring,2168,200;might ring,2164,170;power ring,2166,150;ring of the sky,2123,100;ring of healing,2214,200;stealth ring,2165,200;sword ring,2207,150;time ring,2169,300;wedding ring,2121,1000;party cake,6280,50;blueberry,2677,1;cherry,2679,3;strawberry,2680,4;candy cane,2688,4;cookie,2687,2;shrimp,2670,4;red mushroom,2788,4;mango,5097,4;green mushroom,2796,4;carrot,2684,4;roll,2690,5;tomato,2685,5;egg,2695,5;brown bread,2691,5;banana,2676,4;cheese,2696,3;grapes,2681,4;salmon,2668,5;cake,6278,10;bread,2689,5;valentine's,6393,30;fish,2667,4;orange,2675,4;decorated,6279,20;meat,2666,4;cream,6394,10;pumpkin,2683,10;melon,2682,5;brown mushroom,2789,6;dragon ham,2672,10;fire mushroom,2795,20;post officers hat,2665,100;bandana,5917,50;ferumbras hat',5903,4000;santa hat,6531,3000;magician hat,2323,1000;mystic turban,2663,150;leather helmet,2461,10;party hat,6578,1000;helmet of the deep,5461,5000;dark helmet,2490,400;amazon helmet,2499,600;devil helmet,2462,600;crown helmet,2491,2000;warrior helmet,2475,4000;skull helmet,5741,5000;royal helmet,2498,40000;horned helmet,2496,100000;terra legs,7885,100;pirate knee breeches,5918,10;brass legs,2478,200;plate legs,2647,500;blue legs,7730,1500;lightning legs,7895,2000;crown legs,2488,2000;knight legs,2477,5000;magma legs,7894,5000;golden legs,2470,80000;sandals,2642,10;boots of haste,2195,30000;soft boots,2640,10000;crocodile boots,3982,200;terra boots,7886,1000;lightning boots,7893,1000;magma boots,7891,1000;fur boots,7457,1000;steel boots,2645,40000;dwarven armor,2503,3000;noble armor,2486,2000;blue robe,2656,10000;magma coat,7899,10000;lightning robe,7898,10000;knight armor,2476,5000;amazon armor,2500,7000;crown armor,2487,20000;golden armor,2466,30000;dragon scale mail,2492,60000;magic plate armor,2472,100000;snakebite rod,2182,500;moonlight rod,2186,1000;necrotic rod,2185,5000;hailstorm rod,2183,15000;wand of vortex,2190,500;wand of dragonbreath,2191,1000;wand of decay,2188,5000;wand of cosmic energy,2189,10000;wand of inferno,2187,15000;sniper arrow,7364,7;infernal bolt,6529,100;bow,2456,400;onyx arrow,7365,10;shiver arrow,7839,10;flaming arrow,7840,10;flash arrow,7838,10;power bolt,2547,6;earth arrow,7850,15;crossbow,2455,360;burst arrow,2546,15;poison arrow,2545,10;bolt,2543,3;throwing knife,2410,25;viper star,7366,45;throwing star,2399,50;hunting spear,3965,50;royal spear,7378,35;enchanted spear,7367,50;assassin star,7368,100;dragon shield,2516,1000;amazon shield,2537,3000;crown shield,2519,5000;tower shield,2528,5000;medusa shield,2536,5000;vampire shield,2534,15000;phoenix shield,2539,16000;demon shield,2520,40000;mastermind shield,2514,80000;serpent sword,2409,2000;crimson sword,7385,2500;wyvern fang,7408,3000;bright sword,2407,20000;djinn blade,2451,30000;relic sword,7383,50000;giant sword,2393,10000;shenlong sword,7405,90000;ice rapier,2396,5000;knight axe,2430,5000;obsidian lance,2425,3000;halberd,2381,800;double axe,2387,800;dreaded cleaver,7419,11000;vile axe,7388,13000;heroic axe,7389,20000;royal axe,7434,50000;dragon lance,2414,10000;war axe,2454,20000;clerical mace,2423,1000;dragon hammer,2434,4000;dragonbone staff,7430,3000;skull staff,2436,6000;crystal mace,2445,60000;lich staff,3961,80000;war hammer,2391,5000;golden mace,2437,17000;hammer of wrath,2444,40000;chaos mace,7427,25000;white pearl,2143,200;orchidalcum pearl,5022,300;black pearl,2144,350;small diamond,2145,150;small sapphire,2146,150;small ruby,2147,300;small emerald,2149,150;small amethyst,2150,150;talon,2151,40;gold nugget,2157,80" />
</parameters>
</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
npcHandler:addModule(FocusModule:new())