• 🏆 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!

Gold mine recharge

Status
Not open for further replies.
Level 1
Joined
Jun 26, 2010
Messages
4
Ok everyone, here is what I would like to do. I should warn you that I am an ultra noob at triggers, so be nice, ok? Anyway, I want to make an ability called deep vein drilling. Basically, the ability would, when activated, cause any gold mine owned by the player to discover a new "vein" upon emptying and refill to half (6250), but only once for each mine, and only for the player who both controls the mine and researched the ability. I know that I need to detect when a mine is depleted, if I researched the ability, which player I am, which mines I own, and run a trigger to recharge them, but I have no idea how.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Ok i have two solutions for you, because your text have somehow no logic at some points:

Solution 1: A building, that have a research. If you research this, all mines of the triggering Player refiles there gold to 6250.

Solution 2: Every gold mine has an ability, that refiles the gold up to 6250.

  • TestTrigger2309
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Magic Sentry
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching (((Unit-type of (Matching unit)) Equal to Gold Mine) and ((Resource quantity contained in (Matching unit)) Less than 6250))) and do (Actions)
        • Loop - Actions
          • Neutral Building - Add 6250 gold to (Picked unit)
          • -------- Don''t know what effect of these two you want --------
          • Neutral Building - Set (Picked unit) to 6250 gold
  • TestTrigger2310
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magic Defense
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Resource quantity contained in (Triggering unit)) Less than 6250
        • Then - Actions
          • Unit - Remove (Ability being cast) from (Triggering unit)
          • Neutral Building - Add 6250 gold to (Triggering unit)
          • -------- Don''t know what effect of these two you want --------
          • Neutral Building - Set (Triggering unit) to 6250 gold
        • Else - Actions
Greetings
~ The Bomb King > Dr. Boom
 
Level 1
Joined
Jun 26, 2010
Messages
4
Ok wait, so if I am reading this right.... The first solution, first action, if I research the research on the gold mine itself, then the game will add 6250 gold to the mine's current total? Im going to go test that now, because I didnt know you could add to a mine and if you can, that's even better than my original idea!
 
Status
Not open for further replies.
Top