• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

setcombat

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
recently helped me make this script here in the forum, but I found something. Whenever the arrow goes to the monster it has 2 equal effects, for example, when I hit the arrow it works 100% correct, when I miss the arrow it appears blood and poff.
How to make sure that poff does not get blood when leaving? what would be the correct ...

Just an observation, the fire that appears above has nothing to do with it, it's just a coincidence of the facts.


LUA:
local bowid = 13480

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 1, 2000, -30)
addDamageCondition(condition, 1, 2000, -29)
addDamageCondition(condition, 1, 2000, -28)
addDamageCondition(condition, 1, 2000, -27)
addDamageCondition(condition, 1, 2000, -26)
addDamageCondition(condition, 1, 2000, -25)
addDamageCondition(condition, 1, 2000, -24)
addDamageCondition(condition, 1, 2000, -23)
addDamageCondition(condition, 1, 2000, -22)
addDamageCondition(condition, 1, 2000, -21)
addDamageCondition(condition, 1, 2000, -20)
addDamageCondition(condition, 1, 2000, -19)
addDamageCondition(condition, 1, 2000, -18)
addDamageCondition(condition, 1, 2000, -17)
addDamageCondition(condition, 1, 2000, -16)
addDamageCondition(condition, 1, 2000, -15)
addDamageCondition(condition, 1, 2000, -14)
addDamageCondition(condition, 1, 2000, -13)
addDamageCondition(condition, 1, 2000, -12)
addDamageCondition(condition, 1, 2000, -11)
addDamageCondition(condition, 1, 2000, -10)
addDamageCondition(condition, 1, 2000, -9)
addDamageCondition(condition, 1, 2000, -8)
addDamageCondition(condition, 1, 2000, -7)
addDamageCondition(condition, 1, 2000, -6)
addDamageCondition(condition, 1, 2000, -5)
addDamageCondition(condition, 1, 2000, -4)
addDamageCondition(condition, 1, 2000, -3)
addDamageCondition(condition, 1, 2000, -2)
addDamageCondition(condition, 1, 2000, -1)


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

function onUseWeapon(cid, var)
    local slotleft = getPlayerSlotItem(cid, CONST_SLOT_LEFT)
    local slotright = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
    local target = getCreatureTarget(cid)
    local distance_effect = CONST_ANI_ARROW
    if slotleft.itemid == bowid or slotright.itemid == bowid then
        distance_effect = CONST_ANI_FLAMMINGARROW
        doTargetCombatCondition(cid, target, condition, CONST_ME_FIRE)
    end
    doSendDistanceShoot(getThingPosition(cid), getThingPosition(target), distance_effect)
    return doCombat(cid, combat, var)
end


Screenshot_4.png
Screenshot_3.png
Screenshot_2.png
 
There's no way to fix that from inside the script I don't think.
Unless you actually do all of the combat calculations inside the script itself, instead of through items.xml and source.
 
Back
Top