• 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!

Missile to item

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
Hi guys, I had a post just about a script, but I had problems with it, what happens is: a bow using the common arrow leaves the monster burned, but I can not change his missile, changing the missile all the other bows have the same missile. "in the case of fire missile"

if anyone knows how to fix this error, i use tfs 0.4
Here I have a bow script, but as I said, it does not recognize the flamming arrow missile.
And if you acknowledge it, all the other bows also miss this bow. (srry for eng.)

weapons xml
<distance id="2544" event="script" value="magmabow.lua"/>

script
local bowid = 7874
local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 8, 2000, -30)



local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
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)
if slotleft.itemid == bowid or slotright.itemid == bowid and getCreatureTarget(cid) then
doTargetCombatCondition(cid, getCreatureTarget(cid), condition, CONST_ME_FIRE)
end
return doCombat(cid, combat, var)
end


If i change CONST_ANI_ARROW) for CONST_ANI_FLAMMINGARROW) all bows change too.
 
Solution
X
LUA:
local bowid = 7874

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 8, 2000, -30)

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
-- setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
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 =...
LUA:
local bowid = 7874

local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 8, 2000, -30)

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
-- setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
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
 
Solution
Back
Top