Reah
New Member
- Joined
- Jul 7, 2008
- Messages
- 87
- Reaction score
- 0
Im using The Forgotten Server Version 0.3.1 Patch2
I got some nice npc but they're not working on this server...
I want u to help me change some lines to work. Then i will change all my npcs like this...
Ok. Here is to script of my Runes Shop ;p
I got some errors. I tried to change the letters in shopModule to ShopModule that i saw in modules.lua but i get new errors... Now i tried to fix error, but i'm realy noob in scripts... Never did npc.
I got some nice npc but they're not working on this server...
I want u to help me change some lines to work. Then i will change all my npcs like this...
Ok. Here is to script of my Runes Shop ;p
Code:
---------holy missile------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
ShopModule:addBuyableItem({'spellbook'}, 2175, 150, 1, 'spellbook')
ShopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 1, 'magic lightwand')
shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion')
ShopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion')
ShopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion')
ShopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion')
ShopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion')
ShopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion')
ShopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion')
ShopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion')
ShopModule:addSellableItem({'normal flask'}, 7636, 5, 'empty small potion flask')
ShopModule:addSellableItem({'strong flask'}, 7634, 10, 'empty strong potion flask')
ShopModule:addSellableItem({'great flask'}, 7635, 15, 'empty great potion flask')
ShopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')
ShopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune')
ShopModule:addBuyableItem({'antidote'}, 2266, 65, 1, 'antidote rune')
ShopModule:addBuyableItem({'avalanche'}, 2274, 180, 4, 'avalanche rune')
ShopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune')
ShopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune')
ShopModule:addBuyableItem({'desintegrate'}, 2310, 80, 3, 'desintegrate rune')
ShopModule:addBuyableItem({'destroy field'}, 2261, 45, 3, 'destroy field')
ShopModule:addBuyableItem({'energy bomb'}, 2262, 325, 2, 'energy bomb rune')
ShopModule:addBuyableItem({'energy field'}, 2277, 115, 3, 'energy field')
ShopModule:addBuyableItem({'energy wall'}, 2279, 340, 4, 'energy wall rune')
ShopModule:addBuyableItem({'explosion'}, 2313, 190, 6, 'explosion rune')
ShopModule:addBuyableItem({'fire bomb'}, 2305, 235, 2, 'fire bomb rune')
ShopModule:addBuyableItem({'fire field'}, 2301, 85, 3, 'fire field rune')
ShopModule:addBuyableItem({'fire wall'}, 2303, 245, 4, 'fire wall rune')
ShopModule:addBuyableItem({'fireball'}, 2302, 150, 5, 'fire ball')
ShopModule:addBuyableItem({'great fireball'}, 2304, 180, 4, 'great fireball rune')
ShopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 10, 'heavy magic missile rune')
ShopModule:addBuyableItem({'icicle'}, 2271, 150, 5, 'icicle rune')
ShopModule:addBuyableItem({'intense healing'}, 2265, 95, 1, 'intense healing rune')
ShopModule:addBuyableItem({'light magic missile'}, 2287, 40, 10, 'light magic missile rune')
ShopModule:addBuyableItem({'magic wall'}, 2293, 350, 3, 'magic wall rune')
ShopModule:addBuyableItem({'paralyze'}, 2278, 700, 1, 'paralyze rune')
ShopModule:addBuyableItem({'poison bomb'}, 2286, 170, 2, 'poison bomb rune')
ShopModule:addBuyableItem({'poison field'}, 2285, 65, 3, 'poison field')
ShopModule:addBuyableItem({'poison wall'}, 2289, 210, 4, 'poison wall rune')
ShopModule:addBuyableItem({'soulfire'}, 2308, 140, 3, 'soulfire rune')
ShopModule:addBuyableItem({'stalagmite'}, 2292, 120, 10, 'stalagmite rune')
ShopModule:addBuyableItem({'stone shower'}, 2288, 150, 4, 'stoneshower rune')
ShopModule:addBuyableItem({'sudden death'}, 2268, 325, 3, 'sudden death rune')
ShopModule:addBuyableItem({'thunderstorm'}, 2268, 150, 4, 'thunderstorm rune')
ShopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune')
ShopModule:addBuyableItem({'wild growth'}, 2269, 320, 2, 'wild growth rune')
ShopModule:addBuyableItemContainer({'bp blank rune'}, 1988, 2260, 220, 1, 'bp blank rune')
ShopModule:addBuyableItemContainer({'bp animate dead'}, 1998, 2316, 7520, 1, 'bp animate dead rune')
ShopModule:addBuyableItemContainer({'bp antidote'}, 2003, 2266, 1320, 1, 'bp antidote rune')
ShopModule:addBuyableItemContainer({'bp avalanche'}, 2002, 2274, 3620, 4, 'bp avalanche rune')
ShopModule:addBuyableItemContainer({'bp chameleon'}, 1998, 2291, 4220, 1, 'bp chameleon rune')
ShopModule:addBuyableItemContainer({'bp convince creature'}, 1998, 2290, 1620, 1, 'bp convince creature rune')
ShopModule:addBuyableItemContainer({'bp desintegrate'}, 2001, 2310, 1620, 3, 'bp desintegrate rune')
ShopModule:addBuyableItemContainer({'bp destroy field'}, 2003, 2261, 920, 3, 'bp destroy field')
ShopModule:addBuyableItemContainer({'bp energy bomb'}, 2003, 2262, 6520, 2, 'bp energy bomb rune')
ShopModule:addBuyableItemContainer({'bp energy field'}, 1998, 2277, 2320, 3, 'bp energy field')
ShopModule:addBuyableItemContainer({'bp energy wall'}, 2002, 2279, 6820, 4, 'bp energy wall rune')
ShopModule:addBuyableItemContainer({'bp explosion'}, 2001, 2313, 3820, 6, 'bp explosion rune')
ShopModule:addBuyableItemContainer({'bp fire bomb'}, 2000, 2305, 4720, 2, 'bp fire bomb rune')
ShopModule:addBuyableItemContainer({'bp fire field'}, 2000, 2301, 1720, 3, 'bp fire field rune')
ShopModule:addBuyableItemContainer({'bp fire wall'}, 2000, 2303, 4920, 4, 'bp fire wall rune')
ShopModule:addBuyableItemContainer({'bp fireball'}, 2000, 2302, 3020, 5, 'bp fire ball')
ShopModule:addBuyableItemContainer({'bp great fireball'}, 2000, 2304, 3620, 4, 'bp great fireball rune')
ShopModule:addBuyableItemContainer({'bp heavy magic missile'}, 2001, 2311, 2420, 10, 'bp heavy magic missile rune')
ShopModule:addBuyableItemContainer({'bp icicle'}, 2002, 2271, 3020, 5, 'bp icicle rune')
ShopModule:addBuyableItemContainer({'bp intense healing'}, 2003, 2265, 1920, 1, 'bp intense healing rune')
ShopModule:addBuyableItemContainer({'bp light magic missile'}, 1998, 2287, 820, 10, 'bp light magic missile rune')
ShopModule:addBuyableItemContainer({'bp magic wall'}, 1999, 2293, 7020, 3, 'bp magic wall rune')
ShopModule:addBuyableItemContainer({'bp paralyze'}, 2002, 2278, 1420, 1, 'bp paralyze rune')
ShopModule:addBuyableItemContainer({'bp poison bomb'}, 1998, 2286, 3420, 2, 'bp poison bomb rune')
ShopModule:addBuyableItemContainer({'bp poison field'}, 1998, 2285, 1320, 3, 'bp poison field')
ShopModule:addBuyableItemContainer({'bp poison wall'}, 1998, 2289, 4220, 4, 'bp poison wall rune')
ShopModule:addBuyableItemContainer({'bp soulfire'}, 2000, 2308, 2820, 3, 'bp soulfire rune')
ShopModule:addBuyableItemContainer({'bp stalagmite'}, 1998, 2292, 2400, 10, 'bp stalagmite rune')
ShopModule:addBuyableItemContainer({'bp stone shower'}, 1999, 2288, 3020, 4, 'bp stoneshower rune')
ShopModule:addBuyableItemContainer({'bp sudden death'}, 2003, 2268, 6520, 3, 'bp sudden death rune')
ShopModule:addBuyableItemContainer({'bp thunderstorm'}, 1999, 2268, 3020, 4, 'bp thunderstorm rune')
ShopModule:addBuyableItemContainer({'bp ultimate healing'}, 2002, 2273, 3520, 1, 'bp ultimate healing rune')
ShopModule:addBuyableItemContainer({'bp wild growth'}, 2002, 2269, 6420, 2, 'bp wild growth rune')
ShopModule:addBuyableItemContainer({'bp health potion'}, 2000, 7618, 45, 1, 'bp health potion')
ShopModule:addBuyableItemContainer({'bp mana potion'}, 2001, 7620, 50, 1, 'bp mana potion')
ShopModule:addBuyableItemContainer({'bp strong health'}, 2000, 7588, 100, 1, 'bp strong health potion')
ShopModule:addBuyableItemContainer({'bp strong mana'}, 2001, 7589, 80, 1, 'bp strong mana potion')
ShopModule:addBuyableItemContainer({'bp great health'}, 2000, 7591, 190, 1, 'bp great health potion')
ShopModule:addBuyableItemContainer({'bp great mana'}, 2001, 7590, 120, 1, 'bp great mana potion')
ShopModule:addBuyableItemContainer({'bp great spirit'}, 1988, 8472, 190, 1, 'bp great spirit potion')
ShopModule:addBuyableItemContainer({'bp ultimate health'}, 2000, 8473, 310, 1, 'bp ultimate health potion')
ShopModule:addBuyableItem({'wand of vortex'}, 2190, 500, 1, 'wand of vortex')
ShopModule:addBuyableItem({'wand of dragonbreath'}, 2191, 1000, 1, 'wand of dragonbreath')
ShopModule:addBuyableItem({'wand of decay'}, 2188, 5000, 1, 'wand of decay')
ShopModule:addBuyableItem({'wand of draconia'}, 8921, 7500, 1, 'wand of draconia')
ShopModule:addBuyableItem({'wand of cosmic energy'}, 2189, 10000, 1, 'wand of cosmic energy')
ShopModule:addBuyableItem({'wand of inferno'}, 2187, 15000, 1, 'wand of inferno')
ShopModule:addBuyableItem({'wand of starstorm'}, 8920, 18000, 1, 'wand of starstorm')
ShopModule:addBuyableItem({'wand of voodoo'}, 8922, 22000, 1, 'wand of voodoo')
ShopModule:addBuyableItem({'snakebite rod'}, 2182, 500, 1, 'snakebite rod')
ShopModule:addBuyableItem({'moonlight rod'}, 2186, 1000, 1, 'moonlight rod')
ShopModule:addBuyableItem({'necrotic rod'}, 2185, 5000, 1, 'necrotic rod')
ShopModule:addBuyableItem({'northwind rod'}, 8911, 7500, 1, 'northwind rod')
ShopModule:addBuyableItem({'terra rod'}, 2181, 10000, 1, 'terra rod')
ShopModule:addBuyableItem({'hailstorm rod'}, 2183, 15000, 1, 'hailstorm rod')
ShopModule:addBuyableItem({'springsprout rod'}, 8912, 18000, 1, 'springsprout rod')
ShopModule:addBuyableItem({'underworld rod'}, 8910, 22000, 1, 'underworld rod')
ShopModule:addSellableItem({'wand of vortex'}, 2190, 500, 1, 'wand of vortex')
ShopModule:addSellableItem({'wand of dragonbreath'}, 2191, 1000, 1, 'wand of dragonbreath')
ShopModule:addSellableItem({'wand of decay'}, 2188, 5000, 1, 'wand of decay')
ShopModule:addSellableItem({'wand of draconia'}, 8921, 7500, 1, 'wand of draconia')
ShopModule:addSellableItem({'wand of cosmic energy'}, 2189, 10000, 1, 'wand of cosmic energy')
ShopModule:addSellableItem({'wand of inferno'},2187, 15000, 1, 'wand of inferno')
ShopModule:addSellableItem({'wand of starstorm'}, 8920, 18000, 1, 'wand of starstorm')
ShopModule:addSellableItem({'wand of voodoo'}, 8922, 22000, 1, 'wand of voodoo')
ShopModule:addSellableItem({'snakebite rod'}, 2182, 500, 1, 'snakebite rod')
ShopModule:addSellableItem({'moonlight rod'}, 2186, 1000, 1, 'moonlight rod')
ShopModule:addSellableItem({'necrotic rod'}, 2185, 5000, 1, 'necrotic rod')
ShopModule:addSellableItem({'northwind rod'}, 8911, 7500, 1, 'northwind rod')
ShopModule:addSellableItem({'terra rod'}, 2181, 10000, 1, 'terra rod')
ShopModule:addSellableItem({'hailstorm rod'}, 2183, 15000, 1, 'hailstorm rod')
ShopModule:addSellableItem({'springsprout rod'}, 8912, 18000, 1, 'springsprout rod')
ShopModule:addSellableItem({'underworld rod'}, 8910, 22000, 1, 'underworld rod')
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}
if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then
if(isSorcerer(cid) or isDruid(cid)) then
if(getPlayerStorageValue(cid, 30002) == -1) then
selfSay('So you ask me for a {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '} to begin your advanture?', cid)
talkState[talkUser] = 1
else
selfSay('What? I have already gave you one {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '}!', cid)
end
else
selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid)
end
elseif(msgcontains(msg, 'yes')) then
if(talkState[talkUser] == 1) then
doPlayerAddItem(cid, items[getPlayerVocation(cid)], 1)
selfSay('Here you are young adept, take care yourself.', cid)
setPlayerStorageValue(cid, 30002, 1)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
selfSay('Ok then.', cid)
talkState[talkUser] = 0
end
return true
end
local ShopModule = ShopModule:new()
npcHandler:addModule(ShopModule)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Code:
[14/02/2009 07:54:33] data/npc/lib/npcsystem/modules.lua:743: attempt to index field 'npcHandler' (a nil value)
[14/02/2009 07:54:33] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/runes.lua
[14/02/2009 07:54:33] data/npc/scripts/runes.lua:5: unexpected symbol near '.'