Spell help!

Bladezor

You can change this now in User CP.
Reaction score
0
can I make a passive spell that I will get 1 gold/lumber every 2 second or something? for that player who spec it. =)
 

jnZ

I
Reaction score
64
an easy way of solving this would be to create a passive dummy ability that basically does nothing (except visuals like tooltip and button).
the rest is solved via triggers.
one trigger that triggers when the hero learns that dummy ability. in that case a global variable for that player could be set to true (b).
and another trigger that periodically triggers, (every 2 seconds in your case) that checks if (b == true) *meaning the ability was learned* and if true, add gold and lumber.
if you work with and integer instead of a boolean you can easily adjust the value depending on the level of the ability or similiar stuff.
 

Razed

New Member
Reaction score
44
Just made two triggers for you, Bladezor. Didn't really think of its efficiency, but I think it's quite decent. And it works also, just tested it with the spell "Human Archmage - Blizzard".

Trigger:
  • Add To UnitGroup
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Human Archmage - Blizzard
    • Actions
      • Unit Group - Add (Learning Hero) to Spell_UnitGroup

Trigger:
  • Give Gold And Lumber
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Spell_UnitGroup and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Owner of (Picked unit)) Current gold
          • Player - Add 1 to (Owner of (Picked unit)) Current lumber


I used one variable of type Unit Group.

The first trigger adds the unit with the ability to the unit group and the second trigger adds 1 gold and lumber to the players whom have learned the ability. I guess you can also figure that out yourself from the triggers, hehe. :)

Hope I helped!
 

Bladezor

You can change this now in User CP.
Reaction score
0
Just made two triggers for you, Bladezor. Didn't really think of its efficiency, but I think it's quite decent. And it works also, just tested it with the spell "Human Archmage - Blizzard".

Trigger:
  • Add To UnitGroup
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Human Archmage - Blizzard
    • Actions
      • Unit Group - Add (Learning Hero) to Spell_UnitGroup

Trigger:
  • Give Gold And Lumber
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Spell_UnitGroup and do (Actions)
        • Loop - Actions
          • Player - Add 1 to (Owner of (Picked unit)) Current gold
          • Player - Add 1 to (Owner of (Picked unit)) Current lumber


I used one variable of type Unit Group.

The first trigger adds the unit with the ability to the unit group and the second trigger adds 1 gold and lumber to the players whom have learned the ability. I guess you can also figure that out yourself from the triggers, hehe. :)

Hope I helped!

thx for the help :)
 
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