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

[Trigger] Chance to add a buff

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2008
Messages
56
I need a trigger that makes a move have a chance to add a buff on the target. It also has to be an activated ability. These are the many fails i have:
  • Freeze
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Frostbolt sorcerer 2
    • Actions
      • Set chance[1] = (Integer((Life of chancer 0314 <gen>)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • chance[1] Equal to 1
        • Then - Actions
          • Hero - Create Freeze and give it to special 0309 <gen>
          • Unit - Move special 0309 <gen> instantly to ((Position of (Casting unit)) offset by (1.00, 1.00))
          • Hero - Order special 0309 <gen> to use (Last created item) on Practise target 0311 <gen>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • special 0309 <gen> Equal to (Hero manipulating item)
            • Then - Actions
              • Game - Display to (All players) the text: pt4 works
            • Else - Actions
              • Game - Display to (All players) the text: pt4 fooked
          • Unit - Move special 0309 <gen> instantly to (Center of Region 022 <gen>)
        • Else - Actions
          • Do nothing
  • chance
    • Events
      • Time - Every 0.87 seconds of game time
    • Conditions
    • Actions
      • Unit - Set life of chancer 0314 <gen> to (Random real number between 1.00 and 100.00)%
Second one works as intended.
For some very weird reason it says fooked every time yet that imo is the simplest part of the trigger... So i turned it off for now...

  • Freeze 2
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Frozen for freeze chances) Equal to True
    • Actions
      • Set chance[1] = (Integer((Life of chancer 0314 <gen>)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • chance[1] Equal to 1
        • Then - Actions
          • Unit - Remove Frozen for freeze chances buff from (Target unit of ability being cast)
        • Else - Actions
          • Do nothing
This one doesn't work either. Anyone know what to do?
 
Level 3
Joined
Aug 4, 2008
Messages
56
Doesn't it work when i give an already existing hero unit an item witch applies the buff, move him there and order him to use the item?
 
Level 6
Joined
Mar 15, 2005
Messages
112
Some problems I see.

  • Freeze
  • Events
  • Unit - A unit Finishes casting an ability
  • Conditions
  • (Ability being cast) Equal to Frostbolt sorcerer 2
  • Actions
  • Set chance[1] = (Integer((Life of chancer 0314 <gen>))) Don't see the point here use random number between x and y
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • chance[1] Equal to 1
  • Then - Actions
  • Hero - Create Freeze and give it to special 0309 <gen>
  • Unit - Move special 0309 <gen> instantly to ((Position of (Casting unit)) offset by (1.00, 1.00))
  • Hero - Order special 0309 <gen> to use (Last created item) on Practise target 0311 <gen>
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • special 0309 <gen> Equal to (Hero manipulating item) Can't refer to this since the event is Finished casting an ability
  • Then - Actions
  • Game - Display to (All players) the text: pt4 works
  • Else - Actions
  • Game - Display to (All players) the text: pt4 fooked
  • Unit - Move special 0309 <gen> instantly to (Center of Region 022 <gen>)
  • Else - Actions
  • Do nothing
So lets see if I understand. You want to add a buff to the target of your spell sometimes? If so you could do something like this.

  • Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Acid Bomb
    • Actions
      • Set Chance = (Random integer number between 1 and 100)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Chance Equal to (==) 1
          • Then - Actions
            • Unit - Add Custom Ability to (Target unit of ability being cast)
            • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Undead\Curse\CurseTarget.mdl
          • Else - Actions
            • Do nothing
The idea here is to add a custom passive ability to mimic the effects your buff will have. Use devotion aura if your want to add or remove some armor. Endurance aura if you want to change its attack speed etc. Use a special effect to make it look like its buffed. Remember to set that special effect as a variable so you can destroy it later. You seem to refer to units incorrectly. If you use starts the effect of an ability you can only refer to casting unit-target of ability being cast-ability being cast etc. You wouldn't be able to use attacking unit-dying unit etc in that trigger. Although you could use variables instead to refer to those units. You would need to set those variables in other triggers. I'm not sure exactly what your trying to do here with the adding of a buff or what effect your trying to achieve. If this isn't helpful please give more details.
 
Level 3
Joined
Aug 4, 2008
Messages
56
No no no. As i said in my first post it's an activated ability. Also i forgot to say the ONLY part that doesn't work is the part where it says fooked (look at the trigger). Oh and thanks redscores, I'll try that.
 
Level 6
Joined
Mar 15, 2005
Messages
112
Then instead of adding a custom passive ability add anything you want? I don't understand the point of the dummy unit. I think I am missing something. Does the dummy cast the spell on you or something? BTW the reason this doesn't work is cause...
  • Freeze 2
  • Events
  • Unit - A unit Is attacked
  • Conditions
  • ((Attacked unit) has buff Frozen for freeze chances) Equal to True
  • Actions
  • Set chance[1] = (Integer((Life of chancer 0314 <gen>))) again use random number
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • chance[1] Equal to 1
  • Then - Actions
  • Unit - Remove Frozen for freeze chances buff from (Target unit of ability being cast) This must be "Attacked unit" since the event is A unit is attack
  • Else - Actions
  • Do nothing
 
Level 3
Joined
Aug 4, 2008
Messages
56
Ok thanks it works now... kinda. The unit needs to be attacked... Is there any way to fix that?
 
Level 3
Joined
Aug 4, 2008
Messages
56
Right, here's the finished version if anyone cares :)wink:)
  • Unfreeze
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Frostbolt sorcerer 2
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • chance[1] Equal to 1
              • chance[1] Equal to 2
              • chance[1] Equal to 3
              • chance[1] Equal to 4
              • chance[1] Equal to 5
              • chance[1] Equal to 6
              • chance[1] Equal to 7
              • chance[1] Equal to 8
              • chance[1] Equal to 9
              • chance[1] Equal to 10
              • chance[1] Equal to 11
              • chance[1] Equal to 12
              • chance[1] Equal to 13
              • chance[1] Equal to 14
              • chance[1] Equal to 15
              • chance[1] Equal to 16
              • chance[1] Equal to 17
              • chance[1] Equal to 18
              • chance[1] Equal to 19
              • chance[1] Equal to 20
              • chance[1] Equal to 21
              • chance[1] Equal to 22
              • chance[1] Equal to 23
              • chance[1] Equal to 24
              • chance[1] Equal to 25
              • chance[1] Equal to 26
              • chance[1] Equal to 27
              • chance[1] Equal to 28
              • chance[1] Equal to 29
              • chance[1] Equal to 30
              • chance[1] Equal to 31
              • chance[1] Equal to 32
              • chance[1] Equal to 33
              • chance[1] Equal to 34
              • chance[1] Equal to 35
              • chance[1] Equal to 36
              • chance[1] Equal to 37
              • chance[1] Equal to 38
              • chance[1] Equal to 39
              • chance[1] Equal to 40
              • chance[1] Equal to 41
              • chance[1] Equal to 42
              • chance[1] Equal to 43
              • chance[1] Equal to 44
              • chance[1] Equal to 45
              • chance[1] Equal to 46
              • chance[1] Equal to 47
              • chance[1] Equal to 48
              • chance[1] Equal to 49
              • chance[1] Equal to 50
              • chance[1] Equal to 51
              • chance[1] Equal to 52
              • chance[1] Equal to 53
              • chance[1] Equal to 54
              • chance[1] Equal to 55
              • chance[1] Equal to 56
              • chance[1] Equal to 57
              • chance[1] Equal to 58
              • chance[1] Equal to 59
              • chance[1] Equal to 60
              • chance[1] Equal to 61
              • chance[1] Equal to 62
              • chance[1] Equal to 63
              • chance[1] Equal to 64
              • chance[1] Equal to 65
              • chance[1] Equal to 66
              • chance[1] Equal to 67
              • chance[1] Equal to 68
              • chance[1] Equal to 69
              • chance[1] Equal to 70
              • chance[1] Equal to 71
              • chance[1] Equal to 72
              • chance[1] Equal to 73
              • chance[1] Equal to 74
              • chance[1] Equal to 75
        • Then - Actions
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack (Target unit of ability being cast)
          • Unit - Remove (Last created unit) from the game
        • Else - Actions
          • Do nothing
  • Freeze
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) has buff Frozen for freeze chances) Equal to True
    • Actions
      • Set chance[1] = (Integer((Life of chancer 0314 <gen>)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • chance[1] Equal to 1
              • chance[1] Equal to 2
              • chance[1] Equal to 3
              • chance[1] Equal to 4
              • chance[1] Equal to 5
              • chance[1] Equal to 6
              • chance[1] Equal to 7
              • chance[1] Equal to 8
              • chance[1] Equal to 9
              • chance[1] Equal to 10
              • chance[1] Equal to 11
              • chance[1] Equal to 12
              • chance[1] Equal to 13
              • chance[1] Equal to 14
              • chance[1] Equal to 15
              • chance[1] Equal to 16
              • chance[1] Equal to 17
              • chance[1] Equal to 18
              • chance[1] Equal to 19
              • chance[1] Equal to 20
              • chance[1] Equal to 21
              • chance[1] Equal to 22
              • chance[1] Equal to 23
              • chance[1] Equal to 24
              • chance[1] Equal to 25
              • chance[1] Equal to 26
              • chance[1] Equal to 27
              • chance[1] Equal to 28
              • chance[1] Equal to 29
              • chance[1] Equal to 30
              • chance[1] Equal to 31
              • chance[1] Equal to 32
              • chance[1] Equal to 33
              • chance[1] Equal to 34
              • chance[1] Equal to 35
              • chance[1] Equal to 36
              • chance[1] Equal to 37
              • chance[1] Equal to 38
              • chance[1] Equal to 39
              • chance[1] Equal to 40
              • chance[1] Equal to 41
              • chance[1] Equal to 42
              • chance[1] Equal to 43
              • chance[1] Equal to 44
              • chance[1] Equal to 45
              • chance[1] Equal to 46
              • chance[1] Equal to 47
              • chance[1] Equal to 48
              • chance[1] Equal to 49
              • chance[1] Equal to 50
              • chance[1] Equal to 51
              • chance[1] Equal to 52
              • chance[1] Equal to 53
              • chance[1] Equal to 54
              • chance[1] Equal to 55
              • chance[1] Equal to 56
              • chance[1] Equal to 57
              • chance[1] Equal to 58
              • chance[1] Equal to 59
              • chance[1] Equal to 60
              • chance[1] Equal to 61
              • chance[1] Equal to 62
              • chance[1] Equal to 63
              • chance[1] Equal to 64
              • chance[1] Equal to 65
              • chance[1] Equal to 66
              • chance[1] Equal to 67
              • chance[1] Equal to 68
              • chance[1] Equal to 69
              • chance[1] Equal to 70
              • chance[1] Equal to 71
              • chance[1] Equal to 72
              • chance[1] Equal to 73
              • chance[1] Equal to 74
              • chance[1] Equal to 75
        • Then - Actions
          • Unit - Remove Frozen for freeze chances buff from (Attacked unit)
        • Else - Actions
          • Do nothing
 
Level 3
Joined
Aug 4, 2008
Messages
56
:grin: I don't want 1-4 cause i need other moves to have a chance to do stuff too and with different percentages...
Well actually I only thought it would be fun to spam a little :grin:
 
Level 9
Joined
May 27, 2006
Messages
498
Use Chance[1] Less than 75 instead of copying and pasting this condition for every single number.
I almost got killed when i saw that...

+ dont use Do nothing action as it does the same as leaving the else actions empty. It just uses a bit of RAM.
 
Status
Not open for further replies.
Top