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

Only use certain spell when equipped with certain equipment

Gutow

New Member
Joined
Nov 15, 2009
Messages
17
Reaction score
2
Hi Guys,

Anyone can help me?

Script:

Only use certain spell when equipped with certain equipment.
 
use some kind of code that checks if the item is there else return true
Lua:
local slot = player:getSlotItem(CONST_SLOT_RING) -- slot here
    if slot and slot.itemid ~= 1234 then
        return true
end

I just used light healing.lua file and edited like this:

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 1.4) + 8
    local max = (level / 5) + (maglevel * 1.8) + 11
    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    local slot = creature:getSlotItem(CONST_SLOT_RING) -- slot here
    if slot and slot.itemid ~= 1234 then
        return creature:sendCancelMessage("You need a special item to use this spell.")
    end
    return combat:execute(creature, var)
end
 
Back
Top