• 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!

skill fishing increases loot drop

famosiin

Member
Joined
Feb 28, 2021
Messages
36
Reaction score
5
Could someone help me to create a script, the more fishing skill the player has the more chance to drop loots he has?

example: going to soucers I found this code that increases the attack speed according to the player's fist.

Lua:
uint32_t getAttackSpeed() const {

            int32_t AtkSpeed;

            AtkSpeed = vocation->getAttackSpeed() - (getSkillLevel(SKILL_FIST)* 10);

            if (AtkSpeed < 500){

                return 500;

            } else {

                return (uint32_t) AtkSpeed;

            }

        }
Post automatically merged:

@up
 
Last edited:
Just copy and paste the codes that already exist, just add the fishing skill level and you're done.
data/events/scripts/monster.lua
data/lib/core/container.lua

maybe you should change this part:
Lua:
 -- Fishing
 if fishing ~= 100 then
    chanceTo = math.ceil((chanceTo * fishing) / 100)
 end
to:
Lua:
 -- Fishing
 if fishing ~= 100 then
    chanceTo = math.ceil((chanceTo * (fishing * 10)) / 100)
 end
Now you will start to gain more chance after level 10, this is an example that will work for sure, but you will have to adjust the values yourself
 

Attachments

Just copy and paste the codes that already exist, just add the fishing skill level and you're done.
data/events/scripts/monster.lua
data/lib/core/container.lua

maybe you should change this part:
Lua:
 -- Fishing
 if fishing ~= 100 then
    chanceTo = math.ceil((chanceTo * fishing) / 100)
 end
to:
Lua:
 -- Fishing
 if fishing ~= 100 then
    chanceTo = math.ceil((chanceTo * (fishing * 10)) / 100)
 end
Now you will start to gain more chance after level 10, this is an example that will work for sure, but you will have to adjust the values yourself
is to add this in containers?

Lua:
 -- Fishing
 if fishing ~= 100 then
    chanceTo = math.ceil((chanceTo * fishing) / 100)
 end

and that in the way of monsters?


Lua:
local fishing = player and player:getSkillLevel(SKILL_FISHING) or 100
        for i = 1, #monsterLoot do
            local item = corpse:createLootItem(monsterLoot[i], charmBonus, preyChanceBoost, fishing)
            if self:getName():lower() == Game.getBoostedCreature():lower() then
                local itemBoosted = corpse:createLootItem(monsterLoot[i], charmBonus, preyChanceBoost)
                if not itemBoosted then
                    Spdlog.warn(string.format("[Monster:onDropLoot] - Could not add loot item to boosted monster: %s, from corpse id: %d.", self:getName(), corpse:getId()))
                end
            end
            if not item then
                Spdlog.warn(string.format("[Monster:onDropLoot] - Could not add loot item to monster: %s, from corpse id: %d.", self:getName(), corpse:getId()))
            end
        end

because in my server files there is none of this information!
 
Back
Top