New 6.78 mechanics!

Discussion in 'Advanced Mechanics' started by MauranKilom, May 31, 2013.

  1. MauranKilom

    MauranKilom Well-Known Member

    Update: Check the list of problems at the end of this post!

    Ok, since there's lots and lots of changes that are pretty interesting from a mechanics standpoint, i'll try to collect them in this thread. If somebody comes along and helps me out a bit, we could probably create trigger descriptions for the new heroes, too!

    1. Hero mechanics changes

    Changes like the one on ES ulti were omitted, there's really nothing exciting there (and ofcourse mechanically irrelevant stuff isn't in here, too).

    WIP here:
    {|}Trigger descriptions yet to come!
    {|}The call to call SetUnitVertexColor(loc_unit02,75,75,75,100) for allies and observers is now omitted in the script, instead the unit already has its red, green and blue values set at 75.
    Also, since i haven't seen this mentioned elsewhere: The hero illu doesn't leech XP because of call SuspendHeroXP(loc_unit02,true) (not a change, but nevertheless interesting).
    {|}Buff removal is done in the following way:
    [jass] local unit loc_unit01=GetTriggerUnit()
    local unit loc_unit02=GetSpellTargetUnit() if IsUnitAlly(loc_unit01,GetOwningPlayer(loc_unit02))==true then
    call UnitRemoveBuffs(loc_unit02,false,true)
    call UnitRemoveBuffs(loc_unit02,true,false)
    call Func0348(loc_unit02)
    Func0348 removes Ice Blast ([note=Ice Blast slow aura that provides the buff][A1JA][/note], [note=Ice Blast buff][B0CD][/note], [note=Ice Blast FX][A1LD][/note]), the [Aetl] Ethereal ability and [note=You expect me to list all the related abilities?]Sticky Napalm[/note].

    Rupture HP removal is done through the standard HP-removal function (the one with the 100000000 physical damage killing blow).
    {|}The DataC values for the [ANcl] Channel based Shallow Grave ability changed from 1 to 9. Those are (bitwise) flags, 1 being [note=Oh, hi, ThoApplesin!]visibility in the UI[/note], 2 being a target circle, 4... uh... "bodily spell"? Don't recall the english equivalent atm, stupid german WE... Anyways, 8 makes it a universal spell and the 16 flag only castable once. Go figure.

    TL;DR: It's a universal spell now. Has the described effect.
    {|}This is probably the mechanics that i was most interested in... How the hell does ice freeze a spell duration? Well, i'll find out...

    Hm, this is probably disappoiting but... Doom now simply lasts a maximum of 999 seconds. The trigger just checks if the caster ís outside of 550 range of the target or if the target is dead every 0.1 seconds. Once this check has passed 160 times, doom will be removed. Oddly enough, it also checks for the doom buff to be present (incase 999 seconds pass? Or is ice aware of a possibility to remove doom that we aren't [fuzzy aphotic shield timings aside]?). And yes, being [note=GetUnitTypeId(loc_unit01)<1 or IsUnitType(loc_unit01,UNIT_TYPE_DEAD)==true]dead[/note] will only increase the counter by one, not actually remove the doom buff. If i can trust Eebster's statement in this post, then reincarnation (like the normal death) would remove doom anyways, so it's pointless (you could just remove the trigger right away).
    {|}Red dragon now has the [A0O4] Corrosive Breath ability, too. Apparently no stacking issues? No clue...
    {|}Just kidding, no mechanics change here. But seriously, Trax buff? Is he serious? As if she wasn't ridiculous enough already...
    {|}Checks every 0.5 seconds for relative HP in 7% steps, capped at 1 and 14. Attackspeed is added with a binary system (not sure if this is new... probably not), magic resistance is added in steps of 4% with direct bonuses:
    [jass]// loc_integer01 is the target bonus magic resistance in percent.
    function Func1933 takes unit loc_unit01,integer loc_integer01 returns nothing
    local integer loc_integer02=0 // Loop counter
    exitwhen loc_integer02>24
    if loc_integer02!=loc_integer01/4 and GetUnitAbilityLevel(loc_unit01,integers135[loc_integer02])>0 then
    call UnitRemoveAbility(loc_unit01,integers135[loc_integer02])
    set loc_integer02=loc_integer02+1
    if GetUnitAbilityLevel(loc_unit01,integers135[loc_integer01/4])==0 then
    call Func0183(loc_unit01,integers135[loc_integer01/4])
    call SetPlayerAbilityAvailable(GetOwningPlayer(loc_unit01),integers135[loc_integer01/4],false)
    endfunction[/jass]I feel like this could be done more efficiently, looks kinda redundant to me...
    PS: Wow, 98% additional magic resistance... Interesting concept.
    PPS: Didn't check the MR values on the abilities. Forgive me, it's late.
    {|}Stone Gaze triggers: Wow, ice did a hell of a job for the facing angle:
    [jass]function Func3029 takes unit loc_unit01,unit loc_unit02 returns boolean
    local real loc_real01=Func0160(loc_unit02,loc_unit01)
    local real loc_real02=GetUnitFacing(loc_unit02)
    local real loc_real03
    local real loc_real04
    local real loc_real05=-1.0
    local real loc_real06=-1.0
    local real loc_real07
    local real loc_real08
    local real loc_real09=-1.0
    local real loc_real10=-1.0
    set loc_real03=RMaxBJ(loc_real02-85,0)
    set loc_real04=loc_real02
    if loc_real02-85<=0 then
    set loc_real05=360-(85-(loc_real04-loc_real03))
    set loc_real06=360
    set loc_real07=loc_real02
    set loc_real08=RMinBJ(loc_real02+85,360)
    if loc_real02+85>=360 then
    set loc_real09=0
    set loc_real10=0+(85-(loc_real08-loc_real07))
    if loc_real01<0 then
    set loc_real01=loc_real01+360
    elseif loc_real01>360 then
    set loc_real01=loc_real01-360
    if(loc_real01>loc_real03 and loc_real01<loc_real04)or(loc_real05!=-1 and loc_real01>loc_real05 and loc_real01<loc_real06)or(loc_real01>loc_real07 and loc_real01<loc_real08)or(loc_real09!=-1 and loc_real01>loc_real09 and loc_real01<loc_real10)then
    return true
    return false
    I feel like this could be done in about 5 lines of code, if done correctly...

    Anyways, it checks the aoe (1025) in 0.02 second intervals, adding 0.02 to the "exposition time" of each unit, adding the 50% (self only) slow aura and the FX to targets that don't already have it.
    If the exposition time of a unit becomes equal to 2.0 (i'd be afraid of comparing reals like that...), it kills the unit if it is an illusion or stuns it for 3 seconds (standard thunderbolt) and amplifies damage on it for 3 seconds. Interesting side fact: It doesn't deal physical damage.
    [jass] if GetUnitAbilityLevel(loc_unit02,'Aetl')>0 or GetUnitAbilityLevel(loc_unit02,'B01N')>0 then
    call UnitDamageTarget(loc_unit01,loc_unit02,loc_real01,true,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
    call UnitDamageTarget(loc_unit01,loc_unit02,loc_real01,true,true,ATTACK_TYPE_HERO,DAMAGE_TYPE_UNIVERSAL,WEAPON_TYPE_WHOKNOWS)
    endif[/jass](Icefrog damage type #7 is used...)
    All the spook ends after those 3 seconds of disable or when stone gaze ends (after 6 seconds). I hope i didn't miss anything of relevance.

    Also, is it just me or is this code bogus?
    [jass] call GroupRemoveGroup(loc_group01,loc_group02)
    call Func0029(loc_group01)
    call Func0029(loc_group02)[/jass]The entire grouping thing looks a lot like copypasted from SotS. Don't feel like diving deeper into it atm.
    {|}Meepo now gets a spellbook with a 24% spell resistance ability. This effectively gives him 35.5% MR (0.86 * 0.75 = 0.645).
    {|}Arrow: Additional damage is min(distance/150, 10) * 10, so from 0 to 100. Added to the normal 90*level damage, no extra instance.
    Starfall: Interesting, it first groups targets within 900 (hardcoded) range and then removes those whose (center to center) distance from Mirana is > 650. Not really that relevant, but... Interesting. Anyways, for each wave, targets are chosen 0.5 seconds before the damage is dealt (when the stars fall down), the second wave begins 1 second after the first one. So while the second wave will choose its target (in 200 hardcoded aoe) 1 second after spell effect (it won't choose a target that's dead at that time), that target may very well die in the 0.5 seconds it takes for the lonely star to fall and deal damage. Note that potential targets may also leave the 200 aoe in that 1 second.
    {|}Reaper's Scythe: When reaper's scythe goes into effect, a flag is set for the target for 1.5 seconds. If a dying unit has this flag set, unit333 will be given the sadist stuff. Yes, this is not MUI, unit333 gets set to the caster on spell effect, so if first rubick and then necro cast reaper's scythe and both targets die (all within 1.5 seconds), necro will get sadist for both kills and rubick none. The same is true for the kill attribution (in the trigger that handles kills, the killer is just replaced with unit333 if the dying unit has said flag), which is quite a considerable flaw in my eyes...

    I don't think the anti-buyback aspect needs mechanical explanation. I could search the code and show it, but i doubt we'll learn anything new from it.
    {|}Decrepify is now based on channel (bitflag: 9)! On EVENT_PLAYER_UNIT_SPELL_CAST it checks if the target is a structure but not a tombstone, if so then it gently interrupts pugna with an error message, otherwise it lets him proceed. On spell effect, our friend e00E appears and *poof* the target is ethereal!
    {|}Aw come one, let me do this another time. I don't even understand how that spell is supposed to work yet...
    {|}Hah, bash reworked, i suggested a system for that long ago in this thread. Maybe the idea is older than that, but i know i came up with it for myself 1.5 years ago.
    What icefrog implemented is: Stun lasts for 1 second, deals 0.01 bash damage. Whenever a unit is attacked and damaged at most 1 second later by a [note=no illusion ofcourse]unit[/note] that at some point learned the [A0JJ] Bash ability, it checks if the damage dealt is 0.01 (does this really work with MR? Like, for sure?), the damage source is said attacker and the [B0GG] Bash buff was placed. If so, it deals the desired amount of physical damage (if the target does not have the [A04R] marker ability).[/tab]

    2. Item mechanics changes

    Now uses a different buff ([B0GP] instead of the standard [BHad] Devotion aura buff).
    {|}Uses KillUnit() on the caster 0.01 second after cast (if done instantly it wouldn't trigger the cooldown). Could be 0.0 seconds, doesn't matter much. Note that this consumes a charge before the usual charge loss on death.

    I have no clue how the bonuses get into the item now. It only has the [A2TK] "Bloodstone target" ability (the suicide), which is channel based. How the hell does it get all the passive bonuses? Edit: They get added when the item is picked up. Thanks ThoApplesin.
    {|}Empty Bottle has now an ability that provides a self targeting buff that targets non-heroes and provides -0.3 movement speed (thanks ThoApplesin).
    However, the burst ability gives 5000% ms bonus instead of 50% (see below).
    {|}On usage, all enemies in the aoe get checked for the dust buff every 0.02 seconds. If it's present and the unit is under the effect of an invisibility spell, it has the self-slow-aura added to it. If either the dust buff is missing or the unit is not [note=as in "under the effect of an invisibility ability", again]invisible[/note], the slow aura and its buff are removed.
    {|}Now has 500000 HP. Note that the item itself still has 1 HP, but you (usually) never have the actual item outside of your inventory (only the 500k HP tome).
    {|}Note that they now have the standard MR of heroes (25%) in addition to their 40% spell resistance, yielding 55% MR in total.
    {|}Target list of [A1FD] Tree Chop is now "tree,ward". Upon cast it checks if the target is an observer or sentry ward and if so, deals 100 physical damage to it.[/tab]

    3. Important bugs

    Here's a list of things that work different from what the changelog describes:
    • Courier burst gave a 10000% ms buff, now gives 5000%. Intended would be 50%.
    • Slardar's bash coding fails for units with additional magic resistance. Speculated reason is that armor type damage reduction doesn't apply below 1 damage (hence allowing the comparison to work), normal MR however does. What needs to be done is simply checking for the bash buff on damage, removing said buff and applying the desired effects (akin to impetus or arcane orb).
    • Bloodrage removes Ice Blast, Napalm and Ethereal only when cast on enemy. This can't be intended.
      Edit: It also removes Dragon Form (replay would be nice).
    • Purifying Flames kills allied non-hero units (it amplifies the damage to account for standard MR, no matter whether it's a hero or not). It's not targetable on non-hero units, my bad. But still, the non-lethal damage on allied heroes will bring them nowhere near the intended 7.5 HP if they have additional magic resistance or may cause suicides if MR was decreased in some way. This should really be cleaned up, using pure damage and checking for Fate's Edict might preserve the [note=as in, not dealing the damage when the target is under Fate's Edict]synergy[/note]. Or using antimagic shell (with near infinite life) for Fate's Edict.
    • Stone Gaze amplification is not physical damage. Not as important as the previous stuff, but it still contradicts the changelog.

    Things that might be an oversight/unintended:
    • Both AA and Omniknight Scepters are undroppable for some reason. Most probably an oversight because there is no reason those two upgrades cannot be removed like Tiny/Enchantress. Thanks crinckle.
    • Allied wards are targetable by QB.
    • Reaper's scythe is not properly MUI. It's [note=which is why i didn't put it in the above list]unlikely[/note] to happen, but Rubick + Necro can produce situations where it matters.
    • Bloodstone suicide costs an additional charge. Not sure if this is intended...

    Also, there's a boatload of wrong/inconsistent tooltips. But that's not really mechanics-related.

    PS: Check Func4117. Only one of the local unit variables is nulled. Just happened to notice.
    Last edited: Jun 2, 2013
  2. DracoLich

    DracoLich Well-Known Member

    regarding necrolyte - there are tons of non-MUI examples, but since such situations are pretty rare, no feels like "go fix it" happen
  3. EebstertheGreat

    EebstertheGreat Forum Manager

    Wait, why does Bloodrage remove Sticky Napalm and Ice Blast from enemies and not from allies? Did IF really call that function just for [Aetl] removal?

    The Doom check for the buff being present is just sensible robust coding. There was already at least one bug that can remove Doom (with Aphotic Shield), and now Bloodseeker can apparently remove Doom too. There are probably others or may be others in the future. So for the sake of good MUI and efficiency and such, the trigger is destroyed if the Doom buff is gone.

    The Orb Effects page says OoV didn't used to work on the red dragon. I have no idea why Corrosive Breath would now. But I guess it does.

    For Huskar to get 96% spell resistance, he needs to have less than 3% of his max hp . . .

    Stone Gaze amplification . . . just wow. So now AT: Hero, DT: Universal is finally used, except if the unit is ethereal, in which case it isn't? The whole point of DT: Universal is that it penetrates both ethereal and magic immunity. The only reason I can think of for not always using Universal in this function is that IceFrog wants to specifically prevent damage from Doom, March of the Machines, or Midnight Pulse being amplified vs. units that are both ethereal and magic immune. In literally any other situation, it changes nothing.

    For Starfall, you sure c2c range is checked? I'm pretty sure IsUnitInRange() takes collision size into account.

    I've already asked about Slardar's bash. It seems to work despite spell resistance (surprisingly enough, 0.0075==0.01 according to JASS), but I'm pretty sure it won't work on magic immune or piped targets. Frankly, this is not the correct way to trigger a Bash, and I don't know why it's done like that.
  4. xpforever

    xpforever Well-Known Member

    Tested, bash won't do damage to magic immune units. Don't know how to test pipe with the standard map.
  5. EebstertheGreat

    EebstertheGreat Forum Manager

    If it does go through Pipe (because 0.01==0), then I can't think of any actual bugs with it, assuming the magic immunity block is intended. This still seems like very strange coding. Magic immune targets could always have been excluded anyway by conventional triggered means (i.e. Func0095).

    Also, AT: Hero, DT: Universal isn't IF damage type #7, but actually #15. The other 14 are:
    1. AT: Hero, DT: Normal (Hero damage)
    2. AT: Piercing, DT: Normal (Piercing damage)
    3. AT: Siege, DT: Normal (Siege damage)
    4. AT: Normal, DT: Normal (Normal damage)
    5. AT: Chaos, DT: Normal (Chaos damage)
    6. AT: Spells, DT: Normal (Mixed damage)
    7. AT: Magic, DT: Normal (Pugna second attack)
    8. AT: Hero, DT: Enhanced (Enhanced damage)
    9. AT: Normal, DT: Enhanced (Spirit Bear with Empower)
    10. AT: Chaos, DT: Enhanced (Infernal with Empower)
    11. AT: Spells, DT: Enhanced (Echo Slam, Homing Missiles, etc.)
    12. AT: Hero, DT: Magic (Pure damage)
    13. AT: Spells, DT: Magic (Magic damage)
    14. AT: Spells, DT: Universal (Doom, March, Pulse)

    Unless you group 1-5 together as "physical damage," ignore 7, and group 8-11 together as "enhanced damage," I guess.

    And don't forget Direct HP Removal, or that some spells deal more than one type of damage, such as Earth Splitter which deals both magical and (hero) physical, and Heartstopper Aura which normally is DHP, but which has a killing blow that deals magical, physical, and pure damage.

    And you could split hairs even more by pointing out that most spells with DT: Enhanced technically are not Enhanced but rather some other damage type nearly identical to Enhanced but which doesn't automatically cancel consumables.
    Last edited: May 31, 2013
  6. xpforever

    xpforever Well-Known Member

    Well, I reported it as a bug so we'll have to wait and see if it actually is one or not.
  7. GodlyKha

    GodlyKha Well-Known Member

    Slardar's triggering seems funky. Is that using a rounding effect with Magic Resistance, taking 0.75 * 0.01 = 0.01 for whatever reason, or what? Wouldn't make any sense if it was using floats, but if its got a ceil() cap in the wc3 engine for whatever reason...
  8. EebstertheGreat

    EebstertheGreat Forum Manager

    As ThoAppelsin pointed out in another thread, 0.0075==0.01. If the epsilon is exactly 0.01, then it might even be the case that 0==0.01, in which case even Pipe might not stop the Bash. Which would be nice I guess.
  9. Kolaris

    Kolaris Well-Known Member

    I don't understand 80% of what I'm reading here, but great work. It's very soothing to read such knowledgeable analysis.
  10. ChibiNya

    ChibiNya Well-Known Member

    SO what buffs does bloodrage remove? Guessing it's not like a purge nya... But It shouldn't just be the Ethereal/Napalm/Ice Blast mentioned there...

    There's probably a better way to code that Slardar bash too nya x.x

    Also about Corrosive Breath... The Damage applies to primary target only? It's being splashed nya...
  11. EebstertheGreat

    EebstertheGreat Forum Manager

    In my testing, only the primary target receives the Corrosive Breath DoT.
  12. DracoLich

    DracoLich Well-Known Member

    since when splash could provide any buff placer? |(
  13. random999

    random999 Well-Known Member

    Rupture cannot kill you in ethereal form. T/F?
  14. EebstertheGreat

    EebstertheGreat Forum Manager

    False, unless you are also magic immune.

    This confusing exception brought to you by IceFrog.
  15. RandomPasserby

    RandomPasserby Well-Known Member

    Does the new list of passives that Doom disables get added to Duel as well?
  16. Wyn-Ryder

    Wyn-Ryder Well-Known Member

    So wait, rupture > shallow grave now too?
  17. EebstertheGreat

    EebstertheGreat Forum Manager

    No, the triggers check for the [BNdo] "Doom" buff, while Duel uses the [B0FG] "Duel" buff.

    Yes, much like Ice Blast and Culling Blade.
  18. YoTengoUnLCD

    YoTengoUnLCD Well-Known Member

  19. fulgorestyle

    fulgorestyle Member

    What about Viper's Corrosive skin? Does it work on HP Removal? So does Necrolyte get slowed and damaged?
  20. Wyn-Ryder

    Wyn-Ryder Well-Known Member

    HP removal isn't a damage type and doesn't trigger anything like that (including pseudo evasions as well). I wonder why he didn't just make it the same as untouchable? (Or is it, but just worded differently?)