AOE spell doesn't work

Kahiera

Active Member
Reaction score
9
Trigger:
  • TP Test
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Zling
    • Actions
      • Game - Display to (All players) the text: (String(Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of Toxic Plume for (Attacking unit)) Greater than or equal to 1
              • (Random integer number between 1 and 100) Less than or equal to ((Level of Toxic Plume for (Attacking unit)) + 3)
        • Then - Actions
          • Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = 0
          • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Attacked unit)) matching (((Owner of (Picked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Unit - Cause (Attacking unit) to damage (Picked unit), dealing ((Real(Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))])) x 12.50) damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] Less than or equal to ((Level of Toxic Plume for (Attacking unit)) x 25)
            • Then - Actions
              • Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = (Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] + 1)
            • Else - Actions
      • Special Effect - Destroy (Last created special effect)


basically what it does is, for each time the hero attacks (if they have the spell) the variable increases by 1 up to a maximum of 25x the level of the ability. but, there's a chance (3+level of the ability) to deal 12.5x value of the variable damage to units in a 600 AOE.
right now i have added a cloud model to show up when it's casted, which i've just realized leaks (dont worry about it i'll fix it later)
the text that's displayed at the start of the trigger is just so i can see when the spell should be casting, which is when the variable is shown as 0.

the problem is, that when the time comes for this to cast, it doesn't. nothing happens at all except that the variable goes down to 0
what do i need to do to damage the surrounding units. i've also tried to simply cause the hero to damage an area of 600 around the attacked unit.
 

Kahiera

Active Member
Reaction score
9
changed it to this
Trigger:
  • TP Test
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Zling
    • Actions
      • Game - Display to (All players) the text: (String(Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))]))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of Toxic Plume for (Attacking unit)) Greater than or equal to 1
              • (Random integer number between 1 and 100) Less than or equal to ((Level of Toxic Plume for (Attacking unit)) + 3)
        • Then - Actions
          • Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = 0
          • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Attacked unit)) matching (((Owner of (Matching unit)) is an ally of (Owner of (Attacking unit))) Equal to False)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
              • Unit - Cause (Attacking unit) to damage (Picked unit), dealing ((Real(Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))])) x 12.50) damage of attack type Spells and damage type Normal
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] Less than or equal to ((Level of Toxic Plume for (Attacking unit)) x 25)
            • Then - Actions
              • Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = (Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] + 1)
            • Else - Actions

and still doesn't do anything
(i've also kept it
Trigger:
  • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Attacked unit)) matching (((Owner of (Matching unit)) is an enemy of (Owner of (Attacking unit))) Equal to True) and do (Actions)
and it did nothing)
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
It's very simple?
You set the variable to 0 before actually doing the damage.
Move this:
Code:
Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = 0
to after this
Code:
# Unit Group - Pick every unit in (Units within 600.00 of (Position of (Attacked unit)) matching (((Owner of (Matching unit)) is an ally of (Owner of (Attacking unit))) Equal to False)) and do (Actions)

    * Loop - Actions
          o Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
          o Unit - Cause (Attacking unit) to damage (Picked unit), dealing ((Real(Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))])) x 12.50) damage of attack type Spells and damage type Normal
          o Special Effect - Destroy (Last created special effect)
 

Kahiera

Active Member
Reaction score
9
ok thanks! +rep
but the special effect doesn't work... should i add a wait or something before destroying it?

edit: ok got it... can anyone tell me if this leaks? if it does, plz tell me how to fix
Trigger:
  • TP
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Zling
    • Actions
      • Set UGroup_Abil_ToxicPlume = (Units within 600.00 of (Position of (Attacked unit)) matching (((Matching unit) belongs to an ally of (Owner of (Attacking unit))) Equal to False))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Level of Toxic Plume for (Attacking unit)) Greater than or equal to 1
              • (Random integer number between 1 and 100) Less than or equal to ((Level of Toxic Plume for (Attacking unit)) + 3)
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Attacked unit)) matching (((Owner of (Matching unit)) is an ally of (Owner of (Attacking unit))) Equal to False)) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Other\HumanBloodCinematicEffect\HumanBloodCinematicEffect.mdl
              • Set Unit_Abil_ToxicPlumeSFX[(Number of units in UGroup_Abil_ToxicPlume)] = (Last created special effect)
              • Unit - Cause (Attacking unit) to damage (Picked unit), dealing ((Real(Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))])) x 12.50) damage of attack type Spells and damage type Normal
              • Unit Group - Remove (Picked unit) from UGroup_Abil_ToxicPlume
          • Wait 2.00 seconds
          • For each (Integer A) from 1 to 500, do (Actions)
            • Loop - Actions
              • Special Effect - Destroy Unit_Abil_ToxicPlumeSFX[(Integer A)]
          • Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = 0
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] Less than or equal to ((Level of Toxic Plume for (Attacking unit)) x 25)
            • Then - Actions
              • Set Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] = (Abil_Int_ToxicPlume[(Player number of (Owner of (Attacking unit)))] + 1)
            • Else - Actions
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You're leaking a group and a location.

Add a Temploc variable and set it to Position of (Attacked unit)
then replace every Position of (Attacked unit) to this.

Also add those 2 lines at the very end (very end, not the end of the last else, common error people do :p) :
Trigger:
  • Actions
    • Custom Script: call RemoveLocation(udg_Temploc)
    • Custom Script: call DestroyGroup(udg_UGroup_Abil_ToxicPlume)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top