What's new

Problem z npc

Status
Not open for further replies.

aveer

User
Joined
Jun 22, 2008
Messages
37
Reaction score
0
Mam problem z npc. Gdy chce kupic jaki? przedmiot npc m?wi ze nie mam kasy, a w bp mam. Tak samo jest w Trade. Nie pisze ile mam kasy i ile dany przedmiot kosztuje. My?le, ?e to jest powszechny problem bo kiedys gdy pr?bowa?em za?o?y? ots na 8.60 mia?em to samo. Czy kto? m?g?by mi pom?c?
 

ELo0n

No to cyk.
Joined
Aug 31, 2010
Messages
296
Reaction score
46
Odp: Problem z npc

Chyba chodzi o g??wny skrypt : ]
w npc/scripts masz plik default.lua
musi on wygl?da? tak :
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler: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

npcHandler:addModule(FocusModule:new())
Nast?pnie npc ma wygl?da? tak :
<?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,4000;boots of haste,2195,40000;golden boots,2646,100000;"/>
</parameters>
</npc>
To przyk?adowy npc , kt?ry kupuje i sprzedaje itemy :)
<parameter key="shop_sellable"
To co ty sprzedajesz temu npc
<parameter key="shop_buyable"
To co kupujesz u npc :)
battle hammer,2417,60
nazwa itemu, id, cena
Dzi?kuje , mam nadzieje ?e pomog?em ;)
 
Status
Not open for further replies.
Top