• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Trigger] Someone check this trigger and see if there are any problems please!!!

Status
Not open for further replies.
Level 3
Joined
May 16, 2009
Messages
11
  • Wrath Scourge
    • Events
    • Conditions
    • Actions
      • Set counter = 0
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Hero - Disable experience gain for (Picked unit)
          • Set code_Unit = (Picked unit)
          • Set cv_Ability_AGI[counter] = (Strength of (Picked unit) (Exclude bonuses))
          • Set cv_Ability_INT[counter] = (Strength of (Picked unit) (Exclude bonuses))
          • Set cv_Ability_STR[counter] = (Strength of (Picked unit) (Exclude bonuses))
          • Set counter = (counter + 1)
          • Hero - Modify Strength of (Picked unit): Set to 0
          • Hero - Modify Agility of (Picked unit): Set to 0
          • Hero - Modify Intelligence of (Picked unit): Set to 0
      • Wait 600.00 seconds
      • For each (Integer A) from 0 to counter, do (Actions)
        • Loop - Actions
          • Hero - Modify Strength of (Picked unit): Set to cv_Ability_AGI[(Integer A)]
          • Hero - Modify Agility of (Picked unit): Set to cv_Ability_STR[(Integer A)]
          • Hero - Modify Intelligence of (Picked unit): Set to cv_Ability_INT[(Integer A)]
          • Hero - Enable experience gain for (Picked unit)
      • Trigger - Turn off (This trigger)

How do i have it select the unit stored in code_unit??
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
I don't know exactly what you mean with "select", but in your trigger:

  • Hero - Modify Strength of code_Unit: Set to cv_Ability_AGI[(Integer A)]
  • Hero - Modify Agility of code_Unit: Set to cv_Ability_STR[(Integer A)]
  • Hero - Modify Intelligence of code_Unit: Set to cv_Ability_INT[(Integer A)]
  • Hero - Enable experience gain for code_Unit
Err... that's it? The "picked unit" doesn't work if it isn't in the unit-group action.
Or what do you mean with "select"?
 
Level 15
Joined
Mar 31, 2009
Messages
1,397
Slightly broken, and I fixed ur leaks

  • Actions
    • Set Counter = 0
    • Set RedGroup = (Units owned by Player 1 (Red) matching (((Matching unit) is A Hero) Equal to True))
    • Unit Group - Pick every unit in RedGroup and do (Actions)
      • Loop - Actions
        • Set unitCode[Counter] = (Picked unit)
        • Hero - Disable experience gain for unitCode[Counter]
        • Set STR[Counter] = (Strength of (Picked unit) (Exclude bonuses))
        • Set AGI[Counter] = (Agility of (Picked unit) (Exclude bonuses))
        • Set INT[Counter] = (Intelligence of (Picked unit) (Exclude bonuses))
        • Set Counter = (Counter + 1)
        • Hero - Modify Strength of (Picked unit): Set to 0
        • Hero - Modify Agility of (Picked unit): Set to 0
        • Hero - Modify Intelligence of (Picked unit): Set to 0
    • Wait 600.00 seconds
    • For each (Integer A) from 0 to Counter, do (Actions)
      • Loop - Actions
        • Hero - Modify Strength of unitCode[(Integer A)]: Set to STR[(Integer A)]
        • Hero - Modify Strength of unitCode[(Integer A)]: Set to STR[(Integer A)]
        • Hero - Modify Strength of unitCode[(Integer A)]: Set to STR[(Integer A)]
        • Hero - Enable experience gain for unitCode[(Integer A)]
    • Custom script: call DestroyGroup(udg_RedGroup)
    • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Top