Results 1 to 3 of 3

Thread: [Confirmed] Magnus's Skewer's TRAVEL range is wrong and slightly too short

  1. #1
    Basic Member ThoAppelsin's Avatar
    Join Date
    Jan 2012
    Posts
    2,893

    [Confirmed] Magnus's Skewer's TRAVEL range is wrong and slightly too short

    It is set to be 600 800 1000 1200
    it should be at least 625 825 1025 1225


    The actual values for DotA is defined as: round (400 + 200*lvl + 25) up to the nearest multiple of 19
    which actually results in 627 836 1026 1235

    This rounding up is actually a necessity while coding, but it definitely has been set to be at least (400 + 200*lvl + 25)
    More detailed explanation of JASS will be in the next post...

  2. #2
    Basic Member ThoAppelsin's Avatar
    Join Date
    Jan 2012
    Posts
    2,893
    Code:
    01  function Func2957 takes nothing returns nothing
    02    local trigger loc_trigger01=CreateTrigger()
    03    local integer loc_integer01=GetHandleId(loc_trigger01)
    04    local real loc_real01=Func0121(GetSpellTargetX())
    05    local real loc_real02=Func0123(GetSpellTargetY())
    06    local unit loc_unit01=GetTriggerUnit()
    07    local real loc_real03=GetUnitX(loc_unit01)
    08    local real loc_real04=GetUnitY(loc_unit01)
    09    local integer loc_integer02=GetUnitAbilityLevel(loc_unit01,'A1RD')
    10    local real loc_real05=Func0159(loc_real03,loc_real04,loc_real01,loc_real02)*bj_DEGTORAD
    11    local real loc_real06=400+200*loc_integer02+25
    12    if Func0141(loc_real03,loc_real04,loc_real01,loc_real02)>loc_real06 then
    13      set loc_real01=Func0121(loc_real03+loc_real06*Cos(loc_real05))
    14      set loc_real02=Func0123(loc_real04+loc_real06*Sin(loc_real05))
    15    endif
    16    call SetUnitPathing(loc_unit01,false)
    17    call SetUnitAnimationByIndex(loc_unit01,3)
    18    call SetUnitTimeScale(loc_unit01,1.5)
    19    call TriggerRegisterTimerEvent(loc_trigger01,0.02,true)
    20    call TriggerRegisterUnitEvent(loc_trigger01,loc_unit01,EVENT_UNIT_DEATH)
    21    call TriggerAddCondition(loc_trigger01,Condition(function Func2956))
    22    call SaveUnitHandle(hashtable001,(loc_integer01),(2),(loc_unit01))
    23    call SaveInteger(hashtable001,(loc_integer01),(5),(loc_integer02))
    24    call SaveUnitHandle(hashtable001,(loc_integer01),(393),(null))
    25    call SaveUnitHandle(hashtable001,(loc_integer01),(394),(null))
    26    call SaveUnitHandle(hashtable001,(loc_integer01),(395),(null))
    27    call SaveUnitHandle(hashtable001,(loc_integer01),(396),(null))
    28    call SaveReal(hashtable001,(loc_integer01),(47),((loc_real01)*1.0))
    29    call SaveReal(hashtable001,(loc_integer01),(48),((loc_real02)*1.0))
    30    call SaveReal(hashtable001,(loc_integer01),(6),((loc_real03)*1.0))
    31    call SaveReal(hashtable001,(loc_integer01),(7),((loc_real04)*1.0))
    32    call SaveReal(hashtable001,(loc_integer01),(13),((Atan2(loc_real02-loc_real04,loc_real01-loc_real03))*1.0))
    33    call SaveInteger(hashtable001,(loc_integer01),(12),(R2I(Func0141(loc_real03,loc_real04,loc_real01,loc_real02)/19.0)))
    34    call SaveEffectHandle(hashtable001,(loc_integer01),(175),(AddSpecialEffectTarget("war3mapImported\\SkewerTuskGlow_1.mdx",loc_unit01,"head")))
    35    set loc_trigger01=null
    36    set loc_unit01=null
    37  endfunction

    The function Func2957 is for the setup of the Skewer.
    at line #09: loc_integer02 is set to be the ability level of Skewer (A1RD)
    at line #11: loc_real06 is set to be 425 + 200*skilllvl
    at line #12: Func0141 calculates distance between x1, y1, x2, y2; if the targeted location (coordinates: loc_real01, loc_real02) was further than our loc_real06, then...
    at lines #13 and 14: ... it nears the targeted location (loc_real01, loc_real02) so that it will be loc_real06 units away from the Magnus (loc_unit01)
    ...
    at line #33: Func0141 again calculates the distance (may not directly use the loc_real06, since one might have targeted a point that was already nearer than loc_real06), turns the real value into an integer, and divides it by 19; AND saves this to hash12

    Assuming that Magnus had targeted somewhere too far, hash12 turns out to be:
    - int(625 / 19) = int(32.895) = 32 for level 1
    - 43, 53 and 64 for the rest


    Now, the main Skewer function is really huge-ish, has about 158 lines in it; mostly due to the logic it uses for Hero detection and damaging...
    So I will only provide the movement related extract of it:

    Code:
    001  function Func2956 takes nothing returns boolean
    002    local trigger loc_trigger01=GetTriggeringTrigger()
    003    local integer loc_integer01=GetHandleId(loc_trigger01)
    004    local unit loc_unit01=(LoadUnitHandle(hashtable001,(loc_integer01),(2)))
    005    local unit loc_unit02=(LoadUnitHandle(hashtable001,(loc_integer01),(393)))
    006    local unit loc_unit03=(LoadUnitHandle(hashtable001,(loc_integer01),(394)))
    007    local unit loc_unit04=(LoadUnitHandle(hashtable001,(loc_integer01),(395)))
    008    local unit loc_unit05=(LoadUnitHandle(hashtable001,(loc_integer01),(396)))
    009    local integer loc_integer02=(LoadInteger(hashtable001,(loc_integer01),(5)))
    010    local real loc_real01=(LoadReal(hashtable001,(loc_integer01),(47)))
    011    local real loc_real02=(LoadReal(hashtable001,(loc_integer01),(48)))
    012    local real loc_real03=(LoadReal(hashtable001,(loc_integer01),(13)))
    013    local real loc_real04=(LoadReal(hashtable001,(loc_integer01),(6)))
    014    local real loc_real05=(LoadReal(hashtable001,(loc_integer01),(7)))
    015    local real loc_real06=Func0121(loc_real04+19*Cos(loc_real03))
    016    local real loc_real07=Func0123(loc_real05+19*Sin(loc_real03))
    017    local group loc_group01
    018    local integer loc_integer03=(LoadInteger(hashtable001,(loc_integer01),(12)))
    019    local location loc_location01
    020    call SetUnitPosition(loc_unit01,loc_real06,loc_real07)
    021    call SetUnitFacing(loc_unit01,loc_real03*bj_RADTODEG)
    022    call SaveReal(hashtable001,(loc_integer01),(6),((loc_real06)*1.0))
    023    call SaveReal(hashtable001,(loc_integer01),(7),((loc_real07)*1.0))
    [...]
    086    if GetTriggerEventId()==EVENT_UNIT_DEATH or GetTriggerEvalCount(loc_trigger01)>loc_integer03 then
    087      call DestroyEffect((LoadEffectHandle(hashtable001,(loc_integer01),(175))))
    088      call SetUnitAnimationByIndex(loc_unit01,0)
    089      call SetUnitTimeScale(loc_unit01,1.0)
    090      call SetUnitPathing(loc_unit01,true)
    091      call FlushChildHashtable(hashtable001,(loc_integer01))
    092      call Func0035(loc_trigger01)
    [...]
    154    endif
    155    set loc_trigger01=null
    156    set loc_unit01=null
    157    return false
    158  endfunction

    The function Func2956 handles many stuff for the Skewer.
    hash6 and hash7 are initially the X and Y coordinates of Magnus
    loc_real03 is the angle between Magnus and the targeted location, which was calculated in the previous function
    loc_real04 and loc_real05 are initially set to be the the X and Y coordinates of Magnus, and they increment by 19*sinorcos(loc_real03) on every cycle line #013, 014, 015, 016, 022 and 023
    loc_real06 and loc_real07 are used for setting the position of Magnus line #20
    loc_real06 and loc_real07 are always set to be 19*sinorcos(loc_real03) higher than loc_real04 and loc_real05 were before getting used to set the position of Magnus line #015, 016

    Now, by far, this means, on each cycle, Magnus is set to be 19*cyclecount afar from his initial position.

    Look at the line #086 where the function gets terminated... The conditions are either Magnus shall die, or cycle count shall be higher than loc_integer03
    loc_integer03... at line #018
    hash12
    it is our 32 43 53 64

    The function shall not get terminated at 32th 43rd 53rd 64th cycles though... It has to be one more than that so that it will be higher.
    > 33 43 53 64
    multiply by 19
    > 627 836 1026 1235

    If you do the calculations with variables instead of values, you shall see that it is just a roundup of the (425 + 200*lvl) to the nearest multiple of 19

  3. #3
    Basic Member
    Join Date
    Dec 2011
    Posts
    11,187
    added to sticky.
    Make sure to read the Forum Rules as well as the stickied Threads of the Forum Section you are posting in.

    Contributions i'd like to highlight:
    My Suggestion: Coaching System
    My Sticky: Intended Changes List
    My Challenge: Completely Fixed Hero Challenge: Skywrath Mage

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •