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

Corruption - Wandering DOT

Status
Not open for further replies.
Level 1
Joined
Nov 27, 2018
Messages
2
Hello,

this is my first post here, i hope the solution has not been posted somewhere already, i gave the search a try and found nothing.

The Spell is supposed to be a single-target DOT (I used Unholy Frenzy) that infects another enemy unit in the area if the unit dies while under the effect of the DOT.

I first put the target of the spell into a group called Corrupted. I also check for 4 different spells, the first one being the original Corruption(the Hero-Ability made from Unholy Frenzy).
The other three are the different Levels of normal abilities for the Dummy who will cast them.

  • Corrupted Group
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Corruption
          • (Ability being cast) Equal to Corruption
          • (Ability being cast) Equal to Corruption II
          • (Ability being cast) Equal to Corruption III
    • Actions
      • Unit Group - Add (Target unit of ability being cast) to Corrupted
Secondly I check dying units for their affiliation with the Group Corruption.
If so, the Dummy comes into play and should cast his Version of Corruption on a nearby target.

  • Corruption
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to (Random unit from Corrupted)
    • Actions
      • Unit - Create 1 Dummy Corruption for (Triggering player) at (Position of (Dying unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral - Parasite (Random unit from (Units within 512.00 of (Position of (Dying unit)) matching (((Target unit of issued order) belongs to an enemy of Player 1 (Red)) Equal to True)))
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Remove (Dying unit) from Corrupted
So here's the funny thing:

I used to have the Dummy-Corruption-Abilities based off Unholy Frenzy as well and it kinda worked.
Only kinda because the dummy would always cast the "wandering" Corruption on the Hero.
So the whole "add unit to group-business" should be working.

I thought, since Unholy Frenzy is probably prioritized for friendlies, since it was thought of as a Buff, that's why it backfires on the Hero. So i changed it and based it off of Parasite.

Since then it doesn't work anymore and I can't figure out why.

Thanks for any Help in advance.
 
Level 7
Joined
Apr 17, 2017
Messages
316
  • Unit - Create 1 Dummy Corruption for (Triggering player) at (Position of (Dying unit)) facing Default building facing degrees
This one. You create a dummy for owner of dying unit which means your enemies. You can either set a variable in your first trigger as caster, or base the spell off unholy frenzy again.
 
Dying unit) Equal to (Random unit from Corrupted)
Avoid such random unit calls, if you don't want to pick a random unit.

Better use an boolean check:
Unit - is unit in unitgroup equals true

matching (((Target unit of issued order) belongs to an enemy of Player 1 (Red)) Equal to True)))
Target unit of issued order is not valid in that moment (cause outside of order event).

You should replace "Target unit of issued order" with "matching unit".
Matching unit referes to the unit beeing checked in a group filter. The check is repeated for all units in aoe. Matching units failing the check won't be valid random units.

(Triggering player)
Inside an player/any unit event Triggering Player is the owner of the triggering Unit.
In your trigger that would be the unit dying. Ownership of dummy might colide with the allowed Targets of you spells.

Does the dot not have a duration?
Parasit is proably better, you have the onKill feature builtin.
With parasit one could use the any unit summons event.
Then test the Summoned Unit Type beeing equal to the one defined inside the parasit spell.

When using parasit you don't need the group variable at all.
Also you have access to the unit source of the spell with summoning Unit (only for the 1. spell, although).
 
Level 1
Joined
Nov 27, 2018
Messages
2
Thank you guys, for your quick reply.

Well, summoning the Dummy for the Triggering Player was kind of a brain fart I must admit. Thanks for pointing that out.

  • Corruption
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in Corrupted) Equal to True
    • Actions
      • Unit - Create 1 Dummy Corruption for (Random player from (All players controlled by a User player)) at (Position of (Dying unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral - Parasite (Random unit from (Units within 512.00 of (Position of (Dying unit)) matching (((Matching unit) belongs to an ally of Player 12 (Brown)) Equal to True)))
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Remove (Dying unit) from Corrupted
This is what i have changed now, with your help.

It works ~60% of the time. When it works it's quite amazing. :)

So every test run the first ~5 jumps work like a charm and then it just stops. maybe in between it does one more.
I find this quite weird, since i don't really have any random conditions set up, except random unit in range. There's always a random enemy unit in range tho, so one of them should've been affected right? (All enemy units on this map are owned by player 12 - I'm working with the old Warchasers Map from Bilzzard)

I thought maybe there's a structure nearby it tries to target, but the spell can't target structures. I tried to add an additional condition in the trigger, so it wouldn't target structures, but i can't really manage to do so. You can only add one matching condition in the action here @ "units in range matching condition" and that's used for "ally of Player 12".

I don't want to get too complicated with this, since I'm only fooling around with the GUI a little.
So if you happen to find a quick solution here, or another brain fart of mine, thank you very much in advance.
If not, thank you anyway, since it kinda works :D I'll just pretend it has a "chance to jump on death" gnehehe.
 
Level 7
Joined
Apr 17, 2017
Messages
316
first of all, you can use and condition in your units in range matching condition, then boolean condition matching unit is a structure equal to false. Secondly, if you choose random unit from unit group it might target the same unit so that you might not even realise it. Also that position of unit is leaking. So you might want to avoid that by using a point variable then destroying at the end of the trigger. If you dont want your dummy to cast corruption spell on targets that has already been casted before, you might add this extra boolean condition : matching unit has a parasite buff equal to false.
 
Status
Not open for further replies.
Top