Ok, the vanilla Lightning Shield damages allies regardless of the fields I set, so I decided to just trigger my own version of it. Anyway, the problem is that I need this spell MUI/MPI, so global variables are a no-no!
The thing is, it fails miserably, and I think it's due to the considered unit being overwritten. "Picked Unit" seems to overwrite when the second group of units (the enemies around the shielded caster) is being considered. Anyway, I tried doing this with JASS, but as far as I know, there's no way to "share" local variables (in this case, the unit with the shield buff) between functions.
The only way I could think of was storing the shielded unit into a global, but as I said in the beginning, I need this MUI.
Here's the spell...
The thing is, it fails miserably, and I think it's due to the considered unit being overwritten. "Picked Unit" seems to overwrite when the second group of units (the enemies around the shielded caster) is being considered. Anyway, I tried doing this with JASS, but as far as I know, there's no way to "share" local variables (in this case, the unit with the shield buff) between functions.
The only way I could think of was storing the shielded unit into a global, but as I said in the beginning, I need this MUI.
Here's the spell...
Trigger:
- Lightning Shield Effects
- Events
- Time - Every 0.20 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff CustomLShield) Equal to True)) and do (Actions)
- Loop - Actions
- Unit Group - Pick every unit in (Units within 250.00 of (Position of (Picked unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)) and do (Actions)
- Loop - Actions
- Unit - Cause (Picked unit) to damage (Matching unit), dealing (5.00 x (Real((Hero level of (Picked unit))))) damage of attack type Hero and damage type Divine
- Game - Display to (Player group((Owner of (Picked unit)))) for 5.00 seconds the text: DEBUGGING: Your Ele...
- Loop - Actions
- Unit Group - Pick every unit in (Units within 250.00 of (Position of (Picked unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True)) and do (Actions)
- Loop - Actions
- Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff CustomLShield) Equal to True)) and do (Actions)
- Events