• 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.

Complex Ability request

Status
Not open for further replies.
Level 7
Joined
Sep 9, 2007
Messages
253
I have a warlock style hero who is able to summon a demon pet which he can use to tank damage. I would like to have the demon permenantly "Spirit Linked" with the warlock so that any time one of them takes damage the other would take the same amount of damage. The 2 units should be spirit linked as soon as the demon is summoned and the spirit link should last indefinately.

Basically, the damage which is passed on to the other unit should be calculated after any spell resistance or armour. for example....
- If the demon gets hit with 100 damage but he has 35% damage reduction then he will take 65 damage and then the warlock will take 65 damage as well.
- If the warlock gets hit with 100 damage and he has 3% damage reduction then he will take 97 Damage and then the demon will take 97 damage as well.

I tried to make this ability myself after seeking advice from the Hive but I have given up. the thread is here http://www.hiveworkshop.com/forums/world-editor-help-zone-98/help-spirit-link-style-spell-210961/

Thank you very much to anybody who helps, I will of course give +rep.
 
Level 7
Joined
Sep 9, 2007
Messages
253
The problem is: it is not possible to specify more than 1 target of spirit link. So I can cast the spirit link on 1 unit but it any subsequent units will be randomly selected. it could jump to any nearby unit.

Also: Spirit link shares the total damage among the affected units. My ability would ideal duplicate the damage so that warlock would take 100% damage and demon would also take 100% damage. ie the full damage is taken by both affected units rather than the full damage being shared.
 
Level 11
Joined
Aug 11, 2009
Messages
605
Oh, ok, hopefully someone can trigger it for you then :)

But I dont think you should duplicate the damage, it would be far too easy to kill the Warlock then. And on Bosses, you would have to avoid abilities with both the Demon and the Warlock which could be hard else you would take full damage on both if one gets hit. Same for PvP with Heroes who have AoE spells. If both the Warlock and the Demon gets hit by the AoE the AoE spell would deal double damage to both of them. Taking 50% each is better, but that is just my oppinion :)

Anyway, good luck on this!
 
Level 7
Joined
Sep 9, 2007
Messages
253
It's a PVE map, sort of like a hero defence with triggered boss encounters so most of the concerns you have raised won't be an issue. But yes I have considered AOE spells being a problem, I was thinking of giving both units high magic resistance but I also like that the player has to consider this risk.

Thanks.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,219
1. import a damage detection system
2. store the summoned units into a variable
2. use this trigger the damage detection system should have the damage taken stored into a varible.
  • link dmg
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Summoned_unit_variable[1]
          • (Triggering unit) Equal to Summoned_unit_variable[2]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Summoned_unit_variable[1]
        • Then - Actions
          • Unit - Cause (Attacking unit) to damage Summoned_unit_variable[2], dealing 500.00 damage of attack type Spells and damage type Normal
        • Else - Actions
the dmg system got the ammout of damage detected so i cant show that.
make sure to do the if part with the other unit too
 
Level 4
Joined
Oct 9, 2009
Messages
50
Here you go.

Added some basic comments to explain stuff, but probably not as many as I should have. You said it was PvE, but I didn't make it MUI (so if it's 1-player, it won't matter). Added some easily removable floating text and chat messages to make sure everything's running well. I set the Summoner and the Summoned to the same Unit Variable Array to keep it compact, with [1] being the summoner and [2] being the summoned unit.

If you have any questions, let me know.
 

Attachments

  • Shared Damage Summon.w3x
    19.6 KB · Views: 63
Level 12
Joined
Nov 20, 2007
Messages
660
Here you go.

Added some basic comments to explain stuff, but probably not as many as I should have. You said it was PvE, but I didn't make it MUI (so if it's 1-player, it won't matter). Added some easily removable floating text and chat messages to make sure everything's running well. I set the Summoner and the Summoned to the same Unit Variable Array to keep it compact, with [1] being the summoner and [2] being the summoned unit.

If you have any questions, let me know.

Your spell leaks, i don't recommand it.
Greenwhy, you want that spell GUI or MPI or MUI ?
 
Level 4
Joined
Oct 9, 2009
Messages
50
Your spell leaks, i don't recommand it.
Greenwhy, you want that spell GUI or MPI or MUI ?

Erm, doesn't leak, just spams a metric ton of Game alerts to verify that it's working. They're sectioned off in the triggers so they're easy to find+remove, I just take extra precautions along every step of the way to make sure each part works, and if it doesn't, figure out where.

Generally when you write any kind of code for someone, if they're not familiar with it, they may not understand which part does what and for why.

I removed them in this version. Tell me if it still seems like it's leaking, and I'll figure out why.
 

Attachments

  • Shared Damage Summon2.w3x
    19.1 KB · Views: 94
Level 7
Joined
Sep 9, 2007
Messages
253
Thanks Meticulous, good suggestion but I think the Damage Detection system will be the more suitable way.

Thanks Matt, I've taken some knowledge from your triggers but I'm working on my own at the moment.

King Drift Alex, only 1 unit in the game will have the spell.
 
Level 7
Joined
Sep 9, 2007
Messages
253
So I've been working on my own solution but I've become stuck. I'll show you what I have so far....

I'm using Weep's GUI friendly damage detection system.
http://www.hiveworkshop.com/forums/...-damage-detection-v1-2-1-a-149098/index2.html

  • Demon Summoned
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoning unit)) Equal to Warlock
    • Actions
      • Set HeroSpecific[13] = (Summoned unit)
      • Unit Group - Add HeroSpecific[13] to Hero_UnitGroup
      • Set Demon_summoned = True
      • Trigger - Turn on Tethered Soul <gen>
      • Trigger - Turn on Tethered Soul update <gen>
      • Trigger - Turn on Tethered Soul death <gen>
      • -------- HeroSpecific[13] is where I save the summoned unit --------
      • -------- HeroSpecific[4] is where the Summoning unit (the warlock) Is saved when he is sold at a tavern --------
  • -------- Adding the summoned unit to Hero_UnitGroup is for functionality in other triggers. --------
  • Tethered Soul
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of GDD_DamagedUnit) Equal to Warlock
          • (Unit-type of GDD_DamagedUnit) Equal to Demon (Level 1)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GDD_DamagedUnit Equal to HeroSpecific[4]
        • Then - Actions
          • Unit - Set life of HeroSpecific[13] to (Percentage life of HeroSpecific[4])%
        • Else - Actions
          • Unit - Set life of HeroSpecific[4] to (Percentage life of HeroSpecific[13])%
  • Tethered Soul update
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit - Set life of HeroSpecific[13] to (Percentage life of HeroSpecific[4])%
      • -------- Because both unit's are meant to remain on the same percentage of HP I need to somehow control HP regen. To do this I made sure the warlock had better percentage regen and use this trigger to update the Demon's HP every 0.5 seconds. --------
  • Tethered Soul death
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Warlock
          • (Unit-type of (Triggering unit)) Equal to Demon (Level 1)
    • Actions
      • Set Demon_summoned = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of GDD_DamagedUnit) Equal to Warlock
        • Then - Actions
          • Unit Group - Remove HeroSpecific[13] from Hero_UnitGroup
          • Unit - Remove HeroSpecific[13] from the game
        • Else - Actions
          • Unit - Kill HeroSpecific[4]
      • Trigger - Turn off Tethered Soul <gen>
      • Trigger - Turn off Tethered Soul update <gen>
      • Trigger - Turn off (This trigger)
This seems to work well against some test grunts which I created but when I Take them away and fight units which are part of the wave spawning system it does something funny. When the Summoned Demon gets attacked his HP's go straight back to 100% and the warlock's HP don't change.

When the Summoned Demon get's attacked it should be firing:
  • Else - Actions
    • Unit - Set life of HeroSpecific[4] to (Percentage life of HeroSpecific[13])%
but it's almost as if the "Then" statement is firing instead. But it works properly against some Grunts so I can't explain it.

EDIT:
Boss units attacking the warlock cause the trigger to correctly damage the demon
Boss units attacking the Demon DO NOT cause triggered damage against the warlock.
All other units seem to work fine both ways.
Seems to be some kind of incompatability with boss units attacking the demon..... what could cause this>?
 
Last edited:
Level 7
Joined
Sep 9, 2007
Messages
253
Ok I've actually worked it out. The "Tethered Soul Update" trigger was causing the bug. I don't understand how because there was no waits or anything like that... I've removed it but now there is a problem of the two units regenerating health at different rates. Any ideas on how to fix this?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
First of all, i dont see in any of the triggers you setting HeroSpecific[4] I'll assume its init elsewhere

It might be a problem with the DDS. Try switching to bribes, i find it a hell of alot easier to use and bugless. I've never used weeps
 
Level 7
Joined
Sep 9, 2007
Messages
253
HeroSpecific[4] is Initialised when the warlock is sold at the tavern at the start of the game.

I'll give Bribes a go but I don't think the problem comes from the DDS, the trigger which was causing problems seemed to be the update trigger which doesn't directly interact with the DDS.
 
Level 7
Joined
Sep 9, 2007
Messages
253
I tried Bribe's system. It has the same problem as Weep's does. The Tethered Soul Update trigger (above) seems to do some very strange things, it seems to heal the Demon for 20hp at a time. The warlocks HP regen is only 1hp/second so I don't understand that at all....
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Whats the average hp of the demon compared to the average hp to the warlock (maximums)
 
Level 7
Joined
Sep 9, 2007
Messages
253
I don't think I understand the question.

Warlock max hp - 290 (this will increase with levels and items)
Demon max hp - 600 (this will increase as the demon ability is levelled up)

If the warlock is taken to 300/600 hp then the warlock should be taken to 145.
If the warlock is taken to 145/290 hp then the demon should be taken to 300.
I want them to always have the same percentage health.
 
Status
Not open for further replies.
Top