• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

whow can you set lvls of custom ability's lvl1 15% lvl 2 30 %

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random integer number between 1 and 100) Less than or equal to (10 + (5 x (Level of Acid Bomb for (Triggering unit))))
      • Then - Actions
      • Else - Actions
Starts chance at 15%, next level would be 20%, 25% and so on
 
Level 5
Joined
Sep 1, 2010
Messages
168
Event: unit becomes attacked
you can add a condition like real - damage taken more than 50.0
actions:
if random number between 1 and 100 equal or less than (10 + level of <dummy ability* for attacking unit>)
pause unit
now depending on more or less pretty coding, use either a wait or start a one-shot timer.
I'll be sloppy now and just use
wait - (level of ability * 0.50) seconds (just a suggestion to modify the bash duration)
unpause triggering unit.
Remember that in a wait you cannot address other units than triggering unit, thus for other abilities a wait is pretty useless.

If you want to have a knockback inbetween, I'd use instead of the suggested wait the following (you'll need a global point variable Loc; nicer would be a local one in jass to ensure MUI, though..):
for loop integer A from 1 to 5, do:
{set Loc = position of triggering unit
unit - move triggering unit instantly 25 with polar offset (unit facing direction -180 degrees)
custom function - call Removlocation (udg_Loc)
wait 0.1 seconds
}
wait (whatever time left until stun is over)
unpause unit


Hope this does it for you.. if you want another angle to hit the unit along, just experiment a bit... (e.g. before loop turn unit instantly facing (angle between attacking unit and attacked unit/triggerung unit)

...


*I'd suggest moon glaive as dummy ability since it really does nothing already :)
 
Level 3
Joined
Mar 26, 2011
Messages
16
heyyyy

heyy no no no no no no no no no no no no i dont want to learn the spell man.all is that i am sayin is when you create a knockback whow i am goin to set its percentage means that --- lvl1 15%----lvl2 20%----lvl3 30%--- thats all i want to know yaar:ogre_rage::ogre_rage::ogre_rage::ogre_rage::ogre_rage: :grin::grin::grin::grin::grin::grin::grin: pleasee reply i am making a map and i need your help !!!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
(Random integer number between 1 and 100) Less than or equal to (10 + (5 x (Level of Acid Bomb for (Triggering unit))))

This is why you should pay attention at maths class.

What both 100 and 10+5*X have in common are they are both divisible by 5...

(Random integer number between 1 and 20) Less than or equal to (2 + (Level of Acid Bomb for (Triggering unit)))

This saves a multiplication.

heyy no no no no no no no no no no no no i dont want to learn the spell man.all is that i am sayin is when you create a knockback whow i am goin to set its percentage means that --- lvl1 15%----lvl2 20%----lvl3 30%--- thats all i want to know yaar pleasee reply i am making a map and i need your help !!!
I believe for the pass range you are after an array to do this (or some stupidly complex formula so lets stick to the array). Basically make an integer array where the index corrosponds to the ability level. Thus intarray[1] = 15%, intarray[2] = 20% and intarray[3] = 30% etc.
The value depends on how chance is implimented, in above ways it would be just the integer value in percentage (15 for level 1) but in my way it would be that divided by 5 (so 3 for level 1).

In the trigger where chance hits/misses are computed, you just use the ability level as the index to that array. This maintains a high level of efficency while providing far more customizability than formulas can (eg in the case that they are not continious).
 
Status
Not open for further replies.
Top