• 🏆 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!

Circle Wound

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Spell description: Warden does throw in a random direction around them, causing all enemies in the way damage, and slowing them down for 3 seconds. Also all those who fell for her ability to be every 0.25 seconds to lose 5% of their maximum health for 3 seconds.

Triggers:

JASS:
function Trig_wc_cast_Conditions takes nothing returns boolean
return(GetSpellAbilityId() == 'A001')
endfunction

function Wc_cast_Actions takes nothing returns nothing
local timer     t=GetExpiredTimer()
local unit      u=LoadUnitHandle(udg_H, GetHandleId(t), 0)
local real      x=LoadReal(udg_H, GetHandleId(t), 1)
local real      y=LoadReal(udg_H, GetHandleId(t), 2)
local real      dis=LoadReal(udg_H, GetHandleId(t), 3)
local real      ang=LoadReal(udg_H, GetHandleId(t), 4)
local effect    e=LoadEffectHandle(udg_H, GetHandleId(t), 5)
local group     gr=CreateGroup()
local unit      g
local unit      d
local real      ang2
if GetWidgetLife(u) > 0.405 and dis<=500.00 then
call SetUnitAnimation(u, "Attack Slam")
call SetUnitX(u,x+dis*Cos(ang*bj_DEGTORAD))
call SetUnitY(u,y+dis*Sin(ang*bj_DEGTORAD))
set  dis=dis+25.00
set  ang=ang+20.00
call SaveReal(udg_H, GetHandleId(t), 3, dis)
call SaveReal(udg_H, GetHandleId(t), 4, ang)
  call GroupEnumUnitsInRange(gr,GetUnitX(u),GetUnitY(u),100.00,null)
   loop
    set g=FirstOfGroup(gr)
     exitwhen g==null
if IsUnitType(g, UNIT_TYPE_STRUCTURE) == false and GetWidgetLife(g) > 0.405 and IsUnitEnemy(g, GetOwningPlayer(u)) == true and GetUnitAbilityLevel(g, 'B000') == 0 then
  set d=CreateUnit(GetOwningPlayer(u),'h000',GetUnitX(u),GetUnitY(u),0)
   call UnitAddAbility(d, 'A000')
    call IssueTargetOrder(d, "slow", g)
     call UnitApplyTimedLife(d, 'BTLF', 1)
      call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl", g, "chest"))
       call UnitDamageTarget(u, g, 150, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DEATH, null)
        set  ang2=Atan2(GetUnitY(g)-GetUnitY(u),GetUnitX(g)-GetUnitX(u))
         call SetUnitX(g,GetUnitX(g)+60*Cos(ang2))
          call SetUnitY(g,GetUnitY(g)+60*Sin(ang2))
endif
 call GroupRemoveUnit(gr,g)
endloop
else
 call SetUnitX(u,x)
  call SetUnitY(u,y)
   call DestroyEffect(e)
    call PauseTimer(t)
     call FlushChildHashtable(udg_H, GetHandleId(t))
      call DestroyTimer(t)
endif
call DestroyGroup(gr)
set  gr=null
set  e=null
set  u=null
set  g=null
set  d=null
endfunction

function Trig_wc_cast_Actions takes nothing returns nothing
local unit   u=GetSpellAbilityUnit()
local real   x=GetUnitX(u)
local real   y=GetUnitY(u)
local real   dis=30.00
local real   ang=GetRandomDirectionDeg()
local timer  t=CreateTimer()
local effect e=AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl", u, "weapon")
      call   SaveUnitHandle(udg_H, GetHandleId(t), 0, u)
      call   SaveReal(udg_H, GetHandleId(t), 1, x)
      call   SaveReal(udg_H, GetHandleId(t), 2, y)
      call   SaveReal(udg_H, GetHandleId(t), 3, dis)
      call   SaveReal(udg_H, GetHandleId(t), 4, ang)
      call   SaveEffectHandle(udg_H, GetHandleId(t), 5, e)
call  TimerStart(t, 0.02, true, function Wc_cast_Actions)
set   u=null
set   t=null
endfunction

JASS:
function Trig_wc_damage_Actions takes nothing returns nothing
local group  gr=CreateGroup()
local unit   g
 set gr=GetUnitsInRectAll(GetPlayableMapRect())
  loop
   set g=FirstOfGroup(gr)
    exitwhen g==null
if IsUnitType(g, UNIT_TYPE_STRUCTURE) == false and GetWidgetLife(g) > 0.405 and GetUnitAbilityLevel(g, 'B000') > 0 then
      call SetUnitState(g, UNIT_STATE_LIFE, GetUnitState(g, UNIT_STATE_LIFE) - GetUnitState(g, UNIT_STATE_MAX_LIFE)*0.05)
       call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl", g, "chest"))
endif
 call GroupRemoveUnit(gr,g)
endloop
call DestroyGroup(gr)
set  gr=null
set  g=null
endfunction

Please credit my work and show me my mistakes.

Keywords:
Spell, Warden, circle, around, Night Elf, wound
Contents

Circular Wound (Map)

Reviews
12.12 IcemanBo: For long time as NeedsFix. Rejected. 12:16, 11th Mar 2011 Bribe: No code structure (four space indentation, indent all code blocks), bad use of BJ's (really simple to code these directly). Rejected until updated.

Moderator

M

Moderator

12.12
IcemanBo: For long time as NeedsFix. Rejected.

12:16, 11th Mar 2011
Bribe:

No code structure (four space indentation, indent all code blocks), bad use of BJ's (really simple to code these directly).

Rejected until updated.
 
Top