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

Cannon Ball.w3x V1.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
It's just like tristana ultimate from LoL:) But the code bit of messy :3

  • Cannon Ball Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CB_Ability = Cannon Ball
      • Set CB_AoE = 150.00
      • Set CB_Damage[1] = 75.00
      • Set CB_Damage[2] = 150.00
      • Set CB_Damage[3] = 225.00
      • Set CB_Damage[4] = 300.00
      • Set CB_Distance[1] = 600.00
      • Set CB_Distance[2] = 800.00
      • Set CB_Distance[3] = 1000.00
      • Set CB_Distance[4] = 1300.00
      • Set CB_Alive = True
      • Set CB_Enemy = True
      • Set CB_Structure = False
      • Set CB_SFX1 = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • Set CB_SFX2 = Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
      • Set CB_Speed = 25.00
  • Cannon Ball
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CB_Ability
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CBIndex Equal to 0
        • Then - Actions
          • Trigger - Turn on Cannon Ball Move <gen>
        • Else - Actions
      • Set CBIndex = (CBIndex + 1)
      • Set CBCaster[CBIndex] = (Triggering unit)
      • Set CBCaster2[CBIndex] = (Triggering player)
      • Set CBCasterPoint[CBIndex] = (Position of CBCaster[CBIndex])
      • Set CBTargetPoint[CBIndex] = (Target point of ability being cast)
      • Set CBIncrease[CBIndex] = (Level of CB_Ability for CBCaster[CBIndex])
      • Set CBDistance[CBIndex] = CB_Distance[CBIncrease[CBIndex]]
      • Set CBDamage[CBIndex] = CB_Damage[CBIncrease[CBIndex]]
      • Set CBAoE[CBIndex] = CB_AoE
      • Unit - Create 1 Cannon Ball for CBCaster2[CBIndex] at CBCasterPoint[CBIndex] facing CBTargetPoint[CBIndex]
      • Set CBDummy[CBIndex] = (Last created unit)
      • Set CBDummyPoint[CBIndex] = (Position of CBDummy[CBIndex])
      • Custom script: call RemoveLocation(udg_CBCasterPoint[udg_CBIndex])
      • Custom script: call RemoveLocation(udg_CBTargetPoint[udg_CBIndex])
  • Cannon Ball Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CBIndex2) from 1 to CBIndex, do (Actions)
        • Loop - Actions
          • Set CBDistance[CBIndex2] = (CBDistance[CBIndex2] - 24.00)
          • Set CBDummyPoint[CBIndex2] = (Position of CBDummy[CBIndex2])
          • Set CBTempPoint[CBIndex2] = (CBDummyPoint[CBIndex2] offset by CB_Speed towards (Facing of CBDummy[CBIndex2]) degrees)
          • Unit - Move CBDummy[CBIndex2] instantly to CBTempPoint[CBIndex2]
          • Set CBTargetGroup[CBIndex2] = (Units within CBAoE[CBIndex2] of CBDummyPoint[CBIndex2])
          • Unit Group - Pick every unit in CBTargetGroup[CBIndex2] and do (Actions)
            • Loop - Actions
              • Set CBTarget[CBIndex2] = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CBTarget[CBIndex2] is A structure) Equal to CB_Structure
                  • (CBTarget[CBIndex2] is alive) Equal to CB_Alive
                  • (CBTarget[CBIndex2] belongs to an enemy of (Owner of CBCaster[CBIndex2])) Equal to CB_Enemy
                  • (CBTarget2[CBIndex2] is in CBDummyAdd) Equal to False
                  • (CBTarget2[CBIndex2] is A flying unit) Not equal to True
                • Then - Actions
                  • Unit Group - Add CBTarget[CBIndex2] to CBDummyAdd
                  • Unit - Move CBTarget[CBIndex2] instantly to CBDummyPoint[CBIndex2]
                  • Special Effect - Destroy (Last created special effect)
                  • Special Effect - Create a special effect attached to the overhead of CBTarget[CBIndex2] using CB_SFX1
                • Else - Actions
          • Destructible - Pick every destructible in (Region centered at CBDummyPoint[CBIndex2] with size (CBAoE[CBIndex2], CBAoE[CBIndex2])) and do (Actions)
            • Loop - Actions
              • Set ISD_d = (Picked destructible)
              • Trigger - Run ISDs system <gen> (checking conditions)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ISD_boolean Equal to True
                • Then - Actions
                  • Set ISD_d = (Picked destructible)
                  • Destructible - Kill ISD_d
                  • Set ISD_d = No destructible
                • Else - Actions
          • Custom script: call DestroyGroup(udg_CBTargetGroup[udg_CBIndex2])
          • Custom script: call RemoveLocation (udg_CBDummyPoint[udg_CBIndex2])
          • Custom script: call RemoveLocation (udg_CBTempPoint[udg_CBIndex2])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBDistance[CBIndex2] Less than or equal to 0.00
            • Then - Actions
              • Unit Group - Pick every unit in CBDummyAdd and do (Actions)
                • Loop - Actions
                  • Set CBTarget2[CBIndex2] = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (CBTarget2[CBIndex2] is A structure) Equal to CB_Structure
                      • (CBTarget2[CBIndex2] is alive) Equal to CB_Alive
                      • (CBTarget2[CBIndex2] belongs to an enemy of CBCaster2[CBIndex2]) Equal to CB_Enemy
                      • (CBTarget2[CBIndex2] is A flying unit) Not equal to True
                    • Then - Actions
                      • Unit - Cause CBCaster[CBIndex2] to damage CBTarget2[CBIndex2], dealing CBDamage[CBIndex2] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the overhead of CBTarget2[CBIndex2] using Abilities\Spells\Human\StormBolt\StormBoltMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • Unit - Remove CBDummy[CBIndex2] from the game
              • Unit Group - Remove all units from CBDummyAdd
              • Set CBAoE[CBIndex2] = CBAoE[CBIndex]
              • Set CBCaster[CBIndex2] = CBCaster[CBIndex]
              • Set CBCaster2[CBIndex2] = CBCaster2[CBIndex]
              • Set CBCasterPoint[CBIndex2] = CBCasterPoint[CBIndex]
              • Set CBDamage[CBIndex2] = CBDamage[CBIndex]
              • Set CBDistance[CBIndex2] = CBDistance[CBIndex]
              • Set CBDummy[CBIndex2] = CBDummy[CBIndex]
              • Set CBDummyPoint[CBIndex2] = CBDummyPoint[CBIndex]
              • Set CBTarget[CBIndex2] = CBTarget[CBIndex]
              • Set CBTarget2[CBIndex2] = CBTarget2[CBIndex]
              • Set CBTargetGroup[CBIndex2] = CBTargetGroup[CBIndex]
              • Set CBTargetPoint[CBIndex2] = CBTargetPoint[CBIndex]
              • Set CBTempPoint[CBIndex2] = CBTempPoint[CBIndex]
              • Set CBIndex = (CBIndex - 1)
              • Set CBIndex2 = (CBIndex2 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CBIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
  • ISDs INIT
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set ISD_hash = (Last created hashtable)
      • Set ISD_loc = (Center of (Playable map area))
      • Unit - Create 1 Peasant for Neutral Passive at ISD_loc facing Default building facing degrees
      • Set ISD_dummy = (Last created unit)
      • Unit - Add Invulnerable (Neutral) to ISD_dummy
      • Unit - Hide ISD_dummy
      • Custom script: call RemoveLocation(udg_ISD_loc)
  • ISDs system
    • Events
    • Conditions
    • Actions
      • Unit - Order ISD_dummy to Harvest ISD_d
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of ISD_dummy) Equal to (Order(harvest))
        • Then - Actions
          • Set ISD_boolean = True
          • Set ISD_p = (Position of ISD_dummy)
          • Unit - Move ISD_dummy instantly to ISD_p
          • Custom script: call RemoveLocation(udg_ISD_p)
          • Set ISD_d = No destructible
        • Else - Actions
          • Set ISD_boolean = False

V1.0 RELEASE
V1.1 FIX DESTRUCTABLE PROBLEM


Keywords:
Tristana, LoL, IamDL, Cannon, Ball
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 14:12, 24th Jan 2015 IcemanBo: http://www.hiveworkshop.com/forums/spells-569/cannon-ball-w3x-v1-1-a-260509/#post2644198
  • Add a proper spell description.
  • Add some comments, at least for the user in config part it's always useful.
  • I would feel safer if you add a harvest ability to your dummy unit that check trees.
  • Moving the (tree checker) dummy is not really needed. You only need to stop his order.
  • Attack- and Damage type, attachment point, attachment effect should be configurable.
  • Only use array variables if really needed. Only index/deindex if needed. I'm looking at your point variables, and your group. :)
  • No need to null destructables. (set them to "No Destructable")
  • onDeindex all units[maxIndex] should be nulled, if not needed anymore.
 
Top