| 03-22-2008, 08:29 PM | #2 | |
Quote:
|
| 03-22-2008, 08:48 PM | #3 |
Hmm.. I've tried and it doesn't seem to. Maybe the event "Spawns a summoned unit" Doesn't work with Locust Swarm? |
| 03-22-2008, 09:19 PM | #4 |
i dunno but's it's easy to test, just display the summoned unit name. If it display nothing, then it doesn't work for an unit with 'Aloc' |
| 03-22-2008, 09:22 PM | #5 |
The problem is that the picked unit function can't get units with locust. So you'll have to use loop over the group (usign FirstofGroup()) in order to catch and use them. |
| 03-22-2008, 09:31 PM | #6 |
hmm.... Alright. I need to get more acquainted with JASS. How exactly would I do that? :( EDIT: Apparently Locust Swarm doesn't work with "Spawns a Summoned Unit" Either. Fantastic. EDIT: So, should this work? I'm not very good at JASS >_<: JASS:function Trig_Enveloping_Fog_Copy_Copy_Copy_Copy_Actions takes nothing returns nothing local group g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Enveloping_Fog_Copy_Copy_Copy_Copy_Func002002002)) local unit u loop set u = FirstOfGroup(g) exitwhen u == null if ( Trig_Enveloping_Fog_Copy_Copy_Copy_Copy_Func003C() ) then call SetUnitManaBJ( GetEnumUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, u) - ( 4.00 + I2R(GetUnitAbilityLevelSwapped('A07L', udg_Arcanist)) ) ) ) call SetUnitManaBJ( udg_Arcanist, ( GetUnitStateSwap(UNIT_STATE_MANA, udg_Arcanist) + ( 4.00 + I2R(GetUnitAbilityLevelSwapped('A07L', udg_Arcanist)) ) ) ) call AddSpecialEffectTargetUnitBJ( "origin", u, "war3mapImported\\DarkRitualQuick.mdx" ) else endif if ( Trig_Enveloping_Fog_Copy_Copy_Copy_Copy_Func004C() ) then call SetUnitManaBJ( udg_Arcanist, ( GetUnitStateSwap(UNIT_STATE_MANA, udg_Arcanist) + GetUnitStateSwap(UNIT_STATE_MANA, u) ) ) call SetUnitManaBJ( u, 0.00 ) call AddSpecialEffectTargetUnitBJ( "origin", u, "war3mapImported\\DarkRitualQuick.mdx" ) else endif call GroupRemoveUnit(g,u) endloop set g = null set u = null endfunction |
| 03-23-2008, 08:57 AM | #7 |
Omg ~_~ GroupEnumUnitsInRange will NOT work with locust units This code is tested and working properly (i hope so ^^) JASS:globals group gr = CreateGroup() // >> you can use this group in other AoE-type functions string fx_name = "war3mapImported\\DarkRitualQuick.mdx" string fx_attach = "origin" integer id_buff = 'B000' // >> Mana Tap buff id endglobals // function needed to check distance between units // because used enumerate function haven't it function GetUnitsDist takes unit u1, unit u2 returns real local real x = GetUnitX(u2) - GetUnitX(u1) local real y = GetUnitY(u2) - GetUnitY(u1) return SquareRoot(x * x + y * y) endfunction function Enveloping_Actions takes nothing returns boolean return GetUnitAbilityLevel(udg_Arcanist, id_buff) > 0 endfunction function Enveloping_Actions takes nothing returns nothing local unit a = udg_Arcanist // just for more readable code local unit u = null local integer i = 0 local player p = null local real amplifier = GetUnitAbilityLevel(a, id_spell) + 4.0 local real caster_mana = GetUnitState(a, UNIT_STATE_MANA) local real target_mana = 0 loop exitwhen i > 15 set p = Player(i) set i = i + 1 if GetPlayerController(p) != MAP_CONTROL_NONE then call GroupEnumUnitsOfPlayer(gr, p, null) // >> this enumerate function also picks units with 'Aloc' loop set u = FirstOfGroup(gr) exitwhen u == null call GroupRemoveUnit(gr, u) // ----- actions ----- // >> necessary checks - "unit is alive" + "unit within 500 of arcanist" + "unit != arcanist" if GetWidgetLife(u) > 0.405 and GetUnitsDist(u, a) < 500 and u != a then set target_mana = GetUnitState(u, UNIT_STATE_MANA) if target_mana >= amplifier then call SetUnitState(a, UNIT_STATE_MANA, caster_mana + amplifier) call SetUnitState(u, UNIT_STATE_MANA, target_mana - amplifier) else call SetUnitState(a, UNIT_STATE_MANA, caster_mana + target_mana) call SetUnitState(u, UNIT_STATE_MANA, 0) endif call DestroyEffect(AddSpecialEffectTarget(fx_name, u, fx_attach)) endif endloop endif // >> if GetPlayerController(p) endloop set a = null set p = null endfunction function InitTrig_Enveloping takes nothing returns nothing local trigger tr = CreateTrigger() call TriggerAddAction(tr, function Enveloping_Actions) call TriggerAddCondition(tr, Condition(function Enveloping_Conditions)) call TriggerRegisterTimerEvent(tr, 1.0, true) set tr = null endfunction Further you can improve this code to vJass standards (scopes, private funcs, etc.) |
| 03-23-2008, 09:09 AM | #8 |
GUI can pick units into a group, even if they hav aloc... im not realy sure what the whole problem is, but i think what you should do is just have a periodic event which finds caster units (finds the buff) and selects all units owned by that player in range, that is easier right? |
| 03-23-2008, 05:42 PM | #9 |
No, GUI doesn't pick units with ALoc. It's kind of annoying, but clearly there are workarounds. Oh boy. That's intimidating, Spec. I'll see if I can figure out how to use that =_= EDIT: I think I'll just adapt my old trigger so that they just give the mana they drain straight to the Arcanist. Thanks for the help anyways, I may need this later. |
| 03-24-2008, 12:59 AM | #10 |
Erm, i hav a hero right now im doing, and i can assure u, GUI picks up units with aloc. If not then its an incredible co-incidence that the units that should have been picked, and have aloc, magicly get into the right group. Which is unlikely, though obviously possible! |
| 03-24-2008, 01:05 AM | #11 |
I had this problem in spell session #9. I ended up just getting rid of aloc. |
