Hopefully the last spell trigger question I have to ask!

Lady MufflaN

New Member
Reaction score
4
Yes, I didn't think it was possible, but it seems like I'm now doing one of the last spells, but I have a problem, I basically want to create a spell that gives more attribute to a hero the more friendly heroes are in range, but I have no idea what conditions I can use for this, I'm totally lost, I was going to use something like
Code:
Alone is Weak
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to The Final Bond 
        (Level of The Final Bond  for (Triggering unit)) Equal to 1
    Actions
        Set DavidFinalBond = (Position of (Triggering unit))
        Set UnitsWithinDFB = (Number of units in (Units within 400.00 of DavidFinalBond))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
            Then - Actions
            Else - Actions

But I have no idea where to go from now, if only I could get a way of checking if allied hero units are in range I should be fine, adding attributes ain't hard, also a implementation that removes the bonus attributes if they aren't in range is essential.
 

Drunken_God

Hopes to get back into Mapmaking with SC2 :)
Reaction score
106
you have to make a periodic trigger that counts units in a the unit group (units within 400 of position of (caster) matching owner of matching unit is an ally of caster equal to true and matching unit is a hero equal to true) and then set the level of your ability to that number
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
It would have to be a periodic trigger and a skill learned trigger.

Code:
Unit learns skill
Learned skill = Final Bond
Add Learning Hero to BondedGroup

Code:
Every 0.01 to 1 second (depends on what you want)
Pick all Units in BondedGroup
      Set Point = Position of Picked Unit
      Set UnitGroup1 = Units in a (your range) of point matching (your conditions)

That'd be how you do it...still trying to figure out the bonus skill points part...If you use a skill as drunkengod said, just set its level to the number of units in the group.
 

Lady MufflaN

New Member
Reaction score
4
Code:
Unit learns skill
Learned skill = Final Bond
Add Learning Hero to BondedGroup

BondedGroup is what kind of variable? Unit Group? Because I dunno what to set the variable to, Units in range?
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Yes its a unit group, it has Group in its name....

Units in range is a unit group selection you can do.
 

Lady MufflaN

New Member
Reaction score
4
Yes its a unit group, it has Group in its name....

Units in range is a unit group selection you can do.

I assume it is something like this you meant?

Code:
Alone is Weak Group
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in DavidFinalBondGroup and do (Actions)
            Loop - Actions
                Set DavidFinalBond = (Position of (Picked unit))
                Set DavidFinalBondGroupFriendly = (Units within 600.00 of DavidFinalBond matching ((((Triggering unit) belongs to an ally of (Owner of David 0103 <gen>)) Equal to True) and (((Picked unit) is A Hero) Equal to True)))

That should only pick friendly heroes right?
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Don't forget to remove the leaks!
Yes its a unit group, it has Group in its name....
It could be a player group (or force).
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Not if you're creating the unit group in the periodic trigger. Since you recreate it every second the unit group will always be there when the trigger fires.
 

Lady MufflaN

New Member
Reaction score
4
Right, so it's the attribute part left then, would I be totally wrong if I thought along the ways of converting real to integer and then use "for each integer.."? Anyone got a idea? (This last spell is without a doubt, the hardest one I've tried to get working...)
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
You'll have to use the "call DestroyGroup (udg_Variable)" inside the trigger when creating a new unit group each time it fires though, same with the point.

Edit: Make a spell based on item stat bonus, give it 6 levels (First level gives 0 bonuses). Then use the "Count unit's in unit group" function and do something like this:

Events:
A unit learns a skill

Conditions:
Learned hero skill Equal to Final Bond

Actions:
Add Final Bonds Stat to (triggering unit)
Set FinalBondUnit = triggering unit
----------------

Events:
Every 1 seconds

Conditions:

Actions:
Temp_Loc = Position of FinalBondUnit
Temp_Group = Unit's withing X of Temp_Loc matching (matching unit) belongs to an ally of (owner of FinalBondUnit) equal to true and (matching unit) is a Hero equal to true
Set level of Final Bonds Stat to (Units in Temp_Group - 1)
call RemoveLocation (udg_Temp_Loc)
call DestroyGroup (udg_Temp_Group)
 

Lady MufflaN

New Member
Reaction score
4
You'll have to use the "call DestroyGroup (udg_Variable)" inside the trigger when creating a new unit group each time it fires though, same with the point.

Of course, this is how it looks at the moment
Code:
Alone is Weak Group
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in DavidFinalBondGroup and do (Actions)
            Loop - Actions
                Set DavidFinalBond = (Position of (Picked unit))
                Set DavidFinalBondGroupFriendly = (Units within 600.00 of DavidFinalBond matching ((((Triggering unit) belongs to an ally of (Owner of David 0103 <gen>)) Equal to True) and (((Picked unit) is A Hero) Equal to True)))
                Set UnitsWithinDFB = (Integer((Real((Number of units in DavidFinalBondGroupFriendly)))))
        Custom script:   call RemoveLocation (udg_DavidFinalBond)
        Custom script:   call DestroyGroup (udg_DavidFinalBondGroupFriendly)
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Remove the call DestroyGroup(udg_DavidFinalBond)
and move the Call DestroyGroup(udg_DavidFinalBondGroupFriendly) into the Select all units in Unit group.
 

Lady MufflaN

New Member
Reaction score
4
Editted my previous post, try something like that.

Like this?

Code:
Alone is Weak Group Copy
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set DavidFinalBond = (Position of (Picked unit))
        Set DavidFinalBondGroupFriendly = (Units within 400.00 of DavidFinalBond matching ((((Triggering unit) belongs to an ally of (Owner of David 0103 <gen>)) Equal to True) and (((Picked unit) is A Hero) Equal to True)))
        Unit - Set level of Ensam är svag ability bonus (+5 All Stats) for (Triggering unit) to (UnitsWithinDFB - 1)
        Custom script:   call RemoveLocation (udg_DavidFinalBond)
        Custom script:   call DestroyGroup (udg_DavidFinalBondGroupFriendly)

EDIT: That one won't work, not like I declared UnitsWithinDFB somehwere, retryin'
 

Lady MufflaN

New Member
Reaction score
4
Trigger #1

Code:
Alone is Weak Copy
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to The Final Bond 
    Actions
        Unit - Add Ensam är svag ability bonus (+5 All Stats) to (Triggering unit)
        Set David = (Triggering unit)


Trigger #2
Code:
Alone is Weak Group Copy
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set DavidFinalBond = (Position of David)
        Set DavidFinalBondGroupFriendly = (Units within 400.00 of DavidFinalBond matching ((((Triggering unit) belongs to an ally of (Owner of David)) Equal to True) and (((Picked unit) is A Hero) Equal to True)))
        Unit - Set level of Ensam är svag ability bonus (+5 All Stats) for David to ((Number of units in DavidFinalBondGroupFriendly) - 1)
        Custom script:   call RemoveLocation (udg_DavidFinalBond)
        Custom script:   call DestroyGroup (udg_DavidFinalBondGroupFriendly)

Somehow it ain't working and I can't see what is wrong :banghead:
 

Lady MufflaN

New Member
Reaction score
4
Updated second trigger, should be closer to good, but it still ain't working.

Code:
Alone is Weak Group Copy
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set DavidFinalBond = (Position of David)
        Set DavidFinalBondGroupFriendly = (Units within 400.00 of DavidFinalBond matching ((((Matching unit) belongs to an ally of (Owner of David)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
        Unit - Set level of Ensam är svag ability bonus (+5 All Stats) for David to ((Number of units in DavidFinalBondGroupFriendly) - 1)
        Custom script:   call RemoveLocation (udg_DavidFinalBond)
        Custom script:   call DestroyGroup (udg_DavidFinalBondGroupFriendly)
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
I have no idea why that ain't working, try making the item ability unit or hero by changing the booleans in object editor. Also it shouldn't be set to Number of units -1, it should be: set Level of Ensam Är Svag to (number of units in Temp_Group), I screwed the math up a little.
 

vypur85

Hibernate
Reaction score
803
What about something like this:

Code:
Melee Initialization
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set TempGroup = (Units in (Playable map area))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Brilliance Aura) Equal to True
                        (Level of Attribute Bonus for (Picked unit)) Equal to 0
                    Then - Actions
                        Unit - Add Attribute Bonus to (Picked unit)
                    Else - Actions
                        Unit - Remove Attribute Bonus from (Picked unit)

Base the ability off Brilliance Aura. It's not tested though. It's easier this I think. (It'll be a different story when it comes to detect the level of spell, you'd need integer and several buff variables, but try this first),
 
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