• 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 A Little help with double conditions

Tegardee

The Boss
Joined
Jun 18, 2014
Messages
106
Reaction score
0
Location
Brazil
so guys, I already solved my problem, but I configured the script to add two conditions on the target, but only add one condition in the target. How I do this? this is the currently script.

Code:
local damageTypes = {COMBAT_FIREDAMAGE, COMBAT_POISONDAMAGE}
local condTypes = {CONDITION_FIRE, CONDITION_POISON}
local shootEffects = {11, 17}
local effects = {15, 41}

local combats = {}
for i = 1, #shootEffects do
  combats[i] = createCombatObject()
  setCombatParam(combats[i], COMBAT_PARAM_TYPE, (damageTypes[i] or 255))
  setCombatParam(combats[i], COMBAT_PARAM_EFFECT, (effects[i] or 255))
  setCombatParam(combats[i], COMBAT_PARAM_DISTANCEEFFECT, (shootEffects[i] or 255))
  setCombatFormula(combats[i], COMBAT_FORMULA_DAMAGE, -0, -62000000, -0, -68000000)
end

local conditions = {}
for j = 1, #condTypes do
  conditions[j] = createConditionObject(condTypes[j])
  setConditionParam(conditions[j], CONDITION_PARAM_DELAYED, 1)
  addDamageCondition(conditions[j], 99999, 100, -152014703)
end

function onUseWeapon(cid, var)

local config = {
vip = "yes", -- Only Vips Use?
days = 0, -- Don't Edit
target = getCreatureTarget(cid), -- Don't Edit
chance = math.random(1, 100), -- Percent of the Condition
}

if (config.vip == "yes") and getAccountVipDays(cid) <= config.days then
doPlayerSendCancel(cid, "Only Vips Can Use.")
return false
end

for i = 1, #combats do
addEvent(function()
if isCreature(cid) then
if (config.chance <= 40 and isCreature(config.target)) then
for j = 1, #conditions do
doTargetCombatCondition(0, config.target, conditions[j], CONST_ME_STUN)
return doCombat(cid, combats[j], var)
end
else
return doCombat(cid, combats[i], var)
end
end
return true
end, i * 200)
end
return true
end

TFS 0.4 3777 (8.6)
 
Last edited:
Back
Top