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

Help fixing triggered multishot

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi! I made these triggers to simulate a multishot that adds some stat damage. It's supossed to be castable up to 400 range. But sometimes it's casts, consumes mana, and no missile is shoot. The other part is that the skill can be cast too fast. It's based on channel ability, but I haven't found a way to prevent the ultra-fast cast, without adding a cooldown (played a bit with Casting Time and Follow Through Time, but no good result)




This one creates one dummy for target unit (max 3). (I know there's a Temp_Group group leak)

  • PoisonStaff DUMMY
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Poison Staff
    • Actions
      • Set Temp_Point = (Position of (Triggering unit))
      • Set Temp_PointArray[1] = (Position of (Triggering unit))
      • Set Temp_Group = (Random 3 units from (Units within 400.00 of Temp_PointArray[1] matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy Poison Staff for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
          • Unit - Order (Last created unit) to Attack (Picked unit)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call RemoveLocation(udg_Temp_PointArray[1])
This one deals the damage

  • PoisonStaff DAMAGE
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to Dummy Poison Staff
    • Actions
      • Trigger - Turn off (This trigger)
      • Set A = Believer Melee 0024 <gen> <- Don't pay attention to his
      • Set Real[1] = (Real((Strength of A (Include bonuses))))
      • Set Real[2] = (Real((Agility of A (Include bonuses))))
      • Set Real[3] = (Real((Intelligence of A (Include bonuses))))
      • Set Real[4] = (Real[1] + (Real[2] + Real[3]))
      • Unit - Cause A to damage GDD_DamagedUnit, dealing (Real[4] / 2.00) damage of attack type Hero and damage type Normal
      • Trigger - Turn on (This trigger)
The next one makes that if the unit casts the skill on the ground, it moves to the point if there's no nearby hostile around the point. If there's an hostile around the point, the unit is ordered to attack the unit. The skill has the 'attack' text order, to basically, the unit is ordered to cast the skill on it.

  • Prevent Cast on Ground
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(attack))
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Mindstaff for (Triggering unit)) Greater than 0
          • (Level of Souvenir Bow for (Triggering unit)) Greater than 0
          • (Level of Poison Staff for (Triggering unit)) Greater than 0
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Stop
      • Set Temp_Point = (Target point of issued order)
      • Set Temp_Group = (Units within 300.00 of Temp_Point matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group) Greater than 0
        • Then - Actions
          • Unit - Order (Triggering unit) to Attack (Random unit from Temp_Group)
        • Else - Actions
          • Unit - Order (Triggering unit) to Right-Click Temp_Point
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Trigger - Turn on (This trigger)
 
Status
Not open for further replies.
Top