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

[Trigger] Spell isnt Mui

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
SPELL MUI : need help 2 fix

i tested this trigger few over time i know its aint mui..... i know i should use hashtable ..... but i dont have time yet i might start to study it tomorrow.... its hard for a French guy to understand all meaning o_O

i think the line that use to destroy tree(within 200) of position of picked unit dont work...

here is the code i gets

  • Ameretusu effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Amaterasu
    • Actions
      • Set AmerSuccess[1] = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AmerSuccess[1] Equal to False
          • AmerOwner[(Integer A)] Equal to No unit
        • Then - Actions
          • For each (Integer A) from 1 to 40, do (Actions)
            • Loop - Actions
              • Set AmerTarget3[(Integer A)] = (Position of (Target unit of ability being cast))
              • Set AmerPlayer[1] = (Owner of (Triggering unit))
              • Set AmerReal3[(Integer A)] = 10.00
              • Set AmerOwner[(Integer A)] = (Triggering unit)
              • Set AmerReal2[(Integer A)] = (0.18 x ((Real((Level of (Ability being cast) for AmerOwner[(Integer A)]))) x ((Real((Strength of AmerOwner[(Integer A)] (Exclude bonuses)))) + 3.75)))
              • Trigger - Turn on Ameretusu loop <gen>
              • Trigger - Run Ameretusu loop <gen> (checking conditions)
        • Else - Actions
  • Ameretusu loop
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set AmerSuccess[1] = False
      • Game - Display to (All players) the text: LOOP BEGIN
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AmerOwner[(Integer A)] Not equal to No unit
        • Then - Actions
          • For each (Integer A) from 1 to 40, do (Actions)
            • Loop - Actions
              • Set AmerSuccess[1] = True
              • Set AmerGroup[(Integer A)] = (Units within 500.00 of AmerTarget3[(Integer A)] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of AmerPlayer[1]) Equal to True)))
              • Unit Group - Pick every unit in AmerGroup[(Integer A)] and do (Actions)
                • Loop - Actions
                  • Set AmerUnit[(Integer A)] = (Picked unit)
                  • Set AmerTarget2[(Integer A)] = (Position of AmerUnit[(Integer A)])
                  • Set AmerReal3[(Integer A)] = (AmerReal3[(Integer A)] - 0.25)
                  • Unit - Cause AmerOwner[(Integer A)] to damage AmerUnit[(Integer A)], dealing AmerReal2[(Integer A)] damage of attack type Spells and damage type Normal
                  • Destructible - Pick every destructible within 500.00 of AmerTarget3[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • Destructible - Kill (Picked destructible)
                  • Destructible - Pick every destructible within 200.00 of AmerTarget2[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked destructible) is alive) Equal to True
                        • Then - Actions
                          • Destructible - Pick every destructible within 200.00 of AmerTarget2[(Integer A)] and do (Actions)
                            • Loop - Actions
                              • Destructible - Kill (Picked destructible)
                        • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (AmerReal3[(Integer A)] Less than or equal to 0.00) or (AmerSuccess[1] Equal to False)
                    • Then - Actions
                      • Custom script: call DestroyGroup( udg_AmerGroup[ GetForLoopIndexA( ) ] )
                      • Custom script: call RemoveLocation( udg_AmerTarget2[ GetForLoopIndexA( ) ] )
                      • Trigger - Turn off (This trigger)
                      • Game - Display to (All players) the text: END
                    • Else - Actions
                  • Custom script: call RemoveLocation( udg_AmerTarget2[ GetForLoopIndexA( ) ] )
                  • Custom script: call DestroyGroup( udg_AmerGroup[ GetForLoopIndexA( ) ] )
        • Else - Actions

 
Last edited:
Level 10
Joined
Feb 20, 2008
Messages
448
I made a spell called Amaterasu :
i wanted to create a damage over time for damage
than i wanted to destroy every tree near 200 of pick unit in a region of 500 of target of ability being cast

and for the unglitch part i also wanted, if 1 of those picked unit die its stop doing dmg and destroying tree on it but still continu for the other

result of spell: he cast amaterasu , poeple get burned for 10 sec, than damage over time for that 10 second on pickunit(alive and ennemy of casting unit)
& destroying tree near 150 of those picked unit in the loop ( so its mean if a unit that is burning going near an other tree this tree will fall same as other picked unit

the spell link( its the same the only difference is mine got more effect)
http://wc3dbz.ipbfree.com/index.php?showtopic=402
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
Here you go:

  • Ameratsu
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ameratsu 2
    • Actions
      • -------- -------------------- --------
      • Set Ameratsu_Time = 10.00
      • Set Ameratsu_Damage = 300.00
      • Set Ameratsu_Level_Bonus = 100.00
      • Set Ameratsu_Range_Initial = 500.00
      • Set Ameratsu_Range_Other = 200.00
      • -------- -------------------- --------
      • Set Temp_Loc_1 = (Position of (Target unit of ability being cast)) // OR Set Temp_Loc_1 = (Target point of ability being cast)
      • Set Temp_Integer_1 = (Level of Ameratsu 2 for (Triggering unit))
      • Set Temp_Group = (Units within Ameratsu_Range_Initial of Temp_Loc_1 matching (((Triggering unit) Not equal to (Matching unit)) and (((Owner of (Picked unit)) is an enemy of (Owner of (Triggering unit))) Equal to True)))
      • -------- -------------------- --------
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Ameratsu_Group
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\FlameStrike\FlameStrikeEmbers.mdl
          • -------- -------------------- --------
          • Hashtable - Save 0.00 as (Key timer) of (Key (Picked unit)) in Ameratsu_Hash
          • Hashtable - Save Temp_Integer_1 as (Key level) of (Key (Picked unit)) in Ameratsu_Hash
          • Hashtable - Save Ameratsu_Damage as (Key damage) of (Key (Picked unit)) in Ameratsu_Hash
          • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Picked unit)) in Ameratsu_Hash
          • Hashtable - Save Handle Of(Last created special effect) as (Key effect) of (Key (Picked unit)) in Ameratsu_Hash
      • -------- -------------------- --------
      • Destructible - Pick every destructible within Ameratsu_Range_Initial of Temp_Loc_1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked destructible) is alive) Equal to True
            • Then - Actions
              • Set Temp_Loc_2 = (Position of (Picked destructible))
              • Destructible - Kill (Picked destructible)
              • Special Effect - Create a special effect at Temp_Loc_2 using Objects\Spawnmodels\NightElf\EntBirthTarget\EntBirthTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_Temp_Loc_2)
            • Else - Actions
      • -------- -------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ameratsu Burn <gen> is on) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn on Ameratsu Burn <gen>
      • -------- -------------------- --------
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
  • Ameratsu Burn
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Ameratsu_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_1 = (Load (Key caster) of (Key (Picked unit)) in Ameratsu_Hash)
          • Set Temp_Real_1 = (Load (Key timer) of (Key (Picked unit)) from Ameratsu_Hash)
          • Set Temp_Real_2 = (Load (Key damage) of (Key (Picked unit)) from Ameratsu_Hash)
          • Set Temp_Integer_1 = (Load (Key level) of (Key (Picked unit)) from Ameratsu_Hash)
          • -------- -------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Picked unit) is dead) Equal to True
                  • Temp_Real_1 Greater than or equal to Ameratsu_Time
            • Then - Actions
              • Set Temp_Effect = (Load (Key effect) of (Key (Picked unit)) in Ameratsu_Hash)
              • Special Effect - Destroy Temp_Effect
              • Unit Group - Remove (Picked unit) from Ameratsu_Group
              • -------- -------------------- --------
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Ameratsu_Hash
            • Else - Actions
              • Set Temp_Loc_1 = (Position of (Picked unit))
              • -------- -------------------- --------
              • Set Temp_Real_1 = (Temp_Real_1 + 0.25)
              • Unit - Cause Temp_Unit_1 to damage (Picked unit), dealing ((Ameratsu_Damage / (Ameratsu_Time / 0.25)) + (((Real(Temp_Integer_1)) - 1.00) x (Ameratsu_Level_Bonus / (Ameratsu_Time / 0.25)))) damage of attack type Spells and damage type Normal
              • -------- -------------------- --------
              • Destructible - Pick every destructible within Ameratsu_Range_Other of Temp_Loc_1 and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked destructible) is alive) Equal to True
                    • Then - Actions
                      • Set Temp_Loc_2 = (Position of (Picked destructible))
                      • Special Effect - Create a special effect at Temp_Loc_2 using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Destructible - Kill (Picked destructible)
                      • Custom script: call RemoveLocation(udg_Temp_Loc_2)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_Temp_Loc_1)
              • -------- -------------------- --------
              • Hashtable - Save Temp_Real_1 as (Key timer) of (Key (Picked unit)) in Ameratsu_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Ameratsu_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
You can easily configure the spell with the variables at the beginning of the skill:

Ameratsu_Time = How long the units will burn and be able to kill trees.
Ameratsu_Damage = How much it does damage during the duration
Ameratsu_Level_Bonus = How much each level of ability increases the damage. Level 1 = 0 bonus.
Ameratsu_Range_Initial = When the spell is cast, trees inside this range will be killed.
Ameratsu_Range_Other = When a unit that is under the spell comes closer than this to a tree, the tree gets killed.

You can also change the special effects and damage type. Remember to initialize the hashtable.

The matching condition is set to flase in this test map when it comes to checking alliance status, so it's easier to test the spell. Change it to true in your map.

I hope this is what you were looking for. It should be leakless and MUI.
 

Attachments

  • Ame Test.w3x
    38 KB · Views: 36
Status
Not open for further replies.
Top