• 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 Ammunition with extra damage

leonmagmo

New Member
Joined
Mar 17, 2009
Messages
82
Reaction score
3
Hello, I have a doubt if is possible to make an ammunition(for example, an arrow) that have 10% of chance to send X effect that give an extra damage.
The only way that I could do this is making a script in Weapons, but the problem is that when I do this I have to change the formula of the arrow normal damage(He no longer recognizes the attack on items.xml) and I want use the attack that is configured in items.xml, anyone know how I can solve it?
Thanks!
 
Hello, I have a doubt if is possible to make an ammunition(for example, an arrow) that have 10% of chance to send X effect that give an extra damage.
The only way that I could do this is making a script in Weapons, but the problem is that when I do this I have to change the formula of the arrow normal damage(He no longer recognizes the attack on items.xml) and I want use the attack that is configured in items.xml, anyone know how I can solve it?
Thanks!
I'd like to know this aswell.
 
You can just do it how I posted it. This is based on skill and attack.
...but not the factor, so if I have full defense I will deal same dmg as if on full atk + it does not check the armor/defense of target, so it's useless way to make this work.
 
Just add this
Code:
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
 
8.54 ( 0.3.6pl1), when the weapon is only added in items.xml he follow this attack:
Code:
<item id="634" article="a" name="small stone" plural="small stones">
        <attribute key="weight" value="90" />
        <attribute key="slotType" value="ammo" />
        <attribute key="attack" value="15" />
        <attribute key="maxHitChance" value="65" />
        <attribute key="weaponType" value="ammunition" />
        <attribute key="ammoType" value="arrow" />
        <attribute key="shootType" value="arrow" />
                               <attribute key="ammoAction" value="moveback" />
                               <attribute key="breakChance" value="40" />
    </item>
 
Then, how I can do a script that this Small Stone have 10% of chance to send a new effect in the target(ex: 67) and give addition to normal damage a damage bonus with this formula:
Code:
function callback_formula(cid, level, skill, attack, factor)
  skill = getPlayerSkill(cid, SKILL_DISTANCE)
  return -(((skill * 2) / 2.7) + (level)), -((skill * 2 / 2.0) + (level))  
end
The normal damage of Small Stone still need to follow the attack in items.xml (it's necessary to check if is Full Attack, Balanced or Full Defense and need to check the armor/defense of target too)
 
You can create 2 combats with different effects and damage, use math.random under function onCastSpell.
Code:
if math.random(1, 10) == 1 then
Then if it's 1 the second combat, else the first combat.

For armor/defence based damage add this to the combat.
Code:
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
 
Back
Top