Ir para conteúdo

[Monster] [help]preciso De Um Npc Que Venda Moveis, Por Favor...


carlooos

Posts Recomendados

eu fiz um mas só funciono depois que eu coloquei no itens que davam para carregar na bag através dos item editor

 

se quiser tentar é assim

 

 

em em data/npc copie e cole um xml qualquer apague tudo e coloque isso

<npc name="Vendedor de Moveis" script="data/npc/scripts/moveis.lua" access="5" lookdir="1">

<health now="1000" max="1000"/>

<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>

</npc>

 

 

e depois va a poasta data/npcs/scripts copie um arquivo .lua qualuqer renomeie para moveis abra apague tudo dentro e coloque isso

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)

 

shopModule:addBuyableItem({'honey flower'}, 2103, 100, 'honey flower')

shopModule:addBuyableItem({'Potted Flower'}, 2104, 100, 'Potted flower')

 

shopModule:addBuyableItem({'Flower bowl'}, 2102, 100, 'Flower Bowl')

shopModule:addBuyableItem({'Bamboo Table'}, 3809, 100, 'health potion')

shopModule:addBuyableItem({'Pendulum Clock'}, 1728, 100, 'Pendulum Clock')

shopModule:addBuyableItem({'Sofa Chair'}, 1661, 100, 'Sofa Chair')

shopModule:addBuyableItem({'Table'}, 1615, 100, 'Table')

shopModule:addBuyableItem({'Chair'}, 1652, 100, 'Chair')

shopModule:addBuyableItem({'Barril'}, 1770, 100, 'Barril')

shopModule:addBuyableItem({'wooden box'}, 1739, 100, 'wooden box')

shopModule:addBuyableItem({'Lamp'}, 2064, 100, 'Lamp')

shopModule:addBuyableItem({'Small Table'}, 1619, 100, 'Small Table')

 

shopModule:addSellableItem({'Smal Round Table'}, 1616, 100, 'Round Table')

shopModule:addSellableItem({'Trough'}, 1775, 100, 'Trough')

shopModule:addSellableItem({'Locker'}, 1732, 100, 'Locker')

 

shopModule:addBuyableItem({'Amphora'}, 2034, 100, 'Amphora')

shopModule:addBuyableItem({'Dresser'}, 1724, 100, 'Dresser')

shopModule:addBuyableItem({'RedChair'}, 1666, 100, 'Red Chair')

shopModule:addBuyableItem({'Green Chair'}, 1670, 100, 'Green chair')

shopModule:addBuyableItem({'Statue'}, 9948, 100, 'Statue')

shopModule:addBuyableItem({'Flower'}, 9988, 100, 'Flower')

 

 

 

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

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

lembre-se isso só deu certo que eu mudei no itens.otb para que os moveis pode-sem ser guardados dentro da bag

tenta ai

espero ter ajudado

hteoe8.jpg

Editado por Castiello
Link para o comentário
Compartilhar em outros sites

Vamos ver se isso te ajuda, alem d emoveis ele vende decoraçao, flores, curtinas etc. Os moveis vem como "parcels" que só da para abrir na casa (Botao direito em cima da caixa).

 

Va em /Data/NPC e copie qualquer arquivo com nome de Sleeper, apgue tudo que estiver dentro e cole isso.

 

<npc name="The Sleeper" script="data/npc/scripts/furniture.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="134" head="115" body="10" legs="90" feet="115" corpse="2212"/>
<parameters>
	<parameter key="module_shop" value="1" />
	<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell chairs, tables, plants, containers, pillows, tapestries and more. Everything for 500 gold pieces." />
	<parameter key="shop_buyable" value="wooden chair,3901,500;sofa chair,3902,500;red cushioned chair,3903,500;green cushioned chair,3904,500;tusk chair,3905,500;ivory chair,3906,500;big table,3909,500;square table,3910,500;round table,3911,500;small table,3912,500;stone table,3913,500;tusk table,3914,500;bamboo table,3919,500;pink flower,3928,500;green flower,3929,500;christmas tree,3931,500;large trunk,3938,500;drawer,3921,500;dresser,3932,500;locker,3934,500;trough,3935,500;
box,3915,500;coal basin,3908,500;birdcage,3918,500;harp,3917,500;piano,3926,500;globe,3927,500;clo
ck,3933,500;lamp,3937,500;blue tapestry,1872,500;green tapestry,1860,500;orange tapestry,1866,500;pink tapestry,1857,500;red tapestry,1869,500;white tapestry,1880,500;yellow tapestry,1863,500;small purple pillow,1678,500;small green pillow,1679,500;small red pillow,1680,500;small blue pillow,1681,500;small orange pillow,1683,500;small turquiose pillow,1684,500;small white pillow,1685,500;heart pillow,1685,500;blue pillow,1686,500;red pillow,1687,500;green pillow,1688,500;yellow pillow,1689,500;round blue pillow,1690,500;round red pillow,1691,500;round purple pillow,1692,500;round turquiose pillow,1693,500;crystal table box,9974,500;crystal of balance,9942,500;gold lamp,9972,500;dracoyle statue east,9954,500;dracoyle statue south,9949,500;velvet tapestry,9837,500;crystal of focus,9941,500;gear wheel,9690,500;vampiric crest,9955,500;gold ingots,9971,500;small topazs,9970,500;black skull,9969,500;Red Crystal Table,9976,500;Blue Crystal Table,9977,500;Light Blue Crystal Table,9978,500;Green Crystal Table,9979,500;" />
</parameters>
</npc>

 

Depois vai em /Data/NPC/Script e copie qualquer arquivo e coloque o nome de furniture, apgue tudo que estiver dentro e coloque isso:

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({'chairs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell wooden, sofa, red cushioned, green cushioned, tusk and ivory chairs.'})
keywordHandler:addKeyword({'tables'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell big, square, round, small, stone, tusk, bamboo tables.'})
keywordHandler:addKeyword({'plants'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell pink and green flowers, also christmas trees.'})
keywordHandler:addKeyword({'furniture'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell large trunks, boxes, drawers, dressers, lockers and troughs.'})
keywordHandler:addKeyword({'more'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell coal basins, birdcages, harps, pianos, globes, clocks and lamps.'})
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell blue, green, orange, pink, red, white and yellow tapestries.'})
keywordHandler:addKeyword({'small'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell small purple, small green, small red, small blue, small orange, small turquiose and small white pillows.'})
keywordHandler:addKeyword({'round'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell round blue, round red, round purple and round turquiose pillows.'})
keywordHandler:addKeyword({'square'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell blue, red, green and yellow pillows.'})
keywordHandler:addKeyword({'pillows'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell heart, small, sqare and round pillows.'})

npcHandler:addModule(FocusModule:new())

 

Pronto NPC esta pronto, agora Importa ele para seu Map Editor e coloque onde quiser.

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...