• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Missile Problem

Status
Not open for further replies.
Triggers
  • Spell Hash
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Diablo1Spells = (Last created hashtable)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • Fire Bolt Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Firebolt
    • Actions
      • Set TempInteger1 = (Level of (Ability being cast) for TempUnit1)
      • Set TempUnit1 = (Triggering unit)
      • Set TempPoint1 = (Position of TempUnit1)
      • Set TempPoint2 = (Target point of ability being cast)
      • Set TempPlayer = (Triggering player)
      • Set TempReal1 = (Angle from TempPoint1 to TempPoint2)
      • Unit - Create 1 Dummy for TempPlayer at TempPoint1 facing TempReal1 degrees
      • Set TempUnit2 = (Last created unit)
      • Custom script: set udg_TempInteger2 = GetUnitTypeId(udg_TempUnit2)
      • Custom script: call SaveReal(udg_Diablo1Spells,udg_TempInteger2,5,udg_TempReal1)
      • -------- Distance --------
      • Set TempReal1 = 1000.00
      • Custom script: call SaveReal(udg_Diablo1Spells,udg_TempInteger2,0,udg_TempReal1)
      • -------- Speed --------
      • Set TempReal1 = (((Real(TempInteger1)) x 10.00) + 50.00)
      • Custom script: call SaveReal(udg_Diablo1Spells,udg_TempInteger2,1,udg_TempReal1)
      • -------- Damage --------
      • Set TempReal1 = ((Real((Intelligence of TempUnit1 (Include bonuses)))) x 4.00)
      • Custom script: call SaveReal(udg_Diablo1Spells,udg_TempInteger2,2,udg_TempReal1)
      • Custom script: call SaveUnitHandle(udg_Diablo1Spells,udg_TempInteger2,3,udg_TempUnit1)
      • Custom script: call SaveReal(udg_Diablo1Spells,udg_TempInteger2,4,0.0)
      • Special Effect - Create a special effect attached to the chest of TempUnit2 using Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
      • Custom script: call SaveEffectHandle(udg_Diablo1Spells,udg_TempInteger2,100,GetLastCreatedEffectBJ())
      • Unit Group - Add TempUnit2 to FireboltGroup
      • Trigger - Turn on Fire Bolt Periodic <gen>
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
  • Fire Bolt Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in FireboltGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in FireboltGroup) Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
          • Custom script: set udg_TempUnit1 = GetEnumUnit()
          • Custom script: set udg_TempInteger1 = GetUnitTypeId(udg_TempUnit1)
          • Custom script: set udg_TempReal1 = LoadReal(udg_Diablo1Spells,udg_TempInteger1,0)
          • Custom script: set udg_TempReal2 = LoadReal(udg_Diablo1Spells,udg_TempInteger1,1)
          • Custom script: set udg_TempReal3 = LoadReal(udg_Diablo1Spells,udg_TempInteger1,2)
          • Custom script: set udg_TempReal4 = LoadReal(udg_Diablo1Spells,udg_TempInteger1,4)
          • Custom script: set udg_TempReal5 = LoadReal(udg_Diablo1Spells,udg_TempInteger1,5)
          • Custom script: set udg_TempUnit2 = LoadUnitHandle(udg_Diablo1Spells,udg_TempInteger1,3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempReal4 Less than TempReal1
            • Then - Actions
              • Set TempReal4 = (TempReal4 + TempReal2)
              • Custom script: call SaveReal(udg_Diablo1Spells,udg_TempInteger1,4,udg_TempReal4)
              • Set TempPoint1 = (Position of TempUnit1)
              • Set TempPoint2 = (TempPoint1 offset by TempReal2 towards TempReal5 degrees)
              • Custom script: call SetUnitX(udg_TempUnit1,GetLocationX(udg_TempPoint2))
              • Custom script: call SetUnitY(udg_TempUnit1,GetLocationY(udg_TempPoint2))
              • Unit Group - Pick every unit in (Units within 50.00 of TempPoint2 matching (((Owner of (Matching unit)) Not equal to (Owner of TempUnit1)) and (((Owner of (Matching unit)) is an enemy of (Owner of TempUnit1)) Equal to True))) and do (Actions)
                • Loop - Actions
                  • Unit - Cause TempUnit2 to damage (Picked unit), dealing TempReal3 damage of attack type Magic and damage type Normal
                  • Unit - Kill TempUnit1
                  • Unit Group - Remove TempUnit1 from FireboltGroup
              • Custom script: call RemoveLocation(udg_TempPoint1)
              • Custom script: call RemoveLocation(udg_TempPoint2)
            • Else - Actions
              • Unit - Kill TempUnit1
              • Unit Group - Remove TempUnit1 from FireboltGroup
  • Remove Effects
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnit1 = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of TempUnit1) Equal to Dummy
        • Then - Actions
          • Custom script: set udg_TempEffect = LoadEffectHandle(udg_Diablo1Spells,GetUnitTypeId(udg_TempUnit1),100)
          • Special Effect - Destroy TempEffect
        • Else - Actions
Whenever I cast this multiple times the missiles stop mid point or w/e and act as if there aren't in the unitgroup. Any help to solve this would be greatly appreciated.
View attachment Diablo 1 Spells.w3x
 
Status
Not open for further replies.
Top