mirror of
https://github.com/otland/forgottenserver
synced 2026-08-15 16:32:07 -04:00
* Moved Creature:addDamageCondition from spells lib to core * Check if target is nil * Renamed parameter "time" to "period" since it is periodic damage * Add named constants for damage list types * Use named constants instead of magic numbers to choose from damage list type * Use damage list types constants in weapons * Use more meaningful constants, shortened parameters * Updated constants in weapons
14 lines
493 B
Lua
14 lines
493 B
Lua
local combat = Combat()
|
|
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
|
|
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
|
|
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
|
|
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)
|
|
|
|
function onUseWeapon(player, variant)
|
|
if not combat:execute(player, variant) then
|
|
return false
|
|
end
|
|
|
|
player:addDamageCondition(Creature(variant:getNumber()), CONDITION_POISON, DAMAGELIST_LOGARITHMIC_DAMAGE, 3)
|
|
return true
|
|
end
|