XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Закрытая тема
 
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
Перевел триггер в код и оптимизировал....
я перевел систему получения урона на джасс и оптимизировал но она перестала работать помогите восстановить
» Вот с оптимизацией:

function Trig_Text_Damage_Conditions takes nothing returns boolean
        return GetEventDamage() >= 1.00 and GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE) > 0
endfunction

function IsUnitAlive takes unit u returns boolean
return GetUnitState(u,UNIT_STATE_LIFE) > 0
endfunction

function Trig_Text_Damage_Actions takes nothing returns nothing
    local real DM=GetEventDamage()
    local unit DU=GetTriggerUnit()
    local real BlockReal=GetEventDamage()
    local unit Blocker=GetTriggerUnit()
    local unit Damager=GetEventDamageSource()
    local effect array e
    local damagetype d
    local real array v
    local texttag t
    local location p = GetUnitLoc(DU)
    local location p1 = GetUnitLoc(Blocker)
    // ----------------------------------------------------------------------------------------------------​
    if (UnitHasBuffBJ(DU, 'B011') == true) then
        call SetUnitState(DU,UNIT_STATE_LIFE,(GetUnitState(DU,UNIT_STATE_LIFE)-25.00))
    endif
    if (UnitHasItemOfTypeBJ(Damager, 'I029') == true) then
        call SetUnitState(Damager,UNIT_STATE_MANA,(GetUnitState(Damager,UNIT_STATE_MANA)+(0.07*BlockReal)))
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarg​et.mdl",Damager,"chest"))
    endif
    if (GetUnitAbilityLevel(Damager,'A02U') > 0) then
        call SetUnitState(Damager,UNIT_STATE_LIFE,(GetUnitState(Damager,UNIT_STATE_LIFE)+((0.05*I2R(GetUnitAbilit​yLevel(Damager,'A02U')))*BlockReal)))
    endif
    if (GetUnitAbilityLevel(Damager,'A05S') > 0) then
        set v[1] =0.10+0.05*GetUnitAbilityLevel(Damager,'A05S')*BlockReal
        set v[2] =0.00+0.05*GetUnitAbilityLevel(Damager,'A05S')*BlockReal
        call SetUnitState(Damager,UNIT_STATE_LIFE,GetUnitState(Damager,UNIT_STATE_LIFE)+v[1])
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarg​et.mdl",Damager,"origin"))
        call SetUnitState(udg_Hero[GetPlayerId(GetOwningPlayer(Damager))+1],UNIT_STATE_LIFE,GetUnitState(udg_Hero​[GetPlayerId(GetOwningPlayer(Damager))+1],UNIT_STATE_LIFE)+v[2])
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarg​et.mdl",udg_Hero[GetPlayerId(GetOwningPlayer(Damager))+1],"origin"))
    endif
    if (GetUnitAbilityLevel(Damager,'A02M') > 0 and GetRandomInt(1,100)<=3*GetUnitAbilityLevel(Damager,'A02M') ) then
        set udg_Idtem_Bonus[GetPlayerId(GetOwningPlayer(Damager))+1] = ( udg_Idtem_Bonus[GetPlayerId(GetOwningPlayer(Damager))+1]+1)
        set e[1] = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl",Dama​ger,"right hand")
        set e[0] = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl",Dama​ger,"left hand")
        call TriggerSleepAction( 12.00 )
        set udg_Idtem_Bonus[GetPlayerId(GetOwningPlayer(Damager))+1] = ( udg_Idtem_Bonus[GetPlayerId(GetOwningPlayer(Damager))+1]-1)
        call DestroyEffect(e[0])
        call DestroyEffect(e[1])
        set e[0] = null
        set e[1] = null
    endif
    if (GetUnitAbilityLevel(DU,'A01Z') > 0 and GetRandomInt(1, 100) <= 3) then
        call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
        call UnitDamageTarget(Blocker,GetEventDamageSource(),BlockReal*I2R(GetUnitAbilityLevel(Blocker,'A01Z')),t​rue,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
        set t = CreateTextTagLocBJ( ( ( "|cffFF9933" + "Return " ) + "" ),p1, 0, 9.00, 25.00, 100.00, 30.00, 0 )
        call SetUnitState(DU,UNIT_STATE_MANA,(GetUnitState(DU,UNIT_STATE_MANA)+7.00))
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt​.mdl",DU,"origin"))
        call SetTextTagVelocity(t,350.00,GetRandomReal(1.00,360.00))
        call SetTextTagPermanent(t,false)
        call SetTextTagLifespan(t,2.00)
        call SetTextTagFadepoint(t,2.50)
        set t = null
    endif
    // ----------------------------------------------------------------------------------------------------​
    if (GetUnitTypeId(DU) != 'H002' or GetUnitTypeId(DU) != 'H00I') then
        if (GetRandomInt(1,100) <= GetHeroAgi(DU,true)/25) then
            call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
            set t = CreateTextTagLocBJ( ( ( "|cffFFFF33" + "Dodge " ) + "" ),p1, 0, 9.00, 25.00, 100.00, 30.00, 0 )
            call SetTextTagVelocity(t,350.00,GetRandomReal(1.00,360.00))
            call SetTextTagPermanent(t,false)
            call SetTextTagLifespan(t,2.00)
            call SetTextTagFadepoint(t,2.50)
            set t = null
    else
        if (UnitHasBuffBJ(DU, 'B008') == false) then
            if (GetRandomInt(1,100) <= GetHeroAgi(DU,true)/15+15) then
            call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
            set t = CreateTextTagLocBJ( ( ( "|cffFFFF33" + "Dodge " ) + "" ),p1, 0, 9.00, 25.00, 100.00, 30.00, 0 )
            call SetTextTagVelocity(t,350.00,GetRandomReal(1.00,360.00))
            call SetTextTagPermanent(t,false)
            call SetTextTagLifespan(t,2.00)
            call SetTextTagFadepoint(t,2.50)
            set t = null
            endif
        else
            if (GetRandomInt(1,100) <= GetHeroAgi(DU,true)/15+65) then
            call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
            set t = CreateTextTagLocBJ( ( ( "|cffFFFF33" + "Dodge " ) + "" ),p1, 0, 9.00, 25.00, 100.00, 30.00, 0 )
            call SetTextTagVelocity(t,350.00,GetRandomReal(1.00,360.00))
            call SetTextTagPermanent(t,false)
            call SetTextTagLifespan(t,2.00)
            call SetTextTagFadepoint(t,2.50)
            set t = null
            endif
        endif
    endif
    if (GetUnitTypeId(DU) == 'H001' and IsUnitAlive(udg_WaterElemental[GetPlayerId(GetOwningPlayer(DU))+1]) == true) then
        call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+(0.50*BlockReal))
        call UnitDamageTarget(Damager,udg_WaterElemental[GetPlayerId(GetOwningPlayer(DU))+1],0.50*BlockReal,false​,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,null)
        set t = CreateTextTagUnitBJ( ( ( udg_Color[GetPlayerId(GetOwningPlayer(Damager))+1] + "-" ) + ( I2S(R2I(( 0.50 *DM))) + "" ) ),DU, 0, 10.50, 100, 100, 100, 0 )
        call SetTextTagVelocity(t, GetRandomReal(-100.00, 100.00), 90.00 )
        call SetTextTagPermanent(t,false)
        call SetTextTagLifespan(t,2.00)
        call SetTextTagFadepoint(t,2.50)
        set t = null
    else
        if (GetUnitAbilityLevel(DU,'A000') > 0 and GetRandomInt(1,100) <= 20+GetUnitAbilityLevel(DU,'A000')/25) then
        call SetUnitState(DU,UNIT_STATE_LIFE,GetUnitState(DU,UNIT_STATE_LIFE)+DM)
        set t = CreateTextTagLocBJ( ( ( "|cffFF0000" + "Block " ) + "" ),p, 0, 9.00, 25.00, 100.00, 30.00, 0 )
        call SetTextTagVelocity(t, 350.00, GetRandomReal(1.00, 360.00) )
        call SetTextTagPermanent(t,false)
        call SetTextTagLifespan(t,2.00)
        call SetTextTagFadepoint(t,2.50)
        set t = null
        else
            if (GetUnitAbilityLevel(DU,'A02Y') > 0) then
                call SetUnitState(DU,UNIT_STATE_LIFE,(GetUnitState(DU,UNIT_STATE_LIFE)+(0.25*BlockReal)))
                call SetUnitState(DU,UNIT_STATE_MANA,(GetUnitState(DU,UNIT_STATE_MANA)+((0.25*BlockReal)*(0.05*I2R(GetUni​tAbilityLevel(DU,'A02Y'))))))
                set t = CreateTextTagUnitBJ(((udg_Color[GetPlayerId(GetOwningPlayer(Damager))+1]+"-")+(I2S(R2I((0.​75*BlockReal)))+"")),DU,0,10.50,100,100,100,0)
                call SetTextTagVelocity(t, GetRandomReal(-100.00, 100.00), 90.00 )
                call SetTextTagPermanent(t,false)
                call SetTextTagLifespan(t,2.00)
                call SetTextTagFadepoint(t,2.50)
                set t = null
            else
                if (UnitHasItemOfTypeBJ(DU, 'I02W') == true ) then
                    if (GetRandomInt(1, 100) <= 20) then
                        call SetUnitState(DU,UNIT_STATE_LIFE,(GetUnitState(DU,UNIT_STATE_LIFE)+20.00))
                        set t = CreateTextTagUnitBJ( ( ( udg_Color[GetPlayerId(GetOwningPlayer(Damager))+1] + "-" ) + ( I2S(R2I((BlockReal - 20.00 ))) + "" ) ),DU, 0, 10.50, 100, 100, 100, 0 )
                        call SetTextTagVelocity(t, GetRandomReal(-100.00, 100.00), 90.00 )
                        call SetTextTagPermanent(t,false)
                        call SetTextTagLifespan(t,2.00)
                        call SetTextTagFadepoint(t,2.50)
                        set t = null
                    endif
                else
                    if UnitHasItemOfTypeBJ(DU, 'I033') then
                        if (GetRandomInt(1, 100) <= 10) then
                        call SetUnitState(DU,UNIT_STATE_LIFE,(GetUnitState(DU,UNIT_STATE_LIFE)+(1.50*BlockReal)))
                        call CreateTextTagUnitBJ( ( "+" + ( I2S(R2I((BlockReal* 0.50 ))) + "" ) ),DU, 0, 10.50, 5.00, 100, 5.00, 0 )
                        call SetTextTagVelocity(t, GetRandomReal(-100.00, 100.00), 90.00 )
                        call SetTextTagPermanent(t,false)
                        call SetTextTagLifespan(t,2.00)
                        call SetTextTagFadepoint(t,2.50)
                        set t = null
                        endif
                    else
                        set t = CreateTextTagUnitBJ( ( ( udg_Color[GetPlayerId(GetOwningPlayer(Damager))+1] + "-" ) + ( I2S(R2I(GetEventDamage())) + "" ) ), GetTriggerUnit(), 0, 10.50, 100, 100, 100, 0.30 )
                        call SetTextTagVelocity(t, GetRandomReal(-100.00, 100.00), 90.00 )
                        call SetTextTagPermanent(t,false)
                        call SetTextTagLifespan(t,2.00)
                        call SetTextTagFadepoint(t,2.50)
                        set t = null
                    endif
                endif
            endif
        endif
    endif
    endif
    set DU = null
    set p = null
    set p1 = null
    set Damager = null
endfunction

//===========================================================================
function InitTrig_Text_Damage_2 takes nothing returns nothing
    set gg_trg_Text_Damage = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Text_Damage, Condition( function Trig_Text_Damage_Conditions ) )
    call TriggerAddAction( gg_trg_Text_Damage, function Trig_Text_Damage_Actions )
endfunction
» Вот без:

function Trig_Text_Damage_Conditions takes nothing returns boolean
    if ( not ( GetEventDamage() >= 1.00 ) ) then
        return false
    endif
    if ( not ( IsUnitDeadBJ(GetTriggerUnit()) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func010C takes nothing returns boolean
    if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B011') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func011C takes nothing returns boolean
    if ( not ( UnitHasItemOfTypeBJ(GetEventDamageSource(), 'I029') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func012C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A02U', GetEventDamageSource()) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func013C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A05S', GetEventDamageSource()) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func014C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A02M', GetEventDamageSource()) > 0 ) ) then
        return false
    endif
    if ( not ( GetRandomInt(1, 100) <= ( 0 + ( 3 * GetUnitAbilityLevelSwapped('A02M', GetEventDamageSource()) ) ) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func015C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A01Z', GetTriggerUnit()) > 0 ) ) then
        return false
    endif
    if ( not ( GetRandomInt(1, 100) <= 3 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func017Func001C takes nothing returns boolean
    if ( ( GetUnitTypeId(GetTriggerUnit()) != 'H002' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetTriggerUnit()) != 'H00I' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Text_Damage_Func017Func002Func001C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 100) <= ( ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetTriggerUnit(), true) / 15 ) + 15 ) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func017Func002Func002C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 100) <= ( ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetTriggerUnit(), true) / 15 ) + 65 ) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func017Func002C takes nothing returns boolean
    if ( not ( UnitHasBuffBJ(GetTriggerUnit(), 'B008') != true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func017Func003C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 100) <= ( GetHeroStatBJ(bj_HEROSTAT_AGI, GetTriggerUnit(), true) / 25 ) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func017C takes nothing returns boolean
    if ( not Trig_Text_Damage_Func017Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018Func001Func001Func001Func001Func001C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 100) <= 10 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018Func001Func001Func001Func001C takes nothing returns boolean
    if ( not ( UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I033') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018Func001Func001Func001Func002C takes nothing returns boolean
    if ( not ( GetRandomInt(1, 100) <= 20 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018Func001Func001Func001C takes nothing returns boolean
    if ( not ( UnitHasItemOfTypeBJ(GetTriggerUnit(), 'I02W') == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018Func001Func001C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A02Y', GetTriggerUnit()) > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018Func001C takes nothing returns boolean
    if ( not ( GetUnitAbilityLevelSwapped('A000', GetTriggerUnit()) == 1 ) ) then
        return false
    endif
    if ( not ( GetRandomInt(1, 100) <= ( 20 + ( GetUnitAbilityLevelSwapped('A000', GetTriggerUnit()) / 25 ) ) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Func018C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H001' ) ) then
        return false
    endif
    if ( not ( IsUnitAliveBJ(udg_WaterElemental[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Text_Damage_Actions takes nothing returns nothing
    // От Сюда
    local real DM=GetEventDamage()
    local unit DU=GetTriggerUnit()
    local real BlockReal=GetEventDamage()
    local unit Blocker=GetTriggerUnit()
    local unit Damager=GetEventDamageSource()
    local effect array e
    local damagetype d
    // ----------------------------------------------------------------------------------------------------​
    if ( Trig_Text_Damage_Func010C() ) then
        call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) - 25.00 ) )
    else
        call DoNothing(  )
    endif
    if ( Trig_Text_Damage_Func011C() ) then
        call SetUnitManaBJ( GetEventDamageSource(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetEventDamageSource()) + ( 0.07 * GetEventDamage() ) ) )
        call AddSpecialEffectTargetUnitBJ( "chest", GetEventDamageSource(), "Abilities\\Spells\\Undead\\ReplenishMana\\SpiritTouchTarget.mdl" )
        call DestroyEffect( GetLastCreatedEffectBJ() )
    else
        call DoNothing(  )
    endif
    if ( Trig_Text_Damage_Func012C() ) then
        call SetUnitLifeBJ( GetEventDamageSource(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetEventDamageSource()) + ( ( 0.05 * I2R(GetUnitAbilityLevelSwapped('A02U', GetEventDamageSource())) ) * GetEventDamage() ) ) )
    else
        call DoNothing(  )
    endif
    if ( Trig_Text_Damage_Func013C() ) then
        set udg_gol[1] = ( ( 0.10 + ( 0.05 * I2R(GetUnitAbilityLevelSwapped('A05S', GetEventDamageSource())) ) ) * GetEventDamage() )
        set udg_gol[2] = ( ( 0.00 + ( 0.05 * I2R(GetUnitAbilityLevelSwapped('A05S', GetEventDamageSource())) ) ) * GetEventDamage() )
        call SetUnitLifeBJ( GetEventDamageSource(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetEventDamageSource()) + udg_gol[1] ) )
        call AddSpecialEffectTargetUnitBJ( "origin", GetEventDamageSource(), "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl" )
        call DestroyEffect( GetLastCreatedEffectBJ() )
        call SetUnitLifeBJ( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))], ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))]) + udg_gol[2] ) )
        call AddSpecialEffectTargetUnitBJ( "origin", udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))], "Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl" )
        call DestroyEffect( GetLastCreatedEffectBJ() )
    else
        call DoNothing(  )
    endif
    if ( Trig_Text_Damage_Func014C() ) then
        set udg_Idtem_Bonus[GetConvertedPlayerId(GetOwningPlayer(                                  (Damager)))] = ( udg_Idtem_Bonus[GetConvertedPlayerId(GetOwningPlayer(                                  (Damager)))] + 1 )
        call AddSpecialEffectTargetUnitBJ( "right hand",                                   (Damager), "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl" )
        set e[1] = GetLastCreatedEffectBJ()
        call AddSpecialEffectTargetUnitBJ( "left hand",                                   (Damager), "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl" )
        set e[0] = GetLastCreatedEffectBJ()
        call TriggerSleepAction( 12.00 )
        set udg_Idtem_Bonus[GetConvertedPlayerId(GetOwningPlayer(                                  (Damager)))] = ( udg_Idtem_Bonus[GetConvertedPlayerId(GetOwningPlayer(                                  (Damager)))] - 1 )
        call DestroyEffect(                           (e[0]) )
        call DestroyEffect(                           (e[1]) )
        set e[0] = null
        set e[1] = null
    else
        call DoNothing(  )
    endif
    if ( Trig_Text_Damage_Func015C() ) then
        call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
        call UnitDamageTarget(Blocker,GetEventDamageSource(),BlockReal*I2R(GetUnitAbilityLevelSwapped('A01Z', Blocker)),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
        call CreateTextTagLocBJ( ( ( "|cffFF9933" + "Return " ) + "" ), GetUnitLoc(Blocker), 0, 9.00, 25.00, 100.00, 30.00, 0 )
        call SetUnitManaBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit()) + 7.00 ) )
        call AddSpecialEffectTargetUnitBJ( "origin", GetTriggerUnit(), "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl" )
        call DestroyEffect( GetLastCreatedEffectBJ() )
        call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 350.00, GetRandomReal(1.00, 360.00) )
        call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
        call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
        call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
    else
        call DoNothing(  )
    endif
    // ----------------------------------------------------------------------------------------------------​
    if ( Trig_Text_Damage_Func017C() ) then
        if ( Trig_Text_Damage_Func017Func003C() ) then
            call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
            call CreateTextTagLocBJ( ( ( "|cffFFFF33" + "Dodge " ) + "" ), GetUnitLoc(Blocker), 0, 9.00, 25.00, 100.00, 30.00, 0 )
            call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 350.00, GetRandomReal(1.00, 360.00) )
            call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
            call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
            call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
        else
            call DoNothing(  )
        endif
    else
        if ( Trig_Text_Damage_Func017Func002C() ) then
            if ( Trig_Text_Damage_Func017Func002Func001C() ) then
                call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
                call CreateTextTagLocBJ( ( ( "|cffFFFF33" + "Dodge " ) + "" ), GetUnitLoc(Blocker), 0, 9.00, 25.00, 100.00, 30.00, 0 )
                call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 350.00, GetRandomReal(1.00, 360.00) )
                call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
                call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
                call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
            else
            endif
        else
            if ( Trig_Text_Damage_Func017Func002Func002C() ) then
                call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+BlockReal)
                call CreateTextTagLocBJ( ( ( "|cffFFFF33" + "Dodge " ) + "" ), GetUnitLoc(Blocker), 0, 9.00, 25.00, 100.00, 30.00, 0 )
                call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 350.00, GetRandomReal(1.00, 360.00) )
                call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
                call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
                call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
            else
            endif
        endif
    endif
    if ( Trig_Text_Damage_Func018C() ) then
        call SetUnitState(Blocker,UNIT_STATE_LIFE,GetUnitState(Blocker,UNIT_STATE_LIFE)+(0.50*BlockReal))
        call UnitDamageTargetBJ( GetEventDamageSource(), udg_WaterElemental[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))], ( 0.50 *                        (BlockReal) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
        call CreateTextTagUnitBJ( ( ( udg_Color[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))] + "-" ) + ( I2S(R2I(( 0.50 * GetEventDamage() ))) + "" ) ), GetTriggerUnit(), 0, 10.50, 100, 100, 100, 0 )
        call SetTextTagVelocityBJ( GetLastCreatedTextTag(), GetRandomReal(-100.00, 100.00), 90.00 )
        call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
        call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
        call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
    else
        if ( Trig_Text_Damage_Func018Func001C() ) then
            call SetUnitState(DU,UNIT_STATE_LIFE,GetUnitState(DU,UNIT_STATE_LIFE)+DM)
            call CreateTextTagLocBJ( ( ( "|cffFF0000" + "Block " ) + "" ), GetUnitLoc(DU), 0, 9.00, 25.00, 100.00, 30.00, 0 )
            call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 350.00, GetRandomReal(1.00, 360.00) )
            call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
            call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
            call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
        else
            if ( Trig_Text_Damage_Func018Func001Func001C() ) then
                call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) + ( 0.25 * GetEventDamage() ) ) )
                call SetUnitManaBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetTriggerUnit()) + ( ( 0.25 * GetEventDamage() ) * ( 0.05 * I2R(GetUnitAbilityLevelSwapped('A02Y', GetTriggerUnit())) ) ) ) )
                call CreateTextTagUnitBJ( ( ( udg_Color[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))] + "-" ) + ( I2S(R2I(( 0.75 * GetEventDamage() ))) + "" ) ), GetTriggerUnit(), 0, 10.50, 100, 100, 100, 0 )
                call SetTextTagVelocityBJ( GetLastCreatedTextTag(), GetRandomReal(-100.00, 100.00), 90.00 )
                call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
                call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
                call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
            else
                if ( Trig_Text_Damage_Func018Func001Func001Func001C() ) then
                    if ( Trig_Text_Damage_Func018Func001Func001Func001Func002C() ) then
                        call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) + 20.00 ) )
                        call CreateTextTagUnitBJ( ( ( udg_Color[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))] + "-" ) + ( I2S(R2I(( GetEventDamage() - 20.00 ))) + "" ) ), GetTriggerUnit(), 0, 10.50, 100, 100, 100, 0 )
                        call SetTextTagVelocityBJ( GetLastCreatedTextTag(), GetRandomReal(-100.00, 100.00), 90.00 )
                        call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
                        call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
                        call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
                    else
                        call DoNothing(  )
                    endif
                else
                    if ( Trig_Text_Damage_Func018Func001Func001Func001Func001C() ) then
                        if ( Trig_Text_Damage_Func018Func001Func001Func001Func001Func001C() ) then
                            call SetUnitLifeBJ( GetTriggerUnit(), ( GetUnitStateSwap(UNIT_STATE_LIFE, GetTriggerUnit()) + ( 1.50 * GetEventDamage() ) ) )
                            call CreateTextTagUnitBJ( ( "+" + ( I2S(R2I(( GetEventDamage() * 0.50 ))) + "" ) ), GetTriggerUnit(), 0, 10.50, 5.00, 100, 5.00, 0 )
                            call SetTextTagVelocityBJ( GetLastCreatedTextTag(), GetRandomReal(-100.00, 100.00), 90.00 )
                            call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
                            call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
                            call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
                        else
                        endif
                    else
                        call CreateTextTagUnitBJ( ( ( udg_Color[GetConvertedPlayerId(GetOwningPlayer(GetEventDamageSource()))] + "-" ) + ( I2S(R2I(GetEventDamage())) + "" ) ), GetTriggerUnit(), 0, 10.50, 100, 100, 100, 0.30 )
                        call SetTextTagVelocityBJ( GetLastCreatedTextTag(), GetRandomReal(-100.00, 100.00), 90.00 )
                        call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
                        call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 2.00 )
                        call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 2.50 )
                    endif
                endif
            endif
            // ----------------------------------------------------------------------------------------------------​
        endif
    endif
    // ----------------------------------------------------------------------------------------------------​
    // ----------------------------------------------------------------------------------------------------​
endfunction

//===========================================================================
function InitTrig_Text_Damage takes nothing returns nothing
    set gg_trg_Text_Damage = CreateTrigger(  )
    call TriggerAddCondition( gg_trg_Text_Damage, Condition( function Trig_Text_Damage_Conditions ) )
    call TriggerAddAction( gg_trg_Text_Damage, function Trig_Text_Damage_Actions )
endfunction
Старый 15.04.2012, 22:26
Hate
конь вакуумный
offline
Опыт: 43,033
Активность:
хм. я бы мог предложить тебе свой код, а ты бы его уже подмял под себя) ибо чето много всякого у тебя тут)
и без оптимизации это = на гуи? тогда лучше уж и гуи показывать)
кстати отладочные сообщения делал?

Отредактировано Hatsume_Hate, 15.04.2012 в 22:36.
Старый 15.04.2012, 22:29
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
Hatsume_Hate, от отладок толку нету т.к. триггер не работает вовсе,ты предлагаешь мне все заного переписывать взяв за основу твою систему?-_- ,это всякое это скилы предметы и т.д
Старый 15.04.2012, 22:59
Hate
конь вакуумный
offline
Опыт: 43,033
Активность:
Vadik29:
Hatsume_Hate, от отладок толку нету т.к. триггер не работает вовсе,ты предлагаешь мне все заного переписывать взяв за основу твою систему?-_-
компилятор на ченить ругается?
ну а че?)
Старый 15.04.2012, 23:00
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
Hatsume_Hate, не не ругается, если бы ругался я бы сюда это не выкладывал...
Старый 15.04.2012, 23:01
Hate
конь вакуумный
offline
Опыт: 43,033
Активность:
а как тригер срабатывает? какое событие?
Старый 15.04.2012, 23:04
Vadik29
Choice Battle 1.6а
offline
Опыт: 15,845
Активность:
Hatsume_Hate, с событием все ок, т.к гуи вариант работало а событие я не трогал
Старый 15.04.2012, 23:06
Hate
конь вакуумный
offline
Опыт: 43,033
Активность:
Vadik29:
Hatsume_Hate, с событием все ок, т.к гуи вариант работало а событие я не трогал
ну так натыкай везде отладки, и посмотри подробно, запускается ли вообще триг.
Старый 15.04.2012, 23:12
Klop
Папа римский
offline
Опыт: 13,006
Активность:
продолжим оптимизацию
((кат Trig_Text_Damage_Conditions
GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE) > 0 //Это ненужно ты мёртвого не удариш
))
((кат (UnitHasBuffBJ(DU, 'B011') == true)
GetUnitAbilityLevel(unit,bId) > 0
))
((кат GetOwningPlayer(Damager)
занести в переменную player зачем постоянно вызывать эту функцию
))
((кат TextTag
Делаем новую функцию создания текстага и передаём нужные параметры, это сократит код и улучшит читаемость
))
И покажи наверно код где ты вызываешь событие
Старый 16.04.2012, 09:42
Nerevar
I'll be back!
offline
Опыт: 18,352
Активность:
Попробуй переписать на основе неоптимизированного варианта,взяв оттуда действия и условия,заного
Возможно что-то упустил в процессе "оптимизации"
Старый 24.04.2012, 19:34
Закрытая тема

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 17:33.