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

Multi Conditions?

LaggyNoob

Member
Joined
Aug 24, 2013
Messages
40
Reaction score
17
Location
England
found this script that works pretty well, but since it's not letting me set 2 lots of different conditions im wondering if anyone has a method to make this work please :D

Lua:
local poisonbow = 5108
local firebow = 5109

local condition = createConditionObject(CONDITION_POISON)
    addDamageCondition(condition, 10, 2000, -15)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, true)
  
local condition = createConditionObject(CONDITION_FIRE)
    addDamageCondition(condition, 10, 2000, -15)
    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 == poisonbow or slotright.itemid == poisonbow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), condition, CONST_ME_POISON)
    elseif slotleft.itemid == firebow or slotright.itemid == firebow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), condition, CONST_ME_FIRE)
    end
   return doCombat(cid, combat, var)
end

When using custom fire bow it should choose the fire condition, and same with poison, if no custom bow in hand just shoot standard arrows.

Thanks!
 
found this script that works pretty well, but since it's not letting me set 2 lots of different conditions im wondering if anyone has a method to make this work please :D

Lua:
local poisonbow = 5108
local firebow = 5109

local condition = createConditionObject(CONDITION_POISON)
    addDamageCondition(condition, 10, 2000, -15)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, true)
 
local condition = createConditionObject(CONDITION_FIRE)
    addDamageCondition(condition, 10, 2000, -15)
    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 == poisonbow or slotright.itemid == poisonbow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), condition, CONST_ME_POISON)
    elseif slotleft.itemid == firebow or slotright.itemid == firebow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), condition, CONST_ME_FIRE)
    end
   return doCombat(cid, combat, var)
end

When using custom fire bow it should choose the fire condition, and same with poison, if no custom bow in hand just shoot standard arrows.

Thanks!

What about this script?

Lua:
local poisonbow = 5108
local firebow = 5109
local conditionpoison = createConditionObject(CONDITION_POISON)
    addDamageCondition(conditionpoison, 10, 2000, -15)
    setConditionParam(conditionpoison, CONDITION_PARAM_DELAYED, true)
local conditionfire = createConditionObject(CONDITION_FIRE)
    addDamageCondition(conditionfire, 10, 2000, -15)
    setConditionParam(conditionfire, 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 == poisonbow or slotright.itemid == poisonbow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), conditionpoison, CONST_ME_POISON)
    elseif slotleft.itemid == firebow or slotright.itemid == firebow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), conditionfire, CONST_ME_FIRE)
    end
    return doCombat(cid, combat, var)
end

You can not use the same table name (condition) if you are going to add a second one to the script.
So i did just rename them to conditionpoison and conditionfire, thay could also be condition1 and condition2. im sure you understand what i mean
 
Last edited:
What about this script?

Lua:
local poisonbow = 5108
local firebow = 5109
local conditionpoison = createConditionObject(CONDITION_POISON)
    addDamageCondition(conditionpoison, 10, 2000, -15)
    setConditionParam(conditionpoison, CONDITION_PARAM_DELAYED, true)
local conditionfire = createConditionObject(CONDITION_FIRE)
    addDamageCondition(conditionfire, 10, 2000, -15)
    setConditionParam(conditionfire, 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 == poisonbow or slotright.itemid == poisonbow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), conditionpoison, CONST_ME_POISON)
    elseif slotleft.itemid == firebow or slotright.itemid == firebow and getCreatureTarget(cid) then
        doTargetCombatCondition(cid, getCreatureTarget(cid), conditionfire, CONST_ME_FIRE)
    end
    return doCombat(cid, combat, var)
end

You can not use the same table name (condition) if you are going to add a second one to the script.
So i did just rename them to conditionpoison and conditionfire, thay could also be condition1 and condition2. im sure you understand what i mean

i tried that with no joy, i got errors on booting up the distro, second let me find them

EDIT: okay what ever you did seemed to of worked! Thanks haha, i tried condition1 and condition2, conditionfire, conditionpoison but i got errors! god knows what i did wrong
 
i tried that with no joy, i got errors on booting up the distro, second let me find them

EDIT: okay what ever you did seemed to of worked! Thanks haha, i tried condition1 and condition2, conditionfire, conditionpoison but i got errors! god knows what i did wrong
You have to make sure you change all the conditions for it to work
Take a look here where i highlight the different conditions
local poisonbow = 5108
local firebow = 5109

local conditionpoison = createConditionObject(CONDITION_POISON)
addDamageCondition(conditionpoison , 10, 2000, -15)
setConditionParam(conditionpoison , CONDITION_PARAM_DELAYED, true)

local conditionfire = createConditionObject(CONDITION_FIRE)
addDamageCondition(conditionfire , 10, 2000, -15)
setConditionParam(conditionfire , 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 == poisonbow or slotright.itemid == poisonbow and getCreatureTarget(cid) then
doTargetCombatCondition(cid, getCreatureTarget(cid), conditionpoison , CONST_ME_POISON)
elseif slotleft.itemid == firebow or slotright.itemid == firebow and getCreatureTarget(cid) then
doTargetCombatCondition(cid, getCreatureTarget(cid), conditionfire , CONST_ME_FIRE)
end
return doCombat(cid, combat, var)
end

And that is basicly the only thing i changed from the script you provided :)
 
Im glad i could guide you in the right direction :)
It's easy going blind when coding sometimes :p

yeah lol, this might puzzle you though, would it be possible to avoid adding condition if it does not blood hit?, possibly not refresh the condition if it's already tagged on a mob
 
yeah lol, this might puzzle you though, would it be possible to avoid adding condition if it does not blood hit?, possibly not refresh the condition if it's already tagged on a mob
Im sure there is a way to make that happen, but nothing im in the mind to challange today. :p

Edit:
Here is an updated version of the script.
Let me know if its working or not @LaggyNoob

Script v1.1
Lua:
local poisonbow = 5108
local firebow = 5109

local combatpoison = createCombatObject()
   setCombatParam(combatpoison, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
   setCombatParam(combatpoison, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
   setCombatFormula(combatpoison, COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

local combatfire = createCombatObject()
   setCombatParam(combatfire, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
   setCombatParam(combatfire, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
   setCombatFormula(combatfire, COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

local conditionpoison = createConditionObject(CONDITION_POISON)
   addDamageCondition(conditionpoison, 10, 2000, -15)
   setConditionParam(conditionpoison, CONDITION_PARAM_DELAYED, true)
   setCombatCondition(combatpoison, conditionpoison)

local conditionfire = createConditionObject(CONDITION_FIRE)
   addDamageCondition(conditionfire, 10, 2000, -15)
   setConditionParam(conditionfire, CONDITION_PARAM_DELAYED, true)
   setCombatCondition(combatfire, conditionfire)

function onUseWeapon(cid, var)
   local slotleft = getPlayerSlotItem(cid,CONST_SLOT_LEFT)
   local slotright = getPlayerSlotItem(cid,CONST_SLOT_RIGHT)
 
   if slotleft.itemid == poisonbow or slotright.itemid == poisonbow and getCreatureTarget(cid) then
       local combat = doCombat(cid, combatpoison, var)
   elseif slotleft.itemid == firebow or slotright.itemid == firebow and getCreatureTarget(cid) then
       local combat = doCombat(cid, combatfire, var)
   end
   return combat
end

I did "bake" the conditions into the combatobject like poison arrow works, and hopefully that should only apply the conditions when the arrow hits the player and it should not when the player block or an arrow miss the target
 
Last edited:
Back
Top