Ir para conteúdo

Featured Replies

Postado

Fala galera!

O NPC do meu servidor está bugado!

por exemplo, vou comprar apenas 100 uh, ele compra 200... assim funciona na hora de vender tb!

ta prejudicando muito os players! quem puder ajudar, agradeço!

tumblr_o70wteR8521r9n6kzo1_400.gif

Postado

verefica se no NPC.XML também tem algo de BUY/SELL

isso acontecia comigo, eu comprava 1 wand vinha duas, ou então troca todo LUA;

 

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Eryn" script="runes.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100" />
	<look type="136" head="58" body="84" legs="86" feet="114" addons="0" />
	<parameters>
		<parameter key="module_shop" value="1" />
		<parameter key="shop_buyable" value="
			avalanche rune,2274,25;
			blank rune,2260,10;
			chameleon rune,2291,210;
			convince creature rune,2290,80;
			cure poison rune,2266,65;
			destroy field rune,2261,15;
			energy field rune,2277,38;
			energy wall rune,2279,85;
			explosion rune,2313,31;
			fire bomb rune,2305,55;
			fire field rune,2301,28;
			fire wall rune,2303,61;
			great fireball rune,2304,45;
			great health potion,7591,190;
			great mana potion,7590,120;
			great spirit potion,8472,190;
			health potion,7618,45;
			heavy magic missile rune,2311,12;
			intense healing rune,2265,95;
			light magic missile rune,2287,4;
			mana potion,7620,50;
			moonlight rod,2186,1000;
			necrotic rod,2185,5000;
			poison field rune,2285,21;
			poison wall rune,2289,52;
			snakebite rod,2182,500;
			spellbook,2175,150;
			stalagmite rune,2292,12;
			strong health potion,7588,100;
			strong mana potion,7589,80;
			sudden death rune,2268,50;
			terra rod,2181,10000;
			
			Hailstorm Rod,2183,15000;
			Wand of Voodoo,8922,22000;
			
			ultimate healing rune,2273,175;
			ultimate health potion,8473,310;
			wand of cosmic energy,2189,10000;
			wand of decay,2188,5000;
			wand of dragonbreath,2191,1000;
			wand of vortex,2190,500;" />
		<parameter key="shop_sellable" value="
			ankh, 2193, 100;
			hailstorm rod, 2183, 3000;
			moonlight rod, 2186, 200;
			mysterious fetish, 2194, 50;
			necrotic rod, 2185, 1000;
			northwind rod, 8911, 1500;
			snakebite rod, 2182, 100;
			springsprout rod, 8912, 3600;
			terra rod, 2181, 2000;
			underworld rod, 8910, 4400;
			stone skin amulet, 2197, 500;
			wand of cosmic energy, 2189, 2000;
			wand of decay, 2188, 1000;
			wand of dragonbreath, 2191, 200;
			wand of inferno, 2187, 3000;
			wand of vortex, 2190, 100;
			wand of draconia, 8921, 1500;
			wand of starstorm, 8920, 3600;
			wand of voodoo, 8922, 4400;
			magic light wand, 2162, 35;
			life crystal, 4851, 50;
			mind stone, 2178, 100" />
	</parameters>
</npc>
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

keywordHandler:addKeyword({'magic'}, StdModule.say, {npcHandler = npcHandler, text = "Okay, then just browse through all of my wares."})

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end
	local player = Player(cid)
	local items = {[1] = 2190, [2] = 2182}
	local itemId = items[player:getVocation():getBase():getId()]
	if msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand') then
		if player:isMage() then
			if player:getStorageValue(Storage.firstMageWeapon) == -1 then
				npcHandler:say('So you ask me for a {' .. ItemType(itemId):getName() .. '} to begin your adventure?', cid)
				npcHandler.topic[cid] = 1
			else
				npcHandler:say('What? I have already gave you one {' .. ItemType(itemId):getName() .. '}!', cid)
			end
		else
			npcHandler:say('Sorry, you aren\'t a druid either a sorcerer.', cid)
		end
	elseif msgcontains(msg, 'yes') then
		if npcHandler.topic[cid] == 1 then
			player:addItem(itemId, 1)
			npcHandler:say('Here you are young adept, take care yourself.', cid)
			player:setStorageValue(Storage.firstMageWeapon, 1)
		end
		npcHandler.topic[cid] = 0
	elseif msgcontains(msg, 'no') and npcHandler.topic[cid] == 1 then
		npcHandler:say('Ok then.', cid)
		npcHandler.topic[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, "Welcome |PLAYERNAME|! Whats your need?")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye, |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye, |PLAYERNAME|.")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just browse through my wares. Or do you want to look only at {potions}, {wands} or {runes}?")
npcHandler:addModule(FocusModule:new())

 

Editado por Jobs (veja o histórico de edições)

Postado
  • Autor

o buy fica no xml e o sell, no .lua, mas acontece do mesmo jeito!

xml:

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Traveller" nameDescription="Traveller" script="traveller.lua" walkinterval="2000" floorchange="1" skull="red">
    <health now="100" max="100"/>
    <look type="580" head="114" body="78" legs="76" feet="115" addons="3"/>
    <parameters>
            <parameter key="module_shop" value="1" />
        <parameter key="message_greet" value="Hello |PLAYERNAME|.I am a dwarf and a great buyer of rarities tell {trade} to see what I am interested in buying! "/>
        <parameter key="message_alreadyfocused" value="You are drunk? I'm talking with you!"/>
        <parameter key="message_farewell" value="Bye, See you later!"/>
        <parameter key="shop_buyable" value="dark sudden death,2263,10000;dark explosion rune,2312,5000"/>
    </parameters>
</npc>

 

.lua

Spoiler

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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

---------------------------------------- crossbow ---------------------------------------- 
shopModule:addSellableItem({'arbalest'},        5803,  500000,      'arbalest')
shopModule:addSellableItem({'elven crossbow'},          12711, 1000000,     'elven crossbow')
shopModule:addSellableItem({'celestial crossbow'},      12710, 1500000,     'celestial crossbow')

---------------------------------------- axes ----------------------------------------
shopModule:addSellableItem({"ravager's axe"},           2443,  200000,     "ravager's axe")
shopModule:addSellableItem({'stonecutter axe'},         2431,  300000,     'stonecutter axe')
shopModule:addSellableItem({"great axe"},                  2415,  500000,     'great axe')
shopModule:addSellableItem({'toguro hammer'},           13028, 1000000,    'toguro hammer')
shopModule:addSellableItem({'adamantiun axe'},          12718, 3000000,    'adamantiun axe')
shopModule:addSellableItem({'mithril axe'},              13149, 2000000,    'mithril axe')
shopModule:addSellableItem({'diamond axe '},              13019, 2000000,    'diamond axe ')
shopModule:addSellableItem({'dragonslayer axe'},        12719, 3000000,    'dragonslayer axe')
shopModule:addSellableItem({'axe of thor'},                13018, 3000000,    'axe of thor')
shopModule:addSellableItem({'dommed axe'},              12721, 6000000,    'dommed axe')
shopModule:addSellableItem({'jomungard axe'},           12722, 3000000,    'jomungard axe')
shopModule:addSellableItem({'magma axe'},                  12723, 4000000,    'magma axe')
--shopModule:addSellableItem({'bloodhunter axe'},         12724, 5200000,    'bloodhunter axe')

---------------------------------------- clubs ---------------------------------------- 
shopModule:addSellableItem({'demonbone'},                  7431,  50000,       'demonbone')
shopModule:addSellableItem({'hammer of wrath'},         2444,  200000,      'hammer of wrath')
shopModule:addSellableItem({'orcish maul'},              7392,  200000,      'orcish maul')
shopModule:addSellableItem({'heavy mace'},              2452,  300000,      'heavy mace')
shopModule:addSellableItem({'thunder hammer'},          2421,  100000,      'thunder hammer')
shopModule:addSellableItem({'mace of fury'},              12729, 2500000,     'mace of fury')
shopModule:addSellableItem({'greatsmith hammer'},       12726, 3000000,     'greatsmith hammer')
shopModule:addSellableItem({'hammer of hercules'},      13011, 6000000,     'hammer of hercules')

---------------------------------------- fists ---------------------------------------- 
shopModule:addSellableItem({'iron gloves'},              13016, 3000000,     'iron gloves')
shopModule:addSellableItem({'four blades'},              13015, 3000000,     'four blades')
shopModule:addSellableItem({'golden gloves'},              13017, 3000000,     'golden gloves')
shopModule:addSellableItem({'spyked grinder'},          13013, 1500000,     'spyked grinder')
shopModule:addSellableItem({'fist butcher'},              13014, 100000,      'fist butcher')

---------------------------------------- swords ---------------------------------------- 
shopModule:addSellableItem({'magic longsword'},         2390,  200000,      'magic longsword')
shopModule:addSellableItem({'magic sword'},              2400,  100000,      'magic sword')
shopModule:addSellableItem({'warlord sword'},              2408,  100000,      'warlord sword')
shopModule:addSellableItem({'helical sword'},             13040, 2000000,     'helical sword')
shopModule:addSellableItem({'divine sword'},             12756, 6000000,     'divine sword')
shopModule:addSellableItem({'alabarda of fire'},        12757, 2500000,     'alabarda of fire')
shopModule:addSellableItem({'sword of teseu'},          12758, 2000000,     'sword of teseu')
shopModule:addSellableItem({'thurdillion sword'},       12759, 5000000,     'thurdillion sword')


---------------------------------------- helmets ---------------------------------------- 

shopModule:addSellableItem({'winged helemt'},              2474,  100000,    'winged helmet')
shopModule:addSellableItem({'magic plate helmet'},      12775, 500000,    'magic plate helmet')
shopModule:addSellableItem({'infantry helmet'},         13124, 500000,    'infantry helmet')
shopModule:addSellableItem({'elven helmet'},              2506,  1000000,   'elven helmet')
shopModule:addSellableItem({'mind helmet'},              12773, 1000000,   'mind helmet')
shopModule:addSellableItem({'horned helmet'},              2496,  1000000,   'horned helmet')
shopModule:addSellableItem({'gladiator helmet'},        12776, 1500000,   'gladiator helmet')
shopModule:addSellableItem({'venom scale helmet'},      12790, 1800000,   'venom scale helmet')
shopModule:addSellableItem({'phoenix helmet'},          12771, 2000000,   'phoenix helmet')
shopModule:addSellableItem({'darkness scale helmet'},   12797, 2300000,   'darkness scale helmet')
shopModule:addSellableItem({'magic golden helmet'},     12791, 3000000,   'magic golden helmet')
shopModule:addSellableItem({'demoniac helmet'},         12772, 3000000,   'demoniac helmet')
shopModule:addSellableItem({"naz'gul scale helmet"},    12784, 4000000,   "naz'gul scale helmet")
shopModule:addSellableItem({'saruman hat'},              12777, 4000000,   'saruman hat')
shopModule:addSellableItem({'soul helmet'},              12778, 5000000,   'soul helmet')
shopModule:addSellableItem({'legendary helmet'},        12779, 6000000,   'legendary helmet')

---------------------------------------- armors ----------------------------------------


shopModule:addSellableItem({'spyked armor'},              12799, 250000,      'spyked armor')
shopModule:addSellableItem({'elven armor'},              12815, 250000,      'elven armor')
shopModule:addSellableItem({'rustic armor'},              12810, 300000,      'rustic armor')
shopModule:addSellableItem({'arcane robe'},              2508,  500000,      'arcane robe') 
shopModule:addSellableItem({'elven armor'},              2505,  1000000,     'elven armor')
shopModule:addSellableItem({'mind robe'},                  12824, 1000000,     'mind robe')
shopModule:addSellableItem({'horned armor'},              12800, 1500000,     'horned armor')
shopModule:addSellableItem({'cursed armor'},              12809, 2000000,     'cursed armor')
shopModule:addSellableItem({'swamplair armor'},         8880, 2000000,     'swamplair armor')
shopModule:addSellableItem({'gladiator armor'},         12804, 2000000,     'gladiator armor')
shopModule:addSellableItem({'venom scale robe'},        12822, 2300000,     'venom scale robe')
shopModule:addSellableItem({'phoenix armor'},              12823, 2300000,     'phoenix armor')
shopModule:addSellableItem({'demoniac robe'},              12813, 2500000,     'demoniac robe')
shopModule:addSellableItem({'blacksmith armor'},        12659, 2500000,     'blacksmith armor')
shopModule:addSellableItem({'shadow armor'},            12801, 3000000,     'shadow armor')
shopModule:addSellableItem({'magic golden armor'},      12806, 4000000,     'magic golden armor')
shopModule:addSellableItem({"naz'gul scale mail"},      12807, 5000000,     "naz'gul scale mail")
shopModule:addSellableItem({'soul armor'},              12805, 6000000,     'soul armor')
shopModule:addSellableItem({'saruman robe'},            12825, 6000000,     'saruman robe')
shopModule:addSellableItem({'legendary armor'},         12808, 7000000,     'legendary armor')

---------------------------------------- Legs ----------------------------------------
shopModule:addSellableItem({'magic plate legs'},     12820, 500000,    'magic plate legs')
shopModule:addSellableItem({'elven legs'},              2507,  700000,    'elven legs')
shopModule:addSellableItem({'gladiator legs'},       12818, 1000000,   'gladiator legs')
shopModule:addSellableItem({'magic golden legs'},    13431, 2000000,   'magic golden legs')
shopModule:addSellableItem({"naz'gul scale legs"},   12817, 3000000,   "naz'gul scale legs")
shopModule:addSellableItem({'soul legs'},            12816, 4000000,   'soul legs')
shopModule:addSellableItem({'saruman legs'},         12819, 5000000,   'saruman legs')
shopModule:addSellableItem({'legendary legs'},       12821, 6000000,   'legendary legs')

---------------------------------------- Boots ----------------------------------------

shopModule:addSellableItem({'shyne boots'},             12997,  250000,    'shyne boots')
shopModule:addSellableItem({'soft boots'},              6132,  300000,     'soft boots')
shopModule:addSellableItem({'firewalker boots'},        9933,  700000,     'firewalker boots')

---------------------------------------- shields ---------------------------------------- 

shopModule:addSellableItem({'plasma shield'},              2542 , 200000,     'plasma shield')
shopModule:addSellableItem({'great shield'},              2522 , 300000,     'great shield')
shopModule:addSellableItem({'blessed shield'},          2523 , 400000,     'blessed shield')
shopModule:addSellableItem({'mind shield'},              12829, 500000,     'mind shield')
shopModule:addSellableItem({'darkness shield'},         12832, 700000,     'darkness shield')
shopModule:addSellableItem({'horned shield'},              12838, 800000,     'horned shield')
shopModule:addSellableItem({'toguro shield'},          12835,  1000000,    'toguro shield')
shopModule:addSellableItem({'phoenix shield'},          12837,  1000000,    'phoenix shield')
shopModule:addSellableItem({'venom scale shield'},      12836, 1000000,    'venom scale shield')
shopModule:addSellableItem({'balrog shield'},             12831, 1300000,    'balrog shield')
shopModule:addSellableItem({'shadow shield'},              12839, 1500000,    'shadow shield')

---------------------------------------- wands ---------------------------------------- 
shopModule:addSellableItem({'arcane wand'},              2453, 100000,       'arcane wand')
shopModule:addSellableItem({'mind wand'},                  7426, 500000,       'mind wand')
shopModule:addSellableItem({'venom wand'},              12739, 1500000,     'venom wand')
shopModule:addSellableItem({'phoenix wand'},              12740, 1700000,     'phoenix wand')
shopModule:addSellableItem({'persefone staff'},           12741, 3000000,     'persefone staff')
shopModule:addSellableItem({'magic plague wand'},       13126, 4000000,     'magic plague wand')
shopModule:addSellableItem({'saruman staff'},              12736, 6000000,     'saruman staff')

local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, '') or msgcontains(msg, '')) then
if(isSorcerer(cid) or isDruid(cid)) then
if(getPlayerStorageValue(cid, 30002) <= 0) 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('...', cid)
end
elseif(msgcontains(msg, '')) 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, '') and isInArray({1}, talkState[talkUser])) then
selfSay('Ok then.', cid)
talkState[talkUser] = 0
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

@Jobs

tumblr_o70wteR8521r9n6kzo1_400.gif

Postado
3 horas atrás, Yamborghini disse:

o buy fica no xml e o sell, no .lua, mas acontece do mesmo jeito!

xml:

  Mostrar conteúdo oculto

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Traveller" nameDescription="Traveller" script="traveller.lua" walkinterval="2000" floorchange="1" skull="red">
    <health now="100" max="100"/>
    <look type="580" head="114" body="78" legs="76" feet="115" addons="3"/>
    <parameters>
            <parameter key="module_shop" value="1" />
        <parameter key="message_greet" value="Hello |PLAYERNAME|.I am a dwarf and a great buyer of rarities tell {trade} to see what I am interested in buying! "/>
        <parameter key="message_alreadyfocused" value="You are drunk? I'm talking with you!"/>
        <parameter key="message_farewell" value="Bye, See you later!"/>
        <parameter key="shop_buyable" value="dark sudden death,2263,10000;dark explosion rune,2312,5000"/>
    </parameters>
</npc>

 

.lua

  Ocultar conteúdo

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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

---------------------------------------- crossbow ---------------------------------------- 
shopModule:addSellableItem({'arbalest'},        5803,  500000,      'arbalest')
shopModule:addSellableItem({'elven crossbow'},          12711, 1000000,     'elven crossbow')
shopModule:addSellableItem({'celestial crossbow'},      12710, 1500000,     'celestial crossbow')

---------------------------------------- axes ----------------------------------------
shopModule:addSellableItem({"ravager's axe"},           2443,  200000,     "ravager's axe")
shopModule:addSellableItem({'stonecutter axe'},         2431,  300000,     'stonecutter axe')
shopModule:addSellableItem({"great axe"},                  2415,  500000,     'great axe')
shopModule:addSellableItem({'toguro hammer'},           13028, 1000000,    'toguro hammer')
shopModule:addSellableItem({'adamantiun axe'},          12718, 3000000,    'adamantiun axe')
shopModule:addSellableItem({'mithril axe'},              13149, 2000000,    'mithril axe')
shopModule:addSellableItem({'diamond axe '},              13019, 2000000,    'diamond axe ')
shopModule:addSellableItem({'dragonslayer axe'},        12719, 3000000,    'dragonslayer axe')
shopModule:addSellableItem({'axe of thor'},                13018, 3000000,    'axe of thor')
shopModule:addSellableItem({'dommed axe'},              12721, 6000000,    'dommed axe')
shopModule:addSellableItem({'jomungard axe'},           12722, 3000000,    'jomungard axe')
shopModule:addSellableItem({'magma axe'},                  12723, 4000000,    'magma axe')
--shopModule:addSellableItem({'bloodhunter axe'},         12724, 5200000,    'bloodhunter axe')

---------------------------------------- clubs ---------------------------------------- 
shopModule:addSellableItem({'demonbone'},                  7431,  50000,       'demonbone')
shopModule:addSellableItem({'hammer of wrath'},         2444,  200000,      'hammer of wrath')
shopModule:addSellableItem({'orcish maul'},              7392,  200000,      'orcish maul')
shopModule:addSellableItem({'heavy mace'},              2452,  300000,      'heavy mace')
shopModule:addSellableItem({'thunder hammer'},          2421,  100000,      'thunder hammer')
shopModule:addSellableItem({'mace of fury'},              12729, 2500000,     'mace of fury')
shopModule:addSellableItem({'greatsmith hammer'},       12726, 3000000,     'greatsmith hammer')
shopModule:addSellableItem({'hammer of hercules'},      13011, 6000000,     'hammer of hercules')

---------------------------------------- fists ---------------------------------------- 
shopModule:addSellableItem({'iron gloves'},              13016, 3000000,     'iron gloves')
shopModule:addSellableItem({'four blades'},              13015, 3000000,     'four blades')
shopModule:addSellableItem({'golden gloves'},              13017, 3000000,     'golden gloves')
shopModule:addSellableItem({'spyked grinder'},          13013, 1500000,     'spyked grinder')
shopModule:addSellableItem({'fist butcher'},              13014, 100000,      'fist butcher')

---------------------------------------- swords ---------------------------------------- 
shopModule:addSellableItem({'magic longsword'},         2390,  200000,      'magic longsword')
shopModule:addSellableItem({'magic sword'},              2400,  100000,      'magic sword')
shopModule:addSellableItem({'warlord sword'},              2408,  100000,      'warlord sword')
shopModule:addSellableItem({'helical sword'},             13040, 2000000,     'helical sword')
shopModule:addSellableItem({'divine sword'},             12756, 6000000,     'divine sword')
shopModule:addSellableItem({'alabarda of fire'},        12757, 2500000,     'alabarda of fire')
shopModule:addSellableItem({'sword of teseu'},          12758, 2000000,     'sword of teseu')
shopModule:addSellableItem({'thurdillion sword'},       12759, 5000000,     'thurdillion sword')


---------------------------------------- helmets ---------------------------------------- 

shopModule:addSellableItem({'winged helemt'},              2474,  100000,    'winged helmet')
shopModule:addSellableItem({'magic plate helmet'},      12775, 500000,    'magic plate helmet')
shopModule:addSellableItem({'infantry helmet'},         13124, 500000,    'infantry helmet')
shopModule:addSellableItem({'elven helmet'},              2506,  1000000,   'elven helmet')
shopModule:addSellableItem({'mind helmet'},              12773, 1000000,   'mind helmet')
shopModule:addSellableItem({'horned helmet'},              2496,  1000000,   'horned helmet')
shopModule:addSellableItem({'gladiator helmet'},        12776, 1500000,   'gladiator helmet')
shopModule:addSellableItem({'venom scale helmet'},      12790, 1800000,   'venom scale helmet')
shopModule:addSellableItem({'phoenix helmet'},          12771, 2000000,   'phoenix helmet')
shopModule:addSellableItem({'darkness scale helmet'},   12797, 2300000,   'darkness scale helmet')
shopModule:addSellableItem({'magic golden helmet'},     12791, 3000000,   'magic golden helmet')
shopModule:addSellableItem({'demoniac helmet'},         12772, 3000000,   'demoniac helmet')
shopModule:addSellableItem({"naz'gul scale helmet"},    12784, 4000000,   "naz'gul scale helmet")
shopModule:addSellableItem({'saruman hat'},              12777, 4000000,   'saruman hat')
shopModule:addSellableItem({'soul helmet'},              12778, 5000000,   'soul helmet')
shopModule:addSellableItem({'legendary helmet'},        12779, 6000000,   'legendary helmet')

---------------------------------------- armors ----------------------------------------


shopModule:addSellableItem({'spyked armor'},              12799, 250000,      'spyked armor')
shopModule:addSellableItem({'elven armor'},              12815, 250000,      'elven armor')
shopModule:addSellableItem({'rustic armor'},              12810, 300000,      'rustic armor')
shopModule:addSellableItem({'arcane robe'},              2508,  500000,      'arcane robe') 
shopModule:addSellableItem({'elven armor'},              2505,  1000000,     'elven armor')
shopModule:addSellableItem({'mind robe'},                  12824, 1000000,     'mind robe')
shopModule:addSellableItem({'horned armor'},              12800, 1500000,     'horned armor')
shopModule:addSellableItem({'cursed armor'},              12809, 2000000,     'cursed armor')
shopModule:addSellableItem({'swamplair armor'},         8880, 2000000,     'swamplair armor')
shopModule:addSellableItem({'gladiator armor'},         12804, 2000000,     'gladiator armor')
shopModule:addSellableItem({'venom scale robe'},        12822, 2300000,     'venom scale robe')
shopModule:addSellableItem({'phoenix armor'},              12823, 2300000,     'phoenix armor')
shopModule:addSellableItem({'demoniac robe'},              12813, 2500000,     'demoniac robe')
shopModule:addSellableItem({'blacksmith armor'},        12659, 2500000,     'blacksmith armor')
shopModule:addSellableItem({'shadow armor'},            12801, 3000000,     'shadow armor')
shopModule:addSellableItem({'magic golden armor'},      12806, 4000000,     'magic golden armor')
shopModule:addSellableItem({"naz'gul scale mail"},      12807, 5000000,     "naz'gul scale mail")
shopModule:addSellableItem({'soul armor'},              12805, 6000000,     'soul armor')
shopModule:addSellableItem({'saruman robe'},            12825, 6000000,     'saruman robe')
shopModule:addSellableItem({'legendary armor'},         12808, 7000000,     'legendary armor')

---------------------------------------- Legs ----------------------------------------
shopModule:addSellableItem({'magic plate legs'},     12820, 500000,    'magic plate legs')
shopModule:addSellableItem({'elven legs'},              2507,  700000,    'elven legs')
shopModule:addSellableItem({'gladiator legs'},       12818, 1000000,   'gladiator legs')
shopModule:addSellableItem({'magic golden legs'},    13431, 2000000,   'magic golden legs')
shopModule:addSellableItem({"naz'gul scale legs"},   12817, 3000000,   "naz'gul scale legs")
shopModule:addSellableItem({'soul legs'},            12816, 4000000,   'soul legs')
shopModule:addSellableItem({'saruman legs'},         12819, 5000000,   'saruman legs')
shopModule:addSellableItem({'legendary legs'},       12821, 6000000,   'legendary legs')

---------------------------------------- Boots ----------------------------------------

shopModule:addSellableItem({'shyne boots'},             12997,  250000,    'shyne boots')
shopModule:addSellableItem({'soft boots'},              6132,  300000,     'soft boots')
shopModule:addSellableItem({'firewalker boots'},        9933,  700000,     'firewalker boots')

---------------------------------------- shields ---------------------------------------- 

shopModule:addSellableItem({'plasma shield'},              2542 , 200000,     'plasma shield')
shopModule:addSellableItem({'great shield'},              2522 , 300000,     'great shield')
shopModule:addSellableItem({'blessed shield'},          2523 , 400000,     'blessed shield')
shopModule:addSellableItem({'mind shield'},              12829, 500000,     'mind shield')
shopModule:addSellableItem({'darkness shield'},         12832, 700000,     'darkness shield')
shopModule:addSellableItem({'horned shield'},              12838, 800000,     'horned shield')
shopModule:addSellableItem({'toguro shield'},          12835,  1000000,    'toguro shield')
shopModule:addSellableItem({'phoenix shield'},          12837,  1000000,    'phoenix shield')
shopModule:addSellableItem({'venom scale shield'},      12836, 1000000,    'venom scale shield')
shopModule:addSellableItem({'balrog shield'},             12831, 1300000,    'balrog shield')
shopModule:addSellableItem({'shadow shield'},              12839, 1500000,    'shadow shield')

---------------------------------------- wands ---------------------------------------- 
shopModule:addSellableItem({'arcane wand'},              2453, 100000,       'arcane wand')
shopModule:addSellableItem({'mind wand'},                  7426, 500000,       'mind wand')
shopModule:addSellableItem({'venom wand'},              12739, 1500000,     'venom wand')
shopModule:addSellableItem({'phoenix wand'},              12740, 1700000,     'phoenix wand')
shopModule:addSellableItem({'persefone staff'},           12741, 3000000,     'persefone staff')
shopModule:addSellableItem({'magic plague wand'},       13126, 4000000,     'magic plague wand')
shopModule:addSellableItem({'saruman staff'},              12736, 6000000,     'saruman staff')

local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, '') or msgcontains(msg, '')) then
if(isSorcerer(cid) or isDruid(cid)) then
if(getPlayerStorageValue(cid, 30002) <= 0) 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('...', cid)
end
elseif(msgcontains(msg, '')) 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, '') and isInArray({1}, talkState[talkUser])) then
selfSay('Ok then.', cid)
talkState[talkUser] = 0
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

@Jobs

 

perdão, eu até vi, porém não entendo lua, vê se os amigos podem te ajudar.

@Sttorm @KotZletY

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.9k

Informação Importante

Confirmação de Termo