Inne Problem z NPC

Status
Zamknięty.

micito00

User
Zarejestrowany
Dołączył
Czerwiec 24, 2010
Posty
27
Liczba reakcji
1
Witam. Ot?? zrobi?em swojego OTS'a i mam taki jeden problem.
Jak id? do NPC np. Soya. Pisze HI .... Trade .... I wybieram item kt?ry chce sprzeda? i naciskam okey, i w tym problem ze tego itemu si? nie da sprzeda?
da si? jedynie za pomoc? napisania np. sell 5 royal helmet itd.. Prosi? bym o wasz? pomoc. Z g?ry dzi?kuje. Pozdrawiam.
 
Odp: Problem z NPC

Jaka wersja klienta?
Moze zamiesc swoj obecny skrypt?
 
Odp: Problem z NPC

Jest pod tibie 8.6
Z g?ry m?wi? ?e pr?bowa?em doda? z innego silnika i nie dzia?a, lub wgra? inny skrypt wyszukany w googlach.
Szczerz? m?wi?c jeszcze jestem "Zielony" w robieniu ots'a.

Skrypt :

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




Zapomnia?em doda? ?e jak b?d? naciska? okey na trade ?eby sprzeda? dany item na konsoli servera pojawia si? :

[29/09/2013 10:20:30] [Error - Npc interface]
[29/09/2013 10:20:30] (Unknown script file)
[29/09/2013 10:20:30] Description:
[29/09/2013 10:20:30] data/npc/lib/npcsystem/modules.lua:1229: bad argument #2 to 'error' (number expected, got string)
[29/09/2013 10:20:30] stack traceback:
[29/09/2013 10:20:30] [C]: in function 'error'
[29/09/2013 10:20:30] data/npc/lib/npcsystem/modules.lua:1229: in function 'callbackOnSell'
[29/09/2013 10:20:30] data/npc/lib/npcsystem/npchandler.lua:265: in function 'processModuleCallback'
[29/09/2013 10:20:30] data/npc/lib/npcsystem/npchandler.lua:450: in function 'onSell'
[29/09/2013 10:20:30] data/npc/lib/npcsystem/modules.lua:1296: in function <data/npc/lib/npcsystem/modules.lua:1295>
 
Ostatnia edycja:
Status
Zamknięty.
Back
Do góry