• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Increase food without units

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Hi

I want to use the food interface for other in game purposes. For this I want the food to increase, but I do not wish to create units for this to happen, since it will create unnecessary lag. This will happen in a trigger every second for about 10 players at a time.

I cannot seem to find any trigger that has anything to do with food.

Any ideas?

I will share the trigger for those who are interested.
  • Freeze Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Add test 0008 <gen> to Default_HeroGroup
      • Unit Group - Pick every unit in Default_HeroGroup and do (Actions)
        • Loop - Actions
          • Set Freeze_LocalHero = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Freeze_LocalHero is A Hero) Equal to True
              • (Freeze_LocalHero is Magic Immune) Not equal to True
              • (Freeze_LocalHero is dead) Not equal to True
              • (Owner of Freeze_LocalHero) Not equal to Neutral Passive
              • (Freeze_LocalHero has buff Warmth (Custom)) Not equal to True
            • Then - Actions
              • Game - Display to (All players) the text: (String(Freeze_Level[(Player number of (Owner of Freeze_LocalHero))]))
              • Set Freeze_LevelAdd = (Freeze_Factor x Freeze_Warmth)
              • Set Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] = (Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] + Freeze_LevelAdd)
              • Set Freeze_Point = (Position of Freeze_LocalHero)
              • Unit - Create 1 Dummy Unit for (Owner of Freeze_LocalHero) at Freeze_Point facing Default building facing degrees
              • Set Freeze_DummyUnit = (Last created unit)
              • Unit - Add a 1.00 second Generic expiration timer to Freeze_DummyUnit
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] Greater than or equal to 100.00
                • Then - Actions
                  • Set Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] = 100.00
                  • Set Freeze_DamagePlayer[(Player number of (Owner of Freeze_LocalHero))] = (Freeze_Damage[(Player number of (Owner of Freeze_LocalHero))] x Freeze_Warmth)
                  • Unit - Cause Freeze_LocalHero to damage Freeze_LocalHero, dealing Freeze_DamagePlayer[(Player number of (Owner of Freeze_LocalHero))] damage of attack type Spells and damage type Normal
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Freeze_LocalHero is dead) Not equal to True
                    • Then - Actions
                      • Unit - Add Coldsnap to Freeze_DummyUnit
                    • Else - Actions
                • Else - Actions
                  • Unit - Add Freezing to Freeze_DummyUnit
              • Unit - Order Freeze_DummyUnit to Human Sorceress - Slow Freeze_LocalHero
              • Custom script: call RemoveLocation (udg_Freeze_Point)
            • Else - Actions
              • Set Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] = (Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] - 10.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] Less than or equal to 0.00
                • Then - Actions
                  • Set Freeze_Level[(Player number of (Owner of Freeze_LocalHero))] = 0.00
                • Else - Actions


Thank you for reading!
 
Status
Not open for further replies.
Top