• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

aoe stun

Status
Not open for further replies.
Level 3
Joined
Sep 3, 2007
Messages
30
can anyone here create a aoe stun for me

i have no clue how to make it and i want it to be like Fan of Knives but instead storm bolts come out stunning units around it can anyone please post one up. Thanks!
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
I asked this question in a different forum. However since I saw this topic here, I'll paste the code I got from him. (btw, I don't know much about JASS)

JASS:
function Trig_Stun_AOE_Actions takes nothing returns nothing
   local unit Caster = GetTriggerUnit()
   local player Owner = GetOwningPlayer(Caster)
   local unit Dummy
   local real DummyX = GetUnitX(Caster)
   local real DummyY = GetUnitY(Caster)
   local real DummyFlyHeight = GetUnitFlyHeight(Caster)
   local group G = CreateGroup()
   local unit EnumUnit
   local integer AbilityLevel = GetUnitAbilityLevel(Caster,'A07E')
   call GroupEnumUnitsInRange(G, DummyX,DummyY, 500, null)
   loop
      set EnumUnit = FirstOfGroup(G)
      exitwhen EnumUnit==null
      if GetUnitState(EnumUnit, UNIT_STATE_LIFE) > 0 and IsUnitEnemy(EnumUnit, Owner) then
         if IsUnitVisible(EnumUnit, Owner) and GetUnitAbilityLevel(EnumUnit, 'Avul') == 0 then
            set Dummy = CreateUnit(Owner,'h01B',DummyX,DummyY,0)
            call UnitAddAbility(Dummy, 'A07F')
            call SetUnitAbilityLevel(Dummy, 'A07F', AbilityLevel)
            call SetUnitFlyHeight(Dummy,DummyFlyHeight,0)
            call IssueTargetOrder( Dummy, "thunderbolt", EnumUnit )
         endif
      endif
      call GroupRemoveUnit(G, EnumUnit)
   endloop
   call DestroyGroup(G)
   set G = null
   set Caster = null
   set Owner = null
   set Dummy = null
endfunction

In this example the A07E is the casted dummy ability and A07F is the storm bolt like ability with stun.

This is storm bolt based "fan of knives" with individual stun.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Hmm, I think he knows too little GUI and not to mention any JASS.
And besides doing these:
set Dummy = CreateUnit(Owner,'h01B',DummyX,DummyY,0)
call UnitAddAbility(Dummy, 'A07F')
call SetUnitAbilityLevel(Dummy, 'A07F', AbilityLevel)
in the loop is just plain "stupid" ;)
Here is my suggestion.
 

Attachments

  • Fan of Storm Bolts.w3x
    39.8 KB · Views: 82
Level 3
Joined
Sep 3, 2007
Messages
30
Hmm, I think he knows too little GUI and not to mention any JASS.
And besides doing these:
set Dummy = CreateUnit(Owner,'h01B',DummyX,DummyY,0)
call UnitAddAbility(Dummy, 'A07F')
call SetUnitAbilityLevel(Dummy, 'A07F', AbilityLevel)
in the loop is just plain "stupid" ;)
Here is my suggestion.

awesome job! this is exactly what i was looking for :D
+rep
 
Status
Not open for further replies.
Top