Mana regen skill based on int? Trigger help

sicpher

New Member
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
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.
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
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
Staff member
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.
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
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.
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.
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
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
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
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
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
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 The Helper:
    basically it is linux
  • The Helper The Helper:
    OMG it is BanLord as Blackveiled on the forum
  • The Helper The Helper:
    what is up buddy
  • jonas jonas:
    thanks for the tip, that sounds cool. Never heard about the VCS before but seems like it should be a good match
  • tom_mai78101 tom_mai78101:
    The winter vacation left a toll on me. I missed staying up late and sleeping in late.
  • C Cherry.Grove:
    i haven't looked into it yet
  • C Cherry.Grove:
    If I could use something Python compatible it would save me some learning
  • C Cherry.Grove:
    But Unity might be easiest
  • C Cherry.Grove:
    looking at old posts here makes me happy. Makes me be all like "wow I was pretty smart in 2009"
  • C Cherry.Grove:
    mostly failing at life through adulthood really demotivated me for a while
  • C Cherry.Grove:
    ....what I don't get is why the fuck they would force us to permanently convert to a version of the game everyone fucking hated : \
  • C Cherry.Grove:
    Raid Shadow Legends texture pack smh
  • jonas jonas:
    Most people fail at life throughout their adulthood. Sometimes we get to learn from it. Usually it just feels like crap.
    +1
  • The Helper The Helper:
    What does not kill you makes you stronger is what they say
  • C Cherry.Grove:
    for real! :cool:
  • Varine Varine:
    Are we still on the topic of failing? I failed lots!
  • jonas jonas:
    If you ever want to talk about it we're here. The way I see it, you're still around. That required a few very difficult successes if you ask me:)
  • Varine Varine:
    I posted a thing here a while ago about my failures if it makes you feel better to hear about other people failing. Drugs and whatnot, I had a lot more fun than was healthy. I'm still a failure, but very few of us actually get to be the self made billionaire. Luck is the only thing that will take you as far as already having money a lot of the time, and the easiest way to get catch that is with a very wide net and the willingness to let other things loose.
  • Varine Varine:
    Have fun, do your best, something about Edison's light bulb not working until he stole it.
  • jonas jonas:
    Eh. Don't define success as being a billionaire or even millionaire. Success is about overcoming your personal challenges. And if you can get to a place in life where you can love yourself, that is winning it big time
  • jonas jonas:
    Being a billionaire probably sucks, you can't go out in public like a random person anymore and you always need a bunch of big guys following you around discreetly
  • jonas jonas:
    And you'll never know if anyone you know really likes you or is just seeing you as a big money sack
  • jonas jonas:
    Most of the best fun I've ever head was with a group of friends eating pizza or drinking a good 10$ bottle of wine, when I had maybe 100$ on my account. Or the time when I was so broke, my friends visited me with bags of ingredients and I cooked for us, because I didn't have money to buy ingredients anymore
  • jonas jonas:
    Or walking with my then-fiancee through the night until dawn, just talking

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top