• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Problems with DotA Undying - Soul Rip

Status
Not open for further replies.
Level 3
Joined
Jun 17, 2015
Messages
53
Hello guys, i tried to make the Soul Rip ability that "deal 18/22/26/30 damages for every unit around the target, max 10/12/14/16 units". But seem like my trigger cause some error that i cant find it :vw_death: please some one help me!!

(When i added float texts: it always appear 150!)

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to (==) Soul Rip
  • Actions
    • Unit Group - Remove all units from Soul_Rip_Count
    • Set AACaster = (Triggering unit)
    • Set AATarget = (Target unit of ability being cast)
    • Set AALoc1 = (Position of (Target unit of ability being cast))
    • Set AAGroup1 = (Random (14 + (4 x (Level of Soul Rip for AACaster))) units from (Units within 1300.00 of AALoc1 matching ((((Matching unit) is A structure) Equal to (==) False) and (((Matching unit) is alive) Equal to (==) True))))
    • Unit Group - Pick every unit in AAGroup1 and do (Actions)
      • Loop - Actions
        • Set AALoc2 = (Position of (Picked unit))
        • Unit Group - Add (Picked unit) to Soul_Rip_Count
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((AATarget belongs to an ally of (Owner of AACaster)) Equal to (==) True) or (AATarget Equal to (==) AACaster)
        • Then - Actions
          • Set AAInteger1 = (Number of units in Soul_Rip_Count)
          • Set AAReal = ((14.00 + (4.00 x (Real((Level of Soul Rip for AACaster))))) x (Real(AAInteger)))
          • Unit - Set life of AATarget to ((Life of AATarget) + ((14.00 + (4.00 x (Real((Level of Soul Rip for AACaster))))) x (Real(AAInteger))))
          • Custom script: call RemoveLocation(udg_AALoc2)
        • Else - Actions
          • Set AAInteger1 = (Number of units in Soul_Rip_Count)
          • Set AAReal = ((14.00 + (4.00 x (Real((Level of Soul Rip for AACaster))))) x (Real(AAInteger)))
          • Unit - Cause AACaster to damage AATarget, dealing ((14.00 + (4.00 x (Real((Level of Soul Rip for AACaster))))) x (Real(AAInteger))) damage of attack type Spells and damage type Magic
          • Custom script: call RemoveLocation(udg_AALoc2)
    • Custom script: call DestroyGroup (udg_AAGroup1)
    • Custom script: call RemoveLocation(udg_AALoc1)
    • Set AACaster = No unit
    • Set AATarget = No unit
 
Level 12
Joined
May 22, 2015
Messages
1,051
I wouldn't mention it if there was no memory clean up, but this trigger will leak a group and several points (depends on how many units are in range) every time you cast it.

It also looks like you put the wrong numbers for how many units to count. Look at this line:
  • Set AAGroup1 = (Random (14 + (4 x (Level of Soul Rip for AACaster))) units from (Units within 1300.00 of AALoc1 matching ((((Matching unit) is A structure) Equal to (==) False) and (((Matching unit) is alive) Equal to (==) True))))
This will give you 18/22/26/30. That is the amount for the damage. In your description, it says you want it to be 10/12/14/16. You would have to change that line to:
  • Set AAGroup1 = (Random (8 + (2 x (Level of Soul Rip for AACaster))) units from (Units within 1300.00 of AALoc1 matching ((((Matching unit) is A structure) Equal to (==) False) and (((Matching unit) is alive) Equal to (==) True))))
 
Status
Not open for further replies.
Top