[Trigger] Heroes Stats Trigger

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2008
Messages
243
Trying to increase a heros attribute by casting a spell off a building. Only works if the player has lumber. Doesn't work. Looking for reasons as to why. Tested this several times now, changing around
  • Set Player_Heroes_Agility[(Player number of (Owner of (Triggering unit)))] = (Player_Heroes_Agility[(Player number of (Owner of (Triggering unit)))] + 1)
but I can't see to get it to work. Any suggestions? Much appreciated as always.

Variables used; (in this short example)
Players_Hero = Unit variable (obviously) <- come to think of it, this is used for something different, so ignore it.
Player_Heroes_Agility = integer <- my example attribute is agility, so you can ignore strength and intelligence.


  • Heroes and attributes to Integers
    • Events
      • Unit - A unit enters Choose Alignment <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set Players_Hero[1] = (Triggering unit)
          • Set Player_Heroes_Strength[(Player number of (Owner of (Triggering unit)))] = (Strength of (Triggering unit) (Exclude bonuses))
          • Set Player_Heroes_Agility[(Player number of (Owner of (Triggering unit)))] = (Agility of (Triggering unit) (Exclude bonuses))
          • Set Player_Heroes_Intelligence[(Player number of (Owner of (Triggering unit)))] = (Intelligence of (Triggering unit) (Exclude bonuses))
        • Else - Actions
  • Increase Heroes Agility
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Increase Agility
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) Current lumber) Greater than or equal to 1
        • Then - Actions
          • Set Player_Heroes_Agility[(Player number of (Owner of (Triggering unit)))] = (Player_Heroes_Agility[(Player number of (Owner of (Triggering unit)))] + 1)
          • Player - Add -1 to (Owner of (Triggering unit)) Current lumber
        • Else - Actions
 
Level 7
Joined
Dec 8, 2008
Messages
243
ah yes, I see now. I thought I'd already looked through actions for Hero - modify hero attributes.
Working now though, thank you. : )
 
Status
Not open for further replies.
Top