[8.21]dark Rodo Com Novo Sistema De Venda

delton
Por delton
em NPCs, monsters e raids

delton

Ex-Xtibian
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 16/11/07Posts: 389Gênero: MasculinoChar no Tibia: Tiger Darm

Vá na pasta data de seu ot dps npc e copia um npc depois renomeie ele para Darok Rodo.

Depois dentro dele coloque isso:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Dark Rodo" script="data/npc/scripts/runes1.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="289" head="140" body="64" legs="121" feet="76" addons="3"/>
</npc>

 

Após ter feito isso va na pasta scripts e copie um script e renomeie ele para runes1.lua, depois coloque isso dentro dele:

local focuses = {}

local function isFocused(cid)

for i, v in pairs(focuses) do

if(v == cid) then

return true

end

end

return false

end

 

local function addFocus(cid)

if(not isFocused(cid)) then

table.insert(focuses, cid)

end

end

local function removeFocus(cid)

for i, v in pairs(focuses) do

if(v == cid) then

table.remove(focuses, i)

break

end

end

end

local function lookAtFocus()

for i, v in pairs(focuses) do

if(isPlayer(v) == TRUE) then

doNpcSetCreatureFocus(v)

return

end

end

doNpcSetCreatureFocus(0)

end

 

local itemWindow = {

{id=2268, subtype=0, buy=215, sell=0},

{id=2273, subtype=0, buy=100, sell=0},

{id=2313, subtype=0, buy=125, sell=0},

{id=2304, subtype=0, buy=125, sell=0},

{id=8828, subtype=0, buy=22000, sell=0},

{id=2187, subtype=0, buy=15000, sell=0},

{id=2188, subtype=0, buy=5000, sell=0},

{id=8827, subtype=0, buy=7500, sell=0},

{id=8826, subtype=0, buy=18000, sell=0},

{id=2189, subtype=0, buy=10000, sell=0},

{id=2190, subtype=0, buy=500, sell=0},

{id=2191, subtype=0, buy=1000, sell=0},

{id=2274, subtype=0, buy=100, sell=0},

{id=8817, subtype=0, buy=750, sell=0},

{id=8816, subtype=0, buy=22000, sell=0},

{id=2183, subtype=0, buy=15000, sell=0},

{id=2181, subtype=0, buy=10000, sell=0},

{id=2182, subtype=0, buy=500, sell=0},

{id=2185, subtype=0, buy=5000, sell=0},

{id=2186, subtype=0, buy=1000, sell=0},

{id=8818, subtype=0, buy=18000, sell=0},

{id=8377, subtype=0, buy=310, sell=0},

{id=7591, subtype=0, buy=190, sell=0},

{id=7588, subtype=0, buy=100, sell=0},

{id=7618, subtype=0, buy=45, sell=0},

{id=8376, subtype=0, buy=190, sell=0},

{id=7590, subtype=0, buy=120, sell=0},

{id=7589, subtype=0, buy=80, sell=0},

{id=7620, subtype=0, buy=50, sell=0},

{id=2163, subtype=0, buy=500, sell=0},

{id=2311, subtype=0, buy=300, sell=0},

{id=2260, subtype=0, buy=10, sell=0}

}

 

local items = {}

for _, item in ipairs(itemWindow) do

items[item.id] = {buyPrice = item.buy, sellPrice = item.sell, subtype = item.subtype}

end

 

local function getPlayerMoney(cid)

return ((getPlayerItemCount(cid, 2160) * 10000) +

(getPlayerItemCount(cid, 2152) * 100) +

getPlayerItemCount(cid, 2148))

end

 

local onBuy = function(cid, item, subtype, amount)

if(items[item] == nil) then

selfSay("Ehm.. sorry... this shouldn't be there, I'm not selling it.", cid)

return

end

 

if(getPlayerMoney(cid) >= amount*items[item].buyPrice) then

local itemz, i = doPlayerAddItem(cid, item, subtype, amount)

if(i < amount) then

if(i == 0) then

selfSay("Sorry, but you don't have space to take it.", cid)

else

selfSay("I've sold some for you, but it seems you can't carry more than this. I won't take more money than necessary.", cid)

doPlayerRemoveMoney(cid, i*items[item].buyPrice)

end

else

selfSay("Thanks for the money!", cid)

doPlayerRemoveMoney(cid, amount*items[item].buyPrice)

end

else

selfSay("You don't have money.", cid)

end

end

 

local onSell = function(cid, item, subtype, amount)

if(items[item] == nil) then

selfSay("Ehm.. sorry... this shouldn't be there, I'm not buying it.", cid)

end

 

if(subtype < 1) then

subtype = -1

end

if(doPlayerRemoveItem(cid, item, amount, subtype) == TRUE) then

doPlayerAddMoney(cid, items[item].sellPrice*amount)

selfSay("Here you are.", cid)

else

selfSay("No item, no deal.", cid)

end

end

 

function onCreatureAppear(cid)

end

 

function onCreatureDisappear(cid)

if(isFocused(cid)) then

selfSay("Hmph!")

removeFocus(cid)

if(isPlayer(cid) == TRUE) then --Be sure he's online

closeShopWindow(cid)

end

end

end

 

function onCreatureSay(cid, type, msg)

if((msg == "hi") and not (isFocused(cid))) then

selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, TRUE)

selfSay("I sell all types {runes}?", cid)

addFocus(cid)

elseif((isFocused(cid)) and (msg == "runes" or msg == "trade")) then

selfSay("Pretty nice, right?", cid)

openShopWindow(cid, itemWindow, onBuy, onSell)

elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then

selfSay("Goodbye!", cid, TRUE)

closeShopWindow(cid)

removeFocus(cid)

end

end

 

function onPlayerCloseChannel(cid)

if(isFocused(cid)) then

selfSay("Hmph!")

closeShopWindow(cid)

removeFocus(cid)

end

end

 

function onPlayerEndTrade(cid)

selfSay("It was a pleasure doing business with you.", cid)

end

 

function onThink()

for i, focus in pairs(focuses) do

if(isCreature(focus) == FALSE) then

removeFocus(focus)

else

local distance = getDistanceTo(focus) or -1

if((distance > 4) or (distance == -1)) then

selfSay("Hmph!")

closeShopWindow(focus)

removeFocus(focus)

end

end

end

lookAtFocus()

end

 

OBS: Onde está em Vermelho é os itens que ele vende e onde está em azul é o que vc prescisa dizer para que apareça a janela dos itens....

 

Caso vc queira que o npc venda itens coloque isso (OBS está em Negrito)

 

{id=2268, subtype=0, buy=215, sell=0},

{id=2273, subtype=0, buy=100, sell=0},

{id=2313, subtype=0, buy=125, sell=0},

{id=2304, subtype=0, buy=125, sell=0},

{id=8828, subtype=0, buy=22000, sell=0},

{id=2187, subtype=0, buy=15000, sell=0},

{id=2188, subtype=0, buy=5000, sell=0},

{id=8827, subtype=0, buy=7500, sell=0},

{id=8826, subtype=0, buy=18000, sell=0},

{id=2189, subtype=0, buy=10000, sell=0},

{id=2190, subtype=0, buy=500, sell=0},

{id=2191, subtype=0, buy=1000, sell=0},

{id=2274, subtype=0, buy=100, sell=0},

{id=8817, subtype=0, buy=750, sell=0},

{id=8816, subtype=0, buy=22000, sell=0},

{id=2183, subtype=0, buy=15000, sell=0},

{id=2181, subtype=0, buy=10000, sell=0},

{id=2182, subtype=0, buy=500, sell=0},

{id=2185, subtype=0, buy=5000, sell=0},

{id=2186, subtype=0, buy=1000, sell=0},

{id=8818, subtype=0, buy=18000, sell=0},

{id=8377, subtype=0, buy=310, sell=0},

{id=7591, subtype=0, buy=190, sell=0},

{id=7588, subtype=0, buy=100, sell=0},

{id=7618, subtype=0, buy=45, sell=0},

{id=8376, subtype=0, buy=190, sell=0},

{id=7590, subtype=0, buy=120, sell=0},

{id=7589, subtype=0, buy=80, sell=0},

{id=7620, subtype=0, buy=50, sell=0},

{id=2163, subtype=0, buy=500, sell=0},

{id=2311, subtype=0, buy=300, sell=0},

{id=2260, subtype=0, buy=10, sell=0},

{id=7634, subtype=0, sell=5, buy=0}

}

 

É um exemplo do Empty Strong Potion

 

Crédits:

80% Eu

20% Sibuna

Olá XTibiano:

Sua assinatura estava com um problema na TAG SPOILER e foi movida para a parte "Sobre mim".
Agradecemos a sua compreensão.

Atenciosamente,
JV Chequer

TulioXD35

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 18/03/08Posts: 28

cara,eu moro em turmalina,e ai pertinho de minas novas ^^

 

daki um dia agente ate se ve por la

Dare Devil

Ex-Coordenador de Imprensa
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 27/06/07Posts: 598Gênero: Masculino
cara,eu moro em turmalina,e ai pertinho de minas novas ^^

 

daki um dia agente ate se ve por la

Amigo posts sem sentido com o que é abordado no tópico,

é considerado flood.

Tópico encaminhado a Moderação~

 

Atenciosamente,

Dare Devil

Atenciosamente,

Dare Devil.

 

Siga-me no Twitter,

@LucasPassosCDR

lastsouls

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 13/12/07Posts: 628

#TulioAC,

 

Evite esse tipo de comentários.

Da proxima será alertado.

 

 

Notificado via PM.

delton

Ex-Xtibian
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 16/11/07Posts: 389Gênero: MasculinoChar no Tibia: Tiger Darm

???

 

TulioAC eu nem moro nessa cidade o.O

Olá XTibiano:

Sua assinatura estava com um problema na TAG SPOILER e foi movida para a parte "Sobre mim".
Agradecemos a sua compreensão.

Atenciosamente,
JV Chequer

Deragon

avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 29/06/08Posts: 65

creditos a simone por desenvolver o primeiro e voce apenas editar ;D

tem o tiozinho q eh de guild e de premiu/promo ?

Usuário banido - Comportamento Destrutivo

heimond

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/08/07Posts: 90

Tipo, eu compro a coisa mas ele n tira a grana do meu char, isso ta "zuado", tem q arruma.Savvy?


Rise ATS


É meu fan?Te ajudei?Me odeia?Então use minha Fan Bar!

Savvy?

delton

Ex-Xtibian
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 16/11/07Posts: 389Gênero: MasculinoChar no Tibia: Tiger Darm

BUG ARRUMADO!!!

 

Ta ae o Script

 

local focuses = {}

local function isFocused(cid)

for i, v in pairs(focuses) do

if(v == cid) then

return true

end

end

return false

end

 

local function addFocus(cid)

if(not isFocused(cid)) then

table.insert(focuses, cid)

end

end

local function removeFocus(cid)

for i, v in pairs(focuses) do

if(v == cid) then

table.remove(focuses, i)

break

end

end

end

local function lookAtFocus()

for i, v in pairs(focuses) do

if(isPlayer(v) == TRUE) then

doNpcSetCreatureFocus(v)

return

end

end

doNpcSetCreatureFocus(0)

end

 

local itemWindow = {

{id=2268, subtype=0, buy=215, sell=0},

{id=2273, subtype=0, buy=100, sell=0},

{id=2313, subtype=0, buy=125, sell=0},

{id=2304, subtype=0, buy=125, sell=0},

{id=8828, subtype=0, buy=22000, sell=0},

{id=2187, subtype=0, buy=15000, sell=0},

{id=2188, subtype=0, buy=5000, sell=0},

{id=8827, subtype=0, buy=7500, sell=0},

{id=8826, subtype=0, buy=18000, sell=0},

{id=2189, subtype=0, buy=10000, sell=0},

{id=2190, subtype=0, buy=500, sell=0},

{id=2191, subtype=0, buy=1000, sell=0},

{id=2274, subtype=0, buy=100, sell=0},

{id=8817, subtype=0, buy=750, sell=0},

{id=8816, subtype=0, buy=22000, sell=0},

{id=2183, subtype=0, buy=15000, sell=0},

{id=2181, subtype=0, buy=10000, sell=0},

{id=2182, subtype=0, buy=500, sell=0},

{id=2185, subtype=0, buy=5000, sell=0},

{id=2186, subtype=0, buy=1000, sell=0},

{id=8818, subtype=0, buy=18000, sell=0},

{id=8377, subtype=0, buy=310, sell=0},

{id=7591, subtype=0, buy=190, sell=0},

{id=7588, subtype=0, buy=100, sell=0},

{id=7618, subtype=0, buy=45, sell=0},

{id=8376, subtype=0, buy=190, sell=0},

{id=7590, subtype=0, buy=120, sell=0},

{id=7589, subtype=0, buy=80, sell=0},

{id=7620, subtype=0, buy=50, sell=0},

{id=2163, subtype=0, buy=500, sell=0},

{id=2311, subtype=0, buy=300, sell=0},

{id=2260, subtype=0, buy=10, sell=0},

{id=7634, subtype=0, sell=5, buy=0}

}

 

local items = {}

for _, item in ipairs(itemWindow) do

items[item.id] = {buyPrice = item.buy, sellPrice = item.sell, subtype = item.subtype}

end

 

local function getPlayerMoney(cid)

return ((getPlayerItemCount(cid, 2160) * 10000) +

(getPlayerItemCount(cid, 2152) * 100) +

getPlayerItemCount(cid, 2148))

end

 

local onBuy = function(cid, item, subtype, amount)

if(items[item] == nil) then

selfSay("Ehm.. sorry... this shouldn't be there, I'm not selling it.", cid)

return

end

 

if(getPlayerMoney(cid) >= amount*items[item].buyPrice) then

local itemz, i = doPlayerAddItem(cid, item, subtype, amount)

if(amount) then

if(i == 0) then

selfSay("Sorry, but you don't have space to take it.", cid)

else

selfSay("I've sold some for you, but it seems you can't carry more than this. I won't take more money than necessary.", cid)

doPlayerRemoveMoney(cid, amount*items[item].buyPrice)

end

else

selfSay("Thanks for the money!", cid)

doPlayerRemoveMoney(cid, amount*items[item].buyPrice)

end

else

selfSay("You don't have money.", cid)

end

end

 

local onSell = function(cid, item, subtype, amount)

if(items[item] == nil) then

selfSay("Ehm.. sorry... this shouldn't be there, I'm not buying it.", cid)

end

 

if(subtype < 1) then

subtype = -1

end

if(doPlayerRemoveItem(cid, item, amount, subtype) == TRUE) then

doPlayerAddMoney(cid, items[item].sellPrice*amount)

selfSay("Here you are.", cid)

else

selfSay("No item, no deal.", cid)

end

end

 

function onCreatureAppear(cid)

end

 

function onCreatureDisappear(cid)

if(isFocused(cid)) then

selfSay("Hmph!")

removeFocus(cid)

if(isPlayer(cid) == TRUE) then --Be sure he's online

closeShopWindow(cid)

end

end

end

 

function onCreatureSay(cid, type, msg)

if((msg == "hi") and not (isFocused(cid))) then

selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, TRUE)

selfSay("eu vendo todo tipo de {runes}!", cid)

addFocus(cid)

elseif((isFocused(cid)) and (msg == "runes" or msg == "trade")) then

selfSay("Pretty nice, right?", cid)

openShopWindow(cid, itemWindow, onBuy, onSell)

elseif((isFocused(cid)) and (msg == "bye" or msg == "good bye" or msg == "cya")) then

selfSay("Good bye!", cid, TRUE)

closeShopWindow(cid)

removeFocus(cid)

end

end

 

function onPlayerCloseChannel(cid)

if(isFocused(cid)) then

selfSay("Hmph!")

closeShopWindow(cid)

removeFocus(cid)

end

end

 

function onPlayerEndTrade(cid)

selfSay("It was a pleasure doing business with you.", cid)

end

 

function onThink()

for i, focus in pairs(focuses) do

if(isCreature(focus) == FALSE) then

removeFocus(focus)

else

local distance = getDistanceTo(focus) or -1

if((distance > 4) or (distance == -1)) then

selfSay("Hmph!")

closeShopWindow(focus)

removeFocus(focus)

end

end

end

lookAtFocus()

end

 

Flwss :D

Olá XTibiano:

Sua assinatura estava com um problema na TAG SPOILER e foi movida para a parte "Sobre mim".
Agradecemos a sua compreensão.

Atenciosamente,
JV Chequer

heimond

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/08/07Posts: 90

Cara, vc ajudo muito agora, vlw.Savvy?


Rise ATS


É meu fan?Te ajudei?Me odeia?Então use minha Fan Bar!

Savvy?

delton

Ex-Xtibian
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 16/11/07Posts: 389Gênero: MasculinoChar no Tibia: Tiger Darm

Meu thyrania 8.22 e 8.21 tah completo....

 

 

Vo bota on sabado ele tah todo em 8.21 e 8.22

Olá XTibiano:

Sua assinatura estava com um problema na TAG SPOILER e foi movida para a parte "Sobre mim".
Agradecemos a sua compreensão.

Atenciosamente,
JV Chequer

charleschaleron

Call Are You!!!
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 05/01/08Posts: 226Char no Tibia: Brahamus

ow se pode ajuda ai o dark rodo naun ta vendendo runas quando eu vo para comprar

se puder ai ajudar

grato pela compreenção.

flws

Chaleron Cronics Project 8.52...Venha conferir!

Meu fã? te impressionei? então use!




Sou fã deste grande jovem


um ótimo programador e editor de servidores em geral

decion

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/09/07Posts: 19

é aqui ta dando problema tambem

 

 

[25/08/2008 18:09:06] Lua Script Error: [Npc interface]

[25/08/2008 18:09:06] (Unknown scriptfile)

 

[25/08/2008 18:09:06] data/npc/scripts/runes.lua:87: attempt to compare nil with number

[25/08/2008 18:09:06] stack traceback:

[25/08/2008 18:09:06] data/npc/scripts/runes.lua:87: in function <data/npc/scripts/runes.lua:79>

zimbituba

Crystal Server Founder
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 19/01/08Posts: 704Char no Tibia: Atera Knight

este fácil, mas ultil ^^

parabéns ai

teria como você me passar o npc de travel?

 

-----------------

edite

eu achei bug bug nesses npc 8.2...

Tipo eles não dão dinheiro acima de 10k ou 100 gps :(

exemplo:

NPC que compra os items... o player vai vender por 20k e o npc paga só 10k :(

tem como você arrumar isto?

If you would like to thank me for my Crystal Server and others, feel free to donate.
Paypal: shynzomapper@hotmail.com

Slinix

The Slinix ® TCS Developer
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/04/08Posts: 53Char no Tibia: Akilles Palyy

Pow , Parabens , Só tem um problema , se o NPC estiver em minha tela (na regiao da screen no tibia) e eu falar hi , ele falara comigo , n importa odne eu esteja , ai se tem 4 npc juntos ( com esse jeito de npc sistem ) eu falo HI ai todos els falam comigo , ai falo trade ou a palavra , + o trade ali do lado abre e fexa , só quandoe stão em mais de 1 npc , resumindo , se arrumar esse problema minha nota é 10 , caso não nota 8 , Vlw

 

 

Edit...

 

nao ta dando pra conpra ele nao me vende ele fala assim

 

09:12 Dark Rodo: Welcome, TheDark.
09:12 Dark Rodo: eu vendo todo tipo de runes!
09:12 TheDark [9]: runes
09:12 Dark Rodo: Pretty nice, right?
09:12 Dark Rodo: Sorry, but you don't have space to take it.
09:13 Dark Rodo: Sorry, but you don't have space to take it.
09:13 Dark Rodo: Sorry, but you don't have space to take it.
09:13 Dark Rodo: Sorry, but you don't have space to take it.
09:13 Dark Rodo: Sorry, but you don't have space to take it.

 

me ajuda ai Ty =)

 

 

 

--------------------------------

 

 

é por que voce não tem espaço na BP ....

 

 

 

EDIT...

 

Eu peguei o otro escrit e blz , agr ele me tira o dinheiro quando compro , + quando vendo n ganho nada -.-

slinixmapper.jpgsimbo.jpg

 

 

slinixfanbar2dz1.jpguserlovefirefox7dm4arohvk6.gif

 

headerqh0.jpg

opensourcelogo.jpg

satan666

Antichrist Superstar
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 07/05/08Posts: 612Char no Tibia: leviana luciferiana

vou da uma edeia aki teste tudo antes de posta pra n dar mais erro.

creationb.jpg

"Um Deus que usasse seu poder para criar seres humanos que de antemão sabia que seriam atormentados eternamente, e que os predestinasse a isso,



não poderia ser sábio, nem justo e tampouco amoroso.

Além de nos submeter a isso vim a nos julgar e condenar por nossos atos aos tormentos do inferno.

pra minha pessoa isso não é um Deus Pai amoroso e bondoso como o chaman, seu padrão seria muito mais inferior do que o de muitos homens."