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

Spread Shot Spell

Status
Not open for further replies.
Well here's something similar that Elder Hong posted on Maps 'n' Mods. What this does is fires a dart that puts the first enemy it touches to sleep.

  • TranquilizerDartTrigger
    • Events: - unit start the effect of an ability
    • Conditions: - Ability being cast equals to Tranquilizer Dart
    • Actions:
      • Unit - Create a dart at (position of Triggering Unit) facing (Angle of Triggering Unit)
      • ------ Add Timer here ------
      • unit group -Add last created unit into MyDartUnitGroup
      • Trigger -Turn on DartMovementTrigger
  • DartMovementTrigger
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • (MyDartUnitGroup is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in MyDartUnitGroup and do (Actions)
        • Loop - Actions
          • Custom script: local real dist = 30 //travel 30 distance per 0.05 second
          • Custom script: local real aoe = 100 //collision size
          • Custom script: local string order = "sleep" //order string
          • Custom script: local unit target = null //Do not touch starting this line
          • Custom script: local unit caster = GetEnumUnit()
          • Custom script: local real angle = GetUnitFacing( caster )
          • Custom script: local location p = GetUnitLoc(caster)
          • Custom script: local group g = CreateGroup()
          • Custom script: set g = GetUnitsInRangeOfLocAll( aoe , p)
          • Custom script: loop
          • Custom script: set target = FirstOfGroup(g)
          • Custom script: exitwhen target ==null
          • Custom script: call GroupRemoveUnit(g,target)
          • Custom script: if IsUnitEnemy(target, GetOwningPlayer(caster)) then
          • Custom script: call GroupRemoveUnit(udg_MyDartUnitGroup,caster)
          • Custom script: call GroupClear(g)
          • Custom script: call KillUnit( caster )
          • Unit - Create 1 Dummy Caster for (Owner of (Picked unit)) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call IssueTargetOrderBJ( GetLastCreatedUnit() , order, target )
          • Custom script: call RemoveLocation( p )
          • Custom script: call DestroyGroup(g)
          • Custom script: return
          • Custom script: endif
          • Custom script: endloop
          • Custom script: call RemoveLocation( p )
          • Custom script: call DestroyGroup(g)
          • Custom script: call SetUnitPosition(caster, GetUnitX( caster ) + dist * Cos(angle * bj_DEGTORAD), GetUnitY( target ) + dist * Sin(angle * bj_DEGTORAD) )
I know no JASS, so I can't really help you.
 
Status
Not open for further replies.
Top