• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Spirit Link Does Not Work With Modern DDS

Status
Not open for further replies.
The problem lies here

JASS:
                    /*
                    *   Calculate spell resistance
                    */
                    call DisableTrigger(RefreshTrigger(targetId_p).parent.trigger)
                    
                        set life = GetWidgetLife(u)
                        set scale = GetUnitState(u, UNIT_STATE_MAX_LIFE)
                        call SetWidgetLife(u, scale)
                        call UnitDamageTarget(killUnit, u, -scale/2, false, false, null, DAMAGE_TYPE_UNIVERSAL, null)
                        set scale = 2*(scale - GetWidgetLife(u))/scale
                        if (scale > 1) then
                            set damageOriginal = -damageOriginal*scale
                        else
                            set damageOriginal = -damageOriginal
                        endif
                        call SetWidgetLife(u, life)
                    
                    call EnableTrigger(RefreshTrigger(targetId_p).parent.trigger)

This may seem innocent, but damage applied to a unit will mess with every other unit that is linked to it with spirit link. In this case, it means that every unit gets healed. This also causes all units to immediately die when a given unit dies.

Coke's, LFH's, and my DDS use this code to calculate what the damage actually is. This means that if you want life link, it must be vJASS. Either that, or we must find a better way to detect spell damage.

edit
Another bad thing happens. When you do that damage calculation and you use something like Trigger Refresh, you only disable the primary trigger partially. If the units are spread across several triggers, then some are going to fire DDS.

There is a way to detect this, but I don't know how you'd set up the triggers correctly.

Primary Trigger: enabled
Secondary Trigger: disabled

When calculating resistance, disable primary and enable secondary. Disable secondary for the target unit. When the damage is applied, block that damage for every unit it fires for. These are units that are spirit linked with the target. This sucks because it makes every piece of damage on a spirit link an n^2 calculation...

We just need to use a vJASS spirit link. You can't use vanilla one.
 
Status
Not open for further replies.
Top