• 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] Another WoW Oriented Trigger Question from Brox

Status
Not open for further replies.
Level 3
Joined
Jun 7, 2007
Messages
33
Ok....I ask too many of these =P. But...I've tried to make this myself, which I attempt to do before I ask for help. My trigger....failed, miserably. But what I need help on is a trigger that will detect whether a unit is in combat or not and when he enters combat it will remove Bloodrage (activateable) and replace it with the passive. I made a trigger using...

  • Combat
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Orc Warrior
          • ((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
        • Then - Actions
          • Set InCombat = 1
          • Unit - Remove Bloodrage from (Attacking unit)
          • Unit - Add Bloodrage In Combat to (Attacking unit)
        • Else - Actions
      • Wait 1.00 seconds
      • Set InCombat = 0
      • Wait 10.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Attacking unit)) Equal to Orc Warrior
          • ((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
          • InCombat Equal to 0
        • Then - Actions
          • Unit - Remove Bloodrage In Combat from (Attacking unit)
          • Unit - Add Bloodrage to (Attacking unit)
        • Else - Actions
          • Do nothing
I knew it wouldn't work when I started making it because it would set the InCombat var to 0 before he was out of combat then it would give him the skill back for a second, in which time he could use it, then it would take it away and keep doing that. If anyone has any ideas on how to do this I would be very pleased to hear them =). I know I ask a lot of tough trigger questions, to me anyway...And apparently to some of you jassers out there, I know my last one was said to be impossible to do. I would like to know if this is possible.

BTW Yes I know this was the stupidest way to even try to make this trigger.....but I couldn't think of anything else and I wanted to see how bad it would be like that. Don't comment on how bad it is plz =P

Thanks in advance.
 
Last edited:
Level 3
Joined
Jun 7, 2007
Messages
33
So I could do like.....
  • Events
    • Unit - A Unit is attacked
  • Conditions
    • (Unit-type of (Attacking unit)) Equal to Orc Warrior
    • ((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
  • Actions
    • Set AttackingUnit = (Attacking Unit)
    • Set AttackedUnit = (Attacked Unit)
    • Unit - Remove Bloodrage from (Attacking unit)
    • Unit - Add Bloodrage In Combat to (Attacking unit)
    • Trigger - Turn on AttackedUnit Alive <gen>
AttackedUnit Alive
  • Events
    • Time - Every .5 seconds of game time.
  • Conditions
    • ((AttackedUnit) is alive) Equal to False
  • Actions
    • Set AttackedUnit = No Unit
    • Unit - Remove Bloodrage In Combat from (AttackingUnit)
    • Unit - Add Bloodrage to (AttackingUnit)
    • Trigger - Turn off (This Trigger)
Not sure if thats right...I did it all in the post editor and not on World Editor so I may have missed something. But do you think that would work?

Edit: It works =D! But could be abuseable...Because when it gives it back it resets the cooldown =/

[Off-Topic]
Do you know of some good JASS tutorials? I want to learn jass but I need to find some good tutorials that explain everything.
 
Last edited:
Level 1
Joined
Nov 30, 2005
Messages
61
No thats not going to work.

  • Custom script: local unit udg_AttackingUnit = GetAttackingUnit()
  • Custom script: local unit udg_AttackedUnit = GetAttackedUnit()
Just add that at the start of your trigger. Now you can use those variables through waits and everything. Use only one trigger.
 
Last edited by a moderator:
Level 12
Joined
Aug 18, 2006
Messages
1,193
does he actually need custom scripts to get variables through waits and everything?

and by the way, those triggers wont work mainly becourse of this

1 : He will gain another Bloodrage In Combat for every Attack he makes

2 : He can only regain his Bloodrage if his Enemy Dies

3 : The second trigger turn off after its activated, and not turned back on later, meaning he can only get back Bloodrage once

4 : He will lose Bloodrage, even if he hasnt used it(or is Bloodrage a Buff?)

i think thats all, good luck :p
 
Level 1
Joined
Nov 30, 2005
Messages
61
I just rock at getting - rep is all. Fear my -repping skillz.

Anyway using those 2 simple lines of Custom Script is the best option. Sure he doesn't need to use them, but its a lot better then what he would have to do otherwise.
 
Level 3
Joined
Jun 7, 2007
Messages
33
does he actually need custom scripts to get variables through waits and everything?

and by the way, those triggers wont work mainly becourse of this

1 : He will gain another Bloodrage In Combat for every Attack he makes

2 : He can only regain his Bloodrage if his Enemy Dies

3 : The second trigger turn off after its activated, and not turned back on later, meaning he can only get back Bloodrage once

4 : He will lose Bloodrage, even if he hasnt used it(or is Bloodrage a Buff?)

i think thats all, good luck :p

1 : No he doesn't o_O I've tested it.

2 : I can add another trigger for if he dies to add it back.

3 : He gets it back everytime. o_O

4 : He's supposed to lose it even if he hasn't used it o.o he's not supposed to be able to use it in combat. So if he hasn't used it then oh well for him =p

And Dr Super Good, I was on topic with the post....I was replying to him telling me to use the custom scripts and I said ok. I just added in an extra comment out of curiosity.
 
Level 1
Joined
Nov 30, 2005
Messages
61
Whether or not it works, its just plain inefficent. Just use those 2 lines of custom script and go about it as you were originally.
 
Status
Not open for further replies.
Top