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

Creating a Vampiric "Spirit Link" Based Spell.

Status
Not open for further replies.
Level 5
Joined
May 20, 2013
Messages
162
Hi! ;)

Not sure i've ever posted on this forum before, so please be patient with me.

I am going through, doing an altered melee map, just for my own amusement. Probably the single biggest alteration i am making is switching out the caster units, and using a different array of spells.

On the Orc side, i am wanting to create a vampiric spell based off of Spirit Link. Why?
Well, i have a few reasons. One, perhaps most important, i don't want to confuse the AI by creating something too far removed from the usage of the base spell. For another, while i want it to serve a group support role, that support needs to facilitate a confrontational play style. Thus this is just a very simple spell that buffs multiple units with a temporary passive vampirism. Simple as that! But i want to base it off of either Spirit Link, or Healing Wave.

Ok, so here is the deal. I am sure i could make some clumsy half-assed version of this that would leak over the place, and look like hell. I want it to be cool, and be as direct, and efficient as possible.

Now, i could be utterly lazy, and just ask you great guys out there to make a spell for me -and if any one feels inclined to do that, by all means! ;) But after i post this, i am going to go tinker on the editor and see what i can come up with myself. I seem to have a vague memory of Spirit Link being a difficult spell to work with because it was hard coded to behave a certain way. Healing Wave might be easier.

Thank you so much for reading my request! ;)
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Not sure what you mean, when you say vampiric, but I don't think healing wave can be of any use here. You cannot get the units hit by healing wave and it also has no buff.
Spirit link is useful, because it applies a buff, which can be used to give that passive vampirism.

If you want the units to have life steal like vampiric aura, then you can simply use a DDS, check for the buff and give the units hp. Most DDS also allow you to distinguish spell and non-spell damage.
 
Level 5
Joined
May 20, 2013
Messages
162
Jampion, TY for replying! :)

Ok, what i meant by vampiric was exactly like Vampiric Aura or Item Life Steal. However, as i wanted it to also apply to ranged attacks, i simply triggered it in using a "Set life of attacking unit to life of attacking unit plus 'level of attacking unit multiplied by Value X'." I have triggered these things more exacting before to exactly reflect the attack damage, but this time i just wanted to get something up & working quickly.

As for the appearance, Spirit Link worked very well without any extra help. I just changed the lightning effect to Finger of Death, and added a different sound effect like Soul Gem, or Soul Preservation. Worked good enough for the girls i go out with. ;)

The problem lies in the Spirit Link itself. I have had this problem before, years ago, and am seeing it again. No matter what you do with the Spirit Link buff. No matter what you punch in on the Data and Stats fields, Spirit Link will ALWAYS split damage between the linked units. The numeric input only determines how evenly it is spread. It seems that the most even spread is not 50%, but rather 0%. 100% will cause one unit to absorb all the damage at intervals. It is a quirky spell.

Unfortunately i do not know what DDS stands for. Everything i know on the Editor is self-taught, and with zero background with languages or programming. Any script i have ever used has been cut & paste from an outside source! :)
 
Level 9
Joined
Apr 23, 2011
Messages
527
DDS means Damage Detection System. It allows triggers to fire whenever a unit takes damage and takes the damage type, damage dealt, damage target and source. It also allows for damage multiplication and nullification. There are many such systems in the Spell section of Hive.

There are some ways to go about this "Vampiric Spirit Link" that I can think of:
- Check every second if a unit has the buff VSP, if so, add a passive lifesteal ability, else, remove the ability (This does not split the health to every unit affected)
- Check every second if a unit has the buff VSP, if so, add the unit to a unit group. Start a timer equal to the duration of the ability. If a unit from the unit group deals damage, heal all units in unit group by the dealt damage / number of units in unit group. When timer ends, turn off the lifesteal trigger. (Jampion's idea, uses a DDS and slightly more complicated, but works better) EDIT: when the trigger is turned off, remove all the units from the unit group.
 
Last edited:
Level 5
Joined
May 20, 2013
Messages
162
Ok, Light, ya, TY for replying. In the past i have used that sort of approach you outlined, and it worked fairly well, at least for a spell that would only ever have one instance of working at a time -like from a unique hero. However, that didn't work for me this time around -my hunch is that i probably needed to throw in a short wait or two in certain parts of the triggers.


Right now, in my test versions of the spell, i have the Spirit Link set at zero percent, and the units recoup health equal to their unit level times five each attack. It is pretty OP! From what i have observed, 0% on Spirit Link data does not mean no damage is shared. To the contrary, it appears to mean that all damage is divided evenly among all units. Whereas setting the rate to 100% seems to cause a single random linked unit to absorb all the damage at periodic intervals, often ending in sudden deaths. It is a quirky spell.

But this got me thinking about a different way to go about this, using a different ability. This idea is based off the old WC2 Unholy Armor spell. How it worked was that in exchange for half a unit's current health, it was temporarily made invulnerable -but still attackable. While, reproducing Unholy Armor in WC3 editor is pretty easy to do, it is not really very satisfying ingame playing vs AI. However, what if the buffed unit also gained a vampiric attack, so that they had a chance to recoup at least part of their life loss while invulnerable? I think that could make the old Unholy Armor a lot more interesting to use, and perhaps more effective for the AI.
 
Level 5
Joined
May 20, 2013
Messages
162
Ok, TY guys, i think i have this one answered well enough.

BTW... i think i was wrong about one detail of Spirit Link. setting it at 1.00 (100%) appears to distribute no damage, odd as that may seem. Going higher than that actually starts damaging the linked units,n in spikes of damage, but i don't understand the logic of it.

So, in its current form, i'm using spirit link set at 1.00, with different lightning effects (finger of death). Then i have these triggers for simulating vampirism,

  • Vampiric Link 1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Vampiric Link
    • Actions
      • Set VampiricallyLinked = (Units in (Playable map area) matching (((Matching unit) has buff (Orc) Vampiric Link) Equal to True))
      • Trigger - Turn on Vampiric Link 2 <gen>
      • Trigger - Turn on Vampiric Link 3 <gen>
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff (Orc) Vampiric Link) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to VampiricallyLinked
  • Vampiric Link 2
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set VampiricallyLinked = (Units in (Playable map area) matching (((Matching unit) has buff (Orc) Vampiric Link) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in VampiricallyLinked) Greater than or equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in VampiricallyLinked and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff (Orc) Vampiric Link) Equal to True
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • Unit Group - Remove (Picked unit) from VampiricallyLinked
        • Else - Actions
          • Unit Group - Remove all units of VampiricallyLinked from VampiricallyLinked
          • Trigger - Turn off Vampiric Link 3 <gen>
          • Trigger - Turn off (This trigger)
  • Vampiric Link 3
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has buff (Orc) Vampiric Link) Equal to True
      • ((Attacked unit) is Magic Immune) Equal to False
      • ((Attacked unit) is Mechanical) Equal to False
      • ((Attacked unit) is A structure) Equal to False
      • ((Attacked unit) is an illusion) Equal to False
      • ((Attacked unit) is dead) Equal to False
    • Actions
      • Unit - Set life of (Attacking unit) to ((Life of (Attacking unit)) + ((Real((Level of (Attacking unit)))) x 5.00))


Now, as i said, everything i do is self taught, so my triggers may be awful. I don't know ;)
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
Ok, TY guys, i think i have this one answered well enough.

BTW... i think i was wrong about one detail of Spirit Link. setting it at 1.00 (100%) appears to distribute no damage, odd as that may seem. Going higher than that actually starts damaging the linked units,n in spikes of damage, but i don't understand the logic of it.

So, in its current form, i'm using spirit link set at 1.00, with different lightning effects (finger of death). Then i have these triggers for simulating vampirism

Use [trigger][/trigger] for GUI code.
I would fix the leaks, make it a little more efficient and make it work for multiple spellcasts. Something like this:

  • Vampiric Link 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Vampiric Link
    • Actions
      • Set point = (Position of (Triggering unit))
      • Set Vamplinkgroup = (Units within 800.00 of point matching (((Matching unit) has buff (Orc) Vampiric Link) Equal to True))
      • Unit Group - Pick every unit in Vamplinkgroup and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to VampiricallyLinked
      • Custom script: call RemoveLocation(udg_point)
      • Custom script: call DestroyGroup(udg_Vamplinkgroup)
  • Vampiric Link 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in VampiricallyLinked and do (Actions)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) has buff (Orc) Vampiric Link) Equal to False
          • Then - Actions
            • Unit - Remove (Picked unit) from VampiricallyLinked
          • Else - Actions
  • Vampiric Link 3
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (PDD_source has buff (Orc) Vampiric Link) Equal to True
      • (PDD_target is Magic Immune) Equal to False
      • (PDD_target is Mechanical) Equal to False
      • (PDD_target is A structure) Equal to False
      • (PDD_target is an illusion) Equal to False
    • Actions
      • Unit - Set life of PDD_source to ((Life of PDD_source) + ((Real((Level of (Attacking unit)))) x 5.00))
Change the range value (800.00) in trigger 1 to the range of your ability. Change the variables in trigger 3 depending on the DDS used.

You may have noticed I used a DDS instead of "A unit is attacked". Why is that? Because that event fires whenever a unit starts to attack. If, say, a player controlling a unit attacks another, the player can simply spam the cancel command and the trigger effects would still fire (i.e. A unit with VPS will heal to full health through spam cancelling without actually attacking/dealing damage).

EDIT: If you want the vampirism to be based on the damage dealt, use this action instead for trigger 3 (edit values accordingly):
  • Unit - Set life of PDD_source to ((Life of PDD_source) + (PDD_amount x 0.12))
 
Last edited:
Level 5
Joined
May 20, 2013
Messages
162
Use [trigger][/trigger] for GUI code.
I would fix the leaks, make it a little more efficient and make it work for multiple spellcasts. Something like this:

  • Vampiric Link 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Vampiric Link
    • Actions
      • Set point = (Position of (Triggering unit))
      • Set Vamplinkgroup = (Units within 800.00 of point matching (((Matching unit) has buff (Orc) Vampiric Link) Equal to True))
      • Unit Group - Pick every unit in Vamplinkgroup and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to VampiricallyLinked
      • Custom script: call RemoveLocation(udg_point)
      • Custom script: call DestroyGroup(udg_Vamplinkgroup)
  • Vampiric Link 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in VampiricallyLinked and do (Actions)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) has buff (Orc) Vampiric Link) Equal to False
          • Then - Actions
            • Unit - Remove (Picked unit) from VampiricallyLinked
          • Else - Actions
  • Vampiric Link 3
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (PDD_source has buff (Orc) Vampiric Link) Equal to True
      • (PDD_target is Magic Immune) Equal to False
      • (PDD_target is Mechanical) Equal to False
      • (PDD_target is A structure) Equal to False
      • (PDD_target is an illusion) Equal to False
    • Actions
      • Unit - Set life of PDD_source to ((Life of PDD_source) + ((Real((Level of (Attacking unit)))) x 5.00))
Change the range value (800.00) in trigger 1 to the range of your ability. Change the variables in trigger 3 depending on the DDS used.

You may have noticed I used a DDS instead of "A unit is attacked". Why is that? Because that event fires whenever a unit starts to attack. If, say, a player controlling a unit attacks another, the player can simply spam the cancel command and the trigger effects would still fire (i.e. A unit with VPS will heal to full health through spam cancelling without actually attacking/dealing damage).

EDIT: If you want the vampirism to be based on the damage dealt, use this action instead for trigger 3 (edit values accordingly):
  • Unit - Set life of PDD_source to ((Life of PDD_source) + (PDD_amount x 0.12))

Holy Wall of Text, Big Buddy!!! Wow! What a detailed, thoughtful reply! :)

I know you had to take some time posting that. I will definitely explore your triggers. This will take me a while though, because i know absolutely nothing about script, and it looks like your triggers use a lot of it. But thank you for this feast! I think i will learn a lot by implementing your triggers! ;)

One question though...

In the three triggers i posted, only the first was initially active. The second & third were turned on when the first was qued, & then turned off when the unit group was emptied. It looks like your three triggers are all initially on. Is that the case?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
One question though...

In the three triggers i posted, only the first was initially active. The second & third were turned on when the first was qued, & then turned off when the unit group was emptied. It looks like your three triggers are all initially on. Is that the case?

No.
The formatter on the forum uses the indentation and the text that follows to decide what icon to display on the left.
As the text does not contain anything to indicate if the trigger is on or off, you can't distinguish it in trigger tags posted on the forum. As such there is no red X on triggers posted on the forum.

  • Trigger Name
    • Events
    • Conditions
    • Actions
This next thing is not how the GUI would appear on your WE so the formatter has no idea what to make out of "event", "conditions" & "actions" instead of "Events", "Conditions" & "Actions"
  • Trigger Name
    • events
    • conditions
    • actions
If you switch your [code ] tags with [trigger ] tags, you'll see what happens.

regards
-Ned
 
Level 5
Joined
May 20, 2013
Messages
162
Woe!!! Ok, i see what you guys keep talking about now! I went back and edited the code to trigger, hopefully it is easier to read now. ;)
 
Level 5
Joined
May 20, 2013
Messages
162
Ok, @Light TY for the time you took to work on these. I plan on coming back to this project tomorrow. Sort of been sidetracked with a bunch of other editor stuff the last month, & i will have to start this one from scratch because i don't have the map it was on anymore ;(. But it shouldn't be hard now since you laid it all out for me :)

One thing i have settled on with this particular ability is that while Spirit Link is nice as a pattern for the ability, i would like to gut it of the active components of the link itself -if i can. Spirit Link is a bit weird in that way.

My goal with this spell is to base it more off the old WC2 Unholy Armor. Namely, the target loses half their current health but gets a buff that makes them invulnerable -but not in the way that triggers aversion. More like BBV invulnerable. Enemy units will still engage them as they would normally. Unholy Armor left it at that, but i think i can make it a lot more interesting, because while i always loved the "idea" behind the spell, in actual game play it was seldom worth the price.

This is where the vampirism comes in. The challenge for the buffed unit is to steal enough life while invulnerable to recoup the life he sacrificed. I think this makes the ability more fun than the original version on WC2, because it is a reasonable goal for the buffed unit to still come out ahead without an enormous amount of micro-managing.

Years ago i accomplished a pretty faithful recreation of Unholy Armor. Forget exactly how i did it, but imagine i can figure it out again. From there, i would like to incorporate it into the framework we started here, operating off the pattern of Spirit link, but incorporating a vampirism trigger.. Woohoo!!! So exciting! :)

EDIT: Much more to come... i actually got quite a bit done last night. I will be posting it soon!


@Light. I used the trigger example you left me, & built something from it that seems to work quite well -albeit only for melee as i have not incorporated a DDS mechanism yet. No idea which one to choose. Granted, this is not complete. I have not chosen a DDS mechanism yet, so i am only dealing with melee However, i have one overwhelming question! Why do you have two unit groups? I see no reason why VampLinkgroup couldn't go on & do what you assign for VampiricallyLinked, as you already gave it the same conditions to follow, and while you dissolve VampLinkGroup, you never really dissolve VampiricallyLinked. So, i am puzzled by that. Will be testing with it myself directly. Expect more updates over the next twelve hours (i am in Pacific time zone, it is going on 9:30 am here).
 
Last edited:
Level 5
Joined
May 20, 2013
Messages
162
@Light i updated my previous post, under EDIT. Today I will be playing around with the trigger structure you left me. However, here are the big changes to the spell i have made so far from the Spell Editor end. First, i am basing it off Unholy Frenzy. This has advantages on several levels. One being that it is a lot more similar AI wise to what i am making than Spirit Link is. Another, i don't have to deal with the quirks of SL.

But here is what i am doing to replicate the Unholy Armor. Functions to add & then remove 1000000000 armor based on presence of buff. When the buff is initially detected, 2 custom abilities are added to unit: one based on Runed Bracers (spell damage immunity) and the other a modified Item Lifesteal for the melee vampirism. The Trigger you posted works very well at detecting the presence of the buff, allowing for the addition/removal of the passives. Since i have not chosen a DDS meter yet, i am only dealing with melee damage currently. When the buff is first detected, the units life is set to "1 + current life/2". One neat thing i discovered last night while testing it: the trigger ended the bonuses after the buff was dispelled by a creep, exactly as it should have! This was good news! It reinforces the notion that this spell is a high risk, high reward gamble.

EDIT: Ok, here is my current incarnation of the triggers. They seem to work correctly, but again, there is no DDS mechanism yet, & i am unsure which one is the best choice at this point in time, i may post a question about that separately. But take a look at these two triggers & tell me if they are correct.

  • Unholy Link 1 alt
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Unholy Reduction (Active)
    • Actions
      • Set VampiricPoint = (Position of (Casting unit))
      • Set VamplinkGroup = (Units in (Playable map area) matching (((Matching unit) has buff Unholy Reduction (UF base)) Equal to True))
      • Unit Group - Pick every unit in VamplinkGroup and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to (1.00 + ((Life of (Picked unit)) / 2.00))
          • Unit - Set Armor of (Picked unit) to 1000000000.00
          • Unit - Add Unholy Reduction to (Picked unit)
          • Unit - Add Vampirism to (Picked unit)
      • Custom script: call RemoveLocation(udg_VampiricPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in VamplinkGroup) Greater than 0
        • Then - Actions
          • Game - Display to (All players) the text: Unholy Link has Awo...
          • Trigger - Turn on Unholy Link 2 alt <gen>
        • Else - Actions
          • Custom script: call DestroyGroup(udg_VamplinkGroup)
And trigger #1 awakens trigger #2, which is asleep by default.


  • Unholy Link 2 alt
  • Events
    • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in VamplinkGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Unholy Reduction (UF base)) Equal to False
            • Then - Actions
              • Unit - Remove Unholy Reduction from (Picked unit)
              • Unit - Remove Vampirism from (Picked unit)
              • Unit - Set Armor of (Picked unit) to ((Real((Integer((Armor of (Picked unit)))))) - 1000000000.00)
              • Unit Group - Remove (Picked unit) from VamplinkGroup
              • Game - Display to (All players) the text: Unholy Link has sub...
            • Else - Actions
              • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in VamplinkGroup) Equal to 0
        • Then - Actions
          • Custom script: call DestroyGroup(udg_VamplinkGroup)
          • Wait 1.00 game-time seconds
          • Game - Display to (All players) the text: Unholy Link has sub...
          • Trigger - Turn off Unholy Link 2 alt <gen>
        • Else - Actions
          • Do nothing
NOTE: Yes i have made changes, mostly to simplify the operation, but it doesn't mean i'm wedded to them! What i did was for the purpose of getting the spell to function properly to my expectations.

#1, i removed the second UG (VampiricallyLinked). I do not understand why it was there, & it seemed to serve no purpose in the spells current form. The trigger appears to function normally without it.

#2, i set it up with trigger #2 turned off by default. And it turns itself off whenever the VampLink UG is emptied.

#3, obviously, since there is no DDS yet, i have not incorporated Trigger #3 yet ;)


EDIT#2

Ok... today i DL two DDS Tools. "Damage Engine" & Weep's "GUI Friendly Damage Detection". Damage Engine is waaaay too ambitious -i doubt i will ever be able to use it. Weep's is probably about as simple an application imaginable & even so, i am still struggling with it.

So here is my initial attempt at plugging in Unholy Reduction #3 trigger into Weep's DDS.

  • Unholy Link 3
    • Events
      • Game - DamageEventAmount becomes Equal to 1.00
    • Conditions
      • (PDD_Source has buff Unholy Reduction (UF base)) Equal to True
      • (PDD_Target is A structure) Equal to False
      • (PDD_Target is Magic Immune) Equal to False
      • (PDD_Target is A structure) Equal to False
      • (PDD_Target is an illusion) Equal to False
      • (PDD_Target is dead) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (PDD_Source is A ranged attacker) Equal to True
        • Then - Actions
          • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + ((DamageEventAmount / 2.00) x ((Real((Level of GDD_DamagedUnit))) / (Real((Level of GDD_DamageSource))))))
        • Else - Actions
          • Unit - Set life of GDD_DamageSource to ((Life of GDD_DamageSource) + (DamageEventAmount x ((Real((Level of GDD_DamagedUnit))) / (Real((Level of GDD_DamageSource))))))
where
The event responses are the following variables:
// GDD_Damage is the amount of damage, replacing Event Response - Damage Taken.
// GDD_DamagedUnit is the damaged unit, replacing Event Response - Triggering Unit.
// Triggering Unit can still be used, if you need to use waits.
// Read the -- Notes -- section below for more info.
// GDD_DamageSource is the damaging unit, replacing Event Response - Damage Source.

And NO! IT'S NOT WORKJING YET!!! ;) I really don't know what i am doing with the DDS tool.
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
You shouldn't use three DDS at the same time, because they use different variables and fire in different ways/times. While PDD and GDD have plugins inside Damage Engine, the latter is much better in terms of what you can do with it. Stick to Damage Engine.

I have replaced the variables with the ones that DE uses.

  • Unholy Link 3
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Unholy Reduction (UF base)) Equal to True
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventTarget is Magic Immune) Equal to False
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventTarget is an illusion) Equal to False
      • (DamageEventTarget is dead) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A ranged attacker) Equal to True
        • Then - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 2.00) x ((Real((Level of DamageEventTarget))) / (Real((Level of DamageEventSource))))))
        • Else - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + (DamageEventAmount x ((Real((Level of DamageEventTarget))) / (Real((Level of DamageEventSource))))))
edit: By the way, don't bother adding a (Do nothing) action at the end of ITE statements, it just makes it less efficient.
 
Level 5
Joined
May 20, 2013
Messages
162
Ok! I set up the test exactly like your trigger, and the health bar still does not move. But at least there is no sudden death.

At this point, i am failing to see how i am advantaged by a DDS at all. It is not making things happen! To the contrary, it has flooded my variable lists & trigger functions with a clutter of options that i obviously do not know how to use, thereby making the whole process even more confusing than it already is! The thing is, i do not understand "how" the DDS works, & so i have no idea what function does what, and it leaves me even more handicapped than my own native born incompetence does already!

Screw it!

The recoup does not "have" to specifically be vampiric attack. I just thought it would be cool. A much easier process would be to do something on the order of a group Soul Reaping so to speak. Something like, [Event: a unit dies. Pick all units within a range (600 or so) around dying unit condition matching picked units are buffed with Unholy Reduction, and owned by player who is not an ally of dying unit. Add picked unit to TheUnholyReducted_UG(player number), Set TheUnholyReducted = last created UG. Pick every unit in TheUnholyReducted_UG(player number) & (set life of picked unit to life of picked unit + something like (level of dying unit multiplied x 200 & divided by all units in UnholyReducted_UG.)]

"That" is something that i actually know how to pull off -not on a 1 shot, but i can make it happen. I may need to change the UG creation order (i always get confused on that), and add an extra variable or two, but at lkeast i know that i could make that method work!

There "is" however one trigger in Damage Engine that i find suspect, and was wondering if it requires user specific modification, because half the fields on it are preemptively turned off. Posting below, but my re-post does not display how that all those green fields are actually turned off by default.

  • Damage Engine Config
    • Events
    • Conditions
      • (UDexUnits[UDex] is A structure) Equal to False
    • Actions
      • -------- - --------
      • -------- This trigger's conditions let you filter out units you don't want detection for. --------
      • -------- NOTE: By default, units with Locust will not pass the check. --------
      • -------- TIP: The unit is called UDexUnits[UDex] and its custom value is UDex --------
      • -------- - --------
      • -------- Copy the Cheat Death Ability from Object Editor into your map and set the following variable respectively: --------
      • -------- - --------
      • Set DamageBlockingAbility = Haste (Neutral Hostile 2)
      • -------- - --------
      • -------- Copy the Detect Spell Damage Ability from Object Editor into your map and set the following variable respectively: --------
      • -------- - --------
      • Set SpellDamageAbility = Haste (Neutral Hostile)
      • -------- - --------
      • -------- You can add extra classifications here if you want to differentiate between your triggered damage --------
      • -------- Use DamageTypeExplosive (or any negative value damage type) if you want a unit killed by that damage to explode --------
      • -------- - --------
      • Set DamageTypeExplosive = -1
      • Set DamageTypeCriticalStrike = 1
      • Set DamageTypeHeal = 2
      • Set DamageTypeReduced = 3
      • Set DamageTypeBlocked = 4
      • -------- - --------
      • -------- Leave the next Set statement disabled if you modified the Spell Damage Reduction item ability to 1.67 reduction --------
      • -------- Otherwise, if you removed that ability from Runed Bracers, you'll need to enable this line: --------
      • -------- - --------
      • Set DmgEvBracers = Runed Bracers
      • -------- - --------
      • -------- Set the damage multiplication factor (1.00 being unmodified, increasing in damage over 1.00 and at 0 damage with 0.00) --------
      • -------- NOTE. With the default values, Runed Bracers is reduces 33%, Elune's Grace reduces 20% and Ethereal increases 67% --------
      • -------- - --------
      • Set DAMAGE_FACTOR_BRACERS = 0.67
      • Set DAMAGE_FACTOR_ELUNES = 0.80
      • Set DAMAGE_FACTOR_ETHEREAL = 1.67
      • -------- - --------
      • -------- Added 25 July 2017 to allow detection of things like Bash or Pulverize or AOE spread --------
      • -------- - --------
      • Set DamageEventAOE = 1
      • Set DamageEventLevel = 1
      • -------- - --------
      • -------- Do not enable any of the following lines as they are simply variable declarations to make copying easier --------
      • -------- - --------
      • Set AfterDamageEvent = (DamageEvent + (AOEDamageEvent + DamageModifierEvent))
      • Set ClearDamageEvent = (This trigger)
      • Set DamageEventAmount = DamageEventPrevAmt
      • Set DamageEventOverride = NextDamageOverride
      • Set DamageEventSource = DamageEventTarget
      • Set DamageEventTrigger = DmgEvTrig
      • Set DamageEventType = (LastDmgPrevType[0] + NextDamageType)
      • Set DamageEventsWasted = DmgEvRecursionN
      • Set DmgEvRunning = DmgEvStarted
      • Set IsDamageSpell = LastDmgWasSpell[0]
      • Set LastDamageHP = (Elapsed time for DmgEvTimer)
      • Set LastDmgPrevAmount[0] = LastDmgValue[0]
      • Set LastDmgSource[0] = LastDmgTarget[0]
      • Set HideDamageFrom[0] = False
      • Set UnitDamageRegistered[0] = False
      • Unit Group - Add EnhancedDamageTarget to DamageEventAOEGroup
O... and this one too... comes disabled by default. It is the Unit Indexer.

  • Unit Indexer
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: call ExecuteFunc("InitializeUnitIndexer")
      • Custom script: endfunction
      • Custom script:
      • Custom script: function ClearUnitIndex takes nothing returns nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of UDexUnits[UDex]) Equal to 0
        • Then - Actions
          • Set UnitIndexLock[UDex] = (UnitIndexLock[UDex] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UnitIndexLock[UDex] Equal to 0
            • Then - Actions
              • Set UDexNext[UDexPrev[UDex]] = UDexNext[UDex]
              • Set UDexPrev[UDexNext[UDex]] = UDexPrev[UDex]
              • Set UDexPrev[UDex] = 0
              • Set UnitIndexEvent = 0.00
              • Set UnitIndexEvent = 2.00
              • Set UnitIndexEvent = 0.00
              • Set UDexUnits[UDex] = No unit
              • Set UDexNext[UDex] = UDexRecycle
              • Set UDexRecycle = UDex
            • Else - Actions
        • Else - Actions
      • Custom script: endfunction
      • Custom script:
      • Custom script: function IndexUnit takes nothing returns boolean
      • Custom script: local integer pdex = udg_UDex
      • Custom script: local integer ndex
      • -------- - --------
      • -------- You can customize the following block - if conditions are false the (Matching unit) won't be indexed. --------
      • -------- - --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UnitIndexerEnabled Equal to True
          • (Custom value of (Matching unit)) Equal to 0
        • Then - Actions
          • Set UDexWasted = (UDexWasted + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UDexWasted Equal to 32
            • Then - Actions
              • Set UDexWasted = 0
              • Set UDex = UDexNext[0]
              • Custom script: loop
              • Custom script: exitwhen udg_UDex == 0
              • Custom script: set ndex = udg_UDexNext[udg_UDex]
              • Custom script: call ClearUnitIndex()
              • Custom script: set udg_UDex = ndex
              • Custom script: endloop
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UDexRecycle Equal to 0
            • Then - Actions
              • Set UDex = (UDexGen + 1)
              • Set UDexGen = UDex
            • Else - Actions
              • Set UDex = UDexRecycle
              • Set UDexRecycle = UDexNext[UDex]
          • Set UDexUnits[UDex] = (Matching unit)
          • Unit - Set the custom value of UDexUnits[UDex] to UDex
          • Set UDexPrev[UDexNext[0]] = UDex
          • Set UDexNext[UDex] = UDexNext[0]
          • Set UDexNext[0] = UDex
          • Set UnitIndexLock[UDex] = 1
          • Set UnitIndexEvent = 0.00
          • Set UnitIndexEvent = 1.00
          • Set UnitIndexEvent = 0.00
          • Custom script: set udg_UDex = pdex
        • Else - Actions
      • Custom script: return false
      • Custom script: endfunction
      • Custom script:
      • Custom script: function InitializeUnitIndexer takes nothing returns nothing
      • Custom script: local integer i = bj_MAX_PLAYER_SLOTS
      • Custom script: local boolexpr b = Filter(function IndexUnit)
      • Custom script: local region re = CreateRegion()
      • Custom script: local trigger t = GetTriggeringTrigger()
      • Custom script: local rect r = GetWorldBounds()
      • Custom script: call RegionAddRect(re, r)
      • Custom script: call TriggerRegisterEnterRegion(t, re, b)
      • Custom script: call TriggerClearActions(t)
      • Custom script: call TriggerAddAction(t, function ClearUnitIndex)
      • Set UnitIndexerEnabled = True
      • Custom script: loop
      • Custom script: set i = i - 1
      • Custom script: call GroupEnumUnitsOfPlayer(bj_lastCreatedGroup, Player(i), b)
      • Custom script: exitwhen i == 0
      • Custom script: endloop
      • Custom script: call RemoveRect(r)
      • Custom script: set re = null
      • Custom script: set r = null
      • Custom script: set t = null
      • Custom script: set b = null
      • Set UnitIndexEvent = 3.00
      • Set UnitIndexEvent = 0.00
Between these two, could this be why the DDS doesn't seem to be working?

MAJOR EDIT!: Yep! Turning those two triggers on made a huge difference. However, sometimes the buffed unit seems to experience a sudden death, and i am not sure where that is coming from. Perhaps if an attack is interrupted? It seems to happen frequently when fighting the ancient yeti that guard the mercenary camps on Ice Crown (map).


Also... now that the life recoup is working, i need a way to distinguish between physical (attack) damage & spell damage. AoE spells like Rain of Fire have a ridiculous return rate.

Maybe Damage Engine will be useful after all!
 
Last edited:
Level 5
Joined
May 20, 2013
Messages
162
@Light

Ok big buddy! Here is the final form i ended up with for trigger #3. I tried to diverge from your formula as little as possible.

  • Unholy Link 3
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Unholy Reduction (UF base)) Equal to True
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventTarget is Magic Immune) Equal to False
      • (DamageEventTarget is Mechanical) Equal to False
      • (DamageEventTarget is an illusion) Equal to False
      • (DamageEventTarget is dead) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A ranged attacker) Equal to True
        • Then - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 2.00) + 0.00))
          • Game - Display to (All players) the text: The Humans be slaug...
        • Else - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 1.00) + 0.00))
          • Game - Display to (All players) the text: The Elven scum must...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDamageSpell Equal to True
        • Then - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 4.00) + 0.00))
          • Game - Display to (All players) the text: Death wills it!!!
        • Else - Actions
And yes, despite my initial frustration, Damage Engine DDS was a huge help here. as far as i can tell we have successfully emulated Life Steal for ranged attackers, & in addition, i was able to separate spell damage from the other forms, and assign it a different return value. Way to go Damage Engine! ;) Unless you can see anything thing else that needs done, all i see left for trigger#3 is to pretty it up with some SFX. But doing that correctly will be its own project, as i don't trust my skills to not screw it up.

So i think that squares away trigger #3. I have a couple of new questions for Triggers 1 & 2 though.

1). Is it possible for a unit to be in two unit groups simultaneously? I am asking because every once in a while a unit slips through the buff based qualification check for the add/remove ability parts of the triggers. I was considering adding them to a second UG as well that could be checked periodically for any units that still have the abilities but no buff, or have the buff, but no abilities. Quality control.

2). However, with the expanded options opened by Damage Engine, maybe i can bypass the add/remove abilities completely in trigger #1 & #2? I will post this particular question on the Damage Engine thread as well. What i am trying to do is create a situation where the unit buffed with Unholy Reduction is immune to all damage but still provokes attack, unlike with invulnerability/spell immunity. Is this something we can do with Damage Engine, or do we need some kind of spell editor? As far as i am concerned, as long as all "damage" is blocked, my objective is satisfied. While it would be nice to have more discretion in terms of how easily the buff is removed, damage denial is the only critical part of this mechanism. If i can stop the buffed target from being damaged while buffed, but still provoking attack, it should increase trigger reliability a noticeable bit.
 
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
527
1. Yes, it's possible, but I don't think its necessary for this one. Actually, you might not even need triggers 1 and 2, since all the ability needs is a buff check.

2. With Damage Engine, you can use another trigger with the event "DamageModifierEvent Equal to 1.00" and set DamageEventAmount to 0.00. No need to add abilities.
 
Level 5
Joined
May 20, 2013
Messages
162
  • Unholy Link Setup
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unholy Reduction (Active)
    • Actions
      • Unit - Set life of (Target unit of ability being cast) to (10.00 + ((Life of (Target unit of ability being cast)) / 2.00))

  • Unholy Reduction Damge Proofing
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget has buff Unholy Reduction (UF base)) Equal to True
    • Actions
      • Set DamageEventAmount = 0.00
      • Set DamageEventType = DamageTypeBlocked



  • Unholy Link Life Recoup
    • Events
      • Game - AfterDamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Unholy Reduction (UF base)) Equal to True
      • (DamageEventTarget is A structure) Equal to False
      • (DamageEventTarget is Magic Immune) Equal to False
      • (DamageEventTarget is Mechanical) Equal to False
      • (DamageEventTarget is an illusion) Equal to False
      • (DamageEventTarget is dead) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventSource is A ranged attacker) Equal to True
        • Then - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 2.00) + 0.00))
          • Game - Display to (All players) the text: The Humans be slaug...
        • Else - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 1.00) + 0.00))
          • Game - Display to (All players) the text: The Elven scum must...
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDamageSpell Equal to True
        • Then - Actions
          • Unit - Set life of DamageEventSource to ((Life of DamageEventSource) + ((DamageEventAmount / 4.00) + 0.00))
          • Game - Display to (All players) the text: Death wills it!!!
        • Else - Actions
 
Status
Not open for further replies.
Top