• 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 Get mount ID and check is mounted for bonus mount

beenii

Well-Known Member
Joined
Jul 26, 2010
Messages
586
Solutions
1
Reaction score
58
I want to make a bonus for certain mounts I think I use a creaturescript, but how do I get that information?

Or some idea of how I can give bonuses to certain mounts
 
mounts are within the outfit table
example:
LUA:
local outfit = player:getOutfit()
local mount = outfit.lookMount
print(mount)
 
mounts are within the outfit table
example:
LUA:
local outfit = player:getOutfit()
local mount = outfit.lookMount
print(mount)
I am editing your bonus system outfit, it is working but my code is very messy and long xD

Code:
function createBonusConditionRegen(id, params)
    local condition = Condition(CONDITION_REGENERATION, CONDITIONID_DEFAULT)
    condition:setParameter(CONDITION_PARAM_TICKS, -1)
    condition:setParameter(CONDITION_PARAM_SUBID, id)
    for i = 1, #params do
        local paramReg = params[i].paramReg
        local value = params[i].value
        condition:setParameter(paramReg, value)
    end
    return condition
end

MountBonusesReg = {
    [{728, 371}] = createBonusConditionRegen(5, {
            {paramReg = CONDITION_PARAM_HEALTHGAIN, value = 5},
            {paramReg = CONDITION_PARAM_MANAGAIN, value = 5}
        }
    )
   
}


function getBonusConditionRegMount(outfit)
    for outfits, bonus in pairs(MountBonusesReg) do
        if table.contains(outfits, outfit) then
            return bonus
        end
    end
    return nil
end


    local previousBonusConditionRegMount = getBonusConditionRegMount(self:getOutfit().lookMount)
    local newBonusConditionRegMount = getBonusConditionRegMount(outfit.lookMount)   
   
   
        if previousBonusConditionRegMount then
        self:removeCondition(CONDITION_REGENERATION, CONDITIONID_DEFAULT, previousBonusConditionRegMount:getSubId())
    end
    if newBonusConditionRegMount then
        self:addCondition(newBonusConditionRegMount)
    end
 

Similar threads

Back
Top