Jpstafe
Well-Known Member
- Joined
- Aug 8, 2011
- Messages
- 505
- Reaction score
- 67
Hello I have this uh trap 7.4 it works if it is used manually, can somebody make this script work as uh trap too but with hotkey? my server is 8.0
so if a person is in bottom or top and use this script with hotkey it will no healhimself? but another person?
don't know how to explain how uh trap work, can somebody help me?
so if a person is in bottom or top and use this script with hotkey it will no healhimself? but another person?
don't know how to explain how uh trap work, can somebody help me?
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 6.8) + 42
local max = (level / 5) + (magicLevel * 12.9) + 90
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
local position = Variant.getPosition(var)
local tile = Tile(position)
if tile then
local bottomCreature = tile:getBottomCreature()
if bottomCreature then
--return combat:execute(bottomCreature, var)
return doCombat(bottomCreature, combat, var)
end
end
-- end
if creature:isPlayer() then
creature:sendCancelMessage("You can only use this rune on creatures.")
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
end
return false
end