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

Spells & Systems Mini-Contest #20

Status
Not open for further replies.
  • Deja Vu Over
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 500, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DV_Caster[(Integer A)] has buff Deja Vu ) Equal to True
            • Then - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DV_Caster[(Integer A)] has buff Deja Vu ) Equal to False
            • Then - Actions
              • Unit - Remove Deja Vu [2] from DV_Caster[(Integer A)]
              • Unit - Add Deja Vu to DV_Caster[(Integer A)]
            • Else - Actions
I'm still trying to find out how to only remove the spell from the guy who doesn't have it and not EVERY unit in that variable once checked. I'm pretty sure I'm doing something terribly wrong here and I just can't see the simple solution to the problem.
 
I'm thinking this'll be my final submission.
Tell me if you see any leaks or anything unnecessary.
  • Bad Breath
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bad Breath
    • Actions
      • -------- This sets the casting unit in a variable so it can be referred to in other actions later in the trigger. --------
      • Set BadBreathCastingUnit = (Casting unit)
      • -------- This sets the casting unit's position in a variable so it can be referred to in other actions later in the trigger. --------
      • Set BadBreathCastingUnitPoint = (Position of BadBreathCastingUnit)
      • -------- This sets the point of where the spell was cast in a variable so it can be referred to in other actions later in the trigger. --------
      • Set BadBreathCastPoint = (Target point of ability being cast)
      • -------- This creates the unit to show that the Malboro has cast Bad Breath. --------
      • Unit - Create 1 Dummy Bad Breath for (Triggering player) at BadBreathCastingUnitPoint facing Default building facing degrees
      • -------- This clears the leak the action creates. --------
      • Custom script: call RemoveLocation(udg_BadBreathCastingUnitPoint)
      • -------- This will move the unit to BadBreathCastPoint. --------
      • Unit - Order (Last created unit) to Move To BadBreathCastPoint
      • -------- Setting the movement speed insanely high, yet it's still stuck at 522. --------
      • Unit - Set (Last created unit) movement speed to 1000000000.00
      • -------- This will make sure that the unit will disappear after 5 seconds. --------
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • -------- This adds units that are not dead, not the BadBreathCastingUnit, not a structure, not mechanical, and not allied to the owner of BadBreathCastingUnit within 200 range of BadBreathCastPoint. --------
      • Set BadBreathUnitGroup = (Units within 200.00 of BadBreathCastPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is dead) Equal to False))) and (((Matching unit) Not equal to BadBreathCastingU
      • -------- This will repeat the unit group actions 5 times for the '1 to 5 random negative buffs' part of the spell. --------
      • For each (Integer BadBreathBuffInteger) from 1 to 5, do (Actions)
        • Loop - Actions
          • -------- This resets the number of buffs the unit has to 0. --------
          • Set BadBreathNumberofBuffs = 0
          • -------- These are the actions that casts the random buffs for each unit. --------
          • Unit Group - Pick every unit in BadBreathUnitGroup and do (Actions)
            • Loop - Actions
              • -------- This resets the buffs the unit already has. --------
              • Set BadBreath_UnitHasSlow = False
              • Set BadBreath_UnitHasBanish = False
              • Set BadBreath_UnitHasCurse = False
              • Set BadBreath_UnitHasDisease = False
              • Set BadBreath_UnitHasFaerieFire = False
              • Set BadBreath_UnitHasHex = False
              • Set BadBreath_UnitHasManaLeak = False
              • Set BadBreath_UnitHasSilence = False
              • Set BadBreath_UnitHasSleep = False
              • Set BadBreath_UnitHasStun = False
              • -------- This sets the random chance for the which buff will be cast. --------
              • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
              • -------- This is the random chance for Slow. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 10
                  • BadBreath_UnitHasSlow Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Slow. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Slow. --------
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                  • -------- This boolean will set that the unit has Slow. --------
                  • Set BadBreath_UnitHasSlow = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 20
                  • BadBreathBuffRandomInteger Greater than or equal to 11
                  • BadBreath_UnitHasHex Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Hex. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Hex. --------
                  • Unit - Order (Last created unit) to Orc Shadow Hunter - Hex (Picked unit)
                  • -------- This boolean will set that the unit has Hex. --------
                  • Set BadBreath_UnitHasHex = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 30
                  • BadBreathBuffRandomInteger Greater than or equal to 21
                  • BadBreath_UnitHasStun Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Stun. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Stun. --------
                  • Unit - Order (Last created unit) to Neutral - Firebolt (Picked unit)
                  • -------- This boolean will set that the unit has Stun. --------
                  • Set BadBreath_UnitHasStun = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 40
                  • BadBreathBuffRandomInteger Greater than or equal to 31
                  • BadBreath_UnitHasSilence Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Silence. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Silence. --------
                  • Unit - Order (Last created unit) to Neutral Dark Ranger - Silence BadBreathUnitPoint
                  • -------- This boolean will set that the unit has Silence. --------
                  • Set BadBreath_UnitHasSilence = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 50
                  • BadBreathBuffRandomInteger Greater than or equal to 41
                  • BadBreath_UnitHasDisease Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Disease. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Disease. --------
                  • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                  • -------- This boolean will set that the unit has Disease. --------
                  • Set BadBreath_UnitHasDisease = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 60
                  • BadBreathBuffRandomInteger Greater than or equal to 51
                  • BadBreath_UnitHasFaerieFire Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Faerie Fire. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Faerie Fire. --------
                  • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Picked unit)
                  • -------- This boolean will set that the unit has Faerie Fire. --------
                  • Set BadBreath_UnitHasFaerieFire = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 70
                  • BadBreathBuffRandomInteger Greater than or equal to 61
                  • BadBreath_UnitHasCurse Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Curse. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Curse. --------
                  • Unit - Order (Last created unit) to Undead Banshee - Curse (Picked unit)
                  • -------- This boolean will set that the unit has Curse. --------
                  • Set BadBreath_UnitHasCurse = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 80
                  • BadBreathBuffRandomInteger Greater than or equal to 71
                  • BadBreath_UnitHasManaLeak Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This will subtract 100 mana from the unit. --------
                  • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 100.00)
                  • -------- This creates a special effect to show that Mana Leak has taken effect on the unit. --------
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                  • -------- This clears the leak the creation of the special effect creates. --------
                  • Special Effect - Destroy (Last created special effect)
                  • -------- This boolean will set that the unit has Mana Leak. --------
                  • Set BadBreath_UnitHasManaLeak = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 90
                  • BadBreathBuffRandomInteger Greater than or equal to 81
                  • BadBreath_UnitHasSleep Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Sleep. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Sleep. --------
                  • Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
                  • -------- This boolean will set that the unit has Sleep. --------
                  • Set BadBreath_UnitHasSleep = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Greater than or equal to 91
                  • BadBreath_UnitHasBanish Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Banish. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Banish. --------
                  • Unit - Order (Last created unit) to Human Blood Mage - Banish (Picked unit)
                  • -------- This boolean will set that the unit has Banish. --------
                  • Set BadBreath_UnitHasBanish = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
[EDIT]
This should be my final submission.
 

Attachments

  • Bad Breath.w3x
    83.6 KB · Views: 52
Last edited:
Level 16
Joined
Jun 24, 2009
Messages
1,409
Aw, since I've changed the base spell type to a channeling one everything is messed up... I've made very n00b and obvious mistakes because I'm too tired, but I fixed every of these(I think). But there is still something I can't find. Could someone help me a little?

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Set SBMax = 2
      • -------- Configurables on each level --------
      • -------- Level 1 --------
      • Set Distance[1] = 1250.00
      • -------- Level 2 --------
      • Set Distance[2] = 1500.00
      • -------- Level 3 --------
      • Set Distance[3] = 1750.00
  • Soul Blast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Soul Blast
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SBHas[SBLastRecycled] Equal to True
        • Then - Actions
          • Set SBMax = (SBMax + 1)
          • Set SBLastRecycled = SBMax
          • Set SBIndex = SBLastRecycled
          • Set SBLastRecycled = SBRecycledList[SBLastRecycled]
        • Else - Actions
          • Set SBIndex = SBLastRecycled
          • Set SBLastRecycled = SBRecycledList[SBLastRecycled]
      • Set SBCaster[SBIndex] = (Triggering unit)
      • Set SBCasterPoint[SBIndex] = (Position of SBCaster[SBIndex])
      • Set SBTargetPoint[SBIndex] = (Target point of ability being cast)
      • Set SBDistance[SBIndex] = 50.00
      • Set SBLevel[SBIndex] = (Level of Soul Blast for SBCaster[SBIndex])
      • Set SBMaxDistance[SBIndex] = Distance[SBLevel[SBIndex]]
      • Set SBAngle[SBIndex] = (Angle from SBCasterPoint[SBIndex] to SBTargetPoint[SBIndex])
      • Set SBTempPoint = (SBCasterPoint[SBIndex] offset by 50.00 towards SBAngle[SBIndex] degrees)
      • Unit - Create 1 Missile Body 1 for (Triggering player) at SBCasterPoint[SBIndex] facing SBAngle[SBIndex] degrees
      • Unit Group - Add (Last created unit) to SBDummyGroup[SBIndex]
      • Animation - Change (Last created unit)'s animation speed to 5.00% of its original speed
      • Unit - Create 1 Missile Body 2 for (Triggering player) at SBCasterPoint[SBIndex] facing SBAngle[SBIndex] degrees
      • Unit Group - Add (Last created unit) to SBDummyGroup[SBIndex]
      • Unit - Create 1 Missile Head for (Triggering player) at SBTempPoint facing SBAngle[SBIndex] degrees
      • Unit Group - Add (Last created unit) to SBDummyGroup[SBIndex]
      • Set SBHas[SBIndex] = True
      • Set SBCount = (SBCount + 1)
      • Set SBTimer[SBIndex] = 3.00
      • Set SBEffect[SBIndex] = False
      • Custom script: call RemoveLocation (udg_SBTempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Soul Blast Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Soul Blast Loop <gen>
          • Trigger - Turn on Wave Effect <gen>
        • Else - Actions
  • Soul Blast Halt
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Soul Blast
    • Actions
      • For each (Integer A) from 0 to SBMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SBCaster[(Integer A)] Equal to (Triggering unit)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SBTimer[(Integer A)] Greater than 0.00
                • Then - Actions
                  • Unit Group - Pick every unit in SBDummyGroup[(Integer A)] and do (Unit - Kill (Picked unit))
                  • Unit Group - Remove all units from SBDummyGroup[(Integer A)]
                  • Set SBTimer[(Integer A)] = 0.00
                  • Custom script: call RemoveLocation (udg_SBTargetPoint[GetForLoopIndexA()])
                  • Custom script: call RemoveLocation (udg_SBCasterPoint[GetForLoopIndexA()])
                  • Set SBHas[(Integer A)] = False
                  • Set SBRecycledList[(Integer A)] = SBLastRecycled
                  • Set SBLastRecycled = (Integer A)
                  • Set SBEffect[(Integer A)] = False
                  • Set SBCount = (SBCount - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SBCount Equal to 0
                    • Then - Actions
                      • Trigger - Turn off Wave Effect <gen>
                      • Trigger - Turn off Soul Blast Loop <gen>
                    • Else - Actions
                • Else - Actions
            • Else - Actions
  • Soul Blast Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SBInteger) from 0 to SBMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SBHas[SBInteger] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SBTimer[SBInteger] Greater than 0.00
                • Then - Actions
                  • Set SBTimer[SBInteger] = (SBTimer[SBInteger] - 0.03)
                • Else - Actions
                  • Set SBEffect[SBInteger] = True
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • SBDistance[SBInteger] Less than SBMaxDistance[SBInteger]
                    • Then - Actions
                      • Set SBDistance[SBInteger] = (SBDistance[SBInteger] + 40.00)
                      • Set SBTempPoint = (SBCasterPoint[SBInteger] offset by SBDistance[SBInteger] towards SBAngle[SBInteger] degrees)
                      • Unit Group - Pick every unit in SBDummyGroup[SBInteger] and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of (Picked unit)) Equal to Missile Head
                            • Then - Actions
                              • Set SBTempPoint2 = (SBCasterPoint[SBInteger] offset by (SBDistance[SBInteger] + 40.00) towards SBAngle[SBInteger] degrees)
                              • Unit - Move (Picked unit) instantly to SBTempPoint2
                              • Custom script: call RemoveLocation (udg_SBTempPoint2)
                            • Else - Actions
                              • Unit - Move (Picked unit) instantly to SBTempPoint
                      • Set SBTempGroup = (Units within 100.00 of SBTempPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of SBCa
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (SBTempGroup is empty) Equal to True
                        • Then - Actions
                        • Else - Actions
                          • Custom script: call RemoveLocation (udg_SBTargetPoint[udg_SBInteger])
                          • Custom script: call RemoveLocation (udg_SBCasterPoint[udg_SBInteger])
                          • Custom script: set bj_wantDestroyGroup = true
                          • Set SBEffect[SBIndex] = False
                          • Unit Group - Pick every unit in (Units within 250.00 of SBTempPoint matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of SBCa and do (Actions)
                            • Loop - Actions
                              • Unit - Cause SBCaster[SBInteger] to damage (Picked unit), dealing (100.00 x (Real(SBLevel[SBInteger]))) damage of attack type Spells and damage type Magic
                          • Unit Group - Pick every unit in SBDummyGroup[SBInteger] and do (Unit - Kill (Picked unit))
                          • Unit Group - Remove all units from SBDummyGroup[SBInteger]
                          • Unit - Create 1 Blast Effect for (Owner of SBCaster[SBInteger]) at SBTempPoint facing Default building facing degrees
                          • Unit - Add a 0.10 second Generic expiration timer to (Last created unit)
                          • Set SBHas[SBInteger] = False
                          • Set SBCount = (SBCount - 1)
                          • Set SBRecycledList[SBInteger] = SBLastRecycled
                          • Set SBLastRecycled = SBInteger
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • SBCount Equal to 0
                            • Then - Actions
                              • Trigger - Turn off (This trigger)
                              • Trigger - Turn off Wave Effect <gen>
                            • Else - Actions
                      • Custom script: call DestroyGroup (udg_SBTempGroup)
                      • Custom script: call RemoveLocation (udg_SBTempPoint)
                    • Else - Actions
                      • Set SBHas[SBInteger] = False
                      • Custom script: set bj_wantDestroyGroup = true
                      • Set SBEffect[SBIndex] = False
                      • Unit Group - Pick every unit in SBDummyGroup[SBInteger] and do (Unit - Kill (Picked unit))
                      • Unit Group - Remove all units from SBDummyGroup[SBInteger]
                      • Custom script: call RemoveLocation (udg_SBTargetPoint[udg_SBInteger])
                      • Custom script: call RemoveLocation (udg_SBCasterPoint[udg_SBInteger])
                      • Set SBCount = (SBCount - 1)
                      • Set SBRecycledList[SBInteger] = SBLastRecycled
                      • Set SBLastRecycled = SBInteger
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • SBCount Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                          • Trigger - Turn off Wave Effect <gen>
                        • Else - Actions
            • Else - Actions
  • Wave Effect
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer B) from 0 to SBMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SBHas[(Integer B)] Equal to True
              • SBEffect[(Integer B)] Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in SBDummyGroup[(Integer B)] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                      • (Unit-type of (Picked unit)) Equal to Missile Head
                    • Then - Actions
                      • Set SBTempPoint = (Position of (Picked unit))
                      • Unit - Create 1 Wave Effect for (Owner of (Picked unit)) at SBTempPoint facing (Facing of (Picked unit)) degrees
                      • Animation - Change (Last created unit)'s animation speed to 150.00% of its original speed
                      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation (udg_SBTempPoint)
                    • Else - Actions
            • Else - Actions
View attachment 102173

Halp plox.
 
This would be my final submission if there would be no further adjustments

JASS:
/*

    Space Collapse 1.0 by Adiktuz
    
    -Creates images of yourself around the target area to saturate the area with arcane energy
    which causes spacial ruptures on the target area
    
    Programs required to implement:
    -NewGenWE with Jass Helper 0.A.2.A or up
    
    How to use:
    1)Copy the triggers named SpaceCollapse, T32 and Nova into your map
      -you can just copy the whole folder for easier copying
    
    2)Import the dummy.mdx into your map and create a dummy caster if you don't have one yet
    
    3)Create another dummy for the image of the caster, use the same settings as your dummy caster
      but set the model to the model of the unit that will have the spell
      
    4)Copy the Ability into your map and give it to your caster, adjust the values to suit your needs
    
    5)Adjust the global variables and the formulas below to your liking
      -be sure to adjust the raw codes on this library and on the Nova library for the dummies
    
    
    Credits to:
    Vexorian - dummy.mdx
    Jesus4Lyf - Timer32

*/

library SpaceCollapse requires Nova, T32
//By Adiktuz


    globals
        private constant integer SC_ID = 'A000' //rawcode of spell
        private constant integer DUMMY_ID = 'h000' //rawcode of dummy caster
        private constant integer CASTER_ID = 'h001' //rawcode of the caster images
        private constant integer IMAGES = 5 //number of images created + the caster itself, don't set it to too high
        private constant string CIRCLE_A = "Abilities\\Spells\\Undead\\RegenerationAura\\ObsidianRegenAura.mdl" //the path to the effect that will be shown below the caster and its images
        private constant string CIRCLE_B = "Abilities\\Spells\\Undead\\UnholyAura\\UnholyAura.mdl" //the path to the effect that will be shown on the AoE
        private constant string CIRCLE_C = "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAura.mdl" //the path to the effect that will be shown above CIRCLE_B
        private constant string COLLAPSE = "Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl" //the path to the effect of the collapse, several of these could be made depending on the amount you set on a function below
        private constant integer ANIMATION = 5 //the index of the animation to be used
        private constant real DELAY = 1.50 //the duration of the spell animation or whatever animation you will be using 
        private constant real DELAY_C = 1.20 //the delay before the collapse happen, scale this depending on the collapse model that you will use
        private constant real SCALE = 1.0 //the scale of CIRCLE_A
        private constant real SCALE_COLLAPSE = .7 //the scale of teh collapse effects
        private constant real OFFSET = 100.0 //the offset of the caster images from the radius of the AOE
        private constant real HEIGHT = 300.0 //the height of CIRCLE_C
        private constant attacktype AT = ATTACK_TYPE_MAGIC //the attack type of the spell
        private constant damagetype DT = DAMAGE_TYPE_NORMAL //the damage type of the spell
        private constant integer FLY = 'Amrf' //rawcode of Medivh's raven form
        private constant integer CIRCLES = IMAGES + 1//do not edit
    endglobals
    
    //I suggest making the cast range to be equal to the radius + (50 to 100)
    private function GetRadius takes integer level returns real
        return 200.0*level
    endfunction
    
    //the radius of the damage of each
    private function GetRadiusF takes integer level returns real
        return 75.0*level
    endfunction
    
    //the function for setting the damage dealt by the spell
    private function GetDamage takes integer level returns real
        return 100.0*level
    endfunction
    
    //the function for getting the maximum number of the collapse effect that will be created around the AOE
    private function GetEffectsMax takes integer level returns integer
        return 6*level
    endfunction
    
    //the function for getting the minimum number of the collapse effect that will be created around the AOE
    private function GetEffectsMin takes integer level returns integer
        return 3*level
    endfunction
    
    //the function for setting the scale of CIRCLE_B and CIRCLE_C
    //I've set CIRCLE_C to be half the scale of CIRCLE_B
    private function GetScaleAB takes integer level returns real
        return GetRadius(level)/100.0
    endfunction
    
    //the initializer Module
    module init
        private static method onInit takes nothing returns nothing
            local trigger t = CreateTrigger()
            local integer i = 0
            loop
                exitwhen i > 15
                call TriggerRegisterPlayerUnitEvent(t, Player(i), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
                set i = i + 1
            endloop
            call TriggerAddCondition(t, Condition(function thistype.SpaceCollapseAction))
            set t = null
        endmethod
    endmodule
    
    //the struct for the main part of the spell
    struct SpaceCollapse
    
        implement init
        
        static unit caster
        static integer level
        static real x
        static real y
        static real x2
        static real y2
        static location TempLoc = Location(0,0)
        real time
        real xc
        real yc
        unit casterr
        unit array images [IMAGES]
        unit array circles [CIRCLES]
        effect array effects [CIRCLES]
        
        private method onDestroy takes nothing returns nothing
            local integer i = 0
            call SetUnitX(this.casterr, this.xc)
            call SetUnitY(this.casterr, this.yc)
            call SetUnitFlyHeight(this.caster, 0.0, 0.0)
            loop
                exitwhen i > CIRCLES
                set this.images[i] = null
                set this.circles[i] = null
                call DestroyEffect(this.effects[i])
                set this.effects[i] = null
                set i = i + 1
            endloop
        endmethod
        
        private method periodic takes nothing returns nothing
            local integer i = 0
            loop
                exitwhen i > CIRCLES
                if i != CIRCLES - 1 then
                    call SetUnitFacing(this.circles[i], this.time*12.0)
                else
                    call SetUnitFacing(this.circles[i], this.time*-12.0)
                endif
                set i = i + 1
            endloop
            set this.time = this.time + T32_PERIOD 
            if this.time >= DELAY then
                call this.stopPeriodic()
                call this.destroy()
            endif
        endmethod
        
        implement T32x
        
        static method create takes player owner, real angle, real x2, real y2, integer level  returns thistype
            local thistype this = .allocate()
            local real angle2 = (360.0/I2R(IMAGES))*.017453292
            local integer i = 1
            local real x = x2 + (GetRadius(level) + OFFSET )*Cos(angle)
            local real y = y2 + (GetRadius(level) + OFFSET )*Sin(angle)
            local real x3
            local real y3
            local real z
            local real fz
            local real scales = GetScaleAB(level)
            set this.circles[0] = CreateUnit(owner, DUMMY_ID, x, y, 0.0)
            set this.effects[0] = AddSpecialEffectTarget(CIRCLE_A, this.circles[0], "origin")
            call UnitApplyTimedLife(this.circles[0], 'BTLF', DELAY + .2)
            call SetUnitScale(this.circles[0], SCALE, SCALE, SCALE)
            call SetUnitExploded(this.circles[0], true)
            call MoveLocation(thistype.TempLoc, x2, y2)
            set this.xc = thistype.x
            set this.yc = thistype.y
            call SetUnitX(thistype.caster, x )
            call SetUnitY(thistype.caster, y )
            set z = GetLocationZ(thistype.TempLoc)
            call UnitAddAbility(this.circles[0], FLY)
            call UnitRemoveAbility(this.circles[0], FLY)
            call UnitAddAbility(this.caster, FLY)
            call UnitRemoveAbility(this.caster, FLY)
            call MoveLocation(thistype.TempLoc, x, y)
            set fz = z - GetLocationZ(thistype.TempLoc)
            call SetUnitFlyHeight(this.circles[0], fz, 0.0)
            call SetUnitFlyHeight(thistype.caster, fz, 0.0)
            set this.time = 0.0
            loop
                exitwhen i == IMAGES
                set x3 = x2 + (GetRadius(level) + OFFSET )*Cos(angle + angle2*i)
                set y3 = y2 + (GetRadius(level) + OFFSET )*Sin(angle + angle2*i)
                set this.circles[i] = CreateUnit(owner, DUMMY_ID, x3, y3, 0.0)
                call UnitAddAbility(this.circles[i], FLY)
                call UnitRemoveAbility(this.circles[i], FLY)
                set this.images[i] = CreateUnit(owner, CASTER_ID, x3, y3, (angle + angle2*i + 3.141592654)/.017453292)
                call UnitAddAbility(this.images[i], FLY)
                call UnitRemoveAbility(this.images[i], FLY)
                call MoveLocation(thistype.TempLoc, x3, y3)
                call SetUnitScale(this.circles[i], SCALE, SCALE, SCALE)
                set fz = z - GetLocationZ(thistype.TempLoc)
                call SetUnitFlyHeight(this.circles[i], fz, 0.0)
                call SetUnitFlyHeight(this.images[i], fz, 0.0)
                call SetUnitExploded(this.circles[i], true)
                call SetUnitExploded(this.images[i], true)
                call SetUnitAnimationByIndex(this.images[i], ANIMATION)
                call UnitApplyTimedLife(this.circles[i], 'BTLF', DELAY + .1)
                call UnitApplyTimedLife(this.images[i], 'BTLF', DELAY + .1)
                set this.effects[i] = AddSpecialEffectTarget(CIRCLE_A, this.circles[i], "origin")
                set i = i + 1
            endloop
            set this.circles[CIRCLES - 1] = CreateUnit(owner, DUMMY_ID, x2, y2, 0.0)
            set this.effects[CIRCLES - 1] = AddSpecialEffectTarget(CIRCLE_B, this.circles[CIRCLES - 1], "origin")
            set this.circles[CIRCLES] = CreateUnit(owner, DUMMY_ID, x2, y2, 0.0)
            set this.effects[CIRCLES] = AddSpecialEffectTarget(CIRCLE_C, this.circles[CIRCLES], "origin")
            call SetUnitScale(this.circles[CIRCLES - 1], scales, scales, scales)
            call SetUnitScale(this.circles[CIRCLES], scales/2.0, scales/2.0, scales/2.0)
            call SetUnitExploded(this.circles[CIRCLES - 1], true)
            call SetUnitExploded(this.circles[CIRCLES], true)
            call UnitAddAbility(this.circles[CIRCLES], FLY)
            call UnitRemoveAbility(this.circles[CIRCLES], FLY)
            call SetUnitFlyHeight(this.circles[CIRCLES], HEIGHT, 0.0)
            call UnitApplyTimedLife(this.circles[CIRCLES - 1], 'BTLF', DELAY + .2)
            call UnitApplyTimedLife(this.circles[CIRCLES], 'BTLF', DELAY + .2)
            call this.startPeriodic()
            set this.casterr = thistype.caster
            return this
        endmethod
        
        static method SpaceCollapseAction takes nothing returns boolean
            if GetSpellAbilityId() == SC_ID then
                set thistype.caster = GetTriggerUnit()
                set thistype.level = GetUnitAbilityLevel(thistype.caster, SC_ID)
                call SetUnitAnimationByIndex(thistype.caster, ANIMATION)
                set thistype.x = GetUnitX(thistype.caster)
                set thistype.y = GetUnitY(thistype.caster)
                set thistype.x2 = GetSpellTargetX()
                set thistype.y2 = GetSpellTargetY()
                call thistype.create(GetOwningPlayer(thistype.caster), Atan2(thistype.y-thistype.y2, thistype.x-thistype.x2), thistype.x2, thistype.y2, thistype.level)
                call NovaSystem.create(thistype.caster, thistype.x2, thistype.y2, GetRadius(thistype.level) - 100.0*thistype.level, GetRadiusF(thistype.level), 0.0, GetEffectsMin(thistype.level),/*
                */GetEffectsMax(thistype.level), DELAY_C , DELAY_C, GetDamage(thistype.level), SCALE_COLLAPSE, SCALE_COLLAPSE, SCALE_COLLAPSE, false, false, false, COLLAPSE, AT, DT)
            endif
            return false
        endmethod
        
    endstruct
    

endlibrary
 

Attachments

  • SpaceCollapse 1.0.w3x
    62 KB · Views: 68
I don't know what you guys are talking about lol
  • Deja Vu Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deja Vu
    • Actions
      • Set DV_Caster[(DV_CasterUnits[(Player number of (Triggering player))] + 1)] = (Triggering unit)
      • Unit - Remove Deja Vu from (Triggering unit)
      • Unit - Add Deja Vu [2] to (Triggering unit)
      • Countdown Timer - Start DV_Timer[((Player number of (Triggering player)) + (DV_Cast[(Player number of (Triggering player))] + 1))] as a One-shot timer that will expire in (2.00 + (Real((Level of Deja Vu for (Triggering unit))))) seconds
  • Deja Vu 2 Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deja Vu [2]
    • Actions
      • Countdown Timer - Pause DV_Timer[(Player number of (Triggering player))]
      • Set DV_Point[0] = (Position of (Triggering unit))
      • Set DV_Point[1] = (DV_Point[0] offset by 9000.00 towards ((Facing of (Triggering unit)) - 180.00) degrees)
      • Unit - Create 1 Caster [Illusion] for (Owner of (Triggering unit)) at DV_Point[0] facing Default building facing degrees
      • Unit - Add a (2.00 + (Real((Level of Deja Vu for (Triggering unit))))) second Generic expiration timer to DV_Illusion
      • Set DV_Illusion = (Last created unit)
      • Unit - Order DV_Illusion to Move To DV_Point[1]
      • Custom script: call RemoveLocation(udg_DV_Point[1])
      • Unit - Remove Deja Vu [2] from (Triggering unit)
      • Unit - Add Deja Vu [3] to (Triggering unit)
      • Countdown Timer - Start DV_Timer2[(Player number of (Triggering player))] as a One-shot timer that will expire in (2.00 + (Real((Level of Deja Vu for DV_Caster[(Player number of (Triggering player))])))) seconds
  • Deja Vu 3 Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deja Vu [3]
    • Actions
      • Countdown Timer - Pause DV_Timer2[(Player number of (Triggering player))]
      • Set DV_Point[2] = (Position of DV_Illusion)
      • Unit - Move (Triggering unit) instantly to DV_Point[2]
      • Custom script: call RemoveLocation(udg_DV_Point[2])
      • Custom script: call RemoveLocation(udg_DV_Point[0])
      • Countdown Timer - Start DV_Timer3[(Player number of (Triggering player))] as a One-shot timer that will expire in (2.00 + (Real((Level of Deja Vu for DV_Caster[(Player number of (Triggering player))])))) seconds
      • Unit - Remove Deja Vu [3] from (Triggering unit)
      • Unit - Add Deja Vu to (Triggering unit)
Well I first did try to use timers to remove the abilities after a certain time, but for the event (Timer expires), I don't know how to check EVERY timer, since a new timer is added to one timer variable the whole time.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Well I fixed the rest of the problems but there are still some.
Well it's MUI but sometimes when got cast more than one at a moment, some effects won't move, but the first unit group will be damaged.

I advise starting a thread on it because it will garner more specific attention that way (people will know you are asking for help that way)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Well you could use hashtables, like this:


  • Deja Vu Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set DV_Hash = (Last created hashtable)
  • Deja Vu Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deja Vu
    • Actions
      • Set DV_Caster = (Triggering unit)
      • Set DV_ID = (Key (Triggering unit))
      • Set DV_Casters[(DV_CasterUnits[(Player number of (Triggering player))] + 1)] = (Triggering unit)
      • Unit - Remove Deja Vu from DV_Caster
      • Unit - Add Deja Vu [2] to DV_Caster
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (1 is stored as a Handle of DV_ID in DV_Hash) Equal to False
        • Then - Actions
          • Custom script: call SaveTimerHandle(udg_DV_Hash, udg_DV_ID, 1, CreateTimer())
          • Hashtable - Save Handle OfDV_Caster as 0 of (Key (Load 1 of DV_ID in DV_Hash)) in DV_Hash
          • Trigger - Add to Deja Vu Timer <gen> the event (Time - (Load 1 of DV_ID in DV_Hash) expires)
        • Else - Actions
      • Countdown Timer - Start (Load 1 of DV_ID in DV_Hash) as a One-shot timer that will expire in (2.00 + (Real((Level of Deja Vu for DV_Caster)))) seconds
  • Deja Vu Timer
    • Events
    • Conditions
    • Actions
      • Set DV_Caster = (Load 0 of (Key (Expiring timer)) in DV_Hash)
      • Unit - Add Deja Vu to DV_Caster
      • Unit - Remove Deja Vu [2] from DV_Caster
      • Special Effect - Create a special effect attached to the overhead of DV_Caster using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Special Effect - Destroy (Last created special effect)


What happens is that if the caster doesn't have a timer created, the trigger then creates a timer and registers the expiration even for it. The trigger also links the unit to the timer.

When the timer expires, the unit bound to the timer can be loaded by using the expiring timer's id.

The first timer could be optimized a bit by using a variable for the timer.

EDIT: Remove this line, it is not needed:
  • Set DV_Casters[(DV_CasterUnits[(Player number of (Triggering player))] + 1)] = (Triggering unit)
http://www.hiveworkshop.com/forums/pastebin.php?id=plp6p5
 
Level 10
Joined
Jun 1, 2008
Messages
485
What happens is that if the caster doesn't have a timer created, the trigger then creates a timer and registers the expiration even for it. The trigger also links the unit to the timer.

When the timer expires, the unit bound to the timer can be loaded by using the expiring timer's id.
well, AFAIK, 1 timer doing 500 action is way better than 500 timer doing one action each. I think u better implement some waiting system for this. or maybe some indexing system.

Judging
Judging will be as follows:
.....
5. Sound effects (5 points) - Try to pick out some good WarCraft III sound effects (portal opening, evil laugh, etc.) - while you can't import audio files you can adjust the pitch to make it sound a bit different.
so... sound effect is a must? this gonna be tough to find a good one. Never use one before...

and.. I'm gonna enter this one...
I think I'll create either
rising sun (0.24-0.30) or golden dragon (2.46-2.55) from this:
or...
admonition (0.00-0.05), vapor blade (0.20-0.28), sonic wave (0.30-0.34), crescent moon (0.40-0.47), ninja drop (1.22-1.28), back slasher (1.40-1.44), reaping the mist (1.47-1.55), Aerial Reaver (2.25-2.33), or Phoenix (2.34-2.44)
from this:
or...
spiral wave (0.20-0.25), Impulse (0.38-0.43), Marble Steam (1.49-1.56), Deep Swing (2.43-2.49)
I really can't decide which to choose. Too bad I can't enter multiple spell...
most of them are fairly simple but interesting to make.

EDIT:
And how do you stop that timer? Since there's no way to remove an event from a trigger. (as far as I know and we all know I don't know how far it goes)
If u use Maker's method, u should try to recycle the timer. Just pause it when the timer is expired then re-start it when there's new caster added. u create a new timer if and only if there's no available paused timer. Well, but that will end up with too many timer running at once, which is bad.
 
Level 10
Joined
Jun 1, 2008
Messages
485
The sound effects are there because often you have a really high-calibur visual-oriented spell that sounds terrible when you have the sound turned on. As long as the sound effects match the video effects, it will be fine.
lol. now that I recall it.. I've seen few that really fit this description...

That vapor blade kinda looks like my Windcutter spell :)
it is? gonna remove it from my list then. It's been a looong time since my last time visit spell section (or even doing warcraft stuff) so I don't know if any of that have been created or not. Hope that I won't create any coincidentally look-alike spell...
 
  • Equilibrium Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Equilibrium Strike
    • Actions
      • -------- --- --------
      • Set ES_Caster = (Triggering unit)
      • Set ES_Target = (Target unit of ability being cast)
      • Set ES_Ability_Level = (Level of (Ability being cast) for ES_Caster)
      • Set ES_Owner = (Owner of ES_Caster)
      • -------- --- --------
      • Set ES_Base_Damage = 60.00
      • Set ES_Level_Damage = 40.00
      • Set ES_Atribute_Factor = 0.20
      • Set ES_Atribute_Damage = (Agility of ES_Caster (Include bonuses))
      • Set ES_Dummy_Ability_Slow = Equilibrium Strike(dummy slow)
      • Set ES_Dummy_Ability_Stun = Equilibrium Strike(dummy stun)
      • Set ES_Spell_Loc = (Position of ES_Target)
      • Set ES_Spell_Loc_2 = (Position of ES_Caster)
      • Set ES_SFX_Offset = 150.00
      • Set ES_Facing_Angle = (Angle from ES_Spell_Loc to ES_Spell_Loc_2)
      • Set ES_SFX_Loc = (ES_Spell_Loc_2 offset by ES_SFX_Offset towards (ES_Facing_Angle + 45.00) degrees)
      • Set ES_SFX_Loc_2 = (ES_Spell_Loc_2 offset by ES_SFX_Offset towards (ES_Facing_Angle - 45.00) degrees)
      • -------- --- --------
      • Set ES_Damage_Calculation = (ES_Base_Damage + ((Real(ES_Ability_Level)) x ES_Level_Damage))
      • Set ES_Atribute_Damage_Calculation = ((Real(ES_Ability_Level)) x (ES_Atribute_Factor x (Real(ES_Atribute_Damage))))
      • -------- --- --------
      • Set ES_Total_Damage = (ES_Atribute_Damage_Calculation + ES_Damage_Calculation)
      • -------- --- --------
      • Special Effect - Create a special effect attached to the weapon of ES_Caster using Abilities\Spells\Orc\Shockwave\ShockwaveMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of ES_Target using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of ES_Target using Abilities\Spells\Orc\Disenchant\DisenchantSpecialArt.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- --- --------
      • -------- --- --------
      • -------- --- --------
      • Unit - Create 1 Dummy_SFX for ES_Owner at ES_SFX_Loc facing ES_Facing_Angle degrees
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • -------- --- --------
      • -------- --- --------
      • -------- --- --------
      • -------- --- --------
      • Unit - Create 1 Dummy_SFX for ES_Owner at ES_SFX_Loc_2 facing ES_Facing_Angle degrees
      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
      • -------- --- --------
      • Floating Text - Create floating text that reads ((String((Integer(ES_Total_Damage)))) + !) above ES_Target with Z offset 0.00, using font size 10.00, color (100.00%, 5.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • -------- --- --------
      • Unit - Create 1 Dummy for ES_Owner at ES_Spell_Loc facing Default building facing degrees
      • Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
      • Unit - Make (Last created unit) face ES_Target over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of ES_Caster) Greater than or equal to (Life of ES_Target)
        • Then - Actions
          • Unit - Add ES_Dummy_Ability_Slow to (Last created unit)
          • Unit - Set level of ES_Dummy_Ability_Slow for (Last created unit) to ES_Ability_Level
          • Unit - Order (Last created unit) to Human Sorceress - Slow ES_Target
        • Else - Actions
          • Unit - Add Equilibrium Strike(dummy stun) to (Last created unit)
          • Unit - Set level of ES_Dummy_Ability_Stun for (Last created unit) to ES_Ability_Level
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt ES_Target
      • Unit - Cause ES_Caster to damage ES_Target, dealing ES_Total_Damage damage of attack type Spells and damage type Unknown
      • Custom script: call RemoveLocation(udg_ES_Spell_Loc)
      • Custom script: call RemoveLocation(udg_ES_Spell_Loc_2)
      • Custom script: call RemoveLocation(udg_ES_SFX_Loc)
      • Custom script: call RemoveLocation(udg_ES_SFX_Loc_2)
my trigger so far...

But I guess I'll make another spell this one seems boring.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Yea sorry I thought this was a different contest, hadn't realized Bribe came up with yet another contest so quickly. Last time I clicked on the notification at the top it was for the old contest, which is why (upon looking at the discussion on this contest) I was confused whether it was new/old. Scanning to the first post I realize it's not due for another couple of weeks.
 
WIP #3
Based on:
Heroes of Newerth - Hero Vindicator - Sage's Lore:
Sages-Lore.png
The Vindicator unleashes forgotten lore from within The Book,
causing any enemy heroes to lose health and mana until they cast a spell.


TEEHEE
(Heroes of Newerth has been hacked recently so some of the websites' pages are not accessible right now, including the heroes pages, so I just linked another website)
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Is it okay if I take an "ability" or "spell" from a game like Call of Duty: Black Ops? I was planning on doing a cool Warcraft-ized version of Mortar Strike. Would that be acceptable?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
So far I've got a spell struct setup (don't think it was necessary, but whatever) and I'm doing a multi-target setup so that you can specify multiple spell targets. The spell is supposed to encapsulate the idea of the "Mortar Team" or "Mortar Strike" (it's called Mortar Strike in my map) in WarCraft III, giving you 3 targets.

The majority of the work is probably going to get that system working properly. I want it so that you can cancel out of the spell after the 1st and 2nd target, but the cool-down and mana-cost should only be deducted (and spell effect executed) when the 3rd (final) target has been chosen.
 
Level 10
Joined
Jul 12, 2009
Messages
318
Alright I think I'll be dropping out of the contest, Maker has told me to use hashtables and I've never even used them before and I don't even know how to make timers for every friggin doodle trigger. MADNESS
Well I guess I just don't know how to destroy the timer.
Timers are a pain to deal with in pure GUI.

May I suggest my GUI-Friendly Timer System, approved at TheHelper.net (but I haven't yet gotten around to submitting it here on the Hive)?
 
Level 7
Joined
Dec 19, 2009
Messages
249
Alright I think I'll be dropping out of the contest, Maker has told me to use hashtables and I've never even used them before and I don't even know how to make timers for every friggin doodle trigger. MADNESS
Well I guess I just don't know how to destroy the timer.

Don't leave, Hashtables are good things to make it MUI but you can still use a recycling index system, maybe you will find it more easier than hashtable.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Damn. Does anybody know how to detect when a player cancels a unit-order? I've got the multiple targeting setup but in order to make it complete I need to detect if any of the targets get cancelled (thus cancelling the spell).

It doesn't seem like there is an order ID that fires when an order is cancelled, so I can't use that. I could check when a player hits the escape key but I don't think that would work for detecting if they click the button in the lower-right corner of the UI.

I wonder if Cancel is an ability.
 
Okay, resubmission with sound effects.

Spell Information

Bad Breath


Originated from the Final Fantasy Series

Spews an area with putrid breath that can give the units in the area 1 to 5 random negative statuses.
The possible effects are:
Hex - Transforms the unit into a random critter, disabling the use of spells and attacking. Lasts 8 seconds.
Stun - Stuns the unit for 3 seconds.
Slow - Slows the movement speed of the unit by 50% and attack speed by 30%. Lasts 20 seconds.
Silence - Disables the usage of spells for the unit. Lasts 10 seconds.
Disease - The unit takes 2 damage per second for 20 seconds.
Faerie Fire - The unit's armor is decreased by 3, and the caster has sight vision over that unit. Lasts 20 seconds.
Curse - The unit has a 33% chance to miss when it attacks. Lasts 20 seconds.
Mana Leak - 100 mana of the unit's mana is destroyed.
Sleep - Sets the unit to sleep. Lasts 5 seconds.
Banish - The unit takes more damage from spells, is slowed, and is unable to attack and is immune to physical damage. Lasts 8 seconds.

Gameplay Video

  • Bad Breath
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bad Breath
    • Actions
      • -------- This sets the casting unit in a variable so it can be referred to in other actions later in the trigger. --------
      • Set BadBreathCastingUnit = (Casting unit)
      • -------- This sets the casting unit's position in a variable so it can be referred to in other actions later in the trigger. --------
      • Set BadBreathCastingUnitPoint = (Position of BadBreathCastingUnit)
      • -------- This sets the point of where the spell was cast in a variable so it can be referred to in other actions later in the trigger. --------
      • Set BadBreathCastPoint = (Target point of ability being cast)
      • -------- This plays the sound effects for the spell. --------
      • Sound - Play AbominationYesAttack2 <gen> at 100.00% volume, located at BadBreathCastingUnitPoint with Z offset 0.00
      • -------- This creates the unit to show that the Malboro has cast Bad Breath. --------
      • Unit - Create 1 Dummy Bad Breath for (Triggering player) at BadBreathCastingUnitPoint facing Default building facing degrees
      • -------- This clears the leak the action creates. --------
      • Custom script: call RemoveLocation(udg_BadBreathCastingUnitPoint)
      • -------- This will move the unit to BadBreathCastPoint. --------
      • Unit - Order (Last created unit) to Move To BadBreathCastPoint
      • -------- Setting the movement speed insanely high, yet it's still stuck at 522. --------
      • Unit - Set (Last created unit) movement speed to 1000000000.00
      • -------- This will make sure that the unit will disappear after 5 seconds. --------
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • -------- This adds units that are not dead, not the BadBreathCastingUnit, not a structure, not mechanical, and not allied to the owner of BadBreathCastingUnit within 200 range of BadBreathCastPoint. --------
      • Set BadBreathUnitGroup = (Units within 200.00 of BadBreathCastPoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is dead) Equal to False))) and (((Matching unit) Not equal to BadBreathCastingU
      • -------- This will repeat the unit group actions 5 times for the '1 to 5 random negative buffs' part of the spell. --------
      • For each (Integer BadBreathBuffInteger) from 1 to 5, do (Actions)
        • Loop - Actions
          • -------- This resets the number of buffs the unit has to 0. --------
          • Set BadBreathNumberofBuffs = 0
          • -------- These are the actions that casts the random buffs for each unit. --------
          • Unit Group - Pick every unit in BadBreathUnitGroup and do (Actions)
            • Loop - Actions
              • -------- This resets the buffs the unit already has. --------
              • Set BadBreath_UnitHasSlow = False
              • Set BadBreath_UnitHasBanish = False
              • Set BadBreath_UnitHasCurse = False
              • Set BadBreath_UnitHasDisease = False
              • Set BadBreath_UnitHasFaerieFire = False
              • Set BadBreath_UnitHasHex = False
              • Set BadBreath_UnitHasManaLeak = False
              • Set BadBreath_UnitHasSilence = False
              • Set BadBreath_UnitHasSleep = False
              • Set BadBreath_UnitHasStun = False
              • -------- This sets the random chance for the which buff will be cast. --------
              • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
              • -------- This is the random chance for Slow. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 10
                  • BadBreath_UnitHasSlow Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Slow. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Slow. --------
                  • Unit - Order (Last created unit) to Human Sorceress - Slow (Picked unit)
                  • -------- This boolean will set that the unit has Slow. --------
                  • Set BadBreath_UnitHasSlow = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 20
                  • BadBreathBuffRandomInteger Greater than or equal to 11
                  • BadBreath_UnitHasHex Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Hex. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Hex. --------
                  • Unit - Order (Last created unit) to Orc Shadow Hunter - Hex (Picked unit)
                  • -------- This boolean will set that the unit has Hex. --------
                  • Set BadBreath_UnitHasHex = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 30
                  • BadBreathBuffRandomInteger Greater than or equal to 21
                  • BadBreath_UnitHasStun Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Stun. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Stun. --------
                  • Unit - Order (Last created unit) to Neutral - Firebolt (Picked unit)
                  • -------- This boolean will set that the unit has Stun. --------
                  • Set BadBreath_UnitHasStun = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 40
                  • BadBreathBuffRandomInteger Greater than or equal to 31
                  • BadBreath_UnitHasSilence Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Silence. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Silence. --------
                  • Unit - Order (Last created unit) to Neutral Dark Ranger - Silence BadBreathUnitPoint
                  • -------- This boolean will set that the unit has Silence. --------
                  • Set BadBreath_UnitHasSilence = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 50
                  • BadBreathBuffRandomInteger Greater than or equal to 41
                  • BadBreath_UnitHasDisease Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Disease. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Disease. --------
                  • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Picked unit)
                  • -------- This boolean will set that the unit has Disease. --------
                  • Set BadBreath_UnitHasDisease = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 60
                  • BadBreathBuffRandomInteger Greater than or equal to 51
                  • BadBreath_UnitHasFaerieFire Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Faerie Fire. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Faerie Fire. --------
                  • Unit - Order (Last created unit) to Night Elf Druid Of The Talon - Faerie Fire (Picked unit)
                  • -------- This boolean will set that the unit has Faerie Fire. --------
                  • Set BadBreath_UnitHasFaerieFire = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 70
                  • BadBreathBuffRandomInteger Greater than or equal to 61
                  • BadBreath_UnitHasCurse Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Curse. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Curse. --------
                  • Unit - Order (Last created unit) to Undead Banshee - Curse (Picked unit)
                  • -------- This boolean will set that the unit has Curse. --------
                  • Set BadBreath_UnitHasCurse = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 80
                  • BadBreathBuffRandomInteger Greater than or equal to 71
                  • BadBreath_UnitHasManaLeak Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This will subtract 100 mana from the unit. --------
                  • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 100.00)
                  • -------- This creates a special effect to show that Mana Leak has taken effect on the unit. --------
                  • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Undead\DarkRitual\DarkRitualTarget.mdl
                  • -------- This clears the leak the creation of the special effect creates. --------
                  • Special Effect - Destroy (Last created special effect)
                  • -------- This boolean will set that the unit has Mana Leak. --------
                  • Set BadBreath_UnitHasManaLeak = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Less than or equal to 90
                  • BadBreathBuffRandomInteger Greater than or equal to 81
                  • BadBreath_UnitHasSleep Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Sleep. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Sleep. --------
                  • Unit - Order (Last created unit) to Undead Dreadlord - Sleep (Picked unit)
                  • -------- This boolean will set that the unit has Sleep. --------
                  • Set BadBreath_UnitHasSleep = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BadBreathBuffRandomInteger Greater than or equal to 91
                  • BadBreath_UnitHasBanish Equal to False
                  • BadBreathNumberofBuffs Not equal to 5
                • Then - Actions
                  • -------- This sets the unit's position in a variable so it can be referred to in other actions later in the trigger. --------
                  • Set BadBreathUnitPoint = (Position of (Picked unit))
                  • -------- This creates the dummy unit that casts Banish. --------
                  • Unit - Create 1 Dummy Caster for (Owner of BadBreathCastingUnit) at BadBreathUnitPoint facing Default building facing degrees
                  • -------- This will make sure that the unit will disappear after 2 seconds. --------
                  • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                  • -------- This will order the dummy unit to cast Banish. --------
                  • Unit - Order (Last created unit) to Human Blood Mage - Banish (Picked unit)
                  • -------- This boolean will set that the unit has Banish. --------
                  • Set BadBreath_UnitHasBanish = True
                  • -------- This increases the number of buffs the unit has by 1. --------
                  • Set BadBreathNumberofBuffs = (BadBreathNumberofBuffs + 1)
                  • -------- This clears the leak the creation of the dummy creates. --------
                  • Custom script: call RemoveLocation(udg_BadBreathUnitPoint)
                  • -------- This clears the leak the unit group creates. --------
                  • Custom script: call DestroyGroup(udg_BadBreathUnitGroup)
                  • -------- This sets the random chance for the which buff will be cast. --------
                  • Set BadBreathBuffRandomInteger = (Random integer number between 1 and 100)
                • Else - Actions
 

Attachments

  • Bad Breath.w3x
    84.1 KB · Views: 198
Level 33
Joined
Mar 27, 2008
Messages
8,035
The same principle is applied when using the same point for spawning armies/minions in an AOS
In Map Init, we set up some locations on the map, and every periodic timer, use the point
It won't leak, as you're using the same point over and over again until the game ends.
 
. . . WHY WON'T THIS WORK, WHY!! It's all your fault baassee, you made me use hashtables again.
  • Sages Lore Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sage's Lore
    • Actions
      • Set SL_ID = (Key (Triggering unit))
      • -------- Setup Spell --------
      • -------- The Casting Unit --------
      • Set SL_Caster = (Triggering unit)
      • -------- The Amount of Damage dealt to the target --------
      • Set SL_Damage = (25 + (5 x (Level of Sage's Lore for DV_Caster)))
      • -------- Area of ability being cast at --------
      • Set SL_Point[0] = (Target point of ability being cast)
      • -------- Area of Effect (Units getting added to unit group) --------
      • Set SL_AOE = 500
      • -------- Setup Spell --------
      • -------- Sounds --------
      • Sound - Play DispelMagicTarget <gen> at 100.00% volume, located at SL_Point[0] with Z offset 0.00
      • Sound - Destroy (Last played sound)
      • -------- Sounds --------
      • -------- Effects --------
      • Special Effect - Create a special effect at SL_Point[0] using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at SL_Point[0] using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at SL_Point[0] using Abilities\Spells\Other\Charm\CharmTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- Effects --------
      • -------- Add Units at SL_Point[0] to a unit group --------
      • Unit Group - Pick every unit in (Units within (Real(SL_AOE)) of SL_Point[0] matching (((Matching unit) belongs to an enemy of (Owner of SL_Caster)) Equal to True)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Picked unit) is A structure) Equal to False
                  • (1 is stored as a Handle of SL_ID in SL_Hashtable) Equal to False
            • Then - Actions
              • Unit Group - Add (Picked unit) to SL_UnitGroup
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\AcidBomb\BottleImpact.mdl
              • Hashtable - Save Handle Of(Last created special effect) as 0 of (Key (Load 1 of SL_ID from SL_Hashtable)) in SL_Hashtable
            • Else - Actions
      • -------- Add Units at SL_Point[0] to a unit group --------
      • -------- Remove leaks --------
      • Custom script: call RemoveLocation(udg_SL_Point[0])
  • Sages Lore Over Time
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SL_UnitGroup and do (Actions)
        • Loop - Actions
          • -------- Units that still have the Sage's Lore Buff will take damage --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Sage's Lore ) Equal to True
            • Then - Actions
              • -------- Position of unit that has buff --------
              • Set SL_Point[1] = (Position of (Picked unit))
              • -------- Effects --------
              • Special Effect - Create a special effect at SL_Point[1] using Abilities\Spells\Other\Silence\SilenceAreaBirth.mdl
              • Special Effect - Destroy (Last created special effect)
              • Special Effect - Create a special effect at SL_Point[1] using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
              • Special Effect - Destroy (Last created special effect)
              • -------- Effects --------
              • -------- Damage --------
              • Unit - Cause SL_Caster to damage (Picked unit), dealing (Real(SL_Damage)) damage of attack type Spells and damage type Normal
              • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - (Real(SL_Damage)))
              • -------- Damage --------
              • -------- Sounds --------
              • Sound - Play Feedback <gen> at 100.00% volume, attached to (Picked unit)
              • Sound - Destroy (Last played sound)
              • -------- Sounds --------
              • -------- Remove Leaks --------
              • Custom script: call RemoveLocation(udg_SL_Point[1])
            • Else - Actions
              • Set SL_Effect = (Load 0 of (Key (Load 1 of SL_ID from SL_Hashtable)) in SL_Hashtable)
              • Special Effect - Destroy SL_Effect
(The hashtable part)
 
Status
Not open for further replies.
Top