Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Estou precisando de um systema que ao jogador der use em um item ,
o personagem do player começa a obter mais chances de dropa loots dos montros, por um tempo  ao usar x item.
ou se for possivel  mais chance de dropar  alguns item especifico  por um tempo  ao usar x item.
ou mais chance de dropa loot de monstro especifico por um tempo  ao usar x item 
Agradeço de coração a quem ajudar.

Exemplo Do item: 
Nome Do Item Drop Booster 
Oque acontece ao usar : 2x mais chances de drop por 2h.

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

Resolvido por Rogex Joyz

Ir para solução
  • Respostas 5
  • Visualizações 513
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • em items.xml   <item id="ID DO ITEM QUE DA O BÔNUS" article="a" name="NOME DO ITEM QUE DA O BONUS">         <attribute key="weight" value="90" /> -- peso         <attribut

Postado
Spoiler

<?xml version="1.0" encoding="UTF-8"?>

<mod name="Loot Ring" version="1.0" author="Cykotitan" contact="otland.net" enabled="yes">

<event type="kill" name="lootring" event="script"> <![CDATA[

local t = {

item = 2179,

slot = CONST_SLOT_RING,

newRate = 5

}

 

local rate = getConfigInfo('rateLoot')

 

function getContentDescription(uid, comma)

local ret, i, containers = '', 0, {}

while i < getContainerSize(uid) do

local v, s = getContainerItem(uid, i), ''

local k = getItemInfo(v.itemid)

if k.name ~= '' then

if v.type > 1 and k.stackable and k.showCount then

s = v.type .. ' ' .. getItemInfo(v.itemid).plural

else

local article = k.article

s = (article == '' and '' or article .. ' ') .. k.name

end

ret = ret .. (i == 0 and not comma and '' or ', ') .. s

if isContainer(v.uid) and getContainerSize(v.uid) > 0 then

table.insert(containers, v.uid)

end

else

ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'

end

i = i + 1

end

for i = 1, #containers do

ret = ret .. getContentDescription(containers, true)

end

return ret

end

 

local function send(cid, pos, corpseid, monster, party)

local corpse = getTileItemById(pos, corpseid).uid

local ret = isContainer(corpse) and getContentDescription(corpse)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))

if party then

for _, pid in ipairs(getPartyMembers(party)) do

doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)

end

end

end

 

local function createLoot(i, ext)

local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id

local random = math.ceil(math.random(100000) / (ext and t.newRate or rate))

local tmpItem

 

if random < i.chance then

tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)

end

 

if not tmpItem then

return

end

 

if i.subType ~= -1 then

doItemSetAttribute(tmpItem, 'subType', i.subType)

end

 

if i.actionId ~= -1 then

doItemSetAttribute(tmpItem, 'aid', i.actionId)

end

 

if i.uniqueId ~= -1 then

doItemSetAttribute(tmpItem, 'uid', i.uniqueId)

end

 

if i.text ~= '' then

doItemSetAttribute(tmpItem, 'text', i.text)

end

 

return tmpItem

end

 

local function createChildLoot(parent, i, ext)

if #i == 0 then

return true

end

 

local size, cap = 0, getContainerCap(parent)

for k = 1, #i do

if size == cap then

break

end

local tmp = createLoot(i[k], ext)

if tmp then

if isContainer(tmp) then

if createChildLoot(tmp, i[k].child, ext) then

doAddContainerItemEx(parent, tmp)

size = size + 1

else

doRemoveItem(tmp)

end

else

doAddContainerItemEx(parent, tmp)

size = size + 1

end

end

end

 

return size > 0

end

 

local function dropLoot(pos, v, ext)

local corpse = getTileItemById(pos, v.lookCorpse).uid

if isContainer(corpse) then

for i = 1, getContainerSize(corpse) do

doRemoveItem(getContainerItem(corpse, 0).uid)

end

local size, cap = 0, getContainerCap(corpse)

for i = 1, #v.loot do

if size == cap then

break

end

local tmp = createLoot(v.loot, ext)

if tmp then

if isContainer(tmp) then

if createChildLoot(tmp, v.loot.child, ext) then

doAddContainerItemEx(corpse, tmp)

size = size + 1

else

doRemoveItem(tmp)

end

else

doAddContainerItemEx(corpse, tmp)

size = size + 1

end

end

end

end

end

 

function onKill(cid, target, lastHit)

if lastHit and isMonster(target) then

local v = getMonsterInfo(getCreatureName(target))

if v.lookCorpse > 0 then

local master = getCreatureMaster(target)

if not master or master == target then

addEvent(dropLoot, 0, getThingPos(target), v, getPlayerSlotItem(cid, t.slot).itemid == t.item)

end

addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))

end

end

return true

end

]]></event>

<event type="login" name="Loot Ring" event="buffer"><![CDATA[

registerCreatureEvent(cid, "lootring")

]]></event>

</mod>

 

Testa esse mods

 

créditos no script

Onde Tem newRate = 5 è Quantos x Vai Ficar O Loot Ao Usar O Ring

                                                                                                               destinyshield.gif.9f031b59b026058f32a1c50da92ebe2a.gif  mídias sociais  destinyshield.gif.02fca81ab0615e050b2bcefd8a73a2e8.gif

                                                                                                                            talk to me              

                                                                                                                               vídeos           

                                                                                             

                                                                                                            LOGONORMAL.png.815b40b04ec583be88d8a1e2626fe430.png

                                                                                                           

                               

Postado
  • Autor
2 minutos atrás, Rogex Joyz disse:
  Mostrar conteúdo oculto

<?xml version="1.0" encoding="UTF-8"?>

<mod name="Loot Ring" version="1.0" author="Cykotitan" contact="otland.net" enabled="yes">

<event type="kill" name="lootring" event="script"> <![CDATA[

local t = {

item = 2179,

slot = CONST_SLOT_RING,

newRate = 5

}

 

local rate = getConfigInfo('rateLoot')

 

function getContentDescription(uid, comma)

local ret, i, containers = '', 0, {}

while i < getContainerSize(uid) do

local v, s = getContainerItem(uid, i), ''

local k = getItemInfo(v.itemid)

if k.name ~= '' then

if v.type > 1 and k.stackable and k.showCount then

s = v.type .. ' ' .. getItemInfo(v.itemid).plural

else

local article = k.article

s = (article == '' and '' or article .. ' ') .. k.name

end

ret = ret .. (i == 0 and not comma and '' or ', ') .. s

if isContainer(v.uid) and getContainerSize(v.uid) > 0 then

table.insert(containers, v.uid)

end

else

ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'

end

i = i + 1

end

for i = 1, #containers do

ret = ret .. getContentDescription(containers, true)

end

return ret

end

 

local function send(cid, pos, corpseid, monster, party)

local corpse = getTileItemById(pos, corpseid).uid

local ret = isContainer(corpse) and getContentDescription(corpse)

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))

if party then

for _, pid in ipairs(getPartyMembers(party)) do

doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)

end

end

end

 

local function createLoot(i, ext)

local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id

local random = math.ceil(math.random(100000) / (ext and t.newRate or rate))

local tmpItem

 

if random < i.chance then

tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)

end

 

if not tmpItem then

return

end

 

if i.subType ~= -1 then

doItemSetAttribute(tmpItem, 'subType', i.subType)

end

 

if i.actionId ~= -1 then

doItemSetAttribute(tmpItem, 'aid', i.actionId)

end

 

if i.uniqueId ~= -1 then

doItemSetAttribute(tmpItem, 'uid', i.uniqueId)

end

 

if i.text ~= '' then

doItemSetAttribute(tmpItem, 'text', i.text)

end

 

return tmpItem

end

 

local function createChildLoot(parent, i, ext)

if #i == 0 then

return true

end

 

local size, cap = 0, getContainerCap(parent)

for k = 1, #i do

if size == cap then

break

end

local tmp = createLoot(i[k], ext)

if tmp then

if isContainer(tmp) then

if createChildLoot(tmp, i[k].child, ext) then

doAddContainerItemEx(parent, tmp)

size = size + 1

else

doRemoveItem(tmp)

end

else

doAddContainerItemEx(parent, tmp)

size = size + 1

end

end

end

 

return size > 0

end

 

local function dropLoot(pos, v, ext)

local corpse = getTileItemById(pos, v.lookCorpse).uid

if isContainer(corpse) then

for i = 1, getContainerSize(corpse) do

doRemoveItem(getContainerItem(corpse, 0).uid)

end

local size, cap = 0, getContainerCap(corpse)

for i = 1, #v.loot do

if size == cap then

break

end

local tmp = createLoot(v.loot, ext)

if tmp then

if isContainer(tmp) then

if createChildLoot(tmp, v.loot.child, ext) then

doAddContainerItemEx(corpse, tmp)

size = size + 1

else

doRemoveItem(tmp)

end

else

doAddContainerItemEx(corpse, tmp)

size = size + 1

end

end

end

end

end

 

function onKill(cid, target, lastHit)

if lastHit and isMonster(target) then

local v = getMonsterInfo(getCreatureName(target))

if v.lookCorpse > 0 then

local master = getCreatureMaster(target)

if not master or master == target then

addEvent(dropLoot, 0, getThingPos(target), v, getPlayerSlotItem(cid, t.slot).itemid == t.item)

end

addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))

end

end

return true

end

]]></event>

<event type="login" name="Loot Ring" event="buffer"><![CDATA[

registerCreatureEvent(cid, "lootring")

]]></event>

</mod>

 

Testa esse mods

 

créditos no script

Como funcionaria no caso ?
1 ring ao ser equipado aumentaria a chance de drop  de todos os monster, é isso ?

Postado
6 minutos atrás, Admin Humilde disse:

Como funcionaria no caso ?
1 ring ao ser equipado aumentaria a chance de drop  de todos os monster, é isso ?

Sim.

 

Nesta parte você configura o que precisa:

 

item = 2179, -- id do item que deseja 

slot = CONST_SLOT_RING, -- slot do item que deseja que seja equipado para adicionar o bonus drop

newRate = 5 -- rate do bonus

 

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

                                                                                                               destinyshield.gif.9f031b59b026058f32a1c50da92ebe2a.gif  mídias sociais  destinyshield.gif.02fca81ab0615e050b2bcefd8a73a2e8.gif

                                                                                                                            talk to me              

                                                                                                                               vídeos           

                                                                                             

                                                                                                            LOGONORMAL.png.815b40b04ec583be88d8a1e2626fe430.png

                                                                                                           

                               

Postado
  • Autor

Beleza, já vou testar aqui. Poderia da uma força para adicionar ''TIME'' no item que for usado ?
Exemplo: ele durar apenas 2h e depois sumir, ou virar outro item quebrado algo do tipo

Deu esse erro


 

[3:15:52.147] [Error - CreatureScript Interface]
[3:15:52.150] In a timer event called from:
[3:15:52.151] local t = {

[3:15:52.153] item = 12759,

[3:15:52.154] slot = CONST_SLOT_RING,

[3:15:52.155] newRate = 5

[3:15:52.156] }

[3:15:52.157]

[3:15:52.158] local rate = getConfigInfo('rateLoot')

[3:15:52.159]

[3:15:52.160] function getContentDescription(uid, comma)

[3:15:52.160] local ret, i, containers = '', 0, {}

[3:15:52.161] while i < getContainerSize(uid) do

[3:15:52.162] local v, s = getContainerItem(uid, i), ''

[3:15:52.165] local k = getItemInfo(v.itemid)

[3:15:52.166] if k.name ~= '' then

[3:15:52.167] if v.type > 1 and k.stackable and k.showCount then

[3:15:52.167] s = v.type .. ' ' .. getItemInfo(v.itemid).plural

[3:15:52.168] else

[3:15:52.169] local article = k.article

[3:15:52.170] s = (article == '' and '' or article .. ' ') .. k.name

[3:15:52.172] end

[3:15:52.173] ret = ret .. (i == 0 and not comma and '' or ', ') .. s

[3:15:52.175] if isContainer(v.uid) and getContainerSize(v.uid) > 0 then

[3:15:52.176] table.insert(containers, v.uid)

[3:15:52.176] end

[3:15:52.177] else

[3:15:52.179] ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'

[3:15:52.185] end

[3:15:52.186] i = i + 1

[3:15:52.187] end

[3:15:52.188] for i = 1, #containers do

[3:15:52.189] ret = ret .. getContentDescription(containers, true)

[3:15:52.190] end

[3:15:52.190] return ret

[3:15:52.191] end

[3:15:52.192]

[3:15:52.193] local function send(cid, pos, corpseid, monster, party)

[3:15:52.194] local corpse = getTileItemById(pos, corpseid).uid

[3:15:52.200] local ret = isContainer(corpse) and getContentDescription(corpse)

[3:15:52.201] doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))

[3:15:52.202] if party then

[3:15:52.203] for _, pid in ipairs(getPartyMembers(party)) do

[3:15:52.205] doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)

[3:15:52.205] end

[3:15:52.206] end

[3:15:52.208] end

[3:15:52.209]

[3:15:52.215] local function createLoot(i, ext)

[3:15:52.216] local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id

[3:15:52.217] local random = math.ceil(math.random(100000) / (ext and t.newRate or rate))

[3:15:52.218] local tmpItem

[3:15:52.219]

[3:15:52.220] if random < i.chance then

[3:15:52.221] tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)

[3:15:52.222] end

[3:15:52.223]

[3:15:52.223] if not tmpItem then

[3:15:52.225] return

[3:15:52.226] end

[3:15:52.231]

[3:15:52.231] if i.subType ~= -1 then

[3:15:52.232] doItemSetAttribute(tmpItem, 'subType', i.subType)

[3:15:52.234] end

[3:15:52.235]

[3:15:52.236] if i.actionId ~= -1 then

[3:15:52.239] doItemSetAttribute(tmpItem, 'aid', i.actionId)

[3:15:52.240] end

[3:15:52.241]

[3:15:52.247] if i.uniqueId ~= -1 then

[3:15:52.248] doItemSetAttribute(tmpItem, 'uid', i.uniqueId)

[3:15:52.249] end

[3:15:52.252]

[3:15:52.253] if i.text ~= '' then

[3:15:52.254] doItemSetAttribute(tmpItem, 'text', i.text)

[3:15:52.255] end

[3:15:52.256]

[3:15:52.257] return tmpItem

[3:15:52.260] end

[3:15:52.261]

[3:15:52.262] local function createChildLoot(parent, i, ext)

[3:15:52.263] if #i == 0 then

[3:15:52.266] return true

[3:15:52.267] end

[3:15:52.268]

[3:15:52.269] local size, cap = 0, getContainerCap(parent)

[3:15:52.269] for k = 1, #i do

[3:15:52.270] if size == cap then

[3:15:52.271] break

[3:15:52.272] end

[3:15:52.272] local tmp = createLoot(i[k], ext)

[3:15:52.273] if tmp then

[3:15:52.280] if isContainer(tmp) then

[3:15:52.282] if createChildLoot(tmp, i[k].child, ext) then

[3:15:52.283] doAddContainerItemEx(parent, tmp)

[3:15:52.285] size = size + 1

[3:15:52.285] else

[3:15:52.286] doRemoveItem(tmp)

[3:15:52.287] end

[3:15:52.288] else

[3:15:52.291] doAddContainerItemEx(parent, tmp)

[3:15:52.294] size = size + 1

[3:15:52.295] end

[3:15:52.296] end

[3:15:52.297] end

[3:15:52.298]

[3:15:52.298] return size > 0

[3:15:52.299] end

[3:15:52.300]

[3:15:52.301] local function dropLoot(pos, v, ext)

[3:15:52.302] local corpse = getTileItemById(pos, v.lookCorpse).uid

[3:15:52.303] if isContainer(corpse) then

[3:15:52.304] for i = 1, getContainerSize(corpse) do

[3:15:52.305] doRemoveItem(getContainerItem(corpse, 0).uid)

[3:15:52.306] end

[3:15:52.309] local size, cap = 0, getContainerCap(corpse)

[3:15:52.310] for i = 1, #v.loot do

[3:15:52.311] if size == cap then

[3:15:52.312] break

[3:15:52.313] end

[3:15:52.313] local tmp = createLoot(v.loot, ext)

[3:15:52.314] if tmp then

[3:15:52.315] if isContainer(tmp) then

[3:15:52.316] if createChildLoot(tmp, v.loot.child, ext) then

[3:15:52.316] doAddContainerItemEx(corpse, tmp)

[3:15:52.319] size = size + 1

[3:15:52.319] else

[3:15:52.320] doRemoveItem(tmp)

[3:15:52.320] end

[3:15:52.320] else

[3:15:52.320] doAddContainerItemEx(corpse, tmp)

[3:15:52.320] size = size + 1

[3:15:52.320] end

[3:15:52.320] end

[3:15:52.321] end

[3:15:52.321] end

[3:15:52.321] end

[3:15:52.322]

[3:15:52.327] function onKill(cid, target, lastHit)

[3:15:52.328] if lastHit and isMonster(target) then

[3:15:52.331] local v = getMonsterInfo(getCreatureName(target))

[3:15:52.332] if v.lookCorpse > 0 then

[3:15:52.333] local master = getCreatureMaster(target)

[3:15:52.335] if not master or master == target then

[3:15:52.336] addEvent(dropLoot, 0, getThingPos(target), v, getPlayerSlotItem(cid, t.slot).itemid == t.item)

[3:15:52.336] end

[3:15:52.337] addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))

[3:15:52.340] end

[3:15:52.342] end

[3:15:52.344] return true

[3:15:52.345] end
 

Esse mods que vc me passou deu error, então fui no mods do outro forum citado no script e peguei o original e funcionou. 
Só gostaria de fazer o ring sumir após algumas horas, alguém sabe como posso fazeR?

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

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo