JuanRenaldo2
Member
- Joined
- Feb 25, 2025
- Messages
- 17
- Solutions
- 1
- Reaction score
- 7
Just wondering how to add distance effect and hit effect to my weapons using this script here. the damage is correct but it does not show any to target distance effect or hit effect(Miss, Block, or Hit). I would like to create different weapons with different hit effects and distance effects for ranged weapons.
LUA:
function onUseWeapon(cid, var)
local target = variantToNumber(var)
local lvl = getPlayerLevel(cid)
local skillType = SKILL_DISTANCE
local skill = getPlayerSkillLevel(cid, skillType)
local dmgMax = (((1000 * 1) + (skill * 40)) * (1 + (skill / 100))) / 1.4
local dmgMin = dmgMax / 1.5
local playerTarget = getCreatureTarget(cid)
local targetPos = getPlayerPosition(playerTarget)
local fromPos = getPlayerPosition(cid)
if(target ~= 0) then
ret = doTargetCombatHealth(cid, playerTarget, COMBAT_PHYSICALDAMAGE, -dmgMin, -dmgMax, 0)
end
return ret
end