Добавлен MATRITSA
call GroupAddUnit(LoadGroupHandle(HashGroupUnit,0,TaimerID),GetFilterUnit())
Принятый ответ
function GroupDamag takes nothing returns nothing
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local integer SpellID = LoadInteger(AbilityID,0,TaimerID)
local unit HeroUnit = LoadUnitHandle(HashUnit,0, TaimerID)
call DisplayTextToForce( GetPlayersAll(), ("oooo") )
if(SpellID == 'A020') or (SpellID == 'A021') or (SpellID == 'A022') or (SpellID == 'A023') or (SpellID == 'A024') or (SpellID == 'A025') or (SpellID == 'A026') or (SpellID == 'A01Z') or (SpellID == 'A01X'){
local integer Damag = LoadInteger(HashDamag,0,TaimerID)
call UnitDamageTargetBJ( HeroUnit, GetEnumUnit(),Damag , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
}
if(SpellID == 'A013') and (IsUnitInGroup(GetEnumUnit(), LoadGroupHandle(HashGroupUnit,0,TaimerID))){
local real Damag = LoadReal(HashDamag,0,TaimerID)
call UnitDamageTargetBJ( HeroUnit, GetEnumUnit(),44 , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
}
set HeroUnit = null
set Taimer = null
endfunction
function Vrag takes nothing returns boolean
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local integer SpellID = LoadInteger(AbilityID,0,TaimerID)
if(SpellID == 'A013') and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID))) {
call GroupAddUnit(LoadGroupHandle(HashGroupUnit,0,TaimerID),GetFilterUnit())
call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(LoadGroupHandle(HashGroupUnit,0, TaimerID))) )
}
set Taimer = null
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID)))
endfunction
function DankoCODE takes nothing returns nothing
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local unit HeroUnit = LoadUnitHandle(HashUnit,0, TaimerID)
local integer Proverka = LoadInteger(IDproverka,0, TaimerID)
local integer TaimerINT = LoadInteger(IntegerTaimer,0, TaimerID)
if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false{
RemoveUnit(GetEnumUnit())
}
if Proverka == 0{
local location LocHeroUnit = GetUnitLoc(GetEnumUnit())
local unit Damy = CreateUnitAtLoc(GetOwningPlayer(HeroUnit) ,'h01Q' , LocHeroUnit, 0)
call SetUnitInvulnerable( HeroUnit, true )
call SetUnitTimeScalePercent( Damy, 25.00 )
call UnitApplyTimedLifeBJ( 1.30, 'BTLF', Damy )
call PlaySoundBJ(gg_snd_DankoAizen)
call RemoveLocation(LocHeroUnit)
call SaveInteger(IDproverka,0, TaimerID, 1)
set Damy = null
set LocHeroUnit = null
}
set HeroUnit = null
set Taimer = null
endfunction
function StartTaimer takes nothing returns nothing
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local unit HeroUnit = LoadUnitHandle(HashUnit,0, TaimerID)
local integer TaimerINT = LoadInteger(IntegerTaimer,0, TaimerID)
local integer SpellID = LoadInteger(AbilityID,0,TaimerID)
local integer i = 0
local integer iend = 0
local group GroupEnumyUnit = CreateGroup()
//данко айзена
if(SpellID == 'A00F') {
local location LocHeroUnit = GetUnitLoc(HeroUnit)
local integer Proverka = LoadInteger(IDproverka,0, TaimerID)
call GroupEnumUnitsInRangeOfLoc(GroupEnumyUnit, LocHeroUnit, 500.00, function Vrag)
call ForGroup(GroupEnumyUnit, function DankoCODE)
call RemoveLocation(LocHeroUnit)
if Proverka == 1 and TaimerINT == 1 {
call SetUnitInvulnerable( HeroUnit, false )
}
set LocHeroUnit = null
}
//Банкай Бякуя
if(SpellID == 'A01W') {
local unit AuraBjakuja = LoadUnitHandle(HashUnit ,18, TaimerID)
local location AuraBjakujaLoc = GetUnitLoc(HeroUnit)
call SetUnitPositionLoc(AuraBjakuja,AuraBjakujaLoc)
call RemoveLocation(AuraBjakujaLoc)
set i = 1
if TaimerINT >= 900{
loop
local unit Sword = LoadUnitHandle(HashUnit ,i, TaimerID)
call SetUnitFlyHeight( Sword, 500.00, 1000.00 )
if TaimerINT == 900{
local location SwordLoc = GetUnitLoc(Sword)
call RemoveUnit(Sword)
local unit Senbonzakura = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h00E',SwordLoc,0)
call SaveUnitHandle(HashUnit ,i,TaimerID,Senbonzakura)
call SetUnitUserData(Senbonzakura,i)
call RemoveLocation(SwordLoc)
set SwordLoc = null
}
set Sword = null
set i =i+1
exitwhen i >= 17
endloop
if TaimerINT == 1000{
call SetUnitFacing(HeroUnit,GetUnitFacing(HeroUnit))
}
set i = 1
if TaimerINT == 900{
call SetUnitInvulnerable( HeroUnit, false )
call PauseUnitBJ( false, HeroUnit)
call UnitAddAbility(HeroUnit,'A01Y')
}
}
if TaimerINT <= 900{
loop
i=i+1
exitwhen i>= 17
if IsUnitDeadBJ(LoadUnitHandle(HashUnit ,i, TaimerID)) == true {
local location HeroUnitLoc = GetUnitLoc(HeroUnit)
local unit Senbonzakura = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h00E',HeroUnitLoc,0)
call SetUnitUserData(Senbonzakura,i)
call SaveUnitHandle(HashUnit ,i, TaimerID,Senbonzakura)
call RemoveLocation(HeroUnitLoc)
set HeroUnitLoc = null
set Senbonzakura = null
}
endloop
}
if TaimerINT == 1{
set i = 1
loop
local unit Senbonzakura = LoadUnitHandle(HashUnit ,i, TaimerID)
call RemoveUnit(Senbonzakura)
set Senbonzakura = null
i=i+1
exitwhen i>= 18
endloop
call RemoveUnit(AuraBjakuja)
call UnitRemoveAbility(HeroUnit,'A01Y')
}
set AuraBjakujaLoc = null
set AuraBjakuja = null
}
//Контроль Сенбонзакура
if(SpellID == 'A020'){
set i = 1
set iend = 2
}
if(SpellID == 'A021'){
set i = 3
set iend = 4
}
if(SpellID == 'A023'){
set i = 5
set iend = 6
}
if(SpellID == 'A024'){
set i = 7
set iend = 8
}
if(SpellID == 'A025'){
set i = 9
set iend = 10
}
if(SpellID == 'A026'){
set i = 11
set iend = 12
}
if(SpellID == 'A01Z'){
set i = 13
set iend = 14
}
if(SpellID == 'A01X'){
set i = 15
set iend = 16
}
if(SpellID == 'A022'){
set i = 17
set iend = 18
}
if(SpellID == 'A020') or (SpellID == 'A021') or (SpellID == 'A022') or (SpellID == 'A023') or (SpellID == 'A024') or (SpellID == 'A025') or (SpellID == 'A026') or (SpellID == 'A01Z') or (SpellID == 'A01X') {
loop
local unit Senbonzakura = LoadUnitHandle(HashUnit,i,TaimerID)
local location SenbonzakuraLoc = GetUnitLoc(Senbonzakura)
local location SenbonzakuraPolar = PolarProjectionBJ(SenbonzakuraLoc,10.50,GetUnitFacing(Senbonzakura))
call SetUnitPositionLoc (Senbonzakura, SenbonzakuraPolar)
call GroupEnumUnitsInRangeOfLoc(GroupEnumyUnit,SenbonzakuraLoc,100.00,function Vrag )
call ForGroup(GroupEnumyUnit,function GroupDamag)
call RemoveLocation(SenbonzakuraLoc)
call RemoveLocation(SenbonzakuraPolar)
set Senbonzakura = null
set SenbonzakuraLoc = null
set SenbonzakuraPolar = null
exitwhen i == iend
i =i+1
endloop
}
//бараган Распира
if(SpellID == 'A013'){
local unit Raspira = LoadUnitHandle(HashUnit ,1, udg_TaimerID)
local location RaspiraLoc =GetUnitLoc(Raspira)
call GroupEnumUnitsInRangeOfLoc(GroupEnumyUnit,RaspiraLoc,460.00,function Vrag )
call ForGroup(LoadGroupHandle(HashGroupUnit,0,TaimerID),function GroupDamag)
call RemoveLocation(RaspiraLoc)
set Raspira = null
set RaspiraLoc = null
}
set TaimerINT = TaimerINT - 1
call SaveInteger(IntegerTaimer,0, TaimerID, TaimerINT)
if TaimerINT == 0{
DestroyTimer(Taimer)
}
call DestroyGroup(GroupEnumyUnit)
set GroupEnumyUnit = null
set HeroUnit = null
set Taimer = null
endfunction
function Trig_SPELL_KRAFT_Actions takes nothing returns nothing
local unit HeroUnit =GetTriggerUnit()
if (GetSpellAbilityUnit() == HeroUnit){
local timer t = CreateTimer()
set udg_TaimerID = GetHandleId(t) Вот айди таймера
local integer IntegerTaim = 0
local integer SpellID = GetSpellAbilityId()
local location HeroLoc = GetUnitLoc(HeroUnit)
local group GroupUnit = CreateGroup() Вот создаю групу
//данко айзена
if(SpellID == 'A00F') {
set IntegerTaim = 70
local effect Effeckt = AddSpecialEffectTarget("Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl",HeroUnit,"chest")
call DestroyEffect(Effeckt)
set Effeckt = null
}
//банкай Бякуя
if(SpellID == 'A01W') {
call SetUnitInvulnerable( HeroUnit, true )
call PlaySoundBJ( gg_snd_1014_bankai_senbonza )
call PauseUnitBJ( true, HeroUnit)
set IntegerTaim = 1000
local integer i = 3
local real angleHero = GetUnitFacing(HeroUnit) - 90.00
local real angleSword0 = angleHero - 110.00
local location HeroLocP = PolarProjectionBJ(HeroLoc, 300, angleHero)
local unit Sword1 = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h01I', HeroLocP, angleSword0 )
call SaveUnitHandle(HashUnit ,1, udg_TaimerID, Sword1)
call RemoveLocation(HeroLocP)
set angleHero = GetUnitFacing(HeroUnit) + 90.00
local real angleSword1 = angleHero + 110.00
set HeroLocP = PolarProjectionBJ(HeroLoc, 300, angleHero)
local unit Sword0 = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h01I', HeroLocP, angleSword1 )
call SaveUnitHandle(HashUnit ,2, udg_TaimerID, Sword0)
local unit AuraBjakuja = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h014',HeroLoc,0)
call SaveUnitHandle(HashUnit ,18, udg_TaimerID,AuraBjakuja)
set AuraBjakuja = null
call RemoveLocation(HeroLocP)
local location PointSword3 = GetUnitLoc(Sword0)
local location PointSword4 = GetUnitLoc(Sword1)
loop
exitwhen i >= 17
local real Range = LoadReal(HashRange ,0, udg_TaimerID)
set Range = Range + 100
call SaveReal(HashRange ,0, udg_TaimerID ,Range)
local location UnitLocSwordP = PolarProjectionBJ(PointSword3, Range, angleSword0)
local unit Sword3 = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h01I', UnitLocSwordP, angleSword0 )
call SaveUnitHandle(HashUnit ,i, udg_TaimerID, Sword3)
call RemoveLocation(UnitLocSwordP)
set Sword3 = null
set UnitLocSwordP = PolarProjectionBJ(PointSword4, Range, angleSword1)
local unit Sword4 = CreateUnitAtLoc(GetOwningPlayer(HeroUnit),'h01I', UnitLocSwordP, angleSword1 )
set i = i+1
call SaveUnitHandle(HashUnit ,i, udg_TaimerID, Sword4)
call RemoveLocation(UnitLocSwordP)
set Sword4 = null
set UnitLocSwordP = null
set i = i+1
endloop
call RemoveLocation(PointSword4)
call RemoveLocation(PointSword3)
set HeroLocP = null
set PointSword4 = null
set PointSword3 = null
set Sword1 = null
set Sword0 = null
call SaveReal(HashRange ,0, udg_TaimerID ,0)
}
//банкай Контроль
if(SpellID == 'A020') or (SpellID == 'A021') or (SpellID == 'A022') or (SpellID == 'A023') or (SpellID == 'A024') or (SpellID == 'A025') or (SpellID == 'A026') or (SpellID == 'A01Z') or (SpellID == 'A01X'){
call SaveLocationHandle(SpellLoc,0,udg_TaimerID,GetSpellTargetLoc())
set IntegerTaim = 1000
local integer Damag = GetHeroStr(HeroUnit,true)
call SaveInteger(HashDamag,0,udg_TaimerID,Damag)
local group SenbonzakuraGroup = CreateGroup()
call GroupEnumUnitsOfPlayer(SenbonzakuraGroup,GetTriggerPlayer(),function UnitDeteckt)
call DestroyGroup(SenbonzakuraGroup)
set SenbonzakuraGroup = null
}
//бараган Регенерацыя
if(SpellID == 'A01l'){
}
//бараган Распира
if(SpellID == 'A013'){
call PlaySoundFromOffsetBJ( gg_snd_Baragan_SozdatiRaspiru, 100, 1.70 )
set IntegerTaim = 3000
local real Damag = GetUnitState(GetEnumUnit(),UNIT_STATE_LIFE) * 0.02
call SaveReal(HashDamag,0,udg_TaimerID,Damag)
local unit Raspira = CreateUnitAtLoc(GetTriggerPlayer(),'h00K',HeroLoc,0)
call SaveUnitHandle(HashUnit ,1, udg_TaimerID, Raspira)
set Raspira = null
}
call SaveInteger(AbilityID ,0, udg_TaimerID,SpellID)
call SaveUnitHandle(HashUnit ,0, udg_TaimerID, HeroUnit)
call SaveInteger(IntegerTaimer,0, udg_TaimerID, IntegerTaim)
call SaveInteger(IDproverka,0, udg_TaimerID, 0)
call SaveGroupHandle(HashGroupUnit,0, udg_TaimerID, GroupUnit) Вот сохраняю
call TimerStart(t, 0.02, true, function StartTaimer)
call SaveTimerHandle(Taimer,0,udg_TaimerID,t)
call RemoveLocation(HeroLoc)
call DestroyGroup(GroupUnit)
set Taimer = null
set HeroLoc = null
set GroupUnit = null
}
set HeroUnit = null
endfunction
//===========================================================================
function InitTrig_SPELL_KRAFT takes nothing returns nothing
set gg_trg_SPELL_KRAFT = CreateTrigger( )
call TriggerAddAction( gg_trg_SPELL_KRAFT, function Trig_SPELL_KRAFT_Actions )
endfunction
У меня тут есить всё необходимое но почемуто в месенжере пишыт что количество юнитов в отряде = 0
function Vrag takes nothing returns boolean
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local integer SpellID = LoadInteger(AbilityID,0,TaimerID)
if(SpellID == 'A013') and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID))) {
call GroupAddUnit(LoadGroupHandle(HashGroupUnit,0,TaimerID),GetFilterUnit())
call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(LoadGroupHandle(HashGroupUnit,0, TaimerID))) )
}
set Taimer = null
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID)))
endfunction
Я понел в чом проблема Я удалял групу зря я думал сейф мне создаст новую глобалиную групу
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local integer SpellID = LoadInteger(AbilityID,0,TaimerID)
if(SpellID == 'A013') and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID))) {
call GroupAddUnit(LoadGroupHandle(HashGroupUnit,0,TaimerID),GetFilterUnit())
call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(LoadGroupHandle(HashGroupUnit,0, TaimerID))) )
}
set Taimer = null
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID)))
endfunction
Я понел в чом проблема Я удалял групу зря я думал сейф мне создаст новую глобалиную групу
`
ОЖИДАНИЕ РЕКЛАМЫ...
Чтобы оставить комментарий, пожалуйста, войдите на сайт.
Отредактирован Пушистый
call GroupAddUnit(LoadGroupHandle(HashGroupUnit,0,TaimerID),GetFilterUnit())
call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(LoadGroupHandle(HashGroupUnit,0,TaimerID) )))
тест выдаёть мне что в отряди 0 юнитов
Месенжером проверял Работу команды всё работает норм
Отредактирован Волчачка
слуш а что даёть эта функцыя Filter
Отредактирован nvc123
т.е. просто писать GroupEnumUnitsInRangeOfLoc(GroupEnumyUnit,RaspiraLoc,500.00,function Vrag)
и вместо точек лучше использовать координаты
и GroupEnumUnitsInRangeOfLoc принимает boolexpr который кэшируется
так что удалять фильтр не нужно
MATRITSA,
скорее всего в таблице нету группы
либо нету самой таблицы
либо TaimerID не определён
Bergi_Bear, судя по тому что он не знает ни русского ни английского он просто школьник
Отредактирован MATRITSA
local timer Taimer = GetExpiredTimer()
local integer TaimerID = GetHandleId(Taimer)
local integer SpellID = LoadInteger(AbilityID,0,TaimerID)
if(SpellID == 'A013') and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID))) {
call GroupAddUnit(LoadGroupHandle(HashGroupUnit,0,TaimerID),GetFilterUnit())
call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(LoadGroupHandle(HashGroupUnit,0, TaimerID))) )
}
set Taimer = null
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(LoadUnitHandle(HashUnit,0, TaimerID)))
endfunction
Я понел в чом проблема Я удалял групу зря я думал сейф мне создаст новую глобалиную групу