• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua How to reduce chance obsidian / wo

oliverarrow

Member
Joined
Jul 31, 2015
Messages
82
Reaction score
6
How to set 2x more hard?


skinning.lua
Code:
local SKINS = {
   [5908] = {
     -- Minotaurs
     [2830] = {25000, 5878},
     [2871] = {25000, 5878},
     [2866] = {25000, 5878},
     [2876] = {25000, 5878},
     [3090] = {25000, 5878},

     -- Lizards
     [4259] = {25000, 5876},
     [4262] = {25000, 5876},
     [4256] = {25000, 5876},

     -- Dragons
     [3104] = {25000, 5877},
     [2844] = {25000, 5877},

     -- Dragon Lords
     [2881] = {25000, 5948},

     -- Behemoths
     [2931] = {25000, 5930, 90000, 5893},

     -- Bone Beasts
     [3031] = {25000, 5925}
   },
   [5942] = {
     -- Demon
     [2956] = {25000, 5905},

     -- Vampire
     [2916] = {25000, 5906}
   }
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local skin = SKINS[item.itemid][itemEx.itemid]
   if(skin == nil) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
     return true
   end

   local random, effect = math.random(1, 100000), CONST_ME_MAGIC_GREEN
   if(random <= skin[1]) then
     doPlayerAddItem(cid, skin[2], 1)
   elseif(skin[3] and random >= skin[3]) then
     doPlayerAddItem(cid, skin[4], 1)
   else
     effect = CONST_ME_POFF
   end

   doSendMagicEffect(toPosition, effect)
   doTransformItem(itemEx.uid, itemEx.itemid + 1)
   return true
end
 
From the looks of this you have it set so its a 25% chance to get something from lower monsters? to get the skin[1] items? 25000/10000? since your math rand is 1,100000. decrease the number of 25000 25000=25%.. 10000=10% chance.. etc. in your configs to get a lower chance of receiving an item since
Code:
if(random <= skin[1]) then
Keep in mind its going to increase the chance you have to get items off the demon the way you have it coded unless you change each config value
Code:
 elseif(skin[3] and random >= skin[3]) then
 
From the looks of this you have it set so its a 25% chance to get something from lower monsters? to get the skin[1] items? 25000/10000? since your math rand is 1,100000. decrease the number of 25000 25000=25%.. 10000=10% chance.. etc. in your configs to get a lower chance of receiving an item since
Code:
if(random <= skin[1]) then
Keep in mind its going to increase the chance you have to get items off the demon the way you have it coded unless you change each config value
Code:
 elseif(skin[3] and random >= skin[3]) then

TY!

To cofirm....
IT = 10%?
Code:
    -- Minotaurs
     [2830] = {10000, 5878},
 
TY!

To cofirm....
IT = 10%?
Code:
    -- Minotaurs
     [2830] = {10000, 5878},

Correctt....this script would work if you just too out all the 0's lol I dont know why they did that when your still only working with whole number percents. but w.e.. keep in mind anything config'd under [5942](demon) will have to be bigger than random variable not smaller tho so 25000 is actually 75%, if your adding more items. cause of elseif(skin[3]....
 

Similar threads

Back
Top