Mana regen skill based on int? Trigger help

sicpher

New Member
Reaction score
0
Hi i have an idea for this spell but i don't know how to apply it using triggers, please help me.

Unit with 200 INT

Unit casts 'Active' spell on self that increases mana regeneration by 0.5% / 1% / 1.5% of total INT every X second for 30 seconds.
 

sicpher

New Member
Reaction score
0
bump....

because this is a core spell (if it's made possible from trigger) of my range class, that's why i really need help =]
 

Avaleirra

Is back. Probably.
Reaction score
128
You can only bump once in 24 hours btw.

Can't you just add mana to a unit based on their intelligence?


Just make a periodic trigger that takes their int and gives them mana if they have the buff.
 

hopy

Active Member
Reaction score
64
Im not sure if theres a easy'r way of doing this but this is my own solution:

First of all you will need an active ability that gives a buff, something like Beserk or something I think would do fine.

Trigger:
  • Arcane Meditation
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Arcane Meditation
    • Actions
      • Trigger - Turn on Arcane Meditation 2 <gen>


Trigger:
  • Arcane Meditation 2
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set MM_Hero = (Units in (Entire map) matching (((Matching unit) has buff Arcane Meditation) Equal to True))
      • Unit Group - Pick every unit in MM_Hero and do (Actions)
        • Loop - Actions
          • Set MM_Int[1] = ((Intelligence of (Picked unit) (Include bonuses)) / 2)
          • Set MM_Int[2] = (Intelligence of (Picked unit) (Include bonuses))
          • Set MM_Int[3] = (MM_Int[1] + MM_Int[2])
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + (Real(MM_Int[(Level of Arcane Meditation for (Picked unit))])))
      • Custom script: call DestroyGroup(bj_MM_Hero)


Just so you know the whole MM_Int[1] = blahblah, MM_Int[2] = blahblah and MM_Int[3] = (MM_Int[1] + MM_Int[2]).
Thats because I couldnt think of any way of doing this in a formula with Int / abilty level or something so I did it like this ... works just as well I'd say :p

MM_Int is an Intreger Variable with an array.
MM_Hero is an Unit Group Variable
Arcane Meditation is the abiltiy ... I thought this would be a nice name for itxD (stolefromthemagetalentsinWoW :O)
- Base it off something like beserk without any bonusses ... for an abiltiy like this Id remove the mana cost also xD.
Arcane Meditation is also a buff ... I forgot to give it a different name so it wouldnt be confusing.


I have not tested this yet, but my PC takes about 10 minutes to load a map so I prefer not to test it myself. xD
Sorry about that.
 

tooltiperror

Super Moderator
Reaction score
231
You can only bump once in 24 hours btw.

Can't you just add mana to a unit based on their intelligence?


Just make a periodic trigger that takes their int and gives them mana if they have the buff.

Personally I would not use that method, because Buff checking is not very accurate.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
BUMP ?!

I don't know how many times I've told new people here:
Don't bump/double post withn 24 hours !

There are rules in this forum, please read them !
(Sorry for this "outbrake" but I'm getting very tired of it ! :()

Anyways, to your problem, here's a version which uses custom value (Use it if you're not using unit's custom value for other stuff) :
Trigger:
  • Int Regeneration
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Set the custom value of (Triggering unit) to 30
      • Unit Group - Add (Triggering unit) to Periodic_Group


Trigger:
  • Int Periodic
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Periodic_Group and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Real((Intelligence of (Picked unit) (Exclude bonuses)))) x (0.05 x (Real((Level of Animate Dead for (Picked unit)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Equal to 0
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Periodic_Group
            • Else - Actions


And here we use hashtables:
Trigger:
  • Int Regen Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set TempHash = (Last created hashtable)


Trigger:
  • Int Regeneration Hash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your_Ability
    • Actions
      • Hashtable - Save 30 as 1 of Key (Triggering unit) in TempHash
      • Unit Group - Add (Triggering unit) to Periodic_Group


Trigger:
  • Int Periodic Hash
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Periodic_Group and do (Actions)
        • Loop - Actions
          • Set TempInt = (Load 1 of Key (Picked unit) from TempHash)
          • Hashtable - Clear all child hashtables of child 1 in TempHash
          • Hashtable - Save (TempInt - 1) as 1 of Key (Picked unit) in TempHash
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Real((Intelligence of (Picked unit) (Exclude bonuses)))) x (0.05 x (Real((Level of Your_Ability for (Picked unit)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempInt - 1) Equal to 0
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Periodic_Group
              • Hashtable - Clear TempHash
            • Else - Actions


I think those should work :S
(Hashtables don't really work that good on Newge, but I hope that reads correct XD)
 

hopy

Active Member
Reaction score
64
Naw I thought I was all cool and helpfull with my little post and than I noticed Komaqtion's post and was all like: <,<

But might I ask something ... it doesn't realy have anything to do with this subject I guess and I aint the creator of this threat but ...
What exactly is a hashtable? I noticed those were new in that patch but never understood what they do.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I'd simply suggest you read on it :p

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/

But basically it's faster gamecache...
Though you might not know what that is either XD

Well, it's just like a variable which can handle several values inside other values... It's almost like structs, though not vJASS and easier to access from the outside ;)

Anyways, read that tutorial and you should understand a bit more at least ;)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, XD Sorry it was supposed to be this:
Trigger:
  • Int Periodic Hash
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Periodic_Group and do (Actions)
        • Loop - Actions
          • Set TempInt = (Load 1 of 0 from TempHash)
          • Hashtable - Clear all child hashtables of child Key (Picked unit) in TempHash
          • Hashtable - Save (TempInt - 1) as 1 of 0 in TempHash
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Real((Intelligence of (Picked unit) (Exclude bonuses)))) x (0.05 x (Real((Level of Animate Dead for (Picked unit)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempInt - 1) Equal to 0
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Periodic_Group
              • Hashtable - Clear all child hashtables of child Key (Picked unit) in TempHash
            • Else - Actions


;)
 

SuperSoldier

New Member
Reaction score
10
Now it's even less MUI... You are loading and saving one value for every unit, not one value per unit, but just one value overall... So now if 30 people cast this spell, they each only get one tick of it...

EDIT: Here, since you're taking forever reading that global hashtable thread, I'ma fix this for you:

Trigger:
  • Int Regen Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set TempHash = (Last created hashtable)


Trigger:
  • Int Regeneration Hash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your_Ability
    • Actions
      • Hashtable - Save 30 as 1 of Key (Triggering unit) in TempHash
      • Unit Group - Add (Triggering unit) to Periodic_Group
      • Trigger - Turn on Int Periodic Hash&lt;gen&gt;


Trigger:
  • Int Periodic Hash
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempBool = False
      • Unit Group - Pick every unit in Periodic_Group and do (Actions)
        • Loop - Actions
          • Set TempBool = True
          • Set TempInt = (Load 1 of Key (Picked unit) from TempHash)
          • Hashtable - Save (TempInt - 1) as 1 of Key (Picked unit) in TempHash
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Real((Intelligence of (Picked unit) (Exclude bonuses)))) x (0.05 x (Real((Level of Your_Ability for (Picked unit)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempInt - 1) Equal to 0
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Periodic_Group
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to False
        • Then - Actions
          • Hashtable - Clear TempHash
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

Psiblade94122

In need of sleep
Reaction score
138
alternitively you can make the spell give a buff to the caster and detect everyone that has the buff every second (then restore mana using picked unit as your "unit")

edit, didnt see post #5
but, why isnt buff checking accurate?
 

sicpher

New Member
Reaction score
0
Thanks for all the helpful replies+triggers, and I PROMISE, i will read the rules before i post next time! cheers! :thup:
 

sicpher

New Member
Reaction score
0
Now it's even less MUI... You are loading and saving one value for every unit, not one value per unit, but just one value overall... So now if 30 people cast this spell, they each only get one tick of it...

EDIT: Here, since you're taking forever reading that global hashtable thread, I'ma fix this for you:

Trigger:
  • Int Regen Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set TempHash = (Last created hashtable)


Trigger:
  • Int Regeneration Hash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Your_Ability
    • Actions
      • Hashtable - Save 30 as 1 of Key (Triggering unit) in TempHash
      • Unit Group - Add (Triggering unit) to Periodic_Group
      • Trigger - Turn on Int Periodic Hash&lt;gen&gt;


Trigger:
  • Int Periodic Hash
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempBool = False
      • Unit Group - Pick every unit in Periodic_Group and do (Actions)
        • Loop - Actions
          • Set TempBool = True
          • Set TempInt = (Load 1 of Key (Picked unit) from TempHash)
          • Hashtable - Save (TempInt - 1) as 1 of Key (Picked unit) in TempHash
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Real((Intelligence of (Picked unit) (Exclude bonuses)))) x (0.05 x (Real((Level of Your_Ability for (Picked unit)))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempInt - 1) Equal to 0
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Periodic_Group
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to False
        • Then - Actions
          • Hashtable - Clear TempHash
          • Trigger - Turn off (This trigger)
        • Else - Actions





I have 1 problem with this trigger, the "Cooldown" on the spell does not work if this trigger is active . I based my spell on Roar
 

SuperSoldier

New Member
Reaction score
10
I have 1 problem with this trigger, the "Cooldown" on the spell does not work if this trigger is active . I based my spell on Roar

wat.
I have no idea how your spell could not have a cooldown if this trigger is active, it doesn't pause the unit, order it to stop, reset the cooldown, or re-add the skill(no idea if that would cause it anyway...)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top