tibera
Well-Known Member
hello Otlanders
anyone can help me?
i use avesta 7.6.
i want put this function in RASHID. but not working :/
Rashid.xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rashid" script="Rashid.lua" walkinterval="25" access="3" lookdir="2">
<look type="128" head="114" body="101" legs="122" feet="115"/>
<mana now="800" max="800"/>
<health now="200" max="200"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, I buy many items, you are abble to choise between armors, weapons, helmets, shields, boots, amulets and dolls, What do you offer me?" />
<parameter key="message_farewell" value="Good bye |PLAYERNAME|!" />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="weapons;armors;helmets;shields;boots list;amulets;dolls" />
<parameter key="keyword_reply1" value="I buy these weapons, daramanian mace, daramanian waraxe, guardian halberd, heavy machete, silver dagger and war axe." />
<parameter key="keyword_reply2" value="I buy these armors, dragon scale mail, dwarven armor, golden armor and leopard armor." />
<parameter key="keyword_reply3" value="I buy these helmets, beholder helmet and devil helmet." />
<parameter key="keyword_reply4" value="i buy these shields, bone shield, dark shield, demon shield, medusa shield and scarab shield." />
<parameter key="keyword_reply5" value="I buy these boots, crocodile boots, traper boots and steel boots." />
<parameter key="keyword_reply6" value="I buy these amulets, ancient amulet, crystal necklace, crystal ring, demonbone amulet, emerald amulet, golden ring, platinum amulet, ring of the sky, ruby necklace, scarab amulet and silver brooch." />
<parameter key="keyword_reply7" value="I buy these dolls, doll and voodoo doll." />
</parameters>
</npc>
Rashid.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler
nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler
nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler
nCreatureSay(cid, type, msg) end
function onThink() npcHandler
nThink() end
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'dragon scale mail'}, 2492, 40000, 'dragon scale mail')
shopModule:addSellableItem({'dwarven armor'}, 2503, 30000, 'dwarven armor')
shopModule:addSellableItem({'golden armor'}, 2466, 20000, 'golden armor')
shopModule:addSellableItem({'leopard armor'}, 3968, 1000, 'leopard armor')
shopModule:addSellableItem({'magic plate armor'}, 2472, 90000, 'magic plate armor')
shopModule:addSellableItem({'golden legs'}, 2470, 70000, 'golden legs')
shopModule:addSellableItem({'bone shield'}, 25480, 'bone shield')
shopModule:addSellableItem({'dark shield'}, 252400, 'dark shield')
shopModule:addSellableItem({'demon shield'}, 2520, 30000, 'demon shield')
shopModule:addSellableItem({'medusa shield'}, 2536, 9000, 'medusa shield')
shopModule:addSellableItem({'scarab shield'}, 2540, 2000, 'scarab shield')
shopModule:addSellableItem({'mastermind shield'}, 2514,50000, 'mastermind shield')
shopModule:addSellableItem({'beholder helmet'}, 3972, 7500, 'beholder helmet')
shopModule:addSellableItem({'devil helmet'}, 2462, 1000, 'devil helmet')
shopModule:addSellableItem({'crocodile boots'}, 3892, 1000, 'crocodile boots')
shopModule:addSellableItem({'traper boots'}, 2642000, 'traper boots')
shopModule:addSellableItem({'steel boots'}, 2645, 30000, 'steel boots')
shopModule:addSellableItem({'daramanian mace'}, 2439, 110, 'daramanian mace')
shopModule:addSellableItem({'daramanian waraxe'}, 2440, 1000, 'daramanian waraxe')
shopModule:addSellableItem({'guardian halberd'}, 2427, 11000, 'guardian halberd')
shopModule:addSellableItem({'heavy machete'}, 2442, 90, 'heavy machete')
shopModule:addSellableItem({'silver dagger'}, 2402, 500, 'silver dagger')
shopModule:addSellableItem({'war axe'}, 2454, 9000, 'war axe')
shopModule:addSellableItem({'ancient amulet'}, 2142, 200, 'ancient amulet')
shopModule:addSellableItem({'crystal necklace'}, 2125, 400, 'crystal necklace')
shopModule:addSellableItem({'crystal ring'}, 2124, 250, 'crystal ring')
shopModule:addSellableItem({'demonbone amulet'}, 2136, 32000, 'demonbone amulet')
shopModule:addSellableItem({'emerald bangle'}, 2127, 800, 'emerald bangle')
shopModule:addSellableItem({'golden ring'}, 2179, 8000, 'golden ring')
shopModule:addSellableItem({'platinum amulet'}, 2172500, 'platinum amulet')
shopModule:addSellableItem({'ring of the sky'}, 2123, 30000, 'ring of the sky')
shopModule:addSellableItem({'ruby necklace'}, 2133, 2000, 'ruby necklace')
shopModule:addSellableItem({'scarab amulet'}, 2135, 200, 'scarab amulet')
shopModule:addSellableItem({'silver brooch'}, 2134, 150,'silver brooch')
shopModule:addSellableItem({'doll'},2100 , 200, 'doll')
shopModule:addSellableItem({'voodoo doll'}, 3955, 400, 'voodoo doll')
shopModule:addSellableItem({'boots of haste'}, 2195, 30000, 'boots of haste')
npcHandler:addModule(FocusModule:new())
anyone can help me?
i use avesta 7.6.
i want put this function in RASHID. but not working :/
Rashid.xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rashid" script="Rashid.lua" walkinterval="25" access="3" lookdir="2">
<look type="128" head="114" body="101" legs="122" feet="115"/>
<mana now="800" max="800"/>
<health now="200" max="200"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, I buy many items, you are abble to choise between armors, weapons, helmets, shields, boots, amulets and dolls, What do you offer me?" />
<parameter key="message_farewell" value="Good bye |PLAYERNAME|!" />
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="weapons;armors;helmets;shields;boots list;amulets;dolls" />
<parameter key="keyword_reply1" value="I buy these weapons, daramanian mace, daramanian waraxe, guardian halberd, heavy machete, silver dagger and war axe." />
<parameter key="keyword_reply2" value="I buy these armors, dragon scale mail, dwarven armor, golden armor and leopard armor." />
<parameter key="keyword_reply3" value="I buy these helmets, beholder helmet and devil helmet." />
<parameter key="keyword_reply4" value="i buy these shields, bone shield, dark shield, demon shield, medusa shield and scarab shield." />
<parameter key="keyword_reply5" value="I buy these boots, crocodile boots, traper boots and steel boots." />
<parameter key="keyword_reply6" value="I buy these amulets, ancient amulet, crystal necklace, crystal ring, demonbone amulet, emerald amulet, golden ring, platinum amulet, ring of the sky, ruby necklace, scarab amulet and silver brooch." />
<parameter key="keyword_reply7" value="I buy these dolls, doll and voodoo doll." />
</parameters>
</npc>
Rashid.lua
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler
function onCreatureDisappear(cid) npcHandler
function onCreatureSay(cid, type, msg) npcHandler
function onThink() npcHandler
-- OTServ event handling functions end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'dragon scale mail'}, 2492, 40000, 'dragon scale mail')
shopModule:addSellableItem({'dwarven armor'}, 2503, 30000, 'dwarven armor')
shopModule:addSellableItem({'golden armor'}, 2466, 20000, 'golden armor')
shopModule:addSellableItem({'leopard armor'}, 3968, 1000, 'leopard armor')
shopModule:addSellableItem({'magic plate armor'}, 2472, 90000, 'magic plate armor')
shopModule:addSellableItem({'golden legs'}, 2470, 70000, 'golden legs')
shopModule:addSellableItem({'bone shield'}, 25480, 'bone shield')
shopModule:addSellableItem({'dark shield'}, 252400, 'dark shield')
shopModule:addSellableItem({'demon shield'}, 2520, 30000, 'demon shield')
shopModule:addSellableItem({'medusa shield'}, 2536, 9000, 'medusa shield')
shopModule:addSellableItem({'scarab shield'}, 2540, 2000, 'scarab shield')
shopModule:addSellableItem({'mastermind shield'}, 2514,50000, 'mastermind shield')
shopModule:addSellableItem({'beholder helmet'}, 3972, 7500, 'beholder helmet')
shopModule:addSellableItem({'devil helmet'}, 2462, 1000, 'devil helmet')
shopModule:addSellableItem({'crocodile boots'}, 3892, 1000, 'crocodile boots')
shopModule:addSellableItem({'traper boots'}, 2642000, 'traper boots')
shopModule:addSellableItem({'steel boots'}, 2645, 30000, 'steel boots')
shopModule:addSellableItem({'daramanian mace'}, 2439, 110, 'daramanian mace')
shopModule:addSellableItem({'daramanian waraxe'}, 2440, 1000, 'daramanian waraxe')
shopModule:addSellableItem({'guardian halberd'}, 2427, 11000, 'guardian halberd')
shopModule:addSellableItem({'heavy machete'}, 2442, 90, 'heavy machete')
shopModule:addSellableItem({'silver dagger'}, 2402, 500, 'silver dagger')
shopModule:addSellableItem({'war axe'}, 2454, 9000, 'war axe')
shopModule:addSellableItem({'ancient amulet'}, 2142, 200, 'ancient amulet')
shopModule:addSellableItem({'crystal necklace'}, 2125, 400, 'crystal necklace')
shopModule:addSellableItem({'crystal ring'}, 2124, 250, 'crystal ring')
shopModule:addSellableItem({'demonbone amulet'}, 2136, 32000, 'demonbone amulet')
shopModule:addSellableItem({'emerald bangle'}, 2127, 800, 'emerald bangle')
shopModule:addSellableItem({'golden ring'}, 2179, 8000, 'golden ring')
shopModule:addSellableItem({'platinum amulet'}, 2172500, 'platinum amulet')
shopModule:addSellableItem({'ring of the sky'}, 2123, 30000, 'ring of the sky')
shopModule:addSellableItem({'ruby necklace'}, 2133, 2000, 'ruby necklace')
shopModule:addSellableItem({'scarab amulet'}, 2135, 200, 'scarab amulet')
shopModule:addSellableItem({'silver brooch'}, 2134, 150,'silver brooch')
shopModule:addSellableItem({'doll'},2100 , 200, 'doll')
shopModule:addSellableItem({'voodoo doll'}, 3955, 400, 'voodoo doll')
shopModule:addSellableItem({'boots of haste'}, 2195, 30000, 'boots of haste')
npcHandler:addModule(FocusModule:new())