• 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 Shootype Wand

Chestnutz

Senior Member
Joined
May 19, 2010
Messages
344
Reaction score
20
Hello,
I'm trying to make a wand that shoots more then one different kind of shootype/damage. (multi shootype wand) I'm using the code:
saved as 'multi.lua' in data/weapons/scripts
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.2, -450, -0.3, -600)´
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.2, -450, -0.3, -600)´

function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end

and in data/weapons/weapons.xml i have the line:
<wand id="2191" level="13" mana="3" min="13" max="25" type="fire" event="function" value="multi">
<vocation id="1"/>
</wand>

it's not working, any ideas?
REP++
~Chestnutz
 
When you use 2 times the same param on a variable you just replace, you dont add it..
You have to create more combat objects like:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.2, -450, -0.3, -600)´

local combat2 = createCombatObjetct()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATH)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.2, -450, -0.3, -600)

Then on the function, return combat as random.. like:
Code:
function onUseWeapon(cid, var)
if(math.random(1,100) >= 50 return doCombat(cid, combat, var)
else return doCombat(cid, combat2, var)
end
end
That means 50% chance to return combat and 50% chance to return combat2.
Btw, im not sure it will work with CONST_ANI_DEATH and COMBAT_DEATH. I was just giving you an example.

Also I found that your line on xml file is wrong..

Should be:
Code:
<wand id="2191" level="13" mana="3" min="13" max="25" type="fire" event="script" value="multi.lua">

Instead of:
Code:
<wand id="2191" level="13" mana="3" min="13" max="25" type="fire" event="function" value="multi">
 
The script I made for you (in requests) isn't what you wanted? and if it's not, try to explain what you want exactly.
 
Back
Top