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

Solved Using more than one skill condition per time

G4BB3R

New Member
Joined
Jul 23, 2010
Messages
80
Reaction score
4
Hello, I am making food system that each food gives you some diferent conditions.

The problem is that when I use second condition (to increase magic level), the first effect (i.e. axe fighting) decreases back.

How to use more than one skill condition ?

Thanks
 
Look at this example, I can't set two conditions at the same time :(

Code:
local MY_CONDITION = {CONDITION_PARAM_SKILL_CLUB, CONDITION_PARAM_SKILL_SWORD}

local combat = {}
for i = 1, #MY_CONDITION do
  local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
    setConditionParam(condition, MY_CONDITION[i], 100)
  combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
    setCombatParam(combat[i], COMBAT_PARAM_AGGRESSIVE, 0)
  setCombatCondition(combat[i], condition)
end

function onSay(cid, words, param, channel)

  doCombat(cid, combat[2], numberToVariant(cid))        
  doCombat(cid, combat[1], numberToVariant(cid))

return true
end
 
Try it by setting different subids for each condition type.
CONDITION_PARAM_SUBID
 
Do not worked, but I analyzed a lot of buff spells examples and got a conclusion.
To work, in a single combat object you need to set all params, and not each param for each combat object.

PHP:
local MY_CONDITION = {CONDITION_PARAM_SKILL_CLUB, CONDITION_PARAM_SKILL_SWORD}

  local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
    for k, CONDICOES in pairs(MY_CONDITION) do
      setConditionParam(condition, CONDICOES, 100) // The magic is here lol
    end
  combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
    setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) 
    setCombatCondition(combat, condition)

function onSay(cid, words, param, channel)
  return  doCombat(cid, combat, numberToVariant(cid))
end
 
Back
Top