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

Solved Spells and actionids

BBFalcon89

Member
Joined
Jul 1, 2010
Messages
51
Reaction score
10
Just wanna check in 1.0, is it possible to use actionid's in spells, for example when i cast a spell i increase an actionid by 1?
 
Sorry I think I may not have been specific enough, i'm not using an item here. I mean in the spell itself ultimate healing.lua itself, would it be possible to add an actionid increment in the spell.

Sorry i feel really stupid right now i kept saying actionid i meant storageid
 
Code:
creature:setStorageValue(60901, creature:getStorageValue(60901) +1)
Like this you can set a storagevalue +1 every time the spell is used.
 
Code:
local storage = 123456 -- change this number to anything you like

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid, level, maglevel)
    min = ((level / 5) + (maglevel * 6.8) + 42)
    max = ((level / 5) + (maglevel * 12.9) + 90)
    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
creature:setStorageValue(storage, creature:getStorageValue(storage) +1)
    return doCombat(creature, combat, var)
end
 
Last edited:
The first parameter of function onCastSpell is creature userdata, so you can just do
Code:
function onCastSpell(creature, var)
    creature:setStorageValue(storage, creature:getStorageValue(storage) +1)
 
The first parameter of function onCastSpell is creature userdata, so you can just do
Code:
function onCastSpell(creature, var)
    creature:setStorageValue(storage, creature:getStorageValue(storage) +1)
Ah thank you, i have edited it. :)
 
Back
Top