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

Chance to kill

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2008
Messages
56
I hope no1 has already asked this question (cause I'm 2 lazy to check the 11 pages i got while trying to search for it) but does any1 know how 2 make an ability that has a 50% chance to kill the enemy and a 50% chance to kill yourself? I believe it cant be based off a passive ability. I can get the move to kill me, but not the enemy.
So far i got this:
Events: Unit - A unit Finishes casting an ability
Conditions: (Ability being cast) Equal to Supreme Fire Blast
Actions: If/then/else multiple action
If - Conditions: Either[1] Equal to True
Then - Actions: Kill (Attacked unit) << The problem might be here...
Else - Actions: Kill (Casting unit)

And
Events: Time - Every 1.50 seconds of game time
Conditions:
Actions: If/then/else multiple action
If - Conditions: Either[1] Equal to True
Then - Actions: Set Either[1] = False
Else - Actions: Set Either[1] = True

I know this trigger works fine but the other one wont work.
 
Level 8
Joined
May 27, 2007
Messages
170
Create an integer variable which can be set to a random number each time the ability is used, like so:

  • To Kill Or Not To Kill
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set To_Kill_Or_Not_To_Kill = (Random integer number between 1 and 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • To_Kill_Or_Not_To_Kill Equal to 1
        • Then - Actions
          • Unit - Kill (Target unit of ability being cast)
        • Else - Actions
          • Unit - Kill (Casting unit)
That just sets it to either 1 or 2, and if it is set to 1, then the target will be killed, if not (i.e. it is set to 2) the caster will be killed.

I used (Target unit of ability being cast) assuming that your ability uses a unit target.

Hope that helps :D
 
Level 8
Joined
Jul 22, 2008
Messages
331
  • Events
    • Unit - unit is attacked
  • Conditions
    • Attacking unit has an anility (your passive ability)
  • Actions
    • Variable - set (your integer variable) equal to random integer number 1 to 100
    • If conditions then action else actions
      • if conditions
        • Integer - If (your integer variable less then 50 do)
      • then Actions
        • Unit - cause attacking unit to damage attacked unit for (10000) damage.
      • else actions
        • Unit - cause attacking unit to damage attacking unit for (10000) damage.
Or just like the post above
 
Status
Not open for further replies.
Top