Триггер на воскрешение крипов - Форум


Правила форума ·

  • Страница 1 из 1
  • 1
Форум » Warcraft III » Триггеры и Jass » Триггер на воскрешение крипов (Не пашет)
Триггер на воскрешение крипов

FatalBlade

#1
Вот триггер:
Code

function Trig_Creeps_Conditions takes nothing returns boolean
      if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
          return false
      endif
      if ( GetDyingUnit() == gg_unit_h03E_0015 ) then
          return false
      endif
      if ( GetDyingUnit() == gg_unit_h03F_0014 ) then
          return false
      endif
      return true
endfunction

function Trig_Creeps_Actions takes nothing returns nothing
      local integer i = 1
      local integer CreepIndex = 0
      local location CreepLoc
      local integer UT = GetUnitTypeId(GetDyingUnit())
      loop
          exitwhen i > 26
          if (( IsUnitInGroup(GetDyingUnit(), udg_CreepUnits[i]) == true ) ) then
              set CreepIndex = i
          endif
          set i = i + 1
      endloop

      if ( CreepIndex == 0 ) then
          return
      endif

      call GroupRemoveUnitSimple( GetDyingUnit(), udg_CreepUnits[CreepIndex] )
      call TriggerSleepAction( 30.00 )
      set CreepLoc = GetRectCenter(udg_CreepsRegions[CreepIndex])
      call CreateNUnitsAtLoc( 1, UT, Player(PLAYER_NEUTRAL_AGGRESSIVE), CreepLoc, bj_UNIT_FACING )
      call GroupAddUnitSimple( GetLastCreatedUnit(), udg_CreepUnits[CreepIndex] )
      call RemoveLocation(CreepLoc)
      set UT = 0
endfunction

//===========================================================================
function InitTrig_Creeps takes nothing returns nothing
      set gg_trg_Creeps = CreateTrigger(  )
      call TriggerRegisterAnyUnitEventBJ( gg_trg_Creeps, EVENT_PLAYER_UNIT_DEATH )
      call TriggerAddCondition( gg_trg_Creeps, Condition( function Trig_Creeps_Conditions ) )
      call TriggerAddAction( gg_trg_Creeps, function Trig_Creeps_Actions )
endfunction  


Он воскрешает убитых крипов на их первоначальной локации. Тут присутствуют массивы - это группы юнитов и области в которых созданны юниты. Т.е. должен вокрешать. Но он почему то не работает. Прошу помоши у джассеров, помогите разобраться в чём проблема. Код простой, не трудно прочитать.
Форум » Warcraft III » Триггеры и Jass » Триггер на воскрешение крипов (Не пашет)
  • Страница 1 из 1
  • 1
Поиск: