Kavalor
(Real)Creator of ChaosOT
It seems to only want to do either the healing or the cures/status fix. Both callbacks never seem to work no matter how I work it around. Anyone? weapon utility and healing
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)
combat:setParameter(COMBAT_PARAM_EFFECT, 73)
function onGetFormulaValues(player, skill, attack)
local mainskill = player:getSkillLevel(SKILL_CLUB)
local level = player:getLevel() -- so we still have access to player level
local magicLevel = player:getMagicLevel() -- so we still have access to player command level
local min = (level * 0.01) + (mainskill * 0.01) + (magicLevel * 0.01) + (attack * 0.1)
local max = (level * 1.8) + (mainskill * 1.8) + (magicLevel * 1.8) + (attack * 1.8)
return min, max
end
combat:setCallback(CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
function onTargetCreature(creature, target)
target:removeCondition(CONDITION_POISON)
target:removeCondition(CONDITION_FIRE)
target:removeCondition(CONDITION_ENERGY)
target:removeCondition(CONDITION_BLEEDING)
target:removeCondition(CONDITION_PARALYZE)
target:removeCondition(CONDITION_INFIGHT)
target:removeCondition(CONDITION_DRUNK)
target:removeCondition(CONDITION_EXHAUST_WEAPON)
target:removeCondition(CONDITION_DROWN)
target:removeCondition(CONDITION_MUTED)
target:removeCondition(CONDITION_FREEZING)
target:removeCondition(CONDITION_DAZZLED)
target:removeCondition(CONDITION_CURSED)
target:removeCondition(CONDITION_EXHAUST_COMBAT)
target:removeCondition(CONDITION_EXHAUST_HEAL)
target:removeCondition(CONDITION_PACIFIED)
target:removeCondition(CONDITION_SPELLCOOLDOWN)
target:removeCondition(CONDITION_SPELLGROUPCOOLDOWN)
target:removeCondition(CONDITION_ROOT)
return true
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(player, variant)
player:addSkillTries(SKILL_CLUB, 1)
return combat:execute(player, variant)
end