Allan Silva
Member
- Joined
- May 30, 2018
- Messages
- 39
- Solutions
- 1
- Reaction score
- 7
Hi
I'm trying to put a function to check if the player is using an item, if it is positive, the player can use the ability, otherwise the player can't use the spell, since only players with the equipped item can release the spell.
Anyone know how to change the script and perform this check? I'm using TFS 1.3
Thanks!
I'm trying to put a function to check if the player is using an item, if it is positive, the player can use the ability, otherwise the player can't use the spell, since only players with the equipped item can release the spell.
Lua:
local weapons = {
{itemId = 2321}, -- giant smithhammer
}
function onStepIn(cid, item, position, fromPosition)
if getPlayerItemCount(cid, weapons.itemId) >= count then
addEvent(onCastSpell, 100, var)
end
end
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat:setParameter(COMBAT_PARAM_USECHARGES, 1)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onGetFormulaValues(player, skill, attack, factor)
local level = player:getLevel()
local min = (level / 5) + (skill + attack) * 0.5
local max = (level / 5) + (skill + attack) * 1.5
return -min * 1.1, -max * 1.1 -- TODO : Use New Real Formula instead of an %
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, var)
return combat:execute(creature, var)
end
Anyone know how to change the script and perform this check? I'm using TFS 1.3
Thanks!
Last edited: