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

Lua Distance weapon adds DoT?

Jompi

A hoagie in disguise.
Joined
Oct 22, 2007
Messages
197
Solutions
1
Reaction score
8
Location
Sweden
I have created a custom bow and I want it to add a fire DoT (like a fire field) to the target when you fire regular arrows from it, I also want the arrow to do the same damage as it did before (not just adding a DoT) and when you use a regular bow the arrow works just like normal.

I have not managed to get it to work from the comments below:
 
Last edited:
Solution
lol, I found the problem, do this
Lua:
local bowid = 22418
local condition = createConditionObject(CONDITION_FIRE)
    addDamageCondition(condition, 10, 2000, -10)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, true)
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...
I don't know why you get that error, I made changes, it looks messier but it should suffice as a workaround
 
What about this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 1492)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area2 = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat2, area2)

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})
setCombatArea(combat, area)

function onUseWeapon(cid, var)

   local better_bow = 2222
   
   if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == better_bow or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == better_bow then
       return doCombat(cid, combat2, var) and true
   end
   return doCombat(cid, combat, var)
end
 
What about this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
setCombatParam(combat2, COMBAT_PARAM_CREATEITEM, 1492)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)

local area2 = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat2, area2)

local area = createCombatArea({
   {1, 1, 1},
   {1, 3, 1},
   {1, 1, 1}
})
setCombatArea(combat, area)

function onUseWeapon(cid, var)

   local better_bow = 2222
 
   if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == better_bow or getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == better_bow then
       return doCombat(cid, combat2, var) and true
   end
   return doCombat(cid, combat, var)
end

Does that just create a fire field under the target? And again, that is a script to modify the burst arrow, yes?

I want it to add a fire DoT to a target when firing regular arrows.

Firing regular arrows with custom bow = Regular arrow damage + fire DoT
Firing regular arrows with normal bow = Regular arrow damage, only.
 
Last edited:
It's creating "fire bomb rune" under target and also making the standard effect as burst arrow if someone have special bow, if no its only making standard burst arrow.
Im noob, what means DoT?
 
It's creating "fire bomb rune" under target and also making the standard effect as burst arrow if someone have special bow, if no its only making standard burst arrow.
Im noob, what means DoT?

It's a good idea, but I'd prefer if it only added the fire effect. There will be fire fields everywhere eventually hehe.

DoT = Damage over time. Like when someone is poisoned or steps in a fire field.
 
lol, I found the problem, do this
Lua:
local bowid = 22418
local condition = createConditionObject(CONDITION_FIRE)
    addDamageCondition(condition, 10, 2000, -10)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, true)
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
 
Solution
lol, I found the problem, do this
Lua:
local bowid = 22418
local condition = createConditionObject(CONDITION_FIRE)
    addDamageCondition(condition, 10, 2000, -10)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, true)
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

Man, I cannot tell you how much I appreciate that. It works 100% as I want it now.
Thanks for keep posting here and helping me fix this.

I bow to you.
 
lol, I found the problem, do this
Lua:
local bowid = 22418
local condition = createConditionObject(CONDITION_FIRE)
    addDamageCondition(condition, 10, 2000, -10)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, true)
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


Would this be possible to do as a movement?
Im using nostalrius tfs 1.2
if player equip bow with item id =xxxx
with specific arrow id = xxxx
applies normal damage + fire damage over time?
Im curious..:)
 
Back
Top