Help With An Ability

Jagan

New Member
Reaction score
30
Hi people, I am trying to trigger a aura/passive spell that adds 1 Agility to my hero for every friendly unit in an AoE. Can someone point me in the right direction? I don't particularly need a testmap or anything, for I am just hoping to learn something from the many veterans around here.

Thanks in advance. :)
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
You'd have to check when a unit has the buff/ability and then pick every unit within x of the unit which has it, and add agility... But i'm not really sure since i never did such a spell.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
You can use a dummy ability, which will be an aura, then have a trigger, trigger upon learning the dummy ability that will give Item Add Agility, or w/e, to the allied units.


Not sure if this will work, but...


Code:
Untitled Trigger 001
    Events
        Unit - A unit Learns a skill
        Unit - A unit Starts the effect of an ability
    Conditions
        ((Triggering unit) has buff Agi Detect ) Equal to True
        (Ability being cast) Equal to Endurance Aura
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked player) is an ally of (Triggering player)) Equal to True)) and do (Unit - Add Item Agility Gain to (Triggering unit))
 

Jagan

New Member
Reaction score
30
Hmm can't seem to set the level of the Add Agility ability right. It stays at level 1.

Code:
Soul Empowerment Setup
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Soul Empowerment (Soul Stealer)
    Actions
        Set SoulEmpowermentCaster = (Learning Hero)
        Trigger - Turn on Soul Empowerment Effects <gen>
        Trigger - Turn on Soul Empowerment Cancel <gen>


Code:
Soul Empowerment Effects
    Events
        Time - Every 0.25 seconds of game time
    Conditions
    Actions
        Set SoulEmpowermentGroup = (Units within 1000000000.00 of (Center of (Entire map)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Soul Empowerment ) Equal to True)))
        Unit Group - Pick every unit in SoulEmpowermentGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in SoulEmpowermentGroup) Less than or equal to 15
                    Then - Actions
                        Unit - Add Soul Empowerment (Bonus Agility) to SoulEmpowermentCaster
                        Unit - Set level of Soul Empowerment (Bonus Agility) for SoulEmpowermentCaster to (Number of units in SoulEmpowermentGroup)
                    Else - Actions


Code:
Soul Empowerment Cancel
    Events
        Time - Every 0.25 seconds of game time
    Conditions
        (Number of units in SoulEmpowermentGroup) Equal to 0
    Actions
        Unit - Remove Soul Empowerment (Bonus Agility) from SoulEmpowermentCaster


Help? :)


EDIT: @Renendaru - It's a passive/aura spell. But thanks for trying. Can you take a look at my codes so far?
 

ThePlague

New Member
Reaction score
14
cant see anything wrong in your code but why not use
Hero-Modify Hero attribute instead of an ability?
 

HappyPeasant

New Member
Reaction score
8
um...
why not just make a trigger that checks 500 around caster. set int var = number of units. then add int # to agi....
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
huhu.. let me try.


every 2 seconds of game time

condition

action

set DAGROUP = units in whole map with matching condition, matching unit level of (da dammi ability) is more or equal to 1,and matching unit is alive.

pick all units in da group

loop
set 2nd Da Group = units within 600 range of picked unit matching condition matching unit is an ally of picked unit = true and alive.
------
set level of agility bonus of picked unit to number of units in 2nd da group,


then just destroy leaks....


unit learns an ability

ability being learn = da dummy ability

add ability ( agility bonus) to triggering unit

set level of ability(agility bonus) for trigerring unit to 1

level 1 of that agility bonus must add 0 bonuses
 

Jagan

New Member
Reaction score
30
Thanks a lot, guys. I'll get back to you as soon as I try them out! :)
 

Jagan

New Member
Reaction score
30
Hmm.. It still doesn't set the ability level right. The count for the number of units in the group is accurate but somehow the leveling seems to be bugged. Can some check it out for me? These are the updated codes. I'll upload the map if this still doesn't work.

Code:
Soul Empowerment Setup
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Soul Empowerment (Soul Stealer)
    Actions
        Set SoulEmpowermentCaster = (Learning Hero)
        Trigger - Turn on Soul Empowerment Effects <gen>
        Set SoulEmpowermentMaxUnitNumber = 25
        Countdown Timer - Start SoulEmpowermentTimer as a Repeating timer that will expire in 0.50 seconds

Code:
Soul Empowerment Effects
    Events
        Time - SoulEmpowermentTimer expires
    Conditions
    Actions
        Unit - Remove Soul Empowerment (Bonus Agility) from SoulEmpowermentCaster
        Set SoulEmpowermentGroup = (Units within 1000000000.00 of (Center of (Entire map)) matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of SoulEmpowermentCaster)) Equal to True)) and (((Matching unit) has buff Soul Empowerment ) Equal
        Set SoulEmpowermentUnitsNumber = (Number of units in SoulEmpowermentGroup)
        Unit Group - Pick every unit in SoulEmpowermentGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SoulEmpowermentUnitsNumber Greater than 0
                    Then - Actions
                        Game - Display to (All players) for 3.00 seconds the text: (String(SoulEmpowermentUnitsNumber))
                        Unit - Add Soul Empowerment (Bonus Agility) to SoulEmpowermentCaster
                        Unit - Set level of Soul Empowerment (Bonus Agility) for SoulEmpowermentCaster to SoulEmpowermentUnitsNumber
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                SoulEmpowermentUnitsNumber Greater than SoulEmpowermentMaxUnitNumber
                            Then - Actions
                                Unit - Set level of Soul Empowerment (Bonus Agility) for SoulEmpowermentCaster to SoulEmpowermentMaxUnitNumber
                            Else - Actions
        Unit Group - Remove all units of SoulEmpowermentGroup from SoulEmpowermentGroup
        Set SoulEmpowermentUnitsNumber = 0

Thanks again.

EDIT: Am using a custom Attribute Bonus for the bonus agility, just in case that was of any importance.
 

Jagan

New Member
Reaction score
30
Ermmm...bump? Any help, guys? Would really like to get this spell to work. It's the final spell for my hero. I'd willingly +Rep for anyone who contributes a hand. :)
 

Jagan

New Member
Reaction score
30
Erm, please specify exactly? I don't quite get it. Sorry, I'm not exactly a pro when it comes to triggers yet.

I don't get why it doesn't work. It counts the number of units in the group and also adds the bonus agility spell correctly, but somehow the level just can't be set according to the number of units. Weird.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
If Number greater than Max
- Set Number = Max
If Number less than 1 then
- Set Number = Max

Unit - Add ability ... to Caster
Unit - Set level of Ability ... for Caster to Number


The loop is not needed.
Or did I miss something here?
 

Jagan

New Member
Reaction score
30
If Number greater than Max
- Set Number = Max
If Number less than 1 then
- Set Number = Max


Unit - Add ability ... to Caster
Unit - Set level of Ability ... for Caster to Number


The loop is not needed.
Or did I miss something here?

Errr...wouldn't that make having 0 allied units nearby set the level of the bonus agility to max as well?
 

Jagan

New Member
Reaction score
30
Code:
Soul Empowerment Effects
    Events
        Time - SoulEmpowermentTimer expires
    Conditions
    Actions
        Unit - Remove Soul Empowerment (+1 Agility) from SoulEmpowermentCaster
        Set SoulEmpowermentGroup = (Units within 1000000000.00 of (Center of (Entire map)) matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of SoulEmpowermentCaster)) Equal to True)) and (((Matching unit) has buff Soul Empowerment ) Equal
        Set SoulEmpowermentUnitsNumber = (Number of units in SoulEmpowermentGroup)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                SoulEmpowermentUnitsNumber Greater than 0
            Then - Actions
                Game - Display to (All players) for 3.00 seconds the text: (String(SoulEmpowermentUnitsNumber))
                Unit - Add Soul Empowerment (+1 Agility) to SoulEmpowermentCaster
                Unit - Set level of Soul Empowerment (+1 Agility) for SoulEmpowermentCaster to SoulEmpowermentUnitsNumber
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SoulEmpowermentUnitsNumber Greater than SoulEmpowermentMaxUnitNumber
                    Then - Actions
                        Unit - Set level of Soul Empowerment (+1 Agility) for SoulEmpowermentCaster to SoulEmpowermentMaxUnitNumber
                    Else - Actions
        Unit Group - Remove all units of SoulEmpowermentGroup from SoulEmpowermentGroup
        Set SoulEmpowermentUnitsNumber = 0

Still doesn't work. Hmm or did I get your message wrongly? It still only adds the ability and does not set the level properly.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top