Trigger for item to cause x chance

Status
Not open for further replies.
Level 3
Joined
Feb 20, 2015
Messages
39
How do i make an item to have chances to poison,stun,slow,etc an enemy?I saw in most map they have item that can do this kind of stuff but how do they do this?
 
Level 3
Joined
Feb 20, 2015
Messages
39
ok this works BUT..i want to add effects like this

20 Chance to weaken the enemy damage by x amount within x seconds..anyone can solve this? i will +rep
 
Level 13
Joined
Jan 2, 2016
Messages
978
You could try to make 2 custom abilities:
1) Based on Inner Fire, with negative damage bonus, and 0 armor bonus, having enemies allowed as targets.
2) Based on Orb of Lightning, with ability (1) in the ability field.

Not sure if it will work, but doesn't hurt to try :p
 
Level 3
Joined
Feb 20, 2015
Messages
39
You could try to make 2 custom abilities:
1) Based on Inner Fire, with negative damage bonus, and 0 armor bonus, having enemies allowed as targets.
2) Based on Orb of Lightning, with ability (1) in the ability field.

Not sure if it will work, but doesn't hurt to try :p
Okay the inner fire did not work because it has to be casted first to be applied but I did managed to get it done by using passive ability like devotion aura with negative value,BUT like i said i want to have X chances for it to occur

  • Traits essence fel chance
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is A Hero) Equal to True
    • Actions
      • Unit - Add Weaken to (Attacking unit)
This work but I want to add chances for this "Weaken".
 
Level 25
Joined
Aug 29, 2012
Messages
1,085
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si - Conditions
    • (Random real number between 0.00 and 100.00) Inférieur ou Égal à 50.00
    • Alors - Actions
    • Sinon - Actions
Sorry my editor is in French, but I think you get the point. In this example, the spell would have a 50% chance to trigger additional actions.
 
Level 3
Joined
Feb 20, 2015
Messages
39
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si - Conditions
    • (Random real number between 0.00 and 100.00) Inférieur ou Égal à 50.00
    • Alors - Actions
    • Sinon - Actions
Sorry my editor is in French, but I think you get the point. In this example, the spell would have a 50% chance to trigger additional actions.
Okay imma try this out
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
the spell would have a 50% chance to trigger additional actions
Actually it will have slightly more/less than 50% chance due to 0 (or 100) being included in the set of possible numbers. The proof is that if you set the test to be "less than or equal to 0.00" it can still pass even though it is meant to represent impossibility. If you lose the equal to part then "less than 100.00" can fail when it is meant to represent certainty. Basically an "off by 1" error.

In this case I would recommend "(random integer between 1 and 2) less than or equal to 1". This would be correct as long as the probability distribution of the JASS random function is constant.
 
Status
Not open for further replies.
Top