Custom Divine Shield

Templarion

Member
Reaction score
8
I know. There are other threads like this but they didn't help me.

First I made the ability based on Divine Shield but it didn't work and I read (from other threads) that the invulnerability-part is made by trigger anyway. So, my custom "divineshield" is based on "invisibility" at the moment. But only thing that happens when spell is cast that the unit turns invisbile. (Suprise :) )

Here is the trigger that I am using to make TARGETED UNIT INVULNERABLE:

Event:
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to divineshield
Actions
Unit - Make (Targeted unit) Invulnerable

What is supposed to happen? Unit turns invulnerable for 66 seconds NOT INVISIBLE. Spell is casted by NON-hero unit.
 

Templarion

Member
Reaction score
8
Didn't help. I want that the targeted unit becomes invulnerable. Should I change the spell where "divineshield" is based on? (It is invisibility if you remember correct and I don't want the unit become invisible.)
 

WastedSavior

A day without sunshine is like, well, night.
Reaction score
217
why base off invis? use nova shield, from lich, it wont give invis.. just remove buffs from nova shield, make the armor given 0, and then use a trigger like

Event
A spell is cast
Condition
ability equal to "your spell"
event
Make targeted unit invulnerable
wait 30 seconds
make unit vulnerable

thats just a ruff thing =o
 

Templarion

Member
Reaction score
8
Did NOT work.

1) I created my divineshield again - now based on "Frost Armor".
2) Removed buffs and armor values.
3) Modified my trigger which now looks like this:

Events:
Unit - A unit Begins casting an ability
Conditions:
(Ability being cast) Equal to Unholy Armor
Actions:
Unit - Make (Targeted unit) Invulnerable

4) I first tried with Actions: +Wait 66 sec. & +Make vulnerable but it didnt work. After that I tried without those two actions and it didnt work this time either.
5) At least the unit didnt turn invisible this time.

If I create the "divineshield" spell based on "Divine Shield" it works well but I CANT TARGET OTHERS than self. That cannot be repaired by changing "Targets Allowed".
 
D

Dipski

Guest
Okay, I just did it like this based off of invisibility
Code:
Untitled Trigger 001
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to <your ability here> 
    Actions
        Unit - Make (Target unit of ability being cast) Invulnerable
- Make sure you change the name of your ability, so it's not the same as any others
- Change Art - Target in the ability editor to nothing
- Change Art - Target Attachment point to nothing
- Change Stats - Buffs to Divine Shield
 

Templarion

Member
Reaction score
8
Thanks for you Dipski, the spell now makes a targeted unit invulnerable BUT the divineshield looks like lasting forever. I would like to wear it off after 66 seconds.

Why this trigger doesn't work? It only makes an unit invulnerable:

Events:
Unit - A unit Begins casting an ability
Conditions:
(Ability being cast) Equal to divineshield
Actions:
Unit - Set life of (Target unit of ability being cast) to 50.00%
Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\NightElf\Immolation\ImmolationTarget.mdl
Unit - Make (Target unit of ability being cast) Invulnerable
Wait 66.00 seconds
Unit - Remove All buffs from (Target unit of ability being cast)
Unit - Make (Target unit of ability being cast) Vulnerable


And thanks for you patience Wasted Savio, too.
 

Templarion

Member
Reaction score
8
I changed "Wait" from "66" to "5" and it still look like lasting forever, well at least it lasted more than 2 minutes and that is far too much.

Thanks for the idea Ace, but it didnt work.

Any other ideas?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
The looks of that effect probably stay until you actually remove that special effect.
However, does the unit turn back to vulnerable after those 5 seconds?
 

Templarion

Member
Reaction score
8
I want that the effect and the invulnerability stop after 66 second. "I want them both down!!" :banghead:

I tested unit's invulnerability by trying to kill it and looking it's armor class.

No effect nor invulnerability stop. They both last forever (at least more than 2 minutes).

I tried this with "Wait 5 seconds"-action and "Wait 66 seconds"-action. Neither works.

Any other ideas?
 

Templarion

Member
Reaction score
8
First this trigger.

Trigger:

Event:
+Unit - A unit Begins casting an ability
Condition:
+(Ability being cast) Equal to Unholy Armor
Actions:
+Unit - Set life of (Target unit of ability being cast) to 50.00%
+Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\NightElf\Immolation\ImmolationTarget.mdl
+Unit - Make (Target unit of ability being cast) Invulnerable
+Wait 5.00 seconds
+Special Effect - Destroy (Last created special effect)
+Unit - Make (Target unit of ability being cast) Vulnerable

Ok guys. Now this gets a little bit more weirder:

First I thought things work fine except the INVULNERABILITY lasts forever (at least the special effect stops after 5 seconds).
BUT when I cast this spell first with one mage to target and before the spell wears off I cast the same spell with another mage to another targer -----> The target of the first cast spell stays under the effect AND under the invulnerability.

1) So, something is wrong with the line: "Unit - Make (Target unit of ability being cast) Vulnerable".

2) I want that the spell can be used my multiple mages to multiple targets without bugs of ever lasting enchantment.
 
N

Neopolis3

Guest
"+Special Effect - Destroy (Last created special effect)"
If you have multiple spells casted, it might not be the correct one being deleted.

Yeaahh... That's complicated. You might use array variables, but since they are not of endless size (Which is very annoying), you could only have a limited number of shields at the same time.

I advise just giving that target unit "Divine Shield" for a second, letting it use it, remove it again, and put it to 66 seconds, giving it your stats and stuff. The problem is, it might give bugs if you use it and them remove it. I don't know, I never tried this.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
A local variable keeping the target unit.


> "Divine Shield" for a second, letting it use it, remove it again

If the ability disappears, so does its effect.
 

Templarion

Member
Reaction score
8
Thank you for your answers.

AceHart, could you be more specific with your idea? I am not very familiar with trigger editor.

Is still need a solution for this matter. Please help.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Some ability that puts a buff and a renewable duration. Rejuvenation or something.

Code:
DivineShieldCast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Divine Shield (Castable)
        ((Target unit of ability being cast) is in Invulnerables) Equal to False
    Actions
        Unit - Add Invulnerable (Neutral) to (Target unit of ability being cast)
        Unit Group - Add (Target unit of ability being cast) to Invulnerables

Code:
DivineShieldActive
    Events
        Time - Every 1.00 seconds of game time
    Conditions
        (Invulnerables is empty) Equal to False
    Actions
        Unit Group - Pick every unit in Invulnerables and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) has buff Divine Shield) Equal to False
                    Then - Actions
                        Unit - Remove Invulnerable (Neutral) from (Picked unit)
                        Unit Group - Remove (Picked unit) from Invulnerables
                    Else - Actions

That might just work.
At least, that what's I would try... YMMV ;)
 

Templarion

Member
Reaction score
8
Thank you very much AceHart for the code and especially making the code easier to read. (Before you edited it, it took time to find out what you meant.)

Though, something doesn't work.

The Invulnerability does not activate right away but it must be clicked before it activates. I want it to activate right after the spell (which activates the triggers) is cast. How do I do this? And what happens to the ability (even if it is activated) when it gets removed (note the event "every 1 second")? Does the effect of an activated ability last of it's duration even if it gets removed?
 

Templarion

Member
Reaction score
8
Yes. I definitely found some inspiration from your demo map. My problem number one was that I set value 0 to "Data - Hit points gained"-field. That's why I was not capable to target any units and this lead me to try other ideas.

Anyway, if anyone is looking for CUSTOM DIVINE SHIELD see above AceHart's demo map.

Thank you for your patience and help everyone - especially AceHart.

THIS CASE IS CLOSED.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top