• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to detect the caster in this case

Status
Not open for further replies.
Level 11
Joined
Dec 5, 2009
Messages
846
Hello i got two triggers here. Im doing a wall spell with rock chunks and when someone attacks a piece of the wall it will blow up just the piece. And the pieces lasts 20 sec. And i want to detect the caster after it casted the spell. how to do that? here's the two triggers.


Trigger 1

  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to Stone Wall
  • Actions
    • Unit Group - Remove all units from SW_Save
    • Trigger - Turn on Spell Stonewall Expolsion <gen>
    • Unit Group - Add (Learning Hero) to SW_Save
Trigger 2

  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Dying unit)) Equal to Stone
  • Actions
    • Set SW_Point = (Position of (Dying unit))
    • Set SW_Group = (Units within ((Real((Level of Stone Wall for (Random unit from SW_Group)))) x 100.00) of SW_Point matching (((Matching unit) belongs to an enemy of (Owner of (Random unit from SW_Group))) Equal to True))
    • Special Effect - Create a special effect at SW_Point using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
    • Unit Group - Pick every unit in SW_Group and do (Actions)
      • Loop - Actions
        • Unit - Cause (Random unit from SW_Save) to damage (Picked unit), dealing ((Real((Level of Stone Wall for (Random unit from SW_Save)))) x 100.00) damage of attack type Spells and damage type Normal
    • Custom script: call RemoveLocation (udg_SW_Point)
    • Custom script: call DestroyGroup (udg_SW_Save)

Just tell me if you need the JASS trigger the main one :p

ty for the help

Regards Chewii.
 
Level 11
Joined
Dec 5, 2009
Messages
846
I don't understand where shall i put it ? :p and i want all the units on the map that can kill this unit and this will work not only the caster.

I want it to dmg lvl 1 100 dmg lvl 2 200 dmg lvl 3 300 dmg the same with the area and it will work if just that unit dies.
 
Level 11
Joined
Dec 5, 2009
Messages
846
in the second trigger im doing when the wall dies it will explode on death 100 dmg 100 AoE on lvl 1 increases 100 on both when lvl increases. But i have to detect the lvl of the ability then i use level ability for unit and well i dunno what i should set on the unit how to detect the unit that casted the spell from beginning. I tried to save him in a unit group and it didn't work i did random unit from group Save and its only one unit from the save group so i thought that i would work but it didn't so i need help with that to detect the caster that casted the spell from beginning. The caster has to be saved in atleast 20 seconds that how long the stone wall lasts.


Ty for help!

Regards Chewii
 
Level 11
Joined
Jan 25, 2009
Messages
572
Chewii, Instead of use the (Dying Unit) you shall use (Triggering Unit) It's more faster then. Because then the Editor don't need to look for the Dying one it only takes the Triggering Unit and if there is none, you will se that nothing happens but it surely will because the Dying Unit is the one that Triggers the whole Effect isn't it? Then it should be Triggering Unit instead of Dying Unit.
 
Level 3
Joined
Feb 4, 2008
Messages
20
As you can see I combined them in one trigger. You go and try it.
And I assume it's only for one unique unit (not MUI) and Stone Wall is a summoning spell.
SW_Caster is a new unit variable.


Goodluck.

  • Stone Wall
    • Events
      • Unit - A unit Finishes casting an ability
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Stone Wall
        • Then - Actions
          • Set SW_Caster = (Casting unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to Stone
        • Then - Actions
          • Set SW_Point = (Position of (Dying unit))
          • Set SW_Group = (Units within ((Real((Level of Stone Wall for (SW_Caster)))) x 100.00) of SW_Point matching (((Matching unit) belongs to an enemy of (Owner of (SW_Caster))) Equal to True))
          • Special Effect - Create a special effect at SW_Point using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
          • Unit Group - Pick every unit in SW_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause (SW_Caster) to damage (Picked Unit), dealing ((Real((Level of Stone Wall for SW_Caster (Random unit from SW_Save)))) x 100.00) damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation (udg_SW_Point)
          • Custom script: call DestroyGroup (udg_SW_Save)
          • Else - Actions
 
Last edited:
Level 11
Joined
Dec 5, 2009
Messages
846
Thanks man but you forgot to change the unit dmg in the unit group to Level of stone wall for SW_Caster. And you can't but the leak scripts in a else or then action ^^ But ty i will give you +rep!
 
Status
Not open for further replies.
Top