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

8.6 "chance on hit" effects

FullyFlared

New Member
Joined
Feb 1, 2013
Messages
14
Reaction score
0
Hey guys! I've looked around the forums practically all day today and can't quite find what I'm looking for.

If possible, I would like to add some certain effects to wands/rods/distance weapons that give a chance on each hit to do several different things depending on the weapon you're using.

For distance weapons I'd like to be able to have a 5% chance per hit to increase holy damage done by 50% for 6 seconds, increase attack speed by 20%, or increase physical damage done by 15% for 5 seconds (3 separate scripts)

For sorcs I would like to make a 5% chance per wand hit to be able to summon a fire devil to attack the master's target for 20 seconds, or until killed. And I would like a script for a 5% chance on wand hits to increase death damage done by 15% for 5 seconds.

For druids I'd like to make rods give a 5% chance to summon a custom healing monster which I'll be adding in, lasting 10 seconds, up to a maximum of 1 summon at a time. And a script for a 5% chance on rod hit to increase the druids healing output amount by 20%.

If this is do-able I would greatly appreciate it. If it's too much work, I can understand that too, but thank you for the consideration anyways.

Server is 8.6
TFS 0.4
 
Several scripts for certain weapons, which is why I can understand why it could be just too much work. As an example, currently, I have almost all melee weapons having 1 of 6 different "chance on hit" effects. Like, a bloody edge has a 5% chance to do bleed damage for 10 seconds... or a fire sword has a 5% chance to burn the foe for 30 seconds... etc etc. I would like to do the same concept for wands, rods, and distance weapons, but with different effects (those that I listed above). But I just personally can't seem to figure out how to do it
 
Here is already 1 of them :p

Fire Devil wand
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

function onGetFormulaValues(cid, level, maglevel)
   min = -(maglevel*4) -level/5
   max = -(maglevel*6) -level/5

   return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local function doRemoveSummon(cid)
   for _, m in pairs(getCreatureSummons(cid)) do
     if getCreatureName(m) == "Fire Devil" then
       doRemoveCreature(m)
     end
   end
   return true
end

function onUseWeapon(cid, var)

   if math.random(1,20) == 1 then
     if #getCreatureSummons(cid) < 1 then
       doSummonMonster(cid, "Fire Devil")
       addEvent(doRemoveSummon, 20 * 1000, cid)
     end
   end
   return doCombat(cid, combat, var)
end
 
Last edited:
You're awesome dude. I'll try out the fire devil wand when I get home from work. I appreciate the fire sword one too but I was saying I already have the melee weapon scripts. I was just giving an example to kind of show what I'm trying to accomplish :)

Just need wands/rods/distance weapons.

Again, thank you so much.
 
What you can do with the wand that increases healing from spells, add time storage (exhaustion.set) in the wand, then make 2 different combats in the healing spells.
You can check if the exhaustion is still there, if it is, make it do the stronger combat, else the normal one.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

function onGetFormulaValues(cid, level, maglevel)
     min = -(maglevel*4) -level/5
     max = -(maglevel*6) -level/5

     return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)

     if math.random(1,20) == 1 then
          exhaustion.set(cid, 20349, 2 * 60)
     end
     return doCombat(cid, combat, var)
end
In the healing spells scripts.
Code:
if exhaustion.check(cid, 20349) then

You could do the same thing for the weapons that increase certain damage types.
 
Last edited:
Back
Top