
eSvira
Membro
-
Registro em
-
Última visita
Solutions
-
eSvira's post in (Resolvido)OTX 3.7 Randomized loot was marked as the answer.Server: OTX 3.7
El bug ocurre al crear un LOOT, afecta levemente el funcionamiento aunque se mejoran la mayoría de los ítems.
El error en la consola se ve así
Así es como está escrito el guión en sí.
function getper() local n = 1 for i=1,10 do n = n+math.random(0,10) if n < 8*i then break end end return n end local lootable_slots = {'hp','mp','ml','melee','shield','dist'} function assign_loot_Slot(pos) local c = Tile(pos):getTopDownItem() if c ~= nil then if c:isContainer() then local h = c:getItemHoldingCount() if h > 0 then for i = 1, h do local i_Ex = c:getItem(i - 1) local itemEx = { itemid = i_Ex:getId(), uid = i_Ex:getUniqueId() } if (isArmor(itemEx.uid) or isWeapon(itemEx.uid) or isShield(itemEx.uid)) and not isItemStackable(itemEx.uid) then if math.random(1,5) == 5 then if math.random(1, 100) <= 15 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Great loot.") nam = Item(itemEx.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) nam = nam..' ['..lootable_slots[math.random(1, #lootable_slots)]..'.+'..getper()..'%]' doSetItemSpecialDescription(itemEx.uid, nam) if math.random(1, 100) <= 10 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Amazing loot.") nam = nam..' ['..lootable_slots[math.random(1, #lootable_slots)]..'.+'..getper()..'%]' doSetItemSpecialDescription(itemEx.uid, nam) if math.random(1, 100) <= 5 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Good loot.") nam = nam..' ['..lootable_slots[math.random(1, #lootable_slots)]..'.+'..getper()..'%]' doSetItemSpecialDescription(itemEx.uid, nam) end end end end end end return true end end end end function onKill(cid, target, lastHit) if (not isSummon(target)) then addEvent(assign_loot_Slot, 2, getThingPos(target)) end return true end
¡Muchas gracias por toda su ayuda y sugerencias!
Solution!
In line 22 add: