• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Help with trigger modifying stats

Status
Not open for further replies.

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Hi guys. I make a trigger which modifying like this:
  • Hero Stat System Intelligent
    • Events
      • Player - Player 1 (Red) types a chat message containing -int as A substring
      • Player - Player 2 (Blue) types a chat message containing -int as A substring
      • Player - Player 3 (Teal) types a chat message containing -int as A substring
      • Player - Player 4 (Purple) types a chat message containing -int as A substring
      • Player - Player 5 (Yellow) types a chat message containing -int as A substring
      • Player - Player 6 (Orange) types a chat message containing -int as A substring
      • Player - Player 7 (Green) types a chat message containing -int as A substring
      • Player - Player 8 (Pink) types a chat message containing -int as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -int as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -int as A substring
    • Conditions
    • Actions
      • Set TempInt = (Integer((Substring((Entered chat string), 4, 8))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) Current lumber) Greater than or equal to TempInt
        • Then - Actions
          • Player - Set (Triggering player) Current lumber to (((Triggering player) Current lumber) - TempInt)
          • Hero - Modify Intelligence of ControledHero[(Player number of (Triggering player))]: Add TempInt
        • Else - Actions
          • Set tempPGroup = (Player group((Triggering player)))
          • Game - Display to tempPGroup the text: You don't have enou...
          • Custom script: call DestroyForce(udg_tempPGroup)
If u are wondering about the ControledHero variable, I set it up in my hero selection trigger like this:
  • Legendary Swordmaster
    • Events
      • Unit - A unit enters Hero Warden <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Soul
    • Actions
      • Set tempPoint = (Center of Starting Locations <gen>)
      • Set HeroAttribute[(Player number of (Owner of (Triggering unit)))] = 2
      • Unit - Kill (Triggering unit)
      • Unit - Create 1 Legendary Swordmaster for (Owner of (Triggering unit)) at tempPoint facing 0.00 degrees
      • Set CV = (Custom value of (Last created unit))
      • Set AttackRange[CV] = 1
      • Set ControledHero[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\Awaken\Awaken.mdl
      • Camera - Pan camera for (Owner of (Triggering unit)) to tempPoint over 0.00 seconds
      • Dialog - Show DialogHeroSelect[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))
      • Custom script: call RemoveLocation(udg_tempPoint)
But I dont know why it didnt work ==. Can anyone fix the modifying trigger for me plz.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Well, it can be but there are some special cases which lead me to do separated triggers instead :D. Most likely because some of my heroes using custom stat (Soul Point for Necromancer, Holy Energy for Holy Cleric, etc). For each of them I need to create a special variable just for them in the trigger :D.
Also, as u can see, I use variable to determine the Base Attribute, attack range (Melee is 0 and Ranged is 1).
 
Status
Not open for further replies.
Top