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

Is it possible to make Infernal Bolt only usable with Arbalest?

yes, im pretty sure it would require source edit in weapons.cpp

BAD IDEA

Why? maybe just make infernal bolt script in weapons and inside if getplayerslot(hand) == arbalest then return true or something.

Arbalest script, not infernal bolt.

As the topic says.. Thanks in advance!

1. Remove infernal bolt's "ammo" attribute from items.xml
2. Remove Arbalest's <attribute key="ammoType" value="bolt"/>
3. Add this code to your arbalest script:
REMEMBER TO CONFIGURE IT!
Code:
local config =
{
    ----------------- CONFIGURATION ----------------
    removeAmmo = true, -- set true to remove one ammo per each shot. true is better for more RPG (remember to add , after "true" or "false")
    damageMultipiler = 1.0, -- 1.0 mean 100% of you normal damage will be apiled per each shot (0.75 = 75%, 2.0 = 200% ...)
    alwaysHits = true, -- set true to make this spell always hits, otherwise hits will be afected by your distance

    --- YOU HAVE TO ADD AMMO IDS AND DISTANCE EFFECT FOR EACH AMMO ---
    ammoIds = {11111, 22222, 33333},    -- type ids here
    effects = {
        [11111] = CONST_ANI_BOLT,
        [22222] = CONST_ANI_ARROW,
        [33333] = CONST_ANI_INFERNAL    -- last can't have , at the end
    }
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE)

function onGetFormulaValues(cid, level, maglevel)
    max = -(13 * getItemAttack(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid) ^ (1 / 1.5) + getPlayerSkillLevel(cid, 4) * 11 / 4 - 30) * config.damageMultipiler
    -- yes yes, this formula looks ugly, but this is a real tibia calculation, you can edit it as you like
    if config.alwaysHits == true then
        min = max
    else
        min = 0
    end
    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
    local ammo = getPlayerSlotItem(cid, CONST_SLOT_AMMO)

    if(isInArray(config.starsids, ammo.itemid)) then
        if(isCreature(getCreatureTarget(cid)) and (getCreatureHealth(getCreatureTarget(cid)) > 0)) then
            local tos = getCreaturePosition(getCreatureTarget(cid))
            local pos = getCreaturePosition(cid)
            local ammo = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
            if(config.removeAmmo == true) then
                doPlayerRemoveItem(cid, ammo.itemid, 1)
            end
            doCombat(cid, combat, var)
            doSendDistanceShoot(pos, tos, config.effects[ammo.itemid])
        end
    else
        return false
    end
    return true
end
 
Last edited:
Back
Top