Syryniss
Member
- Joined
- Feb 13, 2014
- Messages
- 206
- Reaction score
- 20
Hi. I'm using custom damage formula for weapons, so hits are based on weapon damage and specific skill. The problem is, that when I cast some spell, that gives bonus attributes like 20 melee percent or for example 20 club and 20 attack speed (which is axe), the damage doesn't change (attack speed is working). However if I get higher skill level by leveling it up, the damage is going up, so it looks like the buff doesn't update with my forumla and when I gain skill in normal way it's updating.
Here is my weapon formula :
And here is my buff script :
I'm using TFS 0.3.6, thanks for any help.
Here is my weapon formula :
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function getWeaponDamage(cid, skill, att, attackStrength)
local lvl = getPlayerLevel(cid)
local sword = getPlayerSkill(cid, 2)
local min = -(((attackStrength * sword)*0.6) )
local max = -(((attackStrength * sword)*0.7) )
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getWeaponDamage")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 123)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 100000)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 120)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end