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

A variant Spirit Link spell

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
I'm trying to make a spell that creates a spirit link between the caster and a specific unit. I tried using the regular spirit link ability, but it doesn't include the caster. Can anyone help me in doing this?

The Goal is to have the spell cast on a unit, and then a spirit link is created between the caster and that unit only.
 
Level 15
Joined
Aug 14, 2007
Messages
936
I am afraid trigger will be involved, but this time you do not need spirit link from warcraft, you do it yourself
2 variables needed
spiritlinkcaster, spiritlinktarget

trigger:takes damage
event :
condition:
actions: -comment: this is simple, you refer triggering unit as the unit that takes damage, notice the event if empty, the trigger: linking will add the unit into this trigger using the add event function, watch below

trigger: linking
event when unit starts the effect of an ability

ability being cast equals spirit link

set spiritlinktarget = target of ability cast
set spiritlinkcaster = casting unit
add to trigger takes damage with {when spiritlinktarget takes damage}(this is unit specific trigger event)
add to trigger takes damage with {when spiritlinkcaster takes damage}(this is unit specific trigger event)

you can choose which one to add


now at the takes damage trigger, you can do whatever you want, e.g, when spiritcaster takes damage, you can actually get the damage taken using, Event response - damage taken (real type)... So I suppose you want to deal the damage taken back to the target... so the action will be, cause spiritcaster to deal spirittarget with Event Response - Damage Taken of type spells and normal

thats it you are done with the spirit linking thing, good luck for more advance abilities dude, if you want it by %, just simply do a 10/100 times damage taken that sort of thing ;)
 
Level 10
Joined
Sep 29, 2006
Messages
447
I understand what you are saying and it's very helpful. However, in order for this trigger to work, a unit would have to take full damage, then i would need to heal whatever % of the damage I want and damage the spirit linked unit. This will be a problem and I'll show you why.

Lets say caster has 10 hp left
an attacker deals 12 damage

the outcome should be:

caster takes 6 damage leaving 4 hp
spirit linked unit takes 6 damage as well

However, with that trigger you mentioned, the caster needs to take all 12 damage before it can be distributed, causing the caster to die and I don't want that to happen.

Your trigger is a good idea and believe me I've thought of it, but I can't find a way around the problem I mentioned. Can anyone else see a way around this?
 
Level 3
Joined
Apr 24, 2005
Messages
61
It's not that spirit link can't target the caster, it can by default, the problem is that it takes random targets.

It could perhaps be solved by giving it a very small range, but it wouldn't be effecient. Another way would be to limit the range of acceptable targets of the spell by, say letting it target ancients only.

It's the only 2 ways I can think of using the object editor, and you'd still have to target your own caster to be sure of the spell affecting him.
 
Level 12
Joined
Mar 16, 2006
Messages
992
Using a damage detection system and triggers are your best bet.

Everything else recommended so far is pretty awful.
 
Level 12
Joined
Mar 16, 2006
Messages
992
Pretty much, yes. Perhaps I didn't express myself clearly above, but I wasn't recommending it. I was clarifying what limits the spell had.

If you didn't recommend anything, then why are you responding to my post? He needs to get himself a damage detection system, learn it, and trigger it-Not read your defensive rabble.
 
Level 3
Joined
Apr 24, 2005
Messages
61
If you didn't recommend anything, then why are you responding to my post? He needs to get himself a damage detection system, learn it, and trigger it-Not read your defensive rabble.

Because he might've settled for an unsatisfying solution instead of finding a better way.

cant you just make the spell target self ?

If he made self the only target the spell wouldn't be able to find any additional targets, rendering it useless.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Pretty much, yes. Perhaps I didn't express myself clearly above, but I wasn't recommending it. I was clarifying what limits the spell had.
who the hell are you judging others ?!

Well Solution would be something like this (not MUI or MPI)
Target = Target Unit
Caster = Caster Unit
Prevlife = Life of Caster
Counter = 0
Enable the timer trigger

Timer Trigger:

Every 0.1 seconds
If Life of Caster > Prevlife of caster
Then: Damage Target by (Prevlife - Life of Caster)/division
Set Prevlife = Life of Caster
Counter = Counter +0.1
If Counter > *time*
Then: Stop Timer trigger

Anyway you got the idea
But I suggest Damage detection as vegavak said
Do this only if you cant use a Damage detection
 
Status
Not open for further replies.
Top