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 they took away all the safeguards to save money and then the worst happened lol
  • The Helper The Helper:
    they did not winterize any of the plants and they froze
  • The Helper The Helper:
    it is not that power consumption went up it was available capacity went down with power plants freezing
  • Varine Varine:
    What a fucking disaster. Are all of the Texas people okay? I see TH is, are we the only two?
  • Varine Varine:
    How have the other states held up? I just got power back so I have no idea what's going on, we didn't get warning
  • Varine Varine:
    Why the fuck didn't they fix this ten years ago when it happened?
  • Blackveiled Blackveiled:
    I'm in it with you and TH as well. My power has been in and out, and I have a ruptured pipe that I need to fix, shouldn't be too bad to fix myself.
  • Varine Varine:
    I hope you're staying warm! Apparently the supply is coming up so hopefully we can get back to normal power soon, mine has been on for six hours now.
  • M Mulciberxp:
    My power has been off most of the last 2 days. We had a generator installed 3 years ago though, so we're staying warm. Water is another issue...
  • The Helper The Helper:
    Where I live has a pool so we are using that to get water to flush the toilets. We have enough bottled water to drink and brush teeth and stuff but it has been a few days and no shower though....
  • Varine Varine:
    I had some water in gallon jugs, and got our water back on yesterday. We don't seem to have any leaks, but I haven't crawled down there to look yet.
  • The Helper The Helper:
    still no water I cannot remember when I last showered now I know how they felt in the old west lol
  • Varine Varine:
    My poor plants are happy, they aren
  • Varine Varine:
    aren't used to going this long without water or lights or normal heat. I think a couple of them froze, but they look like they'll make it
  • Varine Varine:
    Well one of them is pretty rough but I think it was sick to begin with, that one always had some problems.
  • jonas jonas:
  • jonas jonas:
    ???
  • Ghan Ghan:
    That is such a Texas thing to say lol
  • midnight8 midnight8:
    a positive could come out of this. So many people trapped at home could put a dent in the covid numbers in Texas
  • Varine Varine:
    That dude, Tom Boyd, is really upset about the backlash from his "it's your fault you're freezing" thing because he claims he resigned before saying it, so it wasn't like he said it in his official capacity or anything.
  • jonas jonas:
    Almost as if he was saying "screw you guys, I'm going home"
  • Varine Varine:
    I'm fairly new here still but that seems to be the analogous message by several of our politicians.
  • vypur85 vypur85:
    Nobody?
  • jonas jonas:
    Hi vypur85, long time no see
  • tom_mai78101 tom_mai78101:
    Hi vypur85, long time no see.

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top