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

Merging two weapon scripts

frigo

New Member
Joined
Apr 10, 2009
Messages
359
Reaction score
0
Location
Lithuania
How do I merge two of these scripts?
The first one gives freezing condition, and the second one makes 50% of the damage hit with ice dmg, and the other 50% with physical damage...
I want it to give freezing condition and 50% ice damage and 50% physical damage, not 100% physical like on all the other ones..
First one:
lua Code:

Code:
local combat = createCombatObject()
local condition = createConditionObject(CONDITION_FREEZING)

setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
 setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.0, 0, 1.0, 0)

setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 750, -300)
setCombatCondition(combat, condition)
function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
Second one:
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_NONE)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL, 0, 0, 0.5, 0)
 
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 0, 0, 0.5, 0)
 
local function onUseWeapon1(parameters)
    doCombat(parameters.cid, parameters.combat1, parameters.var)
end
 
local function onUseWeapon2(parameters)
    doCombat(parameters.cid, parameters.combat2, parameters.var)
end
 
function onUseWeapon(cid, var)
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2 }
 
addEvent(onUseWeapon1, 0, parameters)
addEvent(onUseWeapon2, 0, parameters)
 
 
end
Sorry for no lua tags, I don't know how to use them on otland://
 
Code:
local _combat = {}
for i = 1, 2 do
	_combat[i] = createCombatObject()
	setCombatParam(_combat[i], COMBAT_PARAM_TYPE, i == 1 and COMBAT_PHYSICALDAMAGE or COMBAT_ICEDAMAGE)
	setCombatFormula(_combat[i], COMBAT_FORMULA_SKILL, 0, 0, 0.5, 0)
end

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.0, 0, 1.0, 0)

local condition = createConditionObject(CONDITION_FREEZING)
setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE)
addDamageCondition(condition, 5, 750, -300)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
	doCombat(cid, _combat[1], var)
	doCombat(cid, _combat[2], var)
	doCombat(cid, combat, var)
end
 
Back
Top