- Joined
- Oct 29, 2012
- Messages
- 1,474
I got some triggers which are originally GUI , But converted into JASS . I want them GUI again but I suck at JASS . What mistakes have I done while converting ? Because it seems they never work fine as the originals do :/
+ 2 reps / + Credits
NOTE : IN THE SECOND TRIGGERS COWS AND RABBITS INCLUDED , NVM ABOUT THEM , THEY ARE SIMULIAR TO SHEEPS , CHICKENS AND PIGS!
PLEASE SEE THE OTHER CATEGORIES IN OTHER POST
+ 2 reps / + Credits
NOTE : IN THE SECOND TRIGGERS COWS AND RABBITS INCLUDED , NVM ABOUT THEM , THEY ARE SIMULIAR TO SHEEPS , CHICKENS AND PIGS!
PLEASE SEE THE OTHER CATEGORIES IN OTHER POST
JASS:
function Trig_Spawned_Animals_and_mercs_Func001Func002Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTrainedUnit()) == 'opeo' ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func001Func010001 takes nothing returns boolean
return ( udg_TempInteger == 7 )
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func001Func011C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_MercAttackGroup) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func001C takes nothing returns boolean
if ( not ( GetPlayerState(Player(PLAYER_NEUTRAL_AGGRESSIVE), PLAYER_STATE_RESOURCE_FOOD_USED) < 60 ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func005001 takes nothing returns boolean
return ( udg_TempInteger == 7 )
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func006C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_MercAttackGroup) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001C takes nothing returns boolean
if ( not ( GetPlayerState(Player(10), PLAYER_STATE_RESOURCE_FOOD_USED) < 50 ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func005001 takes nothing returns boolean
return ( udg_TempInteger == 7 )
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func006C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_MercAttackGroup) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002Func007C takes nothing returns boolean
if ( not ( GetPlayerState(Player(9), PLAYER_STATE_RESOURCE_FOOD_USED) < 50 ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTrainedUnit()) == 'h008' ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func003Func002C takes nothing returns boolean
if ( not ( udg_TempUnit == null ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func003C takes nothing returns boolean
if ( not ( udg_AniCount[udg_TempInteger] < udg_AnimalsMaximum ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func001Func003Func002C takes nothing returns boolean
if ( not ( udg_TempUnit == null ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func001Func003C takes nothing returns boolean
if ( not ( udg_AniCount[udg_TempInteger] < udg_AnimalsMaximum ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTrainedUnit()) == 'npig' ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func004Func002C takes nothing returns boolean
if ( not ( udg_TempUnit == null ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func004C takes nothing returns boolean
if ( not ( udg_AniCount[udg_TempInteger] < udg_AnimalsMaximum ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTrainedUnit()) == 'nshe' ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001Func008C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTrainedUnit()) == 'nech' ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetTrainedUnit(), UNIT_TYPE_UNDEAD) == true ) ) then
return false
endif
return true
endfunction
function Trig_Spawned_Animals_and_mercs_Actions takes nothing returns nothing
if ( Trig_Spawned_Animals_and_mercs_Func001C() ) then
set udg_TempPoint = GetUnitRallyPoint(GetTriggerUnit())
set udg_TempPoint1 = GetUnitLoc(GetTriggerUnit())
set udg_TempPoint2 = PolarProjectionBJ(udg_TempPoint1, 64.00, AngleBetweenPoints(udg_TempPoint1, udg_TempPoint))
set udg_TempInteger = GetConvertedPlayerId(GetOwningPlayer(GetTrainedUnit()))
set udg_TempPlayer = GetOwningPlayer(GetTriggerUnit())
if ( Trig_Spawned_Animals_and_mercs_Func001Func008C() ) then
call IssueTrainOrderByIdBJ( GetTriggerUnit(), 'nech' )
call RemoveUnit( GetTrainedUnit() )
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func003C() ) then
call CreateNUnitsAtLoc( 1, 'nech', Player(bj_PLAYER_NEUTRAL_VICTIM), udg_TempPoint2, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_AniChicks[udg_TempInteger] )
set udg_AniCount[udg_TempInteger] = ( udg_AniCount[udg_TempInteger] + 1 )
call SetUnitPositionLoc( GetLastCreatedUnit(), udg_TempPoint2 )
call SetUnitUserData( GetLastCreatedUnit(), udg_TempInteger )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", udg_TempPoint )
else
set udg_TempUnit = GroupPickRandomUnit(udg_AniChicks[udg_TempInteger])
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func003Func002C() ) then
else
set udg_TempPoint3 = GetUnitLoc(udg_TempUnit)
call GroupRemoveUnitSimple( udg_TempUnit, udg_AniChicks[udg_TempInteger] )
call RemoveUnit( udg_TempUnit )
call CreateNUnitsAtLoc( 1, 'n00E', Player(bj_PLAYER_NEUTRAL_VICTIM), udg_TempPoint3, bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), udg_TempInteger )
call CreateNUnitsAtLoc( 1, 'h00F', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint3, bj_UNIT_FACING )
call SetUnitScalePercent( GetLastCreatedUnit(), 30.00, 30.00, 30.00 )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', GetLastCreatedUnit() )
endif
endif
else
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func004C() ) then
call IssueTrainOrderByIdBJ( GetTriggerUnit(), 'nshe' )
call RemoveUnit( GetTrainedUnit() )
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func004C() ) then
call CreateNUnitsAtLoc( 1, 'nshe', Player(bj_PLAYER_NEUTRAL_VICTIM), udg_TempPoint2, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_AniSheep[udg_TempInteger] )
set udg_AniCount[udg_TempInteger] = ( udg_AniCount[udg_TempInteger] + 1 )
call SetUnitPositionLoc( GetLastCreatedUnit(), udg_TempPoint2 )
call SetUnitUserData( GetLastCreatedUnit(), udg_TempInteger )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", udg_TempPoint )
else
set udg_TempUnit = GroupPickRandomUnit(udg_AniSheep[udg_TempInteger])
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func004Func002C() ) then
else
set udg_TempPoint3 = GetUnitLoc(udg_TempUnit)
call GroupRemoveUnitSimple( udg_TempUnit, udg_AniSheep[udg_TempInteger] )
call RemoveUnit( udg_TempUnit )
call CreateNUnitsAtLoc( 1, 'n00F', Player(bj_PLAYER_NEUTRAL_VICTIM), udg_TempPoint3, bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), udg_TempInteger )
call CreateNUnitsAtLoc( 1, 'h00F', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint3, bj_UNIT_FACING )
call SetUnitScalePercent( GetLastCreatedUnit(), 30.00, 30.00, 30.00 )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', GetLastCreatedUnit() )
endif
endif
else
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func001C() ) then
call IssueTrainOrderByIdBJ( GetTriggerUnit(), 'npig' )
call RemoveUnit( GetTrainedUnit() )
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func001Func003C() ) then
call CreateNUnitsAtLoc( 1, 'npig', Player(bj_PLAYER_NEUTRAL_VICTIM), udg_TempPoint2, bj_UNIT_FACING )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_AniPigs[udg_TempInteger] )
set udg_AniCount[udg_TempInteger] = ( udg_AniCount[udg_TempInteger] + 1 )
call SetUnitPositionLoc( GetLastCreatedUnit(), udg_TempPoint2 )
call SetUnitUserData( GetLastCreatedUnit(), udg_TempInteger )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", udg_TempPoint )
else
set udg_TempUnit = GroupPickRandomUnit(udg_AniPigs[udg_TempInteger])
if ( Trig_Spawned_Animals_and_mercs_Func001Func008Func004Func001Func003Func002C() ) then
else
set udg_TempPoint3 = GetUnitLoc(udg_TempUnit)
call GroupRemoveUnitSimple( udg_TempUnit, udg_AniPigs[udg_TempInteger] )
call RemoveUnit( udg_TempUnit )
call CreateNUnitsAtLoc( 1, 'n00G', Player(bj_PLAYER_NEUTRAL_VICTIM), udg_TempPoint3, bj_UNIT_FACING )
call SetUnitUserData( GetLastCreatedUnit(), udg_TempInteger )
call CreateNUnitsAtLoc( 1, 'h00F', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint3, bj_UNIT_FACING )
call SetUnitScalePercent( GetLastCreatedUnit(), 30.00, 30.00, 30.00 )
call UnitApplyTimedLifeBJ( 1.50, 'BTLF', GetLastCreatedUnit() )
endif
endif
else
endif
endif
endif
call UnitAddAbilityBJ( 'Aeth', GetLastCreatedUnit() )
call RemoveLocation(udg_TempPoint)
call RemoveLocation(udg_TempPoint1)
call RemoveLocation(udg_TempPoint2)
else
set udg_TempPlayer = GetOwningPlayer(GetTrainedUnit())
if ( Trig_Spawned_Animals_and_mercs_Func001Func002C() ) then
call RemoveUnit( GetTrainedUnit() )
call IssueTrainOrderByIdBJ( GetTriggerUnit(), 'h008' )
set udg_TempPoint2 = GetRandomLocInRect(udg_revRect[GetRandomInt(1, 30)])
// toto ma ostat ake je (jednotky)
set udg_TempInteger = GetRandomInt(1, 14)
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007C() ) then
call CreateNUnitsAtLoc( 1, udg_mercType[udg_TempInteger], Player(9), udg_TempPoint2, bj_UNIT_FACING )
call SetUnitColor( GetLastCreatedUnit(), GetPlayerColor(udg_TempPlayer) )
call RemoveGuardPosition( GetLastCreatedUnit() )
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func005001() ) then
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Trappers )
else
call DoNothing( )
endif
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func006C() ) then
else
set udg_TempInt = GetRandomInt(1, 18)
set udg_TempPoint1 = GetRandomLocInRect(udg_wayRect[udg_TempInt])
call SetUnitAbilityLevelSwapped( 'A00G', GetLastCreatedUnit(), udg_TempInt )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", udg_TempPoint1 )
call CreateNUnitsAtLoc( 1, 'h009', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint2, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
endif
else
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001C() ) then
call CreateNUnitsAtLoc( 1, udg_mercType[udg_TempInteger], Player(10), udg_TempPoint2, bj_UNIT_FACING )
call SetUnitColor( GetLastCreatedUnit(), GetPlayerColor(udg_TempPlayer) )
call RemoveGuardPosition( GetLastCreatedUnit() )
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func005001() ) then
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Trappers )
else
call DoNothing( )
endif
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func006C() ) then
else
set udg_TempInt = GetRandomInt(1, 18)
set udg_TempPoint1 = GetRandomLocInRect(udg_wayRect[udg_TempInt])
call SetUnitAbilityLevelSwapped( 'A00G', GetLastCreatedUnit(), udg_TempInt )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", udg_TempPoint1 )
call CreateNUnitsAtLoc( 1, 'h009', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint2, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
endif
else
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func001C() ) then
call CreateNUnitsAtLoc( 1, 'h000', Player(10), udg_TempPoint2, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'Afae', GetLastCreatedUnit() )
set udg_TempUnit = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, udg_mercType[udg_TempInteger], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_TempPoint2, bj_UNIT_FACING )
call SetUnitColor( GetLastCreatedUnit(), GetPlayerColor(udg_TempPlayer) )
call IssueTargetOrderBJ( udg_TempUnit, "faeriefire", GetLastCreatedUnit() )
call RemoveGuardPosition( GetLastCreatedUnit() )
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func001Func010001() ) then
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Trappers )
else
call DoNothing( )
endif
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func007Func001Func001Func011C() ) then
else
set udg_TempInt = GetRandomInt(1, 18)
set udg_TempPoint1 = GetRandomLocInRect(udg_wayRect[udg_TempInt])
call SetUnitAbilityLevelSwapped( 'A00G', GetLastCreatedUnit(), udg_TempInt )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", udg_TempPoint1 )
call CreateNUnitsAtLoc( 1, 'h009', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint2, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
endif
else
call QuestMessageBJ( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), bj_QUESTMESSAGE_UNITACQUIRED, "TRIGSTR_628" )
endif
endif
endif
call RemoveLocation (udg_TempPoint1)
call RemoveLocation (udg_TempPoint2)
else
if ( Trig_Spawned_Animals_and_mercs_Func001Func002Func001C() ) then
set udg_TempPoint = GetUnitRallyPoint(GetTriggerUnit())
set udg_TempPoint1 = GetUnitLoc(GetTriggerUnit())
set udg_TempPoint2 = PolarProjectionBJ(udg_TempPoint1, 64.00, AngleBetweenPoints(udg_TempPoint1, udg_TempPoint))
call RemoveUnit( GetTrainedUnit() )
call CreateNUnitsAtLoc( 1, 'opeo', GetOwningPlayer(GetTriggerUnit()), udg_TempPoint2, bj_UNIT_FACING )
call RemoveLocation(udg_TempPoint)
call RemoveLocation(udg_TempPoint1)
call RemoveLocation(udg_TempPoint2)
else
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_Spawned_Animals_and_mercs takes nothing returns nothing
set gg_trg_Spawned_Animals_and_mercs = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spawned_Animals_and_mercs, EVENT_PLAYER_UNIT_TRAIN_FINISH )
call TriggerAddAction( gg_trg_Spawned_Animals_and_mercs, function Trig_Spawned_Animals_and_mercs_Actions )
endfunction
-
Spawned Animals and mercs
-
Events
- Unit - A unit Finishes training a unit
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Unit-type of (Trained unit)) is Undead) Equal to True
-
Then - Actions
- Set TempPoint = (Rally-Point of (Triggering unit) as a point)
- Set TempPoint1 = (Position of (Triggering unit))
- Set TempPoint2 = (TempPoint1 offset by 64.00 towards (Angle from TempPoint1 to TempPoint) degrees)
- Set TempInteger = (Player number of (Owner of (Trained unit)))
- Set TempPlayer = (Owner of (Triggering unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Chicken
-
Then - Actions
- Unit - Order (Triggering unit) to train/upgrade to a Chicken
- Unit - Remove (Trained unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AniCount[TempInteger] Less than AnimalsMaximum
-
Then - Actions
- Unit - Create 1 Chicken for Neutral Victim at TempPoint2 facing Default building facing degrees
- Unit Group - Add (Last created unit) to AniChicks[TempInteger]
- Set AniCount[TempInteger] = (AniCount[TempInteger] + 1)
- Unit - Move (Last created unit) instantly to TempPoint2
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Order (Last created unit) to Move To TempPoint
-
Else - Actions
- Set TempUnit = (Random unit from AniChicks[TempInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempUnit Equal to No unit
- Then - Actions
-
Else - Actions
- Set TempPoint3 = (Position of TempUnit)
- Unit Group - Remove TempUnit from AniChicks[TempInteger]
- Unit - Remove TempUnit from the game
- Unit - Create 1 Golden Chicken (Level 2) for Neutral Victim at TempPoint3 facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Create 1 FeralSpiritEffect for Neutral Passive at TempPoint3 facing Default building facing degrees
- Animation - Change (Last created unit)'s size to (30.00%, 30.00%, 30.00%) of its original size
- Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Sheep
-
Then - Actions
- Unit - Order (Triggering unit) to train/upgrade to a Sheep
- Unit - Remove (Trained unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AniCount[TempInteger] Less than AnimalsMaximum
-
Then - Actions
- Unit - Create 1 Sheep for Neutral Victim at TempPoint2 facing Default building facing degrees
- Unit Group - Add (Last created unit) to AniSheep[TempInteger]
- Set AniCount[TempInteger] = (AniCount[TempInteger] + 1)
- Unit - Move (Last created unit) instantly to TempPoint2
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Order (Last created unit) to Move To TempPoint
-
Else - Actions
- Set TempUnit = (Random unit from AniSheep[TempInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempUnit Equal to No unit
- Then - Actions
-
Else - Actions
- Set TempPoint3 = (Position of TempUnit)
- Unit Group - Remove TempUnit from AniSheep[TempInteger]
- Unit - Remove TempUnit from the game
- Unit - Create 1 Black Sheep (Level 2) for Neutral Victim at TempPoint3 facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Create 1 FeralSpiritEffect for Neutral Passive at TempPoint3 facing Default building facing degrees
- Animation - Change (Last created unit)'s size to (30.00%, 30.00%, 30.00%) of its original size
- Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Pig
-
Then - Actions
- Unit - Order (Triggering unit) to train/upgrade to a Pig
- Unit - Remove (Trained unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AniCount[TempInteger] Less than AnimalsMaximum
-
Then - Actions
- Unit - Create 1 Pig for Neutral Victim at TempPoint2 facing Default building facing degrees
- Unit Group - Add (Last created unit) to AniPigs[TempInteger]
- Set AniCount[TempInteger] = (AniCount[TempInteger] + 1)
- Unit - Move (Last created unit) instantly to TempPoint2
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Order (Last created unit) to Move To TempPoint
-
Else - Actions
- Set TempUnit = (Random unit from AniPigs[TempInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempUnit Equal to No unit
- Then - Actions
-
Else - Actions
- Set TempPoint3 = (Position of TempUnit)
- Unit Group - Remove TempUnit from AniPigs[TempInteger]
- Unit - Remove TempUnit from the game
- Unit - Create 1 Fat Pig (Level 2) for Neutral Victim at TempPoint3 facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Create 1 FeralSpiritEffect for Neutral Passive at TempPoint3 facing Default building facing degrees
- Animation - Change (Last created unit)'s size to (30.00%, 30.00%, 30.00%) of its original size
- Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Rabbit
-
Then - Actions
- Unit - Order (Triggering unit) to train/upgrade to a Rabbit
- Unit - Remove (Trained unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AniCount[TempInteger] Less than AnimalsMaximum
-
Then - Actions
- Unit - Create 1 Rabbit for Neutral Victim at TempPoint2 facing Default building facing degrees
- Unit Group - Add (Last created unit) to AniRabbits[TempInteger]
- Set AniCount[TempInteger] = (AniCount[TempInteger] + 1)
- Unit - Move (Last created unit) instantly to TempPoint2
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Order (Last created unit) to Move To TempPoint
-
Else - Actions
- Set TempUnit = (Random unit from AniRabbits[TempInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempUnit Equal to No unit
- Then - Actions
-
Else - Actions
- Set TempPoint3 = (Position of TempUnit)
- Unit Group - Remove TempUnit from AniRabbits[TempInteger]
- Unit - Remove TempUnit from the game
- Unit - Create 1 Green Rabbit (Level 2) for Neutral Victim at TempPoint3 facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Create 1 FeralSpiritEffect for Neutral Passive at TempPoint3 facing Default building facing degrees
- Animation - Change (Last created unit)'s size to (30.00%, 30.00%, 30.00%) of its original size
- Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Cow
-
Then - Actions
- Unit - Order (Triggering unit) to train/upgrade to a Cow
- Unit - Remove (Trained unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AniCount[TempInteger] Less than AnimalsMaximum
-
Then - Actions
- Unit - Create 1 Cow for Neutral Victim at TempPoint2 facing Default building facing degrees
- Unit Group - Add (Last created unit) to AniCows[TempInteger]
- Set AniCount[TempInteger] = (AniCount[TempInteger] + 1)
- Unit - Move (Last created unit) instantly to TempPoint2
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Order (Last created unit) to Move To TempPoint
-
Else - Actions
- Set TempUnit = (Random unit from AniCows[TempInteger])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempUnit Equal to No unit
- Then - Actions
-
Else - Actions
- Set TempPoint3 = (Position of TempUnit)
- Unit Group - Remove TempUnit from AniCows[TempInteger]
- Unit - Remove TempUnit from the game
- Unit - Create 1 Brown Cow ( Level 2 ) for Neutral Victim at TempPoint3 facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to TempInteger
- Unit - Create 1 FeralSpiritEffect for Neutral Passive at TempPoint3 facing Default building facing degrees
- Animation - Change (Last created unit)'s size to (30.00%, 30.00%, 30.00%) of its original size
- Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Unit - Add Ghost (Visible) to (Last created unit)
- Custom script: call RemoveLocation(udg_TempPoint)
- Custom script: call RemoveLocation(udg_TempPoint1)
- Custom script: call RemoveLocation(udg_TempPoint2)
-
Else - Actions
- Set TempPlayer = (Owner of (Trained unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Random Mercenary
-
Then - Actions
- Unit - Remove (Trained unit) from the game
- Unit - Order (Triggering unit) to train/upgrade to a Random Mercenary
- Set TempPoint2 = (Random point in revRect[(Random integer number between 1 and 30)])
- -------- toto ma ostat ake je (jednotky) --------
- Set TempInteger = (Random integer number between 1 and 14)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Player 10 (Light Blue) Food used) Less than 50
-
Then - Actions
- Unit - Create 1 mercType[TempInteger] for Player 10 (Light Blue) at TempPoint2 facing Default building facing degrees
- Unit - Change color of (Last created unit) to (Color of TempPlayer)
- AI - Ignore (Last created unit)'s guard position
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- TempInteger Equal to 7
-
Then - Actions
- Unit Group - Add (Last created unit) to Trappers
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in MercAttackGroup) Greater than 0
- Then - Actions
-
Else - Actions
- Set TempInt = (Random integer number between 1 and 18)
- Set TempPoint1 = (Random point in wayRect[TempInt])
- Unit - Set level of RegionWanderer (Neutral Hostile) for (Last created unit) to TempInt
- Unit - Order (Last created unit) to Attack-Move To TempPoint1
- Unit - Create 1 TeleportEffect for Neutral Passive at TempPoint2 facing Default building facing degrees
- Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Neutral Hostile Food used) Less than 60
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in MercAttackGroup) Greater than 0
- Then - Actions
-
Else - Actions
- Set TempInt = (Random integer number between 1 and 18)
- Set TempPoint1 = (Random point in wayRect[TempInt])
- Unit - Add RegionWanderer (Neutral Hostile) to (Triggering unit)
- Unit - Order (Last created unit) to Attack-Move To TempPoint1
- Unit - Create 1 TeleportEffect for Neutral Passive at TempPoint2 facing Default building facing degrees
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Custom script: call RemoveLocation (udg_TempPoint1)
- Custom script: call RemoveLocation (udg_TempPoint2)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Unit-type of (Trained unit)) Equal to Peon
-
Then - Actions
- Set TempPoint = (Rally-Point of (Triggering unit) as a point)
- Set TempPoint1 = (Position of (Triggering unit))
- Set TempPoint2 = (TempPoint1 offset by 64.00 towards (Angle from TempPoint1 to TempPoint) degrees)
- Unit - Remove (Trained unit) from the game
- Unit - Create 1 Peon for (Owner of (Triggering unit)) at TempPoint2 facing Default building facing degrees
- Custom script: call RemoveLocation(udg_TempPoint)
- Custom script: call RemoveLocation(udg_TempPoint1)
- Custom script: call RemoveLocation(udg_TempPoint2)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events