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

Help with Chances

Status
Not open for further replies.
Level 7
Joined
Nov 13, 2007
Messages
244
Well what i need a spell that when an enemy unit attacks my unit give him 10% to counter attack dealing X1 my units agillit this is what i got.


  • Counter Attack 1
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Ability being cast) Equal to Counter-Attack
    • Actions
      • Trigger - Turn on Counter Attack 2 <gen>

And this is the second part:


  • Counter Attack 2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Ability being cast) Equal to Counter-Attack
    • Actions
      • Set counter_caster = (Attacked unit)
      • Set counter_target = (Attacking unit)
      • Set chance_counter = (Random integer number between 10 and 10)
      • Unit - Cause counter_caster to damage counter_target, dealing (Real(((Agility of counter_caster (Include bonuses)) x 1))) damage of attack type Spells and damage type Normal
 
Level 17
Joined
Apr 13, 2008
Messages
1,608
(Ability being cast) Equal to Counter-Attack
This line is crap.
Instead use this:
Level of attacked unit's Counter Attack Ability == 1


Set chance_counter = (Random integer number between 10 and 10)
This line is crap.
Instead use this:

Set chance_counter = (Random integer number between 1 and 10)
If chance_counter == 1 then
Unit - Cause counter_caster to damage counter_target, dealing (Real(((Agility of counter_caster (Include bonuses)) x 1))) damage of attack type Spells and damage type Normal
 
Level 11
Joined
Jun 21, 2007
Messages
505
Note: please when you write trigger in your posts, don't put a space before "Events", "Conditions" and "Actions".
  • Events:
    • Unit - A unit is attacked
  • Conditions:
    • Boolean - Unit has ability
  • Actions:
    • If Random integer number (between 1 and 10) equal to (1) then do (Cause (Attacked unit) to deal damage to (Attacking unit) of type Normal and value of (Agility X level of ability)....)..
I see you are plotting something there about your project heh? Could you tell us something about it?
 
Status
Not open for further replies.
Top