Set damage/armor chat command

wilze

Active Member
Reaction score
3
How do I modify a units damage/armor with a chat command? :banghead:

I have already made trigger that sets the health and mana of the unit to a requested value (after a tutorial by Tom Jones). Now I need help with this! Thanks in advance!

Edit: One more question, how would I make this trigger loop the unit animation?
Trigger:
  • Play Animation
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 4)) Equal to play
    • Actions
      • Unit Group - Pick every unit in Group_A and do (Actions)
        • Loop - Actions
          • Animation - Play (Picked unit)'s (Substring((Entered chat string), 6, (Length of (Entered chat string)))) animation
 

Amn

Member
Reaction score
18
for damage use the ability item attack damage bonus with 30 levels or more.
at level 1 put 0 bonus damage, increasing by 10 or 5 each level.
then u increase the level by trigger giving the ability to the unit if doesnt have it.

for armor u can do the same, the ability name is item armor bonus
 

wilze

Active Member
Reaction score
3
Holy crapper! I just imported your system into my map, and I think I did it properly. But I had to change the substring conditions in your test command trigger cause I already had another command that interfered with that one. But now when I test it, the unit I have selected inherits a bunch of abilities? And gains no damage? I'll upload the map so you can take a look.

Mediafire link:
http://www.mediafire.com/?631096q52nqyn6b
 

vypur85

Hibernate
Reaction score
803
Mind posting the triggers instead?

The system should work fine. Just copy the system trigger. Remember to auto generate unknown variables (can be found in File>Preference). The damage addition/setting trigger should be the source of your problem. Also, remember to create 5 separate Item Damage Bonus with correct damage value. Make sure you set the ability variable correctly at the Map Init trigger. I guess that's about it. :)

(The bolded phrase being the most important, judging from your description.)
 

wilze

Active Member
Reaction score
3
Trigger:
  • Damage System Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Int_DamageSys_DigitCount = 5
      • Set Abi_DamageSys_Damage[1] = Spawn Doodad
      • Set Abi_DamageSys_Damage[2] = Max Mana Modifier
      • Set Abi_DamageSys_Damage[3] = Terrain 2x2
      • Set Abi_DamageSys_Damage[4] = Fighter F
      • Set Abi_DamageSys_Damage[5] = Max Life Modifier

Trigger:
  • Damage System
    • Events
    • Conditions
    • Actions
      • -------- Required if unit does not have the dummy ability to begin with --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Level of Abi_DamageSys_Damage[1] for Unit_DamageSys_Unit) Equal to (==) 0
          • Then - Actions
            • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
              • Loop - Actions
                • Unit - Add Abi_DamageSys_Damage[(Integer A)] to Unit_DamageSys_Unit
          • Else - Actions
      • -------- Determine Current Damage --------
      • Set Int_DamageSys_CurrentDmg = 0
        • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
          • Loop - Actions
            • Set Int_DamageSys_CurrentDmg = (Int_DamageSys_CurrentDmg + (((Level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit) - 1) x (Integer((Power(10.00, ((Real((Integer A))) - 1.00)))))))
      • -------- Add Damage --------
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Int_DamageSys_ADDdamage Greater than (>) 0
          • Then - Actions
            • Set Int_DamageSys_ADDdamage = (Int_DamageSys_ADDdamage + Int_DamageSys_CurrentDmg)
              • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
                • Loop - Actions
                  • Set Int_General = ((Int_DamageSys_ADDdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
                  • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
          • Else - Actions
            • Do Multiple ActionsFor each (Integer A) from 1 to Int_DamageSys_DigitCount, do (Actions)
              • Loop - Actions
                • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to 1
                • Set Int_General = ((Int_DamageSys_SETdamage mod (Integer((Power(10.00, (Real((Integer A)))))))) / (Integer((Power(10.00, ((Real((Integer A))) - 1.00))))))
                • Unit - Set level of Abi_DamageSys_Damage[(Integer A)] for Unit_DamageSys_Unit to (Int_General + 1)
      • Set Int_DamageSys_ADDdamage = 0
      • Set Int_DamageSys_SETdamage = 0

Trigger:
  • Set Damage
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 6)) Equal to (==) setdam
        • Then - Actions
          • Set Int_DamageSys_SETdamage = (Integer((Substring((Entered chat string), 8, 12))))
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 6)) Equal to (==) adddam
        • Then - Actions
          • Set Int_DamageSys_ADDdamage = (Integer((Substring((Entered chat string), 8, 12))))
        • Else - Actions
      • Unit Group - Pick every unit in Group_A and do (Actions)
        • Loop - Actions
          • Set Unit_DamageSys_Unit = (Picked unit)
          • Trigger - Run Damage System <gen> (checking conditions)
 

wilze

Active Member
Reaction score
3
Bump! (I think I'm allowed to bump now? My clock is telling me it's 24hrs since the last post, if not I'm sorry)
 

vypur85

Hibernate
Reaction score
803
Uh. The problem is as I've mentioned... (Read the bolded text from previous post)

You did not create 5 Item Damage Bonus abilities and set them to appropriate damage values. After that, define the abilities in the Map Initialisation trigger (ie Set Abi_DamageSys_Damage[1] = Item Damage Bonus 1, Set Abi_DamageSys_Damage[2] = Item Damage Bonus 2.... etc).

Read the 'How to implement' in the Set Damage thread. For reference, check out the demo map. You should be on the right track.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top