Раньше было статейка который через триггер запускали перезарядки способности у определённого юнита...

Принятый ответ

- Вы про это?
	function StartAbilityCooldown takes unit whichUnit, integer abilityId, real cd returns boolean
        local integer pAbility = 0
        local integer offset1
        local integer offset2
        local boolean bRes = false
        
        if GetUnitAbilityLevel( whichUnit, abilityId ) == 0 or cd == 0.00 then
            return bRes
        endif
        
        set pAbility = GetUnitAbility( whichUnit, abilityId )
        
        if pAbility < 1 then
            return bRes
        else
            set offset1 = RMem( pAbility + 0x134 )
            set offset2 = RMem( pAbility + 0x138 )
          
            if offset1 > 0 or offset1 < 0 or offset2 > 0 or offset2 < 0 then
                call WMem( pAbility + 0x134, mR2I( cd ) )
                call WMem( pAbility + 0x138, mR2I( 10.00 ) )
                if not InGame then
                    call BJDebugMsg( "Start Cooldown WARNING!" )
                    call BJDebugMsg( "ADRESS-VAL1-VAL2" )
                    call BJDebugMsg( Int2Hex(pAbility)+" - "+Int2Hex(offset1)+" - "+Int2Hex(offset2))
                    call BJDebugMsg( "abil-"+Id2String(abilityId) +" owner-"+ Int2Hex(pAbility)  )
                endif
            endif
            set Memory[pReserverdIntArg1 / 4] = mR2I( cd )
            call CallThisCallWith2Args( pStartAbilityCD, pAbility, pReserverdIntArg1 )
            set bRes =  IsAbilityOnCooldown( whichUnit, abilityId )
            call WMem( pAbility + 0x134, offset1 )
            call WMem( pAbility + 0x138, offset2 )
        endif
        return bRes
    endfunction
0
21
6 лет назад
Отредактирован scopterectus
0
- Вы про это?
	function StartAbilityCooldown takes unit whichUnit, integer abilityId, real cd returns boolean
        local integer pAbility = 0
        local integer offset1
        local integer offset2
        local boolean bRes = false
        
        if GetUnitAbilityLevel( whichUnit, abilityId ) == 0 or cd == 0.00 then
            return bRes
        endif
        
        set pAbility = GetUnitAbility( whichUnit, abilityId )
        
        if pAbility < 1 then
            return bRes
        else
            set offset1 = RMem( pAbility + 0x134 )
            set offset2 = RMem( pAbility + 0x138 )
          
            if offset1 > 0 or offset1 < 0 or offset2 > 0 or offset2 < 0 then
                call WMem( pAbility + 0x134, mR2I( cd ) )
                call WMem( pAbility + 0x138, mR2I( 10.00 ) )
                if not InGame then
                    call BJDebugMsg( "Start Cooldown WARNING!" )
                    call BJDebugMsg( "ADRESS-VAL1-VAL2" )
                    call BJDebugMsg( Int2Hex(pAbility)+" - "+Int2Hex(offset1)+" - "+Int2Hex(offset2))
                    call BJDebugMsg( "abil-"+Id2String(abilityId) +" owner-"+ Int2Hex(pAbility)  )
                endif
            endif
            set Memory[pReserverdIntArg1 / 4] = mR2I( cd )
            call CallThisCallWith2Args( pStartAbilityCD, pAbility, pReserverdIntArg1 )
            set bRes =  IsAbilityOnCooldown( whichUnit, abilityId )
            call WMem( pAbility + 0x134, offset1 )
            call WMem( pAbility + 0x138, offset2 )
        endif
        return bRes
    endfunction
Принятый ответ
0
23
6 лет назад
0
ScopteRectuS, ну мемхак ок сделаю...
Чтобы оставить комментарий, пожалуйста, войдите на сайт.