SK
talkaction

Not Drop Loot

Por SkyLigh, 27 de ago. de 2012 em Actions e Talkactions

loot
script
12
2.3k
SkyLighS
27 de agosto de 2012 às 10:34

Iae galera

 

hoje venho trazer um script que não dropa loot como um aol so que sem precisar usar amuleto e também não e uma bless

 

então vamos la

 

Em data / talkactions / scripts / e renome algum arquivo.lua para loot e adicione

 

function onSay(cid, words, param)
local price = 1000 -- dinheiro que vai custa
if getPlayerStorageValue(cid,1254) > 0 or not doPlayerRemoveMoney(cid, price) then

doPlayerSendTextMessage(cid, 28, "Você, não tem dinheiro suficiente e/ou já tem Anti Drop.")
return true
end
doPlayerSendTextMessage(cid, 27, "Parabéns você comprou Anti Drop, por " .. price .. " gp's")
setPlayerStorageValue(cid, 1254, 1)
return true
end

 

talkactions.xml

 

<talkaction words="!loot" event="script" value="loot.lua"/>

 

data/creaturescripts/scripts renome algum arquivo pra antidrop e adicione

 

function onDeath(cid, deathList)
if getPlayerStorageValue(cid, 1254) > 0 then
setPlayerStorageValue(cid, 1254, 0)
doCreatureSetDropLoot(cid, false)

end
return true
end

 

em creaturescripts.xml

 

<event type="death" name="noDrop" script="antiDrop.lua"/>

 

em login.lua

 

registerCreatureEvent(cid, "noDrop")

 

Créditos

Skyligh (Por Criar E Pela Ideia E Postar)

Skyforever (Ajudou Em Alguns Erros)

 

gostou ? rep +

Editado Setembro 1 por SkyLigh

LuckOakeL
27 de agosto de 2012 às 13:10

No lugar de:

 

function onDeath(cid, deathList)

 

Não teria que ser assim?

 

function onPrepareDeath(cid)

 

Vai acabar não funcionando com o onDeath.

Editado Agosto 27 por LuckOake

VodkartV
27 de agosto de 2012 às 13:37

No lugar de:

 

function onDeath(cid, deathList)

 

Não teria que ser assim?

 

function onPrepareDeath(cid)

 

Vai acabar não funcionando com o onDeath.

 

funciona com a função main onDeath também

LuckOakeL
27 de agosto de 2012 às 13:38

Estranho, aqui não funcionou, perdi meu loot do mesmo jeito.

VodkartV
27 de agosto de 2012 às 13:42

também, o parâmetro da função está errada

 

 

troca

 

doCreatureSetDropLoot(cid, true)

 

para

 

doCreatureSetDropLoot(cid, false)

SkyLighS
27 de agosto de 2012 às 16:43

Pronto arrumei o bug

 

vlw vodkart

Piabeta KunP
29 de agosto de 2012 às 23:08

Achei um pequeno bug, qndo vc ja tem o no drop ele nao confere e faz o comando denovo!

SkymagnumS
29 de agosto de 2012 às 23:12

if not doPlayerRemoveMoney(cid, price) and getPlayerStorageValue(cid,1254) > 0 then

 

isso é oque então?

Editado Agosto 29 por Skymagnum

VodkartV
29 de agosto de 2012 às 23:38

mas está errado o algoritmo do código, certo é

 

if getPlayerStorageValue(cid,1254) > 0 or not doPlayerRemoveMoney(cid, price) then

Piabeta KunP
30 de agosto de 2012 às 01:18

mas está errado o algoritmo do código, certo é

 

if getPlayerStorageValue(cid,1254) > 0 or not doPlayerRemoveMoney(cid, price) then

 

isso corrigirá o bug que eu citei?

VodkartV
30 de agosto de 2012 às 09:51

sim

1 mês depois...
DaniielzD
11 de setembro de 2012 às 21:25

VALEEO