//TESH.scrollpos=0
//TESH.alwaysfold=0
function AddOpenWound takes unit target returns nothing
local location here
set here = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'u00J', Player(bj_PLAYER_NEUTRAL_EXTRA), here, bj_UNIT_FACING )
call SetUnitLifeBJ(target, GetUnitStateSwap(UNIT_STATE_LIFE, target) + 1 ) // the unit deals 1 damage
call RemoveLocation(here)
call IssueTargetOrderBJ( bj_lastCreatedUnit, "attack", target)
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', bj_lastCreatedUnit )
call UnitAddAbilityBJ( 'Aloc', bj_lastCreatedUnit )
endfunction
function AddBrokenLeg takes unit target returns nothing
local location here
set here = GetUnitLoc(target)
call CreateNUnitsAtLoc( 1, 'u00K', Player(bj_PLAYER_NEUTRAL_EXTRA), here, bj_UNIT_FACING )
call RemoveLocation(here)
call SetUnitLifeBJ(target, GetUnitStateSwap(UNIT_STATE_LIFE, target) + 1 ) // the unit deals 1 damage
call IssueTargetOrderBJ( bj_lastCreatedUnit, "attack", target)
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', bj_lastCreatedUnit )
call UnitAddAbilityBJ( 'Aloc', bj_lastCreatedUnit )
endfunction
// not used since v4.1
function BuffCheck takes unit myUnit returns integer
local integer mybuff
set mybuff = 0
if (GetUnitAbilityLevel(myUnit, 'Bpsi') > 0) then
set mybuff = mybuff +1
endif
if (GetUnitAbilityLevel(myUnit, 'Bssi') > 0) then
set mybuff = mybuff +2
endif
return mybuff
endfunction
// not used since v4.1
function ReAddBuff takes integer cola, unit pepsi returns nothing
if (cola == 1) then
call AddOpenWound(pepsi)
elseif (cola == 2) then
call AddBrokenLeg(pepsi)
elseif (cola == 3) then
call AddOpenWound(pepsi)
call AddBrokenLeg(pepsi)
endif
endfunction
// not used since v4.1
function SetSkills takes integer owner returns nothing
local integer loopy
set udg_setskills[owner] = true
if (udg_SkillA[owner] > 0) then
set loopy = 1
loop
exitwhen loopy > udg_SkillA[owner]
call SelectHeroSkill( udg_Hero[owner], 'A005' )
set loopy = loopy + 1
endloop
endif
if (udg_SkillB[owner] > 0) then
set loopy = 1
loop
exitwhen loopy > udg_SkillB[owner]
call SelectHeroSkill( udg_Hero[owner], 'A00E' )
set loopy = loopy + 1
endloop
endif
if (udg_SkillC[owner] > 0) then
set loopy = 1
loop
exitwhen loopy > udg_SkillC[owner]
call SelectHeroSkill( udg_Hero[owner], 'A006' )
set loopy = loopy + 1
endloop
endif
if (udg_SkillD[owner] > 0) then
set loopy = 1
loop
exitwhen loopy > udg_SkillD[owner]
call SelectHeroSkill( udg_Hero[owner], 'A00N' )
call SelectHeroSkill( udg_Hero[owner], 'A018' )
call SelectHeroSkill( udg_Hero[owner], 'A019' )
set loopy = loopy + 1
endloop
endif
set udg_setskills[owner] = false
endfunction
// not used since v4.1
function ChangeUnit takes unit oldUnit, integer newUnitId, string attach returns unit
local real lifetrans
local real manatrans
local integer owner
local integer index
local unit newUnit
local item indexItem
local boolean wasHidden
call BJDebugMsg("Warning: old ChangeUnit Function is used by " + GetPlayerName(GetOwningPlayer(oldUnit)))
set lifetrans = GetUnitLifePercent(oldUnit)
set manatrans = GetUnitManaPercent(oldUnit)
set owner = GetConvertedPlayerId(GetOwningPlayer(oldUnit))
set udg_BuffInt[owner] = BuffCheck(oldUnit)
// If we have bogus data, don't attempt the replace.
if (oldUnit == null) then
set bj_lastReplacedUnit = oldUnit
return oldUnit
endif
// Hide the original unit.
set wasHidden = IsUnitHidden(oldUnit)
call ShowUnit(oldUnit, false)
// Create the replacement unit.
set newUnit = CreateUnit(GetOwningPlayer(oldUnit), newUnitId, GetUnitX(oldUnit), GetUnitY(oldUnit), GetUnitFacing(oldUnit))
// Mirror properties of the old unit onto the new unit.
//call PauseUnit(newUnit, IsUnitPaused(oldUnit))
call SetResourceAmount(newUnit, GetResourceAmount(oldUnit))
// If both the old and new units are heroes, handle their hero info.
if (IsUnitType(oldUnit, UNIT_TYPE_HERO) and IsUnitType(newUnit, UNIT_TYPE_HERO)) then
call SetHeroXP(newUnit, GetHeroXP(oldUnit), false)
set index = 0
loop
set indexItem = UnitItemInSlot(oldUnit, index)
if (indexItem != null) then
call UnitRemoveItem(oldUnit, indexItem)
call UnitAddItem(newUnit, indexItem)
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
endif
// Remove or kill the original unit. It is sometimes unsafe to remove
// hidden units, so kill the original unit if it was previously hidden.
if wasHidden then
call KillUnit(oldUnit)
call RemoveUnit(oldUnit)
else
call RemoveUnit(oldUnit)
endif
call DestroyEffectBJ( udg_PlayerAttach[owner] )
set udg_PlayerAttach[owner] = AddSpecialEffectTargetUnitBJ( "weapon", newUnit, attach )
call SetUnitColor( newUnit, ConvertPlayerColor(12) )
call SetUnitLifePercentBJ( newUnit, lifetrans)
call SetUnitManaPercentBJ( newUnit, manatrans)
call SelectUnitForPlayerSingle( newUnit, GetOwningPlayer(newUnit) )
set udg_Hero[owner] = newUnit
call ReAddBuff(udg_BuffInt[owner],udg_Hero[owner])
call SetSkills(owner)
return newUnit
endfunction
Name | Type | is_array | initial_value |
AliveHeroGroup | group | No | |
alpha | string | Yes | |
AmmoTypeNeeded | itemcode | Yes | |
AttachmentEffectShoot | string | Yes | |
AttackTypes | integer | Yes | |
blubber | integer | No | |
boardplace | integer | No | |
BossSound | sound | Yes | |
BossUnitType | unitcode | Yes | |
BuffInt | integer | Yes | |
CenterOfPlayableMap | location | No | |
CinematicHero1 | unit | No | |
CinematicHero2 | unit | No | |
CinematicZombie | unit | No | |
color1 | real | No | |
color2 | real | No | |
ColorSave | string | Yes | |
ColorStr | string | Yes | |
CurrentEquippedWeapon | item | Yes | |
deathcheck | boolean | Yes | |
effect | string | Yes | |
EnemyPlayerInt | integer | No | 18 |
EnemyPlayers | force | No | |
FindPing | itemcode | Yes | |
Hero | unit | Yes | UnitNull |
Hummer1 | unit | No | |
Hummer2 | unit | No | |
IsSinglePlayer | boolean | No | |
KickedPlayer | player | No | |
Kills | integer | Yes | 0 |
killsboard | multiboard | No | |
Lettersofusername1 | string | Yes | |
load_code | integer | Yes | 0 |
loadcache | string | Yes | |
Marine2 | unit | No | |
Marine3 | unit | No | |
maxammo | integer | No | |
MaxRounds | integer | No | |
Mutantcinematic | unit | No | |
newHero | unitcode | Yes | |
Ping | string | Yes | |
PingItgr | integer | Yes | |
PlayerAttach | effect | Yes | |
Proof | boolean | Yes | |
PulseBuff | effect | Yes | |
reloading | boolean | Yes | |
Save_Code | string | Yes | |
Save_Y | string | Yes | |
setskills | boolean | Yes | |
SkillA | integer | Yes | |
SkillB | integer | Yes | |
SkillC | integer | Yes | |
SkillD | integer | Yes | |
Spawns | rect | Yes | |
Tank | unit | No | |
Tank2 | unit | No | |
temp | integer | Yes | |
tempInt | integer | No | |
TimerRunned | integer | No | |
Timertmp | timer | No | |
tmp_Point2 | location | No | |
tmpEffect | effect | No | |
tmpPoint | location | No | |
ToPing | string | Yes | |
Wait | real | No | |
WaveOn | integer | No | 1 |
WaveTrigger | trigger | Yes | |
WeaponAmount | integer | No | |
WeaponAttachmentCurrent | effect | Yes | |
WeaponAttachmentModels | string | Yes | |
WeaponItemType | itemcode | Yes | |
WeaponMissileArt | string | Yes | |
WeaponModifierHashtable | hashtable | No | |
WeaponSoundAttack | sound | Yes | |
WeaponSoundReload | sound | Yes | |
WeaponTypeAlternate | unitcode | Yes | |
WeaponTypeHero | unitcode | Yes | |
ZombieOrderGroup | group | No |
function Trig_CreateItemsAroundMap_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
call FogMaskEnableOn()
call UseTimeOfDayBJ( false )
call SetTimeOfDay( 0.00 )
set bla = 1
loop
exitwhen bla > 5
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I008', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00A', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I029', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01D', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00C', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I005', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00U', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I000', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00E', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I007', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.05 )
set bla = 1
loop
exitwhen bla > 10
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I004', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01O', udg_tmpPoint ) // Flare Shells (want to remove)
//call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
set bla = 1
loop
exitwhen bla > 3
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01K', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01X', udg_tmpPoint ) // Longbow (want remove)
//call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01M', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01J', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00W', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01R', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01W', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00N', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02I', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02G', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02H', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02K', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02J', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02M', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.33 )
set bla = 1
loop
exitwhen bla > 3
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00F', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01Q', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01P', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01S', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00S', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00J', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00K', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00P', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01B', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01C', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00I', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00Y', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00L', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00X', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I009', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02D', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01G', udg_tmpPoint ) // Chainsaw (remove?)
//call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01V', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01T', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02A', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = 1
loop
exitwhen bla > 2
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01E', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00Q', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00R', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00P', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01A', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00Z', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01N', udg_tmpPoint ) // Flare Pistol --> want to remove
//call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I016', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02V', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02U', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
// Item Creation
set bla = 1
loop
exitwhen bla > 10
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I018', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I012', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I013', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02P', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02T', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
set bla = 1
loop
exitwhen bla > 5
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01I', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02E', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I019', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01H', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I014', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I015', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.33 )
set bla = 1
loop
exitwhen bla > 15
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I017', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I011', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02Q', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
// Drop Ammo across map
set bla = 1
loop
exitwhen bla > 30
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00O', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00H', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00G', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I003', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.33 )
set bla = 1
loop
exitwhen bla > 20
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I001', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I006', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00B', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I002', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01Y', udg_tmpPoint ) // Hunting Arrows (want to remove)
//call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
set bla = 1
loop
exitwhen bla > 15
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I010', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00M', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00T', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00V', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.33 )
set bla = 1
loop
exitwhen bla > 10
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01L', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02F', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01F', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00D', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01U', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
endfunction
//===========================================================================
function InitTrig_CreateItemsAroundMap takes nothing returns nothing
set gg_trg_CreateItemsAroundMap = CreateTrigger( )
call TriggerAddAction( gg_trg_CreateItemsAroundMap, function Trig_CreateItemsAroundMap_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Move_items_Func002A takes nothing returns nothing
local location udg_tmpPoint
set udg_tmpPoint = GetRandomLocInRect(gg_rct_move_items)
call SetItemPositionLoc( GetEnumItem(), udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
endfunction
function Trig_MoveItemsFromWater_Actions takes nothing returns nothing
call EnumItemsInRectBJ( gg_rct_items, function Trig_Move_items_Func002A )
call EnumItemsInRectBJ( gg_rct_items2, function Trig_Move_items_Func002A )
endfunction
//===========================================================================
function InitTrig_MoveItemsFromWater takes nothing returns nothing
set gg_trg_MoveItemsFromWater = CreateTrigger( )
call TriggerAddAction( gg_trg_MoveItemsFromWater, function Trig_MoveItemsFromWater_Actions )
endfunction
//TESH.scrollpos=92
//TESH.alwaysfold=0
function SaveFile takes string Msg returns nothing
if GetLocalPlayer() == GetTriggerPlayer() then
call PreloadGenClear()
call PreloadGenStart()
call Preload("-load " + Msg)
call PreloadGenEnd("Afterlife\\" + GetPlayerName(GetTriggerPlayer()) + ".txt")
endif
call DisplayTimedTextToForce( GetForceOfPlayer(GetTriggerPlayer()), 60.00, ( "Your brand new Savecode: " + Msg ) )
endfunction
function Trig_saveCrypt_Actions takes nothing returns nothing
local string loadcache
local player TriggerPlayerNr
local integer x
local integer y
local integer z
local integer a
local integer b
local integer c
local integer d
local string array Letter
local boolean array Proof
local integer array tmp
local integer array x16
local integer e
local integer f
set TriggerPlayerNr = GetTriggerPlayer()
set b = 0
set c = 0
set d = 0
set a = 0
set x = 4
set y = 0
set z = 0
set udg_KickedPlayer = GetTriggerPlayer()
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "|cff0080FFSaveing....|r" )
if ( udg_Proof[( GetConvertedPlayerId(TriggerPlayerNr) + 100 )] == false ) then
set udg_Proof[( 100 + GetConvertedPlayerId(TriggerPlayerNr) )] = true
set a = GetHeroXP(udg_Hero[GetConvertedPlayerId(TriggerPlayerNr)])
set b = 0
// Checksum aufbauen
set f = GetHeroXP(udg_Hero[GetConvertedPlayerId(TriggerPlayerNr)])
set d = 0
set z = 0
set y = 0
loop
exitwhen y > 9
if ( a >= 1000000 ) then
set a = ( a - 1000000 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 100000 ) then
set a = ( a - 100000 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 10000 ) then
set a = ( a - 10000 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 1000 ) then
set a = ( a - 1000 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 100 ) then
set a = ( a - 100 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 10 ) then
set a = ( a - 10 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 1 ) then
set a = ( a - 1 )
set b = ( b + 1 )
else
endif
set y = y + 1
endloop
set c = StringLength(GetPlayerName(TriggerPlayerNr))
set y = 1
loop
exitwhen y > c
set Letter[y] = SubStringBJ(StringCase(GetPlayerName(TriggerPlayerNr), false), y, y)
set y = y + 1
endloop
set y = 1
loop
exitwhen y > c
set x = 1
loop
exitwhen x > 39
if ( Letter[y] == udg_alpha[x] ) then
set d = ( d + x )
else
endif
set x = x + 1
endloop
set y = y + 1
endloop
// --------------------------
set d = ( d * StringLength(GetPlayerName(TriggerPlayerNr)) )
set d = ( d * b )
set z = ( ( f - ModuloInteger(f, 100) ) / 100 )
set d = ( d - z )
set e = 1
loop
exitwhen e > 10
if ( d < 111111 ) then
set d = ( d + 13037 )
set e = 2
else
set e = 10
endif
set e = e + 1
endloop
set a = d
// Xp in hex
set x16[0] = ModuloInteger(f, 16)
set f = ( f - x16[0] )
set f = ( f / 16 )
set x16[1] = ModuloInteger(f, 16)
set f = ( f - x16[1] )
set f = ( f / 16 )
set x16[2] = ModuloInteger(f, 16)
set f = ( f - x16[2] )
set f = ( f / 16 )
set x16[3] = ModuloInteger(f, 16)
set f = ( f - x16[3] )
set f = ( f / 16 )
set x16[4] = ModuloInteger(f, 16)
set f = ( f - x16[4] )
set f = ( f / 16 )
set x16[5] = ModuloInteger(f, 16)
set f = ( f - x16[5] )
// Buchstabensalat
set y = 4
loop
exitwhen y > 9
set z = GetRandomInt(1, 5)
set tmp[y] = ( tmp[y] + (z * 10) )
set y = y + 1
endloop
set z = GetRandomInt(1, 4)
if ( z == 4 ) then
set x16[0] = ( x16[0] + 34 )
else
if ( z == 3 ) then
set x16[0] = ( x16[0] + 17 )
else
if ( z == 2 ) then
set x16[0] = ( x16[0] + 51 )
else
endif
endif
endif
set z = GetRandomInt(1, 4)
if ( z == 4 ) then
set x16[1] = ( x16[1] + 51 )
else
if ( z == 3 ) then
set x16[1] = ( x16[1] + 17 )
else
if ( z == 2 ) then
set x16[1] = ( x16[1] + 34 )
else
endif
endif
endif
set z = GetRandomInt(1, 4)
if ( z == 4 ) then
set x16[2] = ( x16[2] + 51 )
else
if ( z == 3 ) then
set x16[2] = ( x16[2] + 34 )
else
if ( z == 2 ) then
set x16[2] = ( x16[2] + 17 )
else
endif
endif
endif
set z = GetRandomInt(1, 4)
if ( z == 4 ) then
set x16[3] = ( x16[3] + 17 )
else
if ( z == 3 ) then
set x16[3] = ( x16[3] + 51 )
else
if ( z == 2 ) then
set x16[3] = ( x16[3] + 34 )
else
endif
endif
endif
set z = GetRandomInt(1, 4)
if ( z == 4 ) then
set x16[4] = ( x16[4] + 51 )
else
if ( z == 3 ) then
set x16[4] = ( x16[4] + 34 )
else
if ( z == 2 ) then
set x16[4] = ( x16[4] + 17 )
else
endif
endif
endif
set z = GetRandomInt(1, 4)
if ( z == 4 ) then
set x16[5] = ( x16[5] + 17 )
else
if ( z == 3 ) then
set x16[5] = ( x16[5] + 34 )
else
if ( z == 2 ) then
set x16[5] = ( x16[5] + 51 )
else
endif
endif
endif
// Checksum verstecken
set y = 0
loop
exitwhen y > 9
if ( a >= 100000 ) then
set a = ( a - 100000 )
set tmp[9] = ( tmp[9] + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 10000 ) then
set a = ( a - 10000 )
set tmp[8] = ( tmp[8] + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 1000 ) then
set a = ( a - 1000 )
set tmp[7] = ( tmp[7] + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 100 ) then
set a = ( a - 100 )
set tmp[6] = ( tmp[6] + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 10 ) then
set a = ( a - 10 )
set tmp[5] = ( tmp[5] + 1 )
else
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( a >= 1 ) then
set a = ( a - 1 )
set tmp[4] = ( tmp[4] + 1 )
else
endif
set y = y + 1
endloop
// Display code and generate .txt file
set Letter[0] = udg_Save_Y[tmp[4]] + udg_Save_Y[x16[5]] + udg_Save_Y[x16[3]] + udg_Save_Y[tmp[6]] + udg_Save_Y[tmp[9]] + udg_Save_Y[x16[1]] + "-" + udg_Save_Y[tmp[5]] + udg_Save_Y[tmp[7]] + udg_Save_Y[x16[2]] + udg_Save_Y[tmp[8]] + udg_Save_Y[x16[0]] + udg_Save_Y[x16[4]]
set udg_Save_Code[GetConvertedPlayerId(TriggerPlayerNr)] = Letter [0]
call SaveFile(Letter[0])
call TriggerSleepAction(0.50)
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "Your brand new savecode is: " + udg_Save_Code[GetConvertedPlayerId(TriggerPlayerNr)])
else
// can't save more than once per game
call TriggerSleepAction(0.50)
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "Saving Generator: |cffD90000Failed.|r" )
endif
set TriggerPlayerNr = null
set loadcache = null
endfunction
//===========================================================================
function InitTrig_saveCrypt takes nothing returns nothing
set gg_trg_saveCrypt = CreateTrigger( )
call DisableTrigger( gg_trg_saveCrypt )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(0), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(1), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(2), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(3), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(4), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(5), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(6), "-save", true )
call TriggerRegisterPlayerChatEvent( gg_trg_saveCrypt, Player(7), "-save", true )
call TriggerAddAction( gg_trg_saveCrypt, function Trig_saveCrypt_Actions )
endfunction
function Trig_loadCrypt_Actions takes nothing returns nothing
local string loadcache
local player TriggerPlayerNr
local integer x
local integer y
local integer z
local integer a
local integer b
local integer c
local integer d
local string array Letter
local boolean array Proof
local integer array tmp
set TriggerPlayerNr = GetTriggerPlayer()
set loadcache = GetEventPlayerChatString()
set b = 0
set c = 0
set d = 0
set a = 0
set x = 4
set y = 0
set z = 0
loop
exitwhen x > 9
set Proof[x] = false
set x = x + 1
endloop
if (( StringLength(loadcache)) == 19 ) then
// decrypt code
set x = 0
loop
exitwhen x > 67
if (( SubStringBJ(loadcache, 18, 18) == udg_Save_Y[x] )) and ( Proof[1] == false) then
if ( x <= 16 ) then
set b = ( b + ( 1 * x ) )
set Proof[1] = true
elseif ( x <= 33 ) then
set Proof[1] = true
set b = ( b + ( 1 * ( x - 17 ) ) )
elseif ( x <= 50 ) then
set Proof[1] = true
set b = ( b + ( 1 * ( x - 34 ) ) )
elseif ( x <= 67 ) then
set Proof[1] = true
set b = ( b + ( 1 * ( x - 51 ) ) )
endif
endif
if (( SubStringBJ(loadcache, 12, 12)) == udg_Save_Y[x] ) and ( Proof[2] == false ) then
if ( x <= 16 ) then
set b = ( b + ( 16 * x ) )
set Proof[2] = true
elseif ( x <= 33 ) then
set Proof[2] = true
set b = ( b + ( 16 * ( x - 17 ) ) )
elseif ( x <= 50 ) then
set Proof[2] = true
set b = ( b + ( 16 * ( x - 34 ) ) )
elseif ( x <= 67 ) then
set Proof[2] = true
set b = ( b + ( 16 * ( x - 51 ) ) )
endif
endif
if (( SubStringBJ(loadcache, 16, 16)) == udg_Save_Y[x] ) and ( Proof[3] == false )then
if ( x <= 16 ) then
set b = ( b + ( 256 * x ) )
set Proof[3] = true
elseif ( x <= 33 ) then
set Proof[3] = true
set b = ( b + ( 256 * ( x - 17 ) ) )
elseif ( x <= 50 ) then
set Proof[3] = true
set b = ( b + ( 256 * ( x - 34 ) ) )
elseif ( x <= 67 ) then
set Proof[3] = true
set b = ( b + ( 256 * ( x - 51 ) ) )
endif
endif
if (( SubStringBJ(loadcache, 9, 9)) == udg_Save_Y[x] ) and ( Proof[4] == false ) then
if ( x <= 16 ) then
set b = ( b + ( 4096 * x ) )
set Proof[4] = true
elseif ( x <= 33 ) then
set Proof[4] = true
set b = ( b + ( 4096 * ( x - 17 ) ) )
elseif ( x <= 50 ) then
set Proof[4] = true
set b = ( b + ( 4096 * ( x - 34 ) ) )
elseif ( x <= 67 ) then
set Proof[4] = true
set b = ( b + ( 4096 * ( x - 51 ) ) )
endif
endif
if (( SubStringBJ(loadcache, 19, 19)) == udg_Save_Y[x] ) and ( Proof[5] == false ) then
if ( x <= 16 ) then
set b = ( b + ( 65536 * x ) )
set Proof[5] = true
elseif ( x <= 33 ) then
set Proof[5] = true
set b = ( b + ( 65536 * ( x - 17 ) ) )
elseif ( x <= 50 ) then
set Proof[5] = true
set b = ( b + ( 65536 * ( x - 34 ) ) )
elseif ( x <= 67 ) then
set Proof[5] = true
set b = ( b + ( 65536 * ( x - 51 ) ) )
endif
endif
if (( SubStringBJ(loadcache, 8, 8)) == udg_Save_Y[x] ) and ( Proof[6] == false ) then
if ( x <= 16 ) then
set b = ( b + ( 1048576 * x ) )
set Proof[6] = true
elseif ( x <= 33 ) then
set Proof[6] = true
set b = ( b + ( 1048576 * ( x - 17 ) ) )
elseif ( x <= 50 ) then
set Proof[6] = true
set b = ( b + ( 1048576 * ( x - 34 ) ) )
elseif ( x <= 67 ) then
set Proof[6] = true
set b = ( b + ( 1048576 * ( x - 51 ) ) )
endif
endif
set x = x + 1
endloop
// create checksum
set tmp[3] = b
set tmp[2] = 0
set tmp[1] = StringLength(GetPlayerName(TriggerPlayerNr))
set y = 1
loop
exitwhen y > tmp[1]
set Letter[y] = SubStringBJ(StringCase(GetPlayerName(TriggerPlayerNr), false), y, y)
set y = y + 1
endloop
set y = 1
loop
exitwhen y > tmp[1]
set x = 1
loop
exitwhen x > 39
if (Letter[y] == udg_alpha[x]) then
set c = ( c + x )
endif
set x = x + 1
endloop
set y = y + 1
endloop
set c = ( c * StringLength(GetPlayerName(TriggerPlayerNr)))
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 1000000 ) then
set tmp[3] = ( tmp[3] - 1000000 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 100000 ) then
set tmp[3] = ( tmp[3] - 100000 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 10000 ) then
set tmp[3] = ( tmp[3] - 10000 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 1000) then
set tmp[3] = ( tmp[3] - 1000 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 100) then
set tmp[3] = ( tmp[3] - 100 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 10 ) then
set tmp[3] = ( tmp[3] - 10 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set y = 0
loop
exitwhen y > 9
if ( tmp[3] >= 1 ) then
set tmp[3] = ( tmp[3] - 1 )
set tmp[2] = ( tmp[2] + 1 )
endif
set y = y + 1
endloop
set c = ( c * tmp[2] )
set a = ( ( b - ModuloInteger(b, 100) ) / 100 )
set c = ( c - a )
set z = 1
loop
exitwhen z > 10
if ( c < 111111 ) then
set c = ( c + 13037 )
set z = 2
else
set z = 10
endif
set z = z + 1
endloop
// load checksum
set x = 0
loop
exitwhen x > 60
if ((SubStringBJ(loadcache, 11, 11)) == udg_Save_Y[x]) then
if ( x <= 9 ) then
set d = ( d + ( 100000 * x ) )
elseif ( x <= 19 ) then
set d = ( d + ( 100000 * ( x - 10 ) ) )
elseif ( x <= 29 ) then
set d = ( d + ( 100000 * ( x - 20 ) ) )
elseif ( x <= 39 ) then
set d = ( d + ( 100000 * ( x - 30 ) ) )
elseif ( x <= 49 ) then
set d = ( d + ( 100000 * ( x - 40 ) ) )
elseif ( x <= 59 ) then
set d = ( d + ( 100000 * ( x - 50 ) ) )
else
set d = ( d + ( 100000 * ( x - 60 ) ) )
endif
endif
if ((SubStringBJ(loadcache, 17, 17)) == udg_Save_Y[x]) then
if ( x <= 9 ) then
set d = ( d + ( 10000 * x ) )
elseif ( x <= 19 ) then
set d = ( d + ( 10000 * ( x - 10 ) ) )
elseif ( x <= 29 ) then
set d = ( d + ( 10000 * ( x - 20 ) ) )
elseif ( x <= 39 ) then
set d = ( d + ( 10000 * ( x - 30 ) ) )
elseif ( x <= 49 ) then
set d = ( d + ( 10000 * ( x - 40 ) ) )
elseif ( x <= 59 ) then
set d = ( d + ( 10000 * ( x - 50 ) ) )
else
set d = ( d + ( 10000 * ( x - 60 ) ) )
endif
endif
if ((SubStringBJ(loadcache, 15, 15)) == udg_Save_Y[x]) then
if ( x <= 9 ) then
set d = ( d + ( 1000 * x ) )
elseif ( x <= 19 ) then
set d = ( d + ( 1000 * ( x - 10 ) ) )
elseif ( x <= 29 ) then
set d = ( d + ( 1000 * ( x - 20 ) ) )
elseif ( x <= 39 ) then
set d = ( d + ( 1000 * ( x - 30 ) ) )
elseif ( x <= 49 ) then
set d = ( d + ( 1000 * ( x - 40 ) ) )
elseif ( x <= 59 ) then
set d = ( d + ( 1000 * ( x - 50 ) ) )
else
set d = ( d + ( 1000 * ( x - 60 ) ) )
endif
endif
if ((SubStringBJ(loadcache, 10, 10)) == udg_Save_Y[x]) then
if ( x <= 9 ) then
set d = ( d + ( 100 * x ) )
elseif ( x <= 19 ) then
set d = ( d + ( 100 * ( x - 10 ) ) )
elseif ( x <= 29 ) then
set d = ( d + ( 100 * ( x - 20 ) ) )
elseif ( x <= 39 ) then
set d = ( d + ( 100 * ( x - 30 ) ) )
elseif ( x <= 49 ) then
set d = ( d + ( 100 * ( x - 40 ) ) )
elseif ( x <= 59 ) then
set d = ( d + ( 100 * ( x - 50 ) ) )
else
set d = ( d + ( 100 * ( x - 60 ) ) )
endif
endif
if ((SubStringBJ(loadcache, 14, 14)) == udg_Save_Y[x]) then
if ( x <= 9 ) then
set d = ( d + ( 10 * x ) )
elseif ( x <= 19 ) then
set d = ( d + ( 10 * ( x - 10 ) ) )
elseif ( x <= 29 ) then
set d = ( d + ( 10 * ( x - 20 ) ) )
elseif ( x <= 39 ) then
set d = ( d + ( 10 * ( x - 30 ) ) )
elseif ( x <= 49 ) then
set d = ( d + ( 10 * ( x - 40 ) ) )
elseif ( x <= 59 ) then
set d = ( d + ( 10 * ( x - 50 ) ) )
else
set d = ( d + ( 10 * ( x - 60 ) ) )
endif
endif
if ((SubStringBJ(loadcache, 7, 7)) == udg_Save_Y[x]) then
if ( x <= 9 ) then
set d = ( d + ( 1 * x ) )
elseif ( x <= 19 ) then
set d = ( d + ( 1 * ( x - 10 ) ) )
elseif ( x <= 29 ) then
set d = ( d + ( 1 * ( x - 20 ) ) )
elseif ( x <= 39 ) then
set d = ( d + ( 1 * ( x - 30 ) ) )
elseif ( x <= 49 ) then
set d = ( d + ( 1 * ( x - 40 ) ) )
elseif ( x <= 59 ) then
set d = ( d + ( 1 * ( x - 50 ) ) )
else
set d = ( d + ( 1 * ( x - 60 ) ) )
endif
endif
set x = x + 1
endloop
// compare checksum
if ( c == d ) then
set Proof[7] = true
else
set Proof[7] = false
endif
// set xp
if (((Proof[7] == true and Proof[6] == true) and (Proof[5] == true and Proof[4] == true)) and ((Proof[3] == true and Proof[2] == true) and Proof[1] == true)) then
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "Authorization: |cff32cd32Approved. Code confirmed|r" )
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "|cff0080FFDecrypting Code... Adding Exp....|r" )
call SetHeroXP( udg_Hero[GetConvertedPlayerId(TriggerPlayerNr)], b, false )
else
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "Authorization: |cffD90000Denied. Invalid Code.|r" )
endif
else
call TriggerSleepAction( 0.50 )
call DisplayTextToForce( GetForceOfPlayer(TriggerPlayerNr), "Authorization: |cffD90000Invalid. Code lenght Error.|r" )
endif
set TriggerPlayerNr = null
set loadcache = null
endfunction
//===========================================================================
function InitTrig_loadCrypt takes nothing returns nothing
set gg_trg_loadCrypt = CreateTrigger( )
call DisableTrigger( gg_trg_loadCrypt )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(0), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(1), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(2), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(3), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(4), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(5), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(6), "-load ", false )
call TriggerRegisterPlayerChatEvent( gg_trg_loadCrypt, Player(7), "-load ", false )
call TriggerAddAction( gg_trg_loadCrypt, function Trig_loadCrypt_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_pingstart_Actions takes nothing returns nothing
local integer pepsi
set udg_ToPing[GetConvertedPlayerId(GetTriggerPlayer())] = StringCase(SubStringBJ(GetEventPlayerChatString(), 7, 10), false)
if ( GetUnitLevel(udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())]) >= 10 and udg_deathcheck[GetConvertedPlayerId(GetTriggerPlayer())] == false ) then
set pepsi = 0
loop
exitwhen pepsi > 66
if ( udg_ToPing[GetConvertedPlayerId(GetTriggerPlayer())] == udg_Ping[pepsi] ) then
call ConditionalTriggerExecute( gg_trg_ping )
else
endif
set pepsi = pepsi + 1
endloop
else
if ( udg_deathcheck[GetConvertedPlayerId(GetTriggerPlayer())] == false ) then
call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), "|CFFC70000You are not Skilled enough" )
else
call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), "|CFFC70000Dead People can't ping" )
endif
endif
endfunction
//===========================================================================
function InitTrig_pingstart takes nothing returns nothing
set gg_trg_pingstart = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(0), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(1), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(2), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(3), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(4), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(5), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(6), "-ping", false )
call TriggerRegisterPlayerChatEvent( gg_trg_pingstart, Player(7), "-ping", false )
call TriggerAddAction( gg_trg_pingstart, function Trig_pingstart_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ping_Func002Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemType(GetEnumItem()) == ITEM_TYPE_CHARGED ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 80.00, 40.00, 80.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func003Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemType(GetEnumItem()) == ITEM_TYPE_PURCHASABLE or GetItemType(GetEnumItem()) == ITEM_TYPE_ARTIFACT ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 33.00, 33.00, 33.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func004Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemType(GetEnumItem()) == ITEM_TYPE_PURCHASABLE ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 33.00, 33.00, 33.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func005Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemType(GetEnumItem()) == ITEM_TYPE_ARTIFACT ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 33.00, 33.00, 33.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func006Func003A takes nothing returns nothing
local location udg_tmpPoint
local integer IDitem
set IDitem = GetItemTypeId(GetEnumItem())
if ( IDitem == 'I008' or IDitem == 'I019' or IDitem == 'I018' or IDitem == 'I017' or IDitem == 'I02G') then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 0.00, 50.00, 0.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func007Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemType(GetEnumItem()) == ITEM_TYPE_PERMANENT ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 0.00, 0.00, 50.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func008Func003A takes nothing returns nothing
local location udg_tmpPoint
local integer IDitem
set IDitem = GetItemTypeId(GetEnumItem())
if ( IDitem == 'I00V' or IDitem == 'I00M' or IDitem == 'I002' or IDitem == 'I003' or IDitem == 'I001' or IDitem == 'I00D' or IDitem == 'I006' or IDitem == 'I00T') then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 80.00, 40.00, 80.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func009Func003A takes nothing returns nothing
local location udg_tmpPoint
local integer IDitem
set IDitem = GetItemTypeId(GetEnumItem())
if ( IDitem == 'I010' or IDitem == 'I001' or IDitem == 'I006' or IDitem == 'I00B' or IDitem == 'I002' or IDitem == 'I003' ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 80.00, 40.00, 80.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func010Func003A takes nothing returns nothing
local location udg_tmpPoint
local integer IDitem
set IDitem = GetItemTypeId(GetEnumItem())
if ( IDitem == 'I00G' or IDitem == 'I00H' or IDitem == 'I01F' or IDitem == 'I00O' or IDitem == 'I00T' ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 80.00, 40.00, 80.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func011Func003A takes nothing returns nothing
local location udg_tmpPoint
local integer IDitem
set IDitem = GetItemTypeId(GetEnumItem())
if ( IDitem == 'I012' or IDitem == 'I01H' or IDitem == 'I004' or IDitem == 'I011' or IDitem == 'I01U') then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 80.00, 0.00, 0.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func012Func002Func001Func002A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemTypeId(GetEnumItem()) == udg_FindPing[(udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())] - 10 )] ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 50.00, 50.00, 50.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func013Func002Func001Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemTypeId(GetEnumItem()) == udg_FindPing[( udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())] - 10 )] ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 50.00, 50.00, 50.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func014Func002Func001Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemTypeId(GetEnumItem()) == udg_FindPing[( udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())] - 10 )] ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 50.00, 50.00, 50.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func015Func002Func001Func003A takes nothing returns nothing
local location udg_tmpPoint
if ( GetItemTypeId(GetEnumItem()) == udg_FindPing[( udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())] - 10 )] ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 80.00, 40.00, 80.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Func016Func003A takes nothing returns nothing
local location udg_tmpPoint
local integer IDitem
set IDitem = GetItemTypeId(GetEnumItem())
if ( IDitem == 'I01I' or IDitem == 'I01L' ) then
set udg_tmpPoint = GetItemLoc(GetEnumItem())
call PingMinimapLocForForceEx( GetPlayersAll(), udg_tmpPoint, 5.00, bj_MINIMAPPINGSTYLE_SIMPLE, 70.00, 80.00, 10.00 )
call RemoveLocation(udg_tmpPoint)
endif
endfunction
function Trig_ping_Actions takes nothing returns nothing
local rect PingRect
local integer level
local string pingstr
set level = GetHeroLevel(udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())])
set pingstr = udg_ToPing[GetConvertedPlayerId(GetTriggerPlayer())]
set PingRect = RectFromCenterSizeBJ(GetUnitLoc(udg_Hero[GetConvertedPlayerId(GetTriggerPlayer())]), ( 60.00 * ( 30.00 + I2R(level) ) ), ( 60.00 * ( 30.00 + I2R(level) ) ))
if ( level >= 10 and level <= 90 and pingstr == "ammo") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func002Func003A )
return
endif
if ( level >= 20 and level <= 40 and pingstr == "wepn") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func003Func003A )
return
endif
if ( level >= 30 and level <= 160 and pingstr == "guns") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func004Func003A )
return
else
endif
if ( level >= 40 and level <= 160 and pingstr == "wep2" ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func005Func003A )
return
else
endif
if ( level >= 50 and pingstr == "medi") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func006Func003A )
return
else
endif
if ( level >= 60 and pingstr == "armr") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func007Func003A )
return
else
endif
if ( level >= 70 and level <= 180 and pingstr == "guam" ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func008Func003A )
return
else
endif
if ( level >= 80 and level <= 180 and pingstr == "smam") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func009Func003A )
return
else
endif
if ( level >= 90 and level <= 180 and pingstr == "riam" ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func010Func003A )
return
else
endif
if ( level >= 100 and pingstr == "expl") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func011Func003A )
return
else
endif
if ( level >= 120 ) then
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = 11
loop
exitwhen udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] > 23
if ( pingstr == udg_Ping[udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())]] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func012Func002Func001Func002A )
return
else
endif
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] + 1
endloop
else
endif
if ( level >= 140 ) then
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = 24
loop
exitwhen udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] > 31
if ( pingstr == udg_Ping[udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())]] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func013Func002Func001Func003A )
return
else
endif
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] + 1
endloop
else
endif
if ( level >= 160 ) then
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = 32
loop
exitwhen udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] > 49
if ( pingstr == udg_Ping[udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())]] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func014Func002Func001Func003A )
return
else
endif
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] + 1
endloop
else
endif
if ( level >= 180 ) then
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = 50
loop
exitwhen udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] > 65
if ( pingstr == udg_Ping[udg_PingItgr[GetConvertedPlayerId(GetTriggerPlayer())]] ) then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func015Func002Func001Func003A )
return
else
endif
set udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] = udg_PingItgr[GetConvertedPlayerId( GetTriggerPlayer( ) )] + 1
endloop
else
endif
if ( level >= 200 and pingstr == "sent") then
call DisplayTextToForce( GetPlayersAll(), ( "Pinging " + ( pingstr + ( ( " within Range of " + ( I2S(( 60 * ( 30 + level ) )) + " Units" ) ) + "." ) ) ) )
call EnumItemsInRectBJ( PingRect, function Trig_ping_Func016Func003A )
return
else
endif
call RemoveRect(PingRect)
endfunction
//===========================================================================
function InitTrig_ping takes nothing returns nothing
set gg_trg_ping = CreateTrigger( )
call TriggerAddAction( gg_trg_ping, function Trig_ping_Actions )
endfunction
function adjustSplashWorkaround takes ability workaround, real newAreaOfEffectFull, real newAreaOfEffectMedium, real newAreaOfEffectSmall, real newDamageFactorMedium, real newDamageFactorSmall returns nothing
// Modifies Orb of Annihilation
// this is only needed because the "SetRealAbilityField" does not work propperly
// Orb of Annihilation is turned on/off, depending if the unit got splash or not
// needs full damage radius to be <0 (greater 0) even when turned off
call BlzSetAbilityRealLevelField( workaround, ABILITY_RLF_FULL_DAMAGE_RADIUS_FAK4, 0, newAreaOfEffectFull)
call BlzSetAbilityRealLevelField( workaround, ABILITY_RLF_HALF_DAMAGE_RADIUS_FAK5, 0, newAreaOfEffectMedium)
call BlzSetAbilityRealLevelField( workaround, ABILITY_RLF_AREA_OF_EFFECT, 0, newAreaOfEffectSmall)
call BlzSetAbilityRealLevelField( workaround, ABILITY_RLF_MEDIUM_DAMAGE_FACTOR_FAK2, 0, newDamageFactorMedium)
call BlzSetAbilityRealLevelField( workaround, ABILITY_RLF_SMALL_DAMAGE_FACTOR_FAK3, 0, newDamageFactorSmall)
// last line is for debugging
// disable the action call off in "Time before" (Hide Ability for Unit)
call BlzSetAbilityActivatedExtendedTooltip('A01D', "FullRad: "+R2S(BlzGetAbilityRealLevelField(workaround,ConvertAbilityRealLevelField('fak4'),0)) + "|nMedRad: "+ R2S(BlzGetAbilityRealLevelField(workaround,ConvertAbilityRealLevelField('fak5'),0)) + "|nSmallRad: " +R2S(BlzGetAbilityRealLevelField(workaround,ConvertAbilityRealLevelField('aare'),0)) , 0)
endfunction
function Trig_remove_0_ammo_Actions takes nothing returns nothing
local integer x
local integer y
set x = 1
loop
exitwhen x > 8
set y = 1
loop
exitwhen y > 6
if ( ( GetItemType(UnitItemInSlotBJ(udg_Hero[x], y)) == ITEM_TYPE_CHARGED ) ) then
if ( ( GetItemCharges(UnitItemInSlotBJ(udg_Hero[x], y)) == 0 ) ) then
call RemoveItem( UnitItemInSlotBJ(udg_Hero[x], y) )
endif
endif
set y = y + 1
endloop
set x = x + 1
endloop
endfunction
//===========================================================================
function InitTrig_remove_0_ammo takes nothing returns nothing
set gg_trg_remove_0_ammo = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_remove_0_ammo, 0.50 )
call TriggerAddAction( gg_trg_remove_0_ammo, function Trig_remove_0_ammo_Actions )
endfunction
function Trig_NoPickupDoubleWeapon_Conditions takes nothing returns boolean
if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_ARTIFACT ) ) then
return false
endif
return true
endfunction
function Trig_NoPickupDoubleWeapon_Actions takes nothing returns nothing
local integer udg_blubber
set udg_blubber = 1
loop
exitwhen udg_blubber > 6
if ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), udg_blubber)) == ITEM_TYPE_ARTIFACT) and (UnitItemInSlotBJ(GetManipulatingUnit(), udg_blubber) != GetManipulatedItem() ) then
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())), "TRIGSTR_1182" )
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
endif
set udg_blubber = udg_blubber + 1
endloop
endfunction
//===========================================================================
function InitTrig_NoPickupDoubleWeapon takes nothing returns nothing
set gg_trg_NoPickupDoubleWeapon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NoPickupDoubleWeapon, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_NoPickupDoubleWeapon, Condition( function Trig_NoPickupDoubleWeapon_Conditions ) )
call TriggerAddAction( gg_trg_NoPickupDoubleWeapon, function Trig_NoPickupDoubleWeapon_Actions )
endfunction
function Trig_NoPickupDoubleArmor_Conditions takes nothing returns boolean
if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_PERMANENT ) ) then
return false
endif
return true
endfunction
function Trig_NoPickupDoubleArmor_Actions takes nothing returns nothing
local integer udg_blubber
set udg_blubber = 1
loop
exitwhen udg_blubber > 6
if ( GetItemType(UnitItemInSlotBJ(GetManipulatingUnit(), udg_blubber)) == ITEM_TYPE_PERMANENT ) and (UnitItemInSlotBJ(GetManipulatingUnit(), udg_blubber) != GetManipulatedItem() ) then
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())), "TRIGSTR_1183" )
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
endif
set udg_blubber = udg_blubber + 1
endloop
endfunction
//===========================================================================
function InitTrig_NoPickupDoubleArmor takes nothing returns nothing
set gg_trg_NoPickupDoubleArmor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NoPickupDoubleArmor, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_NoPickupDoubleArmor, Condition( function Trig_NoPickupDoubleArmor_Conditions ) )
call TriggerAddAction( gg_trg_NoPickupDoubleArmor, function Trig_NoPickupDoubleArmor_Actions )
endfunction
//TESH.scrollpos=25
//TESH.alwaysfold=0
function Trig_AmmoStack_Conditions takes nothing returns boolean
if ( not ( GetItemType(GetManipulatedItem()) == ITEM_TYPE_CHARGED ) ) then
return false
endif
return true
endfunction
function Trig_AmmoStack_Actions takes nothing returns nothing
local integer x
local integer y
local integer z
local integer v
set x = GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))
set y = 0
set v = 0
if ( GetItemUserData(GetManipulatedItem()) == 0 ) then
call SetItemUserData( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) * 5 ) )
endif
set z = 0
loop
exitwhen z > 6
if (( GetItemTypeId(UnitItemInSlot(udg_Hero[x], z)) == GetItemTypeId(GetManipulatedItem()) ) and ( (GetItemCharges(UnitItemInSlot(udg_Hero[x], z)) + GetItemCharges(GetManipulatedItem())) <= (GetItemUserData(UnitItemInSlot(udg_Hero[x], z))))) then
set y = ( y + 1 )
if (y >= 2 ) then
call SetItemCharges( UnitItemInSlot(udg_Hero[x], v), (GetItemCharges(UnitItemInSlot(udg_Hero[x], v)) + GetItemCharges(UnitItemInSlot(udg_Hero[x], z))))
call RemoveItem( UnitItemInSlot(udg_Hero[x], z))
elseif ((y == 1) and (v == 0)) then
set v = z
endif
else
endif
set z = z + 1
endloop
endfunction
//===========================================================================
function InitTrig_AmmoStack takes nothing returns nothing
set gg_trg_AmmoStack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AmmoStack, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_AmmoStack, Condition( function Trig_AmmoStack_Conditions ) )
call TriggerAddAction( gg_trg_AmmoStack, function Trig_AmmoStack_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
function Trig_Reloading_MR_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H02A' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I02B' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_MR_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 5
set ammotype = udg_FindPing[48]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_MR_Prototype12_RELOAD, 100, GetManipulatingUnit() )
call TriggerSleepAction( 4.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_MR takes nothing returns nothing
set gg_trg_Reloading_MR = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_MR, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_MR, Condition( function Trig_Reloading_MR_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_MR, function Trig_Reloading_MR_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Realoding_Glock_18_Func002Func002C takes nothing returns boolean
if ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H020' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H01Z' ) ) then
return true
endif
return false
endfunction
function Trig_Realoding_Glock_18_Func002C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I022' ) ) then
return false
endif
if ( not Trig_Realoding_Glock_18_Func002Func002C() ) then
return false
endif
return true
endfunction
function Trig_Realoding_Glock_18_Conditions takes nothing returns boolean
if ( not Trig_Realoding_Glock_18_Func002C() ) then
return false
endif
return true
endfunction
function Trig_Realoding_Glock_18_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 33
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Beretta_PX4_Storm_R, 100, GetManipulatingUnit() )
call TriggerSleepAction( 3.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Realoding_Glock_18 takes nothing returns nothing
set gg_trg_Realoding_Glock_18 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Realoding_Glock_18, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Realoding_Glock_18, Condition( function Trig_Realoding_Glock_18_Conditions ) )
call TriggerAddAction( gg_trg_Realoding_Glock_18, function Trig_Realoding_Glock_18_Actions )
endfunction
function Trig_Reloading_26mmFlarePistol_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01K' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01N' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_26mmFlarePistol_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 1
set ammotype = udg_FindPing[47]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call TriggerSleepAction( 1.00 )
call PlaySoundOnUnitBJ( gg_snd_Flare_pistol_reload, 100, GetManipulatingUnit() )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_26mm_Flare_Pistol takes nothing returns nothing
set gg_trg_Reloading_26mm_Flare_Pistol = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_26mm_Flare_Pistol, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_26mm_Flare_Pistol, Condition( function Trig_Reloading_26mmFlarePistol_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_26mm_Flare_Pistol, function Trig_Reloading_26mmFlarePistol_Actions )
endfunction
function Trig_Reloading_Firestar_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H002' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I007' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Firestar_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 7
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Firestar_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Firestar takes nothing returns nothing
set gg_trg_Reloading_Firestar = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Firestar, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Firestar, Condition( function Trig_Reloading_Firestar_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Firestar, function Trig_Reloading_Firestar_Actions )
endfunction
function Trig_Reloading_IMI_Barak2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01I' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01J' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_IMI_Barak2_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 17
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_IMI_SP_21_Barak_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.20 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_IMI_Barak2 takes nothing returns nothing
set gg_trg_Reloading_IMI_Barak2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_IMI_Barak2, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_IMI_Barak2, Condition( function Trig_Reloading_IMI_Barak2_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_IMI_Barak2, function Trig_Reloading_IMI_Barak2_Actions )
endfunction
function Trig_Reloading_Colt_Python_357_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00Z' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00W' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Colt_Python_357_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 6
set ammotype = udg_FindPing[49]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Colt_Pyton_Elite_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.80 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Colt_Python_357 takes nothing returns nothing
set gg_trg_Reloading_Colt_Python_357 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Colt_Python_357, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Colt_Python_357, Condition( function Trig_Reloading_Colt_Python_357_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Colt_Python_357, function Trig_Reloading_Colt_Python_357_Actions )
endfunction
function Trig_Reloading_Desert_Eagle_44_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00Y' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00U' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Desert_Eagle_44_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 7
set ammotype = udg_FindPing[53]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Desert_Eagle_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 1.90 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Desert_Eagle_44 takes nothing returns nothing
set gg_trg_Reloading_Desert_Eagle_44 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Desert_Eagle_44, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Desert_Eagle_44, Condition( function Trig_Reloading_Desert_Eagle_44_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Desert_Eagle_44, function Trig_Reloading_Desert_Eagle_44_Actions )
endfunction
function Trig_Reloading_SIG_Sauer_Pro_2340_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00R' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00N' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_SIG_Sauer_Pro_2340_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 13
set ammotype = udg_FindPing[51]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Sig_Sauer_SSG_Pro_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_SIG_Sauer_Pro_2340 takes nothing returns nothing
set gg_trg_Reloading_SIG_Sauer_Pro_2340 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_SIG_Sauer_Pro_2340, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_SIG_Sauer_Pro_2340, Condition( function Trig_Reloading_SIG_Sauer_Pro_2340_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_SIG_Sauer_Pro_2340, function Trig_Reloading_SIG_Sauer_Pro_2340_Actions )
endfunction
function Trig_Reloading_SmithWesson_500_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H007' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I009' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_SmithWesson_500_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 5
set ammotype = udg_FindPing[55]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd__500_Smith_Wesson_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 4.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_SmithWesson_500 takes nothing returns nothing
set gg_trg_Reloading_SmithWesson_500 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_SmithWesson_500, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_SmithWesson_500, Condition( function Trig_Reloading_SmithWesson_500_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_SmithWesson_500, function Trig_Reloading_SmithWesson_500_Actions )
endfunction
function Trig_Reloading_Baretta_9000S_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H003' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01M' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Baretta_9000S_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 14
set ammotype = udg_FindPing[52]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_APS_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.70 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Baretta_9000S takes nothing returns nothing
set gg_trg_Reloading_Baretta_9000S = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Baretta_9000S, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Baretta_9000S, Condition( function Trig_Reloading_Baretta_9000S_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Baretta_9000S, function Trig_Reloading_Baretta_9000S_Actions )
endfunction
function Trig_Reloading_HecklerKoch_USP_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H006' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01W' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_HecklerKoch_USP_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 12
set ammotype = udg_FindPing[54]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_H_K_USP_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_HecklerKoch_USP takes nothing returns nothing
set gg_trg_Reloading_HecklerKoch_USP = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_HecklerKoch_USP, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_HecklerKoch_USP, Condition( function Trig_Reloading_HecklerKoch_USP_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_HecklerKoch_USP, function Trig_Reloading_HecklerKoch_USP_Actions )
endfunction
function Trig_Reloading_Mauser_M2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01J' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01K' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Mauser_M2_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 8
set ammotype = udg_FindPing[54]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Barret_XM109_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Mauser_M2 takes nothing returns nothing
set gg_trg_Reloading_Mauser_M2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Mauser_M2, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Mauser_M2, Condition( function Trig_Reloading_Mauser_M2_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Mauser_M2, function Trig_Reloading_Mauser_M2_Actions )
endfunction
function Trig_Reloading_Coonan_357_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01O' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01R' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Coonan_357_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 8
set ammotype = udg_FindPing[49]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Sig_Sauer_SSG_Pro_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Coonan_357 takes nothing returns nothing
set gg_trg_Reloading_Coonan_357 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Coonan_357, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Coonan_357, Condition( function Trig_Reloading_Coonan_357_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Coonan_357, function Trig_Reloading_Coonan_357_Actions )
endfunction
function Trig_Reloading_FN_Five_Seven_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H000' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I000' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_FN_Five_Seven_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 20
set ammotype = udg_FindPing[45]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Five_Seven_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.90 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_FN_Five_Seven takes nothing returns nothing
set gg_trg_Reloading_FN_Five_Seven = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_FN_Five_Seven, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_FN_Five_Seven, Condition( function Trig_Reloading_FN_Five_Seven_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_FN_Five_Seven, function Trig_Reloading_FN_Five_Seven_Actions )
endfunction
function Trig_Reloading_Beretta_93R_Func003C takes nothing returns boolean
if ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H004' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H005' ) ) then
return true
endif
return false
endfunction
function Trig_Reloading_Beretta_93R_Conditions takes nothing returns boolean
if ( not Trig_Reloading_Beretta_93R_Func003C() ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I005' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Beretta_93R_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Beretta_PX4_Storm_R, 100, GetManipulatingUnit() )
call TriggerSleepAction( 3.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Beretta_93R takes nothing returns nothing
set gg_trg_Reloading_Beretta_93R = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Beretta_93R, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Beretta_93R, Condition( function Trig_Reloading_Beretta_93R_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Beretta_93R, function Trig_Reloading_Beretta_93R_Actions )
endfunction
function Trig_Reloading_SOW_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H02B' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H02C' )) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I02C' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_SOW_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[49]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_SOW_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 1.80 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_SOW takes nothing returns nothing
set gg_trg_Reloading_SOW = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_SOW, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_SOW, Condition( function Trig_Reloading_SOW_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_SOW, function Trig_Reloading_SOW_Actions )
endfunction
function Trig_Reloading_Scorp_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetManipulatingUnit()) == 'H027' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H028' )) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I029' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Scorp_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Scorpion_reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Scorp takes nothing returns nothing
set gg_trg_Reloading_Scorp = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Scorp, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Scorp, Condition( function Trig_Reloading_Scorp_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Scorp, function Trig_Reloading_Scorp_Actions )
endfunction
function Trig_Reloading_Thomsen_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H01V' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H01W' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I020' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Thomsen_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 100
set ammotype = udg_FindPing[54]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Ingram_Mac11_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.40 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Thomsen takes nothing returns nothing
set gg_trg_Reloading_Thomsen = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Thomsen, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Thomsen, Condition( function Trig_Reloading_Thomsen_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Thomsen, function Trig_Reloading_Thomsen_Actions )
endfunction
function Trig_Reloading_Revelli_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H021' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I023' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Revelli_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 50
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Micro_Uzi_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Revelli takes nothing returns nothing
set gg_trg_Reloading_Revelli = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Revelli, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Revelli, Condition( function Trig_Reloading_Revelli_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Revelli, function Trig_Reloading_Revelli_Actions )
endfunction
function Trig_Reloading_G36_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01T' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H01U' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01Z' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_G36_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 100
set ammotype = udg_FindPing[42]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_m4a1_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.50 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_G36 takes nothing returns nothing
set gg_trg_Reloading_G36 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_G36, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_G36, Condition( function Trig_Reloading_G36_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_G36, function Trig_Reloading_G36_Actions )
endfunction
function Trig_Reloading_HK21_Conditions takes nothing returns boolean
if ( not (GetUnitTypeId(GetManipulatingUnit()) == 'H022') ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I024' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_HK21_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 90
set ammotype = udg_FindPing[43]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_AK_47_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_HK21 takes nothing returns nothing
set gg_trg_Reloading_HK21 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_HK21, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_HK21, Condition( function Trig_Reloading_HK21_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_HK21, function Trig_Reloading_HK21_Actions )
endfunction
function Trig_Reloading_Steyr_AUG_A1_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H016' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H017' )) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01C' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Steyr_AUG_A1_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 42
set ammotype = udg_FindPing[42]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Steyr_AUG_A1_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Steyr_AUG_A1 takes nothing returns nothing
set gg_trg_Reloading_Steyr_AUG_A1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Steyr_AUG_A1, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Steyr_AUG_A1, Condition( function Trig_Reloading_Steyr_AUG_A1_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Steyr_AUG_A1, function Trig_Reloading_Steyr_AUG_A1_Actions )
endfunction
function Trig_Reloading_Mac10_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetManipulatingUnit()) == 'H00A' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00Q' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00C' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Mac10_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[54]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Ingram_Mac11_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.40 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Mac10 takes nothing returns nothing
set gg_trg_Reloading_Mac10 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Mac10, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Mac10, Condition( function Trig_Reloading_Mac10_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Mac10, function Trig_Reloading_Mac10_Actions )
endfunction
function Trig_Reloading_FN_P90_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H00J' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00S' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00K' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_FN_P90_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 50
set ammotype = udg_FindPing[45]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_FN_P90_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_FN_P90 takes nothing returns nothing
set gg_trg_Reloading_FN_P90 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_FN_P90, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_FN_P90, Condition( function Trig_Reloading_FN_P90_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_FN_P90, function Trig_Reloading_FN_P90_Actions )
endfunction
function Trig_Reloading_AK_47_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H00V' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00X' )) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00S' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_AK_47_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[43]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_AK_47_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_AK_47 takes nothing returns nothing
set gg_trg_Reloading_AK_47 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_AK_47, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_AK_47, Condition( function Trig_Reloading_AK_47_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_AK_47, function Trig_Reloading_AK_47_Actions )
endfunction
function Trig_Reloading_IMI_M_Galil_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H018' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H019' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01D' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_IMI_M_Galil_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 20
set ammotype = udg_FindPing[43]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_IMI_Galil_M_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.50 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_IMI_M_Galil takes nothing returns nothing
set gg_trg_Reloading_IMI_M_Galil = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_IMI_M_Galil, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_IMI_M_Galil, Condition( function Trig_Reloading_IMI_M_Galil_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_IMI_M_Galil, function Trig_Reloading_IMI_M_Galil_Actions )
endfunction
function Trig_Reloading_FN_SCAR_H_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H012' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H013' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01A' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_FN_SCAR_H_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 20
set ammotype = udg_FindPing[43]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_SCAR_H_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 1.80 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_FN_SCAR_H takes nothing returns nothing
set gg_trg_Reloading_FN_SCAR_H = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_FN_SCAR_H, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_FN_SCAR_H, Condition( function Trig_Reloading_FN_SCAR_H_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_FN_SCAR_H, function Trig_Reloading_FN_SCAR_H_Actions )
endfunction
function Trig_Reloading_FN_Minime_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00W' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_FN_Minime_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 100
set ammotype = udg_FindPing[46]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_FN_Minime_reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 4.60 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_FN_Minime takes nothing returns nothing
set gg_trg_Reloading_FN_Minime = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_FN_Minime, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_FN_Minime, Condition( function Trig_Reloading_FN_Minime_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_FN_Minime, function Trig_Reloading_FN_Minime_Actions )
endfunction
function Trig_Reloading_SIG_SSG_552_Commando_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H014' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H015' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01B' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_SIG_SSG_552_Commando_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[42]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_FN_F2000_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 1.60 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_SIG_SSG_552_Commando takes nothing returns nothing
set gg_trg_Reloading_SIG_SSG_552_Commando = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_SIG_SSG_552_Commando, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_SIG_SSG_552_Commando, Condition( function Trig_Reloading_SIG_SSG_552_Commando_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_SIG_SSG_552_Commando, function Trig_Reloading_SIG_SSG_552_Commando_Actions )
endfunction
function Trig_Reloading_M4A1_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H00D' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00E' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00I' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_M4A1_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[42]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_m4a1_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.50 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_M4A1 takes nothing returns nothing
set gg_trg_Reloading_M4A1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_M4A1, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_M4A1, Condition( function Trig_Reloading_M4A1_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_M4A1, function Trig_Reloading_M4A1_Actions )
endfunction
function Trig_Reloading_Micro_Uzi_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H008' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H009' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00A' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Micro_Uzi_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 20
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Micro_Uzi_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Micro_Uzi takes nothing returns nothing
set gg_trg_Reloading_Micro_Uzi = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Micro_Uzi, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Micro_Uzi, Condition( function Trig_Reloading_Micro_Uzi_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Micro_Uzi, function Trig_Reloading_Micro_Uzi_Actions )
endfunction
function Trig_Reloading_PP90M1_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H01M' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H01N' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01Q' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_PP90M1_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 64
set ammotype = udg_FindPing[44]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_SCAR_H_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_PP90M1 takes nothing returns nothing
set gg_trg_Reloading_PP90M1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_PP90M1, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_PP90M1, Condition( function Trig_Reloading_PP90M1_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_PP90M1, function Trig_Reloading_PP90M1_Actions )
endfunction
function Trig_Reloading_HK_UMP_45_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H00F' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00G' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00F' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_HK_UMP_45_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 25
set ammotype = udg_FindPing[54]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_H_K_UMP_45_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_HK_UMP_45 takes nothing returns nothing
set gg_trg_Reloading_HK_UMP_45 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_HK_UMP_45, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_HK_UMP_45, Condition( function Trig_Reloading_HK_UMP_45_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_HK_UMP_45, function Trig_Reloading_HK_UMP_45_Actions )
endfunction
function Trig_Reloading_HK_MP7_PDW_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H00H' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00I' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00J' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_HK_MP7_PDW_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 40
set ammotype = udg_FindPing[41]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_MP_7_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 1.50 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_HK_MP7_PDW takes nothing returns nothing
set gg_trg_Reloading_HK_MP7_PDW = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_HK_MP7_PDW, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_HK_MP7_PDW, Condition( function Trig_Reloading_HK_MP7_PDW_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_HK_MP7_PDW, function Trig_Reloading_HK_MP7_PDW_Actions )
endfunction
function Trig_Reloading_HK_MP5_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetManipulatingUnit()) == 'H00B' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H00C' ) ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00E' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_HK_MP5_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 30
set ammotype = udg_FindPing[52]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_MP_5_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.00 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_HK_MP5 takes nothing returns nothing
set gg_trg_Reloading_HK_MP5 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_HK_MP5, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_HK_MP5, Condition( function Trig_Reloading_HK_MP5_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_HK_MP5, function Trig_Reloading_HK_MP5_Actions )
endfunction
function Trig_Reloading_Steyr_Scout_Tactical_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00K' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00L' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Steyr_Scout_Tactical_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 10
set ammotype = udg_FindPing[43]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Steyr_Scout_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 3.10 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Steyr_Scout_Tactical takes nothing returns nothing
set gg_trg_Reloading_Steyr_Scout_Tactical = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Steyr_Scout_Tactical, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Steyr_Scout_Tactical, Condition( function Trig_Reloading_Steyr_Scout_Tactical_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Steyr_Scout_Tactical, function Trig_Reloading_Steyr_Scout_Tactical_Actions )
endfunction
function Trig_Reloading_AI_Arctic_Warfare_Rifle_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00M' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01E' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_AI_Arctic_Warfare_Rifle_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 5
set ammotype = udg_FindPing[48]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_loadclip, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.10 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_AI_Arctic_Warfare_Rifle takes nothing returns nothing
set gg_trg_Reloading_AI_Arctic_Warfare_Rifle = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_AI_Arctic_Warfare_Rifle, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_AI_Arctic_Warfare_Rifle, Condition( function Trig_Reloading_AI_Arctic_Warfare_Rifle_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_AI_Arctic_Warfare_Rifle, function Trig_Reloading_AI_Arctic_Warfare_Rifle_Actions )
endfunction
function Trig_Reloading_Winchester_44_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H011' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00Y' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Winchester_44_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
local integer reload
set udg_maxammo = 7
set ammotype = udg_FindPing[53]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) - 1 ) )
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PolledWait( 0.25 )
set reload = GetItemCharges(GetManipulatedItem())
loop
exitwhen reload == udg_maxammo
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) > 0 ) or (GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) + 1 ) )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - 1 ) )
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call PolledWait( 0.50 )
else
endif
set reload = reload + 1
endloop
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Winchester_44 takes nothing returns nothing
set gg_trg_Reloading_Winchester_44 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Winchester_44, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Winchester_44, Condition( function Trig_Reloading_Winchester_44_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Winchester_44, function Trig_Reloading_Winchester_44_Actions )
endfunction
function Trig_Reload_IZH27_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00T' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00Q' ) ) then
return false
endif
return true
endfunction
function Trig_Reload_IZH27_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 2
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call TriggerSleepAction( 0.35 )
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call TriggerSleepAction( 0.35 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reload_IZH27 takes nothing returns nothing
set gg_trg_Reload_IZH27 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reload_IZH27, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reload_IZH27, Condition( function Trig_Reload_IZH27_Conditions ) )
call TriggerAddAction( gg_trg_Reload_IZH27, function Trig_Reload_IZH27_Actions )
endfunction
function Trig_Reloading_Valtro_PM_5_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00U' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00R' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Valtro_PM_5_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 7
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Valtro_PM_5_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Valtro_PM_5 takes nothing returns nothing
set gg_trg_Reloading_Valtro_PM_5 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Valtro_PM_5, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Valtro_PM_5, Condition( function Trig_Reloading_Valtro_PM_5_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Valtro_PM_5, function Trig_Reloading_Valtro_PM_5_Actions )
endfunction
function Trig_Reloading_AA_12_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetManipulatingUnit()) == 'H01X' ) or ( GetUnitTypeId(GetManipulatingUnit()) == 'H01Y' )) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I021' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_AA_12_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 20
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Valtro_PM_5_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_AA_12 takes nothing returns nothing
set gg_trg_Reloading_AA_12 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_AA_12, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_AA_12, Condition( function Trig_Reloading_AA_12_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_AA_12, function Trig_Reloading_AA_12_Actions )
endfunction
function Trig_Reloading_Saiga_12_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01P' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01S' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Saiga_12_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 8
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_AK_47_Reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 2.30 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Saiga_12 takes nothing returns nothing
set gg_trg_Reloading_Saiga_12 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Saiga_12, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Saiga_12, Condition( function Trig_Reloading_Saiga_12_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Saiga_12, function Trig_Reloading_Saiga_12_Actions )
endfunction
function Trig_Reloading_Benelli_Nova_Tactical_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H00N' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00P' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Benelli_Nova_Tactical_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
local integer reload
set udg_maxammo = 6
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PolledWait( 0.25 )
set reload = GetItemCharges(GetManipulatedItem())
loop
exitwhen reload == udg_maxammo
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) > 0 ) or (GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) + 1 ) )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - 1 ) )
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call PolledWait( 0.50 )
else
endif
set reload = reload + 1
endloop
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Benelli_Nova_Tactical takes nothing returns nothing
set gg_trg_Reloading_Benelli_Nova_Tactical = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Benelli_Nova_Tactical, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Benelli_Nova_Tactical, Condition( function Trig_Reloading_Benelli_Nova_Tactical_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Benelli_Nova_Tactical, function Trig_Reloading_Benelli_Nova_Tactical_Actions )
endfunction
function Trig_Browning_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01L' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01P' ) ) then
return false
endif
return true
endfunction
function Trig_Browning_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
local integer reload
set udg_maxammo = 5
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) - 1 ) )
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PolledWait( 0.25 )
set reload = GetItemCharges(GetManipulatedItem())
loop
exitwhen reload == udg_maxammo
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) > 0 ) or (GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) + 1 ) )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - 1 ) )
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call PolledWait( 0.50 )
else
endif
set reload = reload + 1
endloop
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Browning takes nothing returns nothing
set gg_trg_Browning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Browning, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Browning, Condition( function Trig_Browning_Conditions ) )
call TriggerAddAction( gg_trg_Browning, function Trig_Browning_Actions )
endfunction
function Trig_Reloading_Ithaca_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H010' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00X' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_Ithaca_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
local integer reload
set udg_maxammo = 4
set ammotype = udg_FindPing[40]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) - 1 ) )
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PolledWait( 0.25 )
set reload = GetItemCharges(GetManipulatedItem())
loop
exitwhen reload == udg_maxammo
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) > 0 ) or (GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) + 1 ) )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - 1 ) )
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call PolledWait( 0.50 )
else
endif
set reload = reload + 1
endloop
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_Ithaca takes nothing returns nothing
set gg_trg_Reloading_Ithaca = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_Ithaca, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_Ithaca, Condition( function Trig_Reloading_Ithaca_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_Ithaca, function Trig_Reloading_Ithaca_Actions )
endfunction
function Trig_Reloading_EX41_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01R' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01V' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_EX41_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
local integer reload
set udg_maxammo = 3
set ammotype = udg_FindPing[50]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PolledWait( 0.25 )
set reload = GetItemCharges(GetManipulatedItem())
loop
exitwhen reload == udg_maxammo
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) > 0 ) or (GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetManipulatedItem()) + 1 ) )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - 1 ) )
call PlaySoundOnUnitBJ( gg_snd_Load_one_shell, 100, GetManipulatingUnit() )
call PolledWait( 0.50 )
else
endif
set reload = reload + 1
endloop
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_EX41 takes nothing returns nothing
set gg_trg_Reloading_EX41 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_EX41, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_EX41, Condition( function Trig_Reloading_EX41_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_EX41, function Trig_Reloading_EX41_Actions )
endfunction
function Trig_Reloading_HK69_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == 'H01Q' ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I01T' ) ) then
return false
endif
return true
endfunction
function Trig_Reloading_HK69_Actions takes nothing returns nothing
local integer udg_maxammo
local integer ammotype
set udg_maxammo = 1
set ammotype = udg_FindPing[50]
call TriggerSleepAction( 0.10 )
if ( GetItemCharges(GetManipulatedItem()) < udg_maxammo ) then
if ( UnitHasItemOfTypeBJ(GetTriggerUnit(), ammotype) == false ) then
else
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = true
call PlaySoundOnUnitBJ( gg_snd_Flare_pistol_reload, 100, GetManipulatingUnit() )
call TriggerSleepAction( 1.50 )
call SetItemCharges( GetManipulatedItem(), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + GetItemCharges(GetManipulatedItem()) ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) - GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) ) )
if ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), GetItemTypeId(GetManipulatedItem()))) > udg_maxammo ) then
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), ammotype)) + ( GetItemCharges(GetManipulatedItem()) - udg_maxammo ) ) )
endif
if ( GetItemCharges(GetManipulatedItem()) > udg_maxammo ) then
call SetItemCharges( GetManipulatedItem(), udg_maxammo )
call SetItemUserData( GetManipulatedItem(), GetItemCharges(GetManipulatedItem()) )
endif
endif
else
endif
set udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = false
endfunction
//===========================================================================
function InitTrig_Reloading_HK69 takes nothing returns nothing
set gg_trg_Reloading_HK69 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reloading_HK69, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddCondition( gg_trg_Reloading_HK69, Condition( function Trig_Reloading_HK69_Conditions ) )
call TriggerAddAction( gg_trg_Reloading_HK69, function Trig_Reloading_HK69_Actions )
endfunction
function Trig_Shooting_26mm_Pistol_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01K' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_26mm_Pistol_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01N')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01N') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_Flare_pistol, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01N'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01N')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01N'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01N')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I01O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01N') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01N') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_26mm_Pistol takes nothing returns nothing
set gg_trg_Shooting_26mm_Pistol = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_26mm_Pistol, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_26mm_Pistol, Condition( function Trig_Shooting_26mm_Pistol_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_26mm_Pistol, function Trig_Shooting_26mm_Pistol_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shooting_BowRed_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01S' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_BowRed_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01X') == true and UnitHasItemOfTypeBJ(GetAttacker(), 'I01Y') == true and GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Y')) > 0 and udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false) then
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Y'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Y')) - 1 ) )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Y'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Y')) - 1 ) )
call PlaySoundOnUnitBJ( gg_snd_BowShooting, 100, GetAttacker() )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endfunction
//===========================================================================
function InitTrig_Shooting_BowRed takes nothing returns nothing
set gg_trg_Shooting_BowRed = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_BowRed, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_BowRed, Condition( function Trig_Shooting_BowRed_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_BowRed, function Trig_Shooting_BowRed_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Bow_Kill_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetKillingUnitBJ()) == 'H01S' ) ) then
return false
endif
return true
endfunction
function Trig_Bow_Kill_Actions takes nothing returns nothing
local location udg_tmpPoint
local location theatkunit
local location atkedunit
local location polar
local real angel
set udg_tmpPoint = GetUnitLoc(GetDyingUnit())
set theatkunit = GetUnitLoc(GetKillingUnit())
set atkedunit = GetUnitLoc(GetTriggerUnit())
set angel = AngleBetweenPoints(theatkunit, atkedunit)
set polar = PolarProjectionBJ(atkedunit, 100.00, angel)
call CreateNUnitsAtLocFacingLocBJ( 1, 'h02D', GetOwningPlayer(GetKillingUnit()), udg_tmpPoint, polar )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "move", polar )
call UnitApplyTimedLifeBJ( 0.20, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(polar)
call RemoveLocation(udg_tmpPoint)
call RemoveLocation(theatkunit)
call RemoveLocation(atkedunit)
endfunction
//===========================================================================
function InitTrig_Bow_Kill takes nothing returns nothing
set gg_trg_Bow_Kill = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bow_Kill, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Bow_Kill, Condition( function Trig_Bow_Kill_Conditions ) )
call TriggerAddAction( gg_trg_Bow_Kill, function Trig_Bow_Kill_Actions )
endfunction
function Trig_Shooting_AA12_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H01Y' ) or ( GetUnitTypeId(GetAttacker()) == 'H01X' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_AA12_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I021') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I021')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H01X' ) then
call PlaySoundOnUnitBJ( gg_snd_AA12_Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_AA12_Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I021'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I021')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I021'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I021')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I021') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I021') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_AA12 takes nothing returns nothing
set gg_trg_Shooting_AA12 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_AA12, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_AA12, Condition( function Trig_Shooting_AA12_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_AA12, function Trig_Shooting_AA12_Actions )
endfunction
function Trig_Shooting_AI_AWR_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00M' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_AI_AWR_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01E')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01E') == true )) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) ) ) then
call PlaySoundOnUnitBJ( gg_snd_Al_Arctic_Warfare, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01E'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01E')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01E'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01E')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
call CameraSetEQNoiseForPlayer( GetOwningPlayer(GetAttacker()), 1.00 )
call TriggerSleepAction( 0.40 )
call CameraClearNoiseForPlayer( GetOwningPlayer(GetAttacker()) )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I01F') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01E') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01E') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_AI_AWR takes nothing returns nothing
set gg_trg_Shooting_AI_AWR = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_AI_AWR, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_AI_AWR, Condition( function Trig_Shooting_AI_AWR_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_AI_AWR, function Trig_Shooting_AI_AWR_Actions )
endfunction
function Trig_Shooting_Browning_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01L' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Browning_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01P') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01P')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Browning, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01P'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01P')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01P'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01P')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01P') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01P') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Browning takes nothing returns nothing
set gg_trg_Shooting_Browning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Browning, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Browning, Condition( function Trig_Shooting_Browning_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Browning, function Trig_Shooting_Browning_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shooting_Steyr_Scout_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00K' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Steyr_Scout_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00L') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00L')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Steyr_Scout_Rifle, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00L'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00L')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00L'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00L')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00G') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00L') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00L') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Steyr_Scout takes nothing returns nothing
set gg_trg_Shooting_Steyr_Scout = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Steyr_Scout, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Steyr_Scout, Condition( function Trig_Shooting_Steyr_Scout_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Steyr_Scout, function Trig_Shooting_Steyr_Scout_Actions )
endfunction
function Trig_Shooting_IZH27_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00T' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_IZH27_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Q')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00Q') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_Shotgun2, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Q'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Q')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Q'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Q')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00Q') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00Q') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_IZH27 takes nothing returns nothing
set gg_trg_Shooting_IZH27 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_IZH27, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_IZH27, Condition( function Trig_Shooting_IZH27_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_IZH27, function Trig_Shooting_IZH27_Actions )
endfunction
function Trig_Shooting_EX41_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01R' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_EX41_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01V') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01V')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_HK69, 100, GetAttacker() )
call PlaySoundOnUnitBJ( gg_snd_ShotgunPumpAction, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01V'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01V')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01V'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01V')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I01U') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01V') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01V') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_EX41 takes nothing returns nothing
set gg_trg_Shooting_EX41 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_EX41, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_EX41, Condition( function Trig_Shooting_EX41_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_EX41, function Trig_Shooting_EX41_Actions )
endfunction
function Trig_Shooting_HK_69_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01Q' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_HK_69_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01T')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01T') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_HK69, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01T'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01T')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01T'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01T')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01U') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01T') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01T') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_HK_69 takes nothing returns nothing
set gg_trg_Shooting_HK_69 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_HK_69, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_HK_69, Condition( function Trig_Shooting_HK_69_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_HK_69, function Trig_Shooting_HK_69_Actions )
endfunction
function Trig_Shooting_HK_USP_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H006' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_HK_USP_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01W') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01W')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_H_K_USP, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01W'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01W')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01W'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01W')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I002') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01W') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01W') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_HK_USP takes nothing returns nothing
set gg_trg_Shooting_HK_USP = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_HK_USP, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_HK_USP, Condition( function Trig_Shooting_HK_USP_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_HK_USP, function Trig_Shooting_HK_USP_Actions )
endfunction
function Trig_Shooting_Mauser_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01J' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Mauser_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01K') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01K')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Mauser_M2__45, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01K'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01K')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01K'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01K')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I002') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01K') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01K') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Mauser takes nothing returns nothing
set gg_trg_Shooting_Mauser = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Mauser, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Mauser, Condition( function Trig_Shooting_Mauser_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Mauser, function Trig_Shooting_Mauser_Actions )
endfunction
function Trig_Shooting_Bereta9000_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H003' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Bereta9000_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01M')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01M') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_Beretta_PX4_Storm, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01M'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01M')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01M'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01M')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I006') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01M') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01M') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Bereta9000 takes nothing returns nothing
set gg_trg_Shooting_Bereta9000 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Bereta9000, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Bereta9000, Condition( function Trig_Shooting_Bereta9000_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Bereta9000, function Trig_Shooting_Bereta9000_Actions )
endfunction
function Trig_Shooting_Galil_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetAttacker()) == 'H018' ) or ( GetUnitTypeId(GetAttacker()) == 'H019' )) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Galil_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01D') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01D')) > 0 )) ) then
if (( GetUnitTypeId(GetAttacker()) == 'H018' ) ) then
call PlaySoundOnUnitBJ( gg_snd_IMI_Galil_M__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_IMI_Galil_M__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01D'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01D')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01D'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01D')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00G') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01D') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01D') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Galil takes nothing returns nothing
set gg_trg_Shooting_Galil = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Galil, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Galil, Condition( function Trig_Shooting_Galil_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Galil, function Trig_Shooting_Galil_Actions )
endfunction
function Trig_Shooting_AK47_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetAttacker()) == 'H00V' ) or ( GetUnitTypeId(GetAttacker()) == 'H00X' )) ) then
return false
endif
return true
endfunction
function Trig_Shooting_AK47_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00S') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00S')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H00V' ) then
call PlaySoundOnUnitBJ( gg_snd_AK_47_Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_AK_47_Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00S'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00S')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00S'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00S')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00G') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00S') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00S') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_AK47 takes nothing returns nothing
set gg_trg_Shooting_AK47 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_AK47, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_AK47, Condition( function Trig_Shooting_AK47_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_AK47, function Trig_Shooting_AK47_Actions )
endfunction
function Trig_Shooting_AUG_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H017' ) or ( GetUnitTypeId(GetAttacker()) == 'H016' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_AUG_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01C') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01C')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H016' ) then
call PlaySoundOnUnitBJ( gg_snd_Steyr_Aug_A1__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_Steyr_Aug_A1__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01C'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01C')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01C'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01C')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00H') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01C') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01C') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_AUG takes nothing returns nothing
set gg_trg_Shooting_AUG = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_AUG, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_AUG, Condition( function Trig_Shooting_AUG_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_AUG, function Trig_Shooting_AUG_Actions )
endfunction
function Trig_Shooting_G36_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H01U' ) or ( GetUnitTypeId(GetAttacker()) == 'H01T' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_G36_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01Z') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Z')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H01T' ) then
call PlaySoundOnUnitBJ( gg_snd_G36_FullAuto, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_G36_SemiAuto, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Z'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Z')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Z'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Z')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00H') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01Z') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01Z') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_G36 takes nothing returns nothing
set gg_trg_Shooting_G36 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_G36, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_G36, Condition( function Trig_Shooting_G36_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_G36, function Trig_Shooting_G36_Actions )
endfunction
function Trig_Shooting_SIG_COMM_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H014' ) or ( GetUnitTypeId(GetAttacker()) == 'H015' )) ) then
return false
endif
return true
endfunction
function Trig_Shooting_SIG_COMM_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01B') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01B')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H014' ) then
call PlaySoundOnUnitBJ( gg_snd_FN_F2000__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_FN_F2000__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01B'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01B')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01B'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01B')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00H') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01B') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01B') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_SIG_COMM takes nothing returns nothing
set gg_trg_Shooting_SIG_COMM = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_SIG_COMM, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_SIG_COMM, Condition( function Trig_Shooting_SIG_COMM_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_SIG_COMM, function Trig_Shooting_SIG_COMM_Actions )
endfunction
function Trig_Shooting_FN_SCAR_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H013' ) or ( GetUnitTypeId(GetAttacker()) == 'H012' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_FN_SCAR_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01A') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01A')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H012' ) then
call PlaySoundOnUnitBJ( gg_snd_FN_SCAR_H__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_FN_SCAR_H__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01A'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01A')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01A'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01A')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00G') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01A') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01A') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_FN_SCAR takes nothing returns nothing
set gg_trg_Shooting_FN_SCAR = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_FN_SCAR, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_FN_SCAR, Condition( function Trig_Shooting_FN_SCAR_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_FN_SCAR, function Trig_Shooting_FN_SCAR_Actions )
endfunction
function Trig_Shooting_M4A1_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H00E' ) or ( GetUnitTypeId(GetAttacker()) == 'H00D' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_M4A1_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00I') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00I')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H00D' ) then
call PlaySoundOnUnitBJ( gg_snd_M4A1__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_M4A1__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00I'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00I')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00I'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00I')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00H') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00I') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00I') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_M4A1 takes nothing returns nothing
set gg_trg_Shooting_M4A1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_M4A1, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_M4A1, Condition( function Trig_Shooting_M4A1_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_M4A1, function Trig_Shooting_M4A1_Actions )
endfunction
function Trig_Shooting_Firestar_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H002' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Firestar_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I007') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I007')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Firestar_9mm, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I007'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I007')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I007'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I007')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I007') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I007') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Firestar takes nothing returns nothing
set gg_trg_Shooting_Firestar = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Firestar, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Firestar, Condition( function Trig_Shooting_Firestar_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Firestar, function Trig_Shooting_Firestar_Actions )
endfunction
function Trig_Shooting_Revelli_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H021' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Revelli_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I023') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I023')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Villar_Perosa, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I023'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I023')) - 2 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I023'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I023')) - 2 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I023') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I023') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Revelli takes nothing returns nothing
set gg_trg_Shooting_Revelli = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Revelli, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Revelli, Condition( function Trig_Shooting_Revelli_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Revelli, function Trig_Shooting_Revelli_Actions )
endfunction
function Trig_Shooting_IMI_Barak_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01I' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_IMI_Barak_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01J') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01J')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_IMI_SP_21_Barak__45, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01J'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01J')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01J'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01J')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01J') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01J') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_IMI_Barak takes nothing returns nothing
set gg_trg_Shooting_IMI_Barak = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_IMI_Barak, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_IMI_Barak, Condition( function Trig_Shooting_IMI_Barak_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_IMI_Barak, function Trig_Shooting_IMI_Barak_Actions )
endfunction
function Trig_Shooting_Baretta_93_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H004' ) or ( GetUnitTypeId(GetAttacker()) == 'H005' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Baretta_93_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I005') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H004' ) then
call PlaySoundOnUnitBJ( gg_snd_Beretta_93R_Semi, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
call PlaySoundOnUnitBJ( gg_snd_Beretta_93R_Burst, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005')) - 3 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I005')) - 3 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
endif
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I005') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I005') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Baretta_93 takes nothing returns nothing
set gg_trg_Shooting_Baretta_93 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Baretta_93, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Baretta_93, Condition( function Trig_Shooting_Baretta_93_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Baretta_93, function Trig_Shooting_Baretta_93_Actions )
endfunction
function Trig_Shooting_Glock_18_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetAttacker()) == 'H01Z' ) or ( GetUnitTypeId(GetAttacker()) == 'H020' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Glock_18_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I022') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I022')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H01Z' ) then
call PlaySoundOnUnitBJ( gg_snd_Glock18_SEMI, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_Glock18_FULL, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I022'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I022')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I022'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I022')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I022') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I022') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Glock_18 takes nothing returns nothing
set gg_trg_Shooting_Glock_18 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Glock_18, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Glock_18, Condition( function Trig_Shooting_Glock_18_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Glock_18, function Trig_Shooting_Glock_18_Actions )
endfunction
function Trig_Shooting_Benelli_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00N' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Benelli_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( (( ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00P') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00P')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Benelli_Nova_Tactical, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00P'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00P')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00P'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00P')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00P') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00P') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Benelli takes nothing returns nothing
set gg_trg_Shooting_Benelli = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Benelli, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Benelli, Condition( function Trig_Shooting_Benelli_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Benelli, function Trig_Shooting_Benelli_Actions )
endfunction
function Trig_Shooting_Ithaca_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H010' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Ithaca_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00X') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00X')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Shotgun, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00X'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00X')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00X'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00X')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00X') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00X') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Ithaca takes nothing returns nothing
set gg_trg_Shooting_Ithaca = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Ithaca, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Ithaca, Condition( function Trig_Shooting_Ithaca_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Ithaca, function Trig_Shooting_Ithaca_Actions )
endfunction
function Trig_Shooting_Valtro_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00U' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Valtro_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00R') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00R')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Valtro_PM_5, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00R'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00R')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00R'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00R')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00R') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00R') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Valtro takes nothing returns nothing
set gg_trg_Shooting_Valtro = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Valtro, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Valtro, Condition( function Trig_Shooting_Valtro_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Valtro, function Trig_Shooting_Valtro_Actions )
endfunction
function Trig_Shooting_Saiga_12_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01P' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Saiga_12_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01S') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01S')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Browning, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01S'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01S')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01S'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01S')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00O') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01S') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01S') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Saiga_12 takes nothing returns nothing
set gg_trg_Shooting_Saiga_12 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Saiga_12, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Saiga_12, Condition( function Trig_Shooting_Saiga_12_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Saiga_12, function Trig_Shooting_Saiga_12_Actions )
endfunction
function Trig_Shooting_SM_500_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H007' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_SM_500_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I009')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I009') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_Browning, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I009'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I009')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I009'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I009')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
call CameraSetEQNoiseForPlayer( GetOwningPlayer(GetAttacker()), 1.00 )
call TriggerSleepAction( 0.40 )
call CameraClearNoiseForPlayer( GetOwningPlayer(GetAttacker()) )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00D') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I009') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I009') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_SM_500 takes nothing returns nothing
set gg_trg_Shooting_SM_500 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_SM_500, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_SM_500, Condition( function Trig_Shooting_SM_500_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_SM_500, function Trig_Shooting_SM_500_Actions )
endfunction
function Trig_Shooting_MR_Prototype_12_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H02A' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_MR_Prototype_12_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02B')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I02B') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_Revolver338, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02B'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02B')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02B'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02B')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
call CameraSetEQNoiseForPlayer( GetOwningPlayer(GetAttacker()), 3.00 )
call TriggerSleepAction( 0.70 )
call CameraClearNoiseForPlayer( GetOwningPlayer(GetAttacker()) )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01F') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I02B') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I02B') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_MR_Prototype_12 takes nothing returns nothing
set gg_trg_Shooting_MR_Prototype_12 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_MR_Prototype_12, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_MR_Prototype_12, Condition( function Trig_Shooting_MR_Prototype_12_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_MR_Prototype_12, function Trig_Shooting_MR_Prototype_12_Actions )
endfunction
function Trig_Shooting_FN_Minime_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00W' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_FN_Minime_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00Z') == true ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Z')) > 0 ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) ) then
call PlaySoundOnUnitBJ( gg_snd_FN_Minime, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Z'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Z')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Z'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Z')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00Z') == true ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I010')) > 0 ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00Z') )
else
call IssueImmediateOrder( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_FN_Minime takes nothing returns nothing
set gg_trg_Shooting_FN_Minime = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_FN_Minime, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_FN_Minime, Condition( function Trig_Shooting_FN_Minime_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_FN_Minime, function Trig_Shooting_FN_Minime_Actions )
endfunction
function Trig_Shooting_HK_21_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H022' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_HK_21_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I024') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I024')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_HK_21, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I024'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I024')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I024'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I024')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00G') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I024') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I024') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_HK_21 takes nothing returns nothing
set gg_trg_Shooting_HK_21 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_HK_21, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_HK_21, Condition( function Trig_Shooting_HK_21_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_HK_21, function Trig_Shooting_HK_21_Actions )
endfunction
function Trig_Shooting_Uzi_Conditions takes nothing returns boolean
if ( not (( GetUnitTypeId(GetAttacker()) == 'H009' ) or ( GetUnitTypeId(GetAttacker()) == 'H008' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Uzi_Actions takes nothing returns nothing
local effect udg_tmpEffect
if (((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00A') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00A')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H008' ) then
call PlaySoundOnUnitBJ( gg_snd_Micro_Uzi__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_Micro_Uzi__Single, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00A'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00A')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00A'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00A')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00A') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00A') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Uzi takes nothing returns nothing
set gg_trg_Shooting_Uzi = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Uzi, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Uzi, Condition( function Trig_Shooting_Uzi_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Uzi, function Trig_Shooting_Uzi_Actions )
endfunction
function Trig_Shooting_vz65_Scorpion_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H028' ) or ( GetUnitTypeId(GetAttacker()) == 'H027' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_vz65_Scorpion_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I029') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I029')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H027' ) then
call PlaySoundOnUnitBJ( gg_snd_Scorpion_AUTO, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_Scorpion_SEMI, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I029'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I029')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I029'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I029')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I029') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I029') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_vz65_Scorpion takes nothing returns nothing
set gg_trg_Shooting_vz65_Scorpion = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_vz65_Scorpion, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_vz65_Scorpion, Condition( function Trig_Shooting_vz65_Scorpion_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_vz65_Scorpion, function Trig_Shooting_vz65_Scorpion_Actions )
endfunction
function Trig_Shooting_PP90M1_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H01N' ) or ( GetUnitTypeId(GetAttacker()) == 'H01M' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_PP90M1_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01Q') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Q')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H01M' ) then
call PlaySoundOnUnitBJ( gg_snd_PP90_M1, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_PP90_M1_Single, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Q'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Q')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Q'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01Q')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I003') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01Q') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01Q') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_PP90M1 takes nothing returns nothing
set gg_trg_Shooting_PP90M1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_PP90M1, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_PP90M1, Condition( function Trig_Shooting_PP90M1_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_PP90M1, function Trig_Shooting_PP90M1_Actions )
endfunction
function Trig_Shooting_mac_10_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H00Q' ) or ( GetUnitTypeId(GetAttacker()) == 'H00A' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_mac_10_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00C') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00C')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H00A' ) then
call PlaySoundOnUnitBJ( gg_snd_Ingram_Mac10__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_Ingram_Mac10__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00C'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00C')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00C'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00C')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I002') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00C') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00C') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_mac_10 takes nothing returns nothing
set gg_trg_Shooting_mac_10 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_mac_10, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_mac_10, Condition( function Trig_Shooting_mac_10_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_mac_10, function Trig_Shooting_mac_10_Actions )
endfunction
function Trig_Shooting_P90_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H00S' ) or ( GetUnitTypeId(GetAttacker()) == 'H00J' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_P90_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00K') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00K')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H00J' ) then
call PlaySoundOnUnitBJ( gg_snd_FN_P90__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_FN_P90__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00K'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00K')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00K'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00K')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( UnitHasItemOfTypeBJ(GetAttacker(), 'I001') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00K') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00K') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_P90 takes nothing returns nothing
set gg_trg_Shooting_P90 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_P90, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_P90, Condition( function Trig_Shooting_P90_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_P90, function Trig_Shooting_P90_Actions )
endfunction
function Trig_Shooting_mp5_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H00C' ) or ( GetUnitTypeId(GetAttacker()) == 'H00B' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_mp5_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00E')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00E') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H00B' ) then
call PlaySoundOnUnitBJ( gg_snd_MP_5__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_MP_5__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00E'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00E')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00E'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00E')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I006') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00E') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) )) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00E') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_mp5 takes nothing returns nothing
set gg_trg_Shooting_mp5 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_mp5, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_mp5, Condition( function Trig_Shooting_mp5_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_mp5, function Trig_Shooting_mp5_Actions )
endfunction
function Trig_Shooting_hk_ump_45_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H00G' ) or ( GetUnitTypeId(GetAttacker()) == 'H00F' ) ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_hk_ump_45_Actions takes nothing returns nothing
local effect udg_tmpEffect
if (((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00F') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00F')) > 0 ))) then
if (GetUnitTypeId(GetAttacker()) == 'H00F') then
call PlaySoundOnUnitBJ( gg_snd_H_K_UMP_45__Multi, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_H_K_UMP_45__Single, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00F'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00F')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00F'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00F')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if (((( UnitHasItemOfTypeBJ(GetAttacker(), 'I002') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00F') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ))) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00F') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_hk_ump_45 takes nothing returns nothing
set gg_trg_Shooting_hk_ump_45 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_hk_ump_45, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_hk_ump_45, Condition( function Trig_Shooting_hk_ump_45_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_hk_ump_45, function Trig_Shooting_hk_ump_45_Actions )
endfunction
function Trig_Shooting_TommyGun_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H01W' ) or ( GetUnitTypeId(GetAttacker()) == 'H01V' ) )) then
return false
endif
return true
endfunction
function Trig_Shooting_TommyGun_Actions takes nothing returns nothing
local effect udg_tmpEffect
if (((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I020') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I020')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H01V' ) then
call PlaySoundOnUnitBJ( gg_snd_TommyGun_FulAuto, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_TommyGun_SEMIAuto, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I020'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I020')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I020'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I020')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if (((( UnitHasItemOfTypeBJ(GetAttacker(), 'I002') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I020') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I020') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_TommyGun takes nothing returns nothing
set gg_trg_Shooting_TommyGun = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_TommyGun, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_TommyGun, Condition( function Trig_Shooting_TommyGun_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_TommyGun, function Trig_Shooting_TommyGun_Actions )
endfunction
function Trig_Shooting_MP7_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H00I' ) or ( GetUnitTypeId(GetAttacker()) == 'H00H' )) ) then
return false
endif
return true
endfunction
function Trig_Shooting_MP7_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00J') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00J')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H00H' ) then
call PlaySoundOnUnitBJ( gg_snd_MP_7_PWD__Full, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_MP_7_PWD__Semi, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00J'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00J')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00J'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00J')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if (((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00B') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00J') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ))) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00J') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_MP7 takes nothing returns nothing
set gg_trg_Shooting_MP7 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_MP7, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_MP7, Condition( function Trig_Shooting_MP7_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_MP7, function Trig_Shooting_MP7_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shooting_Five_Seven_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H000' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Five_Seven_Actions takes nothing returns nothing
local effect udg_tmpEffect
if (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I000') == true ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I000')) > 0 )) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) then
call PlaySoundOnUnitBJ( gg_snd_Five_Seven, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I000'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I000')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I000'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I000')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ( (( UnitHasItemOfTypeBJ(GetAttacker(), 'I000') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I001') == true )) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) ) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I000') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Five_Seven takes nothing returns nothing
set gg_trg_Shooting_Five_Seven = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Five_Seven, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Five_Seven, Condition( function Trig_Shooting_Five_Seven_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Five_Seven, function Trig_Shooting_Five_Seven_Actions )
endfunction
function Trig_Shooting_SOW_Prototype_042_Conditions takes nothing returns boolean
if ( not ( ( GetUnitTypeId(GetAttacker()) == 'H02C' ) or ( GetUnitTypeId(GetAttacker()) == 'H02B' ) )) then
return false
endif
return true
endfunction
function Trig_Shooting_SOW_Prototype_042_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I02C') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02C')) > 0 )) ) then
if ( GetUnitTypeId(GetAttacker()) == 'H02B' ) then
call PlaySoundOnUnitBJ( gg_snd_SOW_Auto, 100, GetAttacker() )
else
call PlaySoundOnUnitBJ( gg_snd_SOW_SemiAuto, 100, GetAttacker() )
endif
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02C'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02C')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02C'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I02C')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if (((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00V') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I02C') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I02C') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_SOW_Prototype_042 takes nothing returns nothing
set gg_trg_Shooting_SOW_Prototype_042 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_SOW_Prototype_042, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_SOW_Prototype_042, Condition( function Trig_Shooting_SOW_Prototype_042_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_SOW_Prototype_042, function Trig_Shooting_SOW_Prototype_042_Actions )
endfunction
function Trig_Shooting_Desert_Eagle_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00Y' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Desert_Eagle_Actions takes nothing returns nothing
local effect udg_tmpEffect
if (((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00U') == true ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00U')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Desert_Eagle__44, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00U'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00U')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00U'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00U')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( (( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00T') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00U') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00U') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Desert_Eagle takes nothing returns nothing
set gg_trg_Shooting_Desert_Eagle = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Desert_Eagle, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Desert_Eagle, Condition( function Trig_Shooting_Desert_Eagle_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Desert_Eagle, function Trig_Shooting_Desert_Eagle_Actions )
endfunction
function Trig_Shooting_SIG_Sauer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00R' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_SIG_Sauer_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00N') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00N')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Sig_Sauer_SSG_Pro, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00N'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00N')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00N'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00N')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00M') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00N') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00N') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_SIG_Sauer takes nothing returns nothing
set gg_trg_Shooting_SIG_Sauer = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_SIG_Sauer, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_SIG_Sauer, Condition( function Trig_Shooting_SIG_Sauer_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_SIG_Sauer, function Trig_Shooting_SIG_Sauer_Actions )
endfunction
function Trig_Shooting_Coonan_357_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H01O' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Coonan_357_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01R') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01R')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Automag, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01R'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01R')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01R'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I01R')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_MinigunEffectAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00V') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I01R') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I01R') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Coonan_357 takes nothing returns nothing
set gg_trg_Shooting_Coonan_357 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Coonan_357, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Coonan_357, Condition( function Trig_Shooting_Coonan_357_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Coonan_357, function Trig_Shooting_Coonan_357_Actions )
endfunction
function Trig_Shooting_Colt_Python_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Colt_Python_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00W') == true ) ) and ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00W')) > 0 )) ) then
call PlaySoundOnUnitBJ( gg_snd_Colt_Pyton_Elite, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00W'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00W')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00W'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00W')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ( ((( UnitHasItemOfTypeBJ(GetAttacker(), 'I00V') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00W') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00W') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Colt_Python takes nothing returns nothing
set gg_trg_Shooting_Colt_Python = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Colt_Python, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Colt_Python, Condition( function Trig_Shooting_Colt_Python_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Colt_Python, function Trig_Shooting_Colt_Python_Actions )
endfunction
function Trig_Shooting_Winchester_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'H011' ) ) then
return false
endif
return true
endfunction
function Trig_Shooting_Winchester_Actions takes nothing returns nothing
local effect udg_tmpEffect
if ( ((( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Y')) > 0 ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00Y') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call PlaySoundOnUnitBJ( gg_snd_Winchester, 100, GetAttacker() )
call SetItemCharges( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Y'), ( GetItemCharges(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Y')) - 1 ) )
call SetItemUserData( GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Y'), ( GetItemUserData(GetItemOfTypeFromUnitBJ(GetAttacker(), 'I00Y')) - 1 ) )
call AddSpecialEffectTargetUnitBJ( "weapon", GetAttacker(), "Konstrukt_ShotgunEffektAttachment.MDX" )
set udg_tmpEffect = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_tmpEffect )
else
if ((( ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00T') == true ) and ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00Y') == true ) ) and ( udg_reloading[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))] == false )) ) then
call UnitUseItem( udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], GetItemOfTypeFromUnitBJ(udg_Hero[GetConvertedPlayerId(GetOwningPlayer(GetAttacker()))], 'I00Y') )
else
call IssueImmediateOrderBJ( GetAttacker(), "stop" )
endif
endif
endfunction
//===========================================================================
function InitTrig_Shooting_Winchester takes nothing returns nothing
set gg_trg_Shooting_Winchester = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shooting_Winchester, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shooting_Winchester, Condition( function Trig_Shooting_Winchester_Conditions ) )
call TriggerAddAction( gg_trg_Shooting_Winchester, function Trig_Shooting_Winchester_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_LearnsSkill_Actions takes nothing returns nothing
if (udg_setskills[GetConvertedPlayerId(GetTriggerPlayer())] == false) then
set udg_SkillA[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetUnitAbilityLevelSwapped('A005', GetTriggerUnit())
set udg_SkillB[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetUnitAbilityLevelSwapped('A00E', GetTriggerUnit())
set udg_SkillC[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetUnitAbilityLevelSwapped('A006', GetTriggerUnit())
set udg_SkillD[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = (GetUnitAbilityLevelSwapped('A00N', GetTriggerUnit()) + GetUnitAbilityLevelSwapped('A018', GetTriggerUnit()) + GetUnitAbilityLevelSwapped('A019', GetTriggerUnit()))
endif
endfunction
//===========================================================================
function InitTrig_LearnsSkill takes nothing returns nothing
set gg_trg_LearnsSkill = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_LearnsSkill, EVENT_PLAYER_HERO_SKILL )
call TriggerAddAction( gg_trg_LearnsSkill, function Trig_LearnsSkill_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Unbezeichneter_Ausl__ser_002_Conditions takes nothing returns boolean
local integer xena
set xena = GetUnitTypeId(GetAttacker())
if ( xena == 'u001' or xena == 'u000' or xena == 'u000' or xena == 'u003' or xena == 'u00C' or xena == 'u002' or xena == 'u00I' or xena == 'u004') then
if (IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) then
return true
endif
return false
endif
return false
endfunction
function Trig_Unbezeichneter_Ausl__ser_002_Actions takes nothing returns nothing
local integer rant
set rant = GetRandomInt(0,10)
if (rant > 5 ) then
call AddOpenWound(GetTriggerUnit())
endif
endfunction
//===========================================================================
function InitTrig_OpenWound takes nothing returns nothing
set gg_trg_OpenWound = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_OpenWound, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_OpenWound, Condition( function Trig_Unbezeichneter_Ausl__ser_002_Conditions ) )
call TriggerAddAction( gg_trg_OpenWound, function Trig_Unbezeichneter_Ausl__ser_002_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_9002_Conditions takes nothing returns boolean
local integer xena
set xena = GetUnitTypeId(GetAttacker())
if ( xena == 'u006' or xena == 'u007' or xena == 'u009' or xena == 'u00E') then
if (IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) then
return true
endif
return false
endif
return false
endfunction
function Trig_9002_Actions takes nothing returns nothing
local integer rant
set rant = GetRandomInt(0,10)
if (rant < GetUnitLevel(GetAttacker())) then
call AddBrokenLeg(GetTriggerUnit())
endif
endfunction
//===========================================================================
function InitTrig_BrokenLeg takes nothing returns nothing
set gg_trg_BrokenLeg = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_BrokenLeg, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_BrokenLeg, Condition( function Trig_9002_Conditions ) )
call TriggerAddAction( gg_trg_BrokenLeg, function Trig_9002_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_New_Item_Spawn_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_1082" )
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01I', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02E', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = 1
loop
exitwhen bla > 5
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01L', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02F', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01H', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I004', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I019', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I008', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I013', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I012', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I018', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I010', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00B', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00M', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00T', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00V', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I004', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.25 )
set bla = 1
loop
exitwhen bla > 2
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I014', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I015', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I02G', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
set bla = 1
loop
exitwhen bla > 10
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00O', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00H', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00G', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I003', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.25 )
set bla = 1
loop
exitwhen bla > 8
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I001', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I006', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I002', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I017', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I011', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
call TriggerSleepAction( 0.25 )
set bla = 1
loop
exitwhen bla > 3
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01Y', udg_tmpPoint ) // Hunting Arrows (want to remove)
//call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01F', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I00D', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
call CreateItemLoc( 'I01U', udg_tmpPoint )
call RemoveLocation(udg_tmpPoint)
//set udg_tmpPoint = GetRandomLocInRect(GetPlayableMapRect())
//call CreateItemLoc( 'I01O', udg_tmpPoint ) // Flare shells (want to remove)
//call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
endloop
set udg_tmpPoint = null
call RemoveLocation(udg_tmpPoint)
call TriggerExecute( gg_trg_MoveItemsFromWater )
endfunction
//===========================================================================
function InitTrig_New_Item_Spawn takes nothing returns nothing
set gg_trg_New_Item_Spawn = CreateTrigger( )
call TriggerAddAction( gg_trg_New_Item_Spawn, function Trig_New_Item_Spawn_Actions )
endfunction
function CreateUnitAtSpawn takes integer whichUnitId, unit whichTarget returns nothing
local rect whichRect = udg_Spawns[GetRandomInt(0, 7)]
local real X = GetRandomReal(GetRectMinX(whichRect), GetRectMaxX(whichRect))
local real Y = GetRandomReal(GetRectMinY(whichRect), GetRectMaxY(whichRect))
local real angle = bj_RADTODEG * Atan2(GetUnitY(whichTarget) - Y, GetUnitX(whichTarget) - X)
set bj_lastCreatedUnit = CreateUnit(Player(udg_EnemyPlayerInt), whichUnitId, X, Y, angle)
//call IssuePointOrder(bj_lastCreatedUnit, "attack", GetUnitX(whichTarget), GetUnitY(whichTarget))
call IssueTargetOrderBJ(bj_lastCreatedUnit, "attack", whichTarget)
set udg_EnemyPlayerInt = udg_EnemyPlayerInt + 1
if udg_EnemyPlayerInt > 23 then
set udg_EnemyPlayerInt = 18
endif
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Coming_W1_Actions takes nothing returns nothing
local integer bla
local unit target
set bla = 1
loop
exitwhen bla > 10
set target = GroupPickRandomUnit(udg_AliveHeroGroup)
call CreateUnitAtSpawn('u004', target)
set bla = bla + 1
call TriggerSleepAction(0.00)
endloop
set bla = 1
loop
exitwhen bla > 44
set target = GroupPickRandomUnit(udg_AliveHeroGroup)
call CreateUnitAtSpawn('u000', target)
set bla = bla + 1
call TriggerSleepAction(0.00)
endloop
endfunction
//===========================================================================
function InitTrig_Coming_W1 takes nothing returns nothing
set gg_trg_Coming_W1 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W1, function Trig_Coming_W1_Actions )
endfunction
//TESH.scrollpos=34
//TESH.alwaysfold=0
function Trig_Coming_W2_Actions takes nothing returns nothing
local integer bla
local unit target
set bla = 1
loop
exitwhen bla > 10
set target = GroupPickRandomUnit(udg_AliveHeroGroup)
call CreateUnitAtSpawn('u004', target)
set bla = bla + 1
call TriggerSleepAction(0.00)
endloop
set bla = 1
loop
exitwhen bla > 44
set target = GroupPickRandomUnit(udg_AliveHeroGroup)
call CreateUnitAtSpawn('u000', target)
set bla = bla + 1
call TriggerSleepAction(0.00)
endloop
set target = GroupPickRandomUnit(udg_AliveHeroGroup)
call CreateUnitAtSpawn('u00I', target)
endfunction
//===========================================================================
function InitTrig_Coming_W2 takes nothing returns nothing
set gg_trg_Coming_W2 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W2, function Trig_Coming_W2_Actions )
endfunction
//TESH.scrollpos=43
//TESH.alwaysfold=0
function Trig_Coming_W3_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
set bla = 1
loop
exitwhen bla > 15
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction(0.01)
endloop
set bla = 1
loop
exitwhen bla > 5
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u000', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u000', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction(0.01)
endloop
call TriggerSleepAction( 5.00 )
set bla = 1
loop
exitwhen bla > 6
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction(0.01)
endloop
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call RemoveLocation(udg_tmpPoint)
endfunction
//===========================================================================
function InitTrig_Coming_W3 takes nothing returns nothing
set gg_trg_Coming_W3 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W3, function Trig_Coming_W3_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Coming_W4_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
set bla = 1
loop
exitwhen bla > 6
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction(0.01)
endloop
call TriggerSleepAction( 5.00 )
set bla = 1
loop
exitwhen bla > 25
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
endfunction
//===========================================================================
function InitTrig_Coming_W4 takes nothing returns nothing
set gg_trg_Coming_W4 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W4, function Trig_Coming_W4_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Coming_W5_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
set bla = 1
loop
exitwhen bla > 12
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set bla = 1
loop
exitwhen bla > 15
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
call TriggerSleepAction( 0.01 )
set bla = bla + 1
endloop
call TriggerSleepAction( 5.00 )
set bla = 1
loop
exitwhen bla > 5
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
endfunction
//===========================================================================
function InitTrig_Coming_W5 takes nothing returns nothing
set gg_trg_Coming_W5 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W5, function Trig_Coming_W5_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Coming_W6_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
set bla = 1
loop
exitwhen bla > 7
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set bla = 1
loop
exitwhen bla > 10
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
call TriggerSleepAction( 0.01 )
set bla = bla + 1
endloop
call TriggerSleepAction( 5.00 )
set bla = 1
loop
exitwhen bla > 5
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
endfunction
//===========================================================================
function InitTrig_Coming_W6 takes nothing returns nothing
set gg_trg_Coming_W6 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W6, function Trig_Coming_W6_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Coming_W7_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
set bla = 1
loop
exitwhen bla > 12
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
call TriggerSleepAction( 0.01 )
set bla = bla + 1
endloop
call TriggerSleepAction( 5.00 )
set bla = 1
loop
exitwhen bla > 7
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u002', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00O', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'n000', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
endfunction
//===========================================================================
function InitTrig_Coming_W7 takes nothing returns nothing
set gg_trg_Coming_W7 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W7, function Trig_Coming_W7_Actions )
endfunction
//TESH.scrollpos=42
//TESH.alwaysfold=0
function Trig_Coming_W8_Actions takes nothing returns nothing
local location udg_tmpPoint
local integer bla
set bla = 1
loop
exitwhen bla > 15
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u003', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
call TriggerSleepAction( 0.01 )
set bla = bla + 1
endloop
set bla = 1
loop
exitwhen bla > 10
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00C', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00C', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
call TriggerSleepAction( 5.00 )
set bla = 1
loop
exitwhen bla > 7
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00A', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00A', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00O', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'n000', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set bla = bla + 1
call TriggerSleepAction( 0.01 )
endloop
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
set udg_tmpPoint = GetRandomLocInRect(udg_Spawns[GetRandomInt(0, 7)])
call CreateNUnitsAtLoc( 1, 'u00I', ForcePickRandomPlayer(udg_EnemyPlayers), udg_tmpPoint, bj_UNIT_FACING )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "attack", GroupPickRandomUnit(GetUnitsInRectOfPlayer(GetPlayableMapRect(), ForcePickRandomPlayer(GetPlayersAllies(Player(0))))) )
call RemoveLocation(udg_tmpPoint)
endfunction
//===========================================================================
function InitTrig_Coming_W8 takes nothing returns nothing
set gg_trg_Coming_W8 = CreateTrigger( )
call TriggerAddAction( gg_trg_Coming_W8, function Trig_Coming_W8_Actions )
endfunction
//TESH.scrollpos=31
//TESH.alwaysfold=0
function Trig_ZombieDrop_Func004C takes nothing returns boolean
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'u002' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'u003' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'u00C' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'u001' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'u000' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetTriggerUnit()) == 'u00I' ) ) then
return true
endif
return false
endfunction
function Trig_ZombieDrop_Conditions takes nothing returns boolean
if ( not Trig_ZombieDrop_Func004C() ) then
return false
endif
return true
endfunction
function Trig_ZombieDrop_Actions takes nothing returns nothing
local location tmpPoint
local integer bla
if (GetRandomInt(1, 50) == 1) then
set bla = GetRandomInt(40, 54)
set tmpPoint = GetUnitLoc(GetTriggerUnit())
call CreateItemLoc( udg_FindPing[bla], tmpPoint )
call RemoveLocation(tmpPoint)
else
endif
set tmpPoint = null
endfunction
//===========================================================================
function InitTrig_ZombieDrop takes nothing returns nothing
set gg_trg_ZombieDrop = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ZombieDrop, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_ZombieDrop, Condition( function Trig_ZombieDrop_Conditions ) )
call TriggerAddAction( gg_trg_ZombieDrop, function Trig_ZombieDrop_Actions )
endfunction
//TESH.scrollpos=159
//TESH.alwaysfold=0
function Trig_BossDrop_Func003C takes nothing returns boolean
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u00F' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u00E' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u00D' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u00B' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u009' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u008' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u007' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u006' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetDyingUnit()) == 'u005' ) ) then
return true
endif
return false
endfunction
function Trig_BossDropOld_Conditions takes nothing returns boolean
if ( not Trig_BossDrop_Func003C() ) then
return false
endif
return true
endfunction
function Trig_BossDropOld_Actions takes nothing returns nothing
local integer rnd
local location pnt
set pnt = GetUnitLoc(GetTriggerUnit())
set rnd = GetRandomInt (1,100)
if ( GetUnitTypeId(GetDyingUnit()) == 'u005' ) then
if ( rnd <= 42) then
call CreateItemLoc('I026',pnt)
elseif (rnd <= 84) then
call CreateItemLoc('I027',pnt)
elseif (rnd <= 94) then
call CreateItemLoc('I028',pnt)
else
call CreateItemLoc('I025',pnt)
endif
call RemoveLocation(pnt)
return
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'u006' ) then
if ( rnd <= 38) then
call CreateItemLoc('I026',pnt)
elseif (rnd <= 72) then
call CreateItemLoc('I027',pnt)
elseif (rnd <= 85) then
call CreateItemLoc('I028',pnt)
else
call CreateItemLoc('I025',pnt)
endif
call RemoveLocation(pnt)
return
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'u007' ) then
if ( rnd <= 20) then
call CreateItemLoc('I026',pnt)
elseif (rnd <= 35) then
call CreateItemLoc('I027',pnt)
elseif (rnd <= 50) then
call CreateItemLoc('I028',pnt)
else
call CreateItemLoc('I025',pnt)
endif
call RemoveLocation(pnt)
return
endif
if ( GetUnitTypeId(GetDyingUnit()) == 'u008' ) then
if (rnd <= 30) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 60) then
call CreateItemLoc('I023',pnt)
else
call CreateItemLoc('I020',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 5
if ( GetUnitTypeId(GetDyingUnit()) == 'u009' ) then
if (rnd <= 25) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd < 60) then
call CreateItemLoc('I023',pnt)
else
call CreateItemLoc('I020',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 6
if ( GetUnitTypeId(GetDyingUnit()) == 'u00B' ) then
if ( rnd <= 20) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 60) then
call CreateItemLoc('I023',pnt)
else
call CreateItemLoc('I020',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 7
if ( GetUnitTypeId(GetDyingUnit()) == 'u00D' ) then
if ( rnd <= 3) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 7) then
call CreateItemLoc('I023',pnt)
elseif (rnd <= 17) then
call CreateItemLoc('I020',pnt)
elseif (rnd <= 62) then
call CreateItemLoc('I01Z',pnt)
elseif (rnd <= 82) then
call CreateItemLoc('I021',pnt)
else
call CreateItemLoc('I02O',pnt)
call CreateItemLoc('I02P',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 8
if ( GetUnitTypeId(GetDyingUnit()) == 'u00E' ) then
if (rnd <= 3) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 9) then
call CreateItemLoc('I020',pnt)
elseif (rnd <= 55) then
call CreateItemLoc('I01Z',pnt)
elseif (rnd <= 75) then
call CreateItemLoc('I021',pnt)
else
call CreateItemLoc('I02O',pnt)
call CreateItemLoc('I02P',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 9
if ( GetUnitTypeId(GetDyingUnit()) == 'u00F' ) then
if (rnd <= 5) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 95) then
call CreateItemLoc('I0IZ',pnt)
call CreateItemLoc('I021',pnt)
else
call CreateItemLoc('I024',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 10
if ( GetUnitTypeId(GetDyingUnit()) == 'u00G' ) then
if (rnd <= 5) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 95) then
call CreateItemLoc('I0IZ',pnt)
call CreateItemLoc('I021',pnt)
else
call CreateItemLoc('I024',pnt)
endif
call RemoveLocation(pnt)
return
endif
// Boss 11
if ( GetUnitTypeId(GetDyingUnit()) == 'n005' ) then
if (rnd <= 5) then
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I028',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I025',pnt)
call CreateItemLoc('I026',pnt)
elseif (rnd <= 95) then
call CreateItemLoc('I0IZ',pnt)
call CreateItemLoc('I021',pnt)
else
call CreateItemLoc('I024',pnt)
endif
call RemoveLocation(pnt)
return
endif
endfunction
//===========================================================================
function InitTrig_BossDropOld takes nothing returns nothing
set gg_trg_BossDropOld = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_BossDropOld, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_BossDropOld, Condition( function Trig_BossDropOld_Conditions ) )
call TriggerAddAction( gg_trg_BossDropOld, function Trig_BossDropOld_Actions )
endfunction
function Trig_wounded_2_prarasite_Conditions takes nothing returns boolean
if ((GetUnitTypeId(GetTriggerUnit()) == 'u000') or (GetUnitTypeId(GetTriggerUnit()) == 'u00C') or (GetUnitTypeId(GetTriggerUnit()) == 'u002' )) then
return true
endif
return false
endfunction
function Trig_wounded_2_prarasite_Actions takes nothing returns nothing
local location point
if (GetRandomInt(1, 2) == 1) then
set point = GetUnitLoc(GetTriggerUnit())
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl", point)
call DestroyEffect(bj_lastCreatedEffect)
call TriggerSleepAction(0.00)
call CreateNUnitsAtLoc( 1, 'u004', ForcePickRandomPlayer(udg_EnemyPlayers), point, bj_UNIT_FACING )
call RemoveLocation(point)
endif
set point = null
endfunction
//===========================================================================
function InitTrig_wounded_2_prarasite takes nothing returns nothing
set gg_trg_wounded_2_prarasite = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_wounded_2_prarasite, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_wounded_2_prarasite, Condition( function Trig_wounded_2_prarasite_Conditions ) )
call TriggerAddAction( gg_trg_wounded_2_prarasite, function Trig_wounded_2_prarasite_Actions )
endfunction
function Trig_walkin_2_wounded_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetTriggerUnit()) == 'u001' ) then
return true
endif
return false
endfunction
function Trig_walkin_2_wounded_Actions takes nothing returns nothing
local location point
if (GetRandomInt(1, 2) == 1) then
set point = GetUnitLoc(GetTriggerUnit())
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl", point)
call DestroyEffect(bj_lastCreatedEffect)
call TriggerSleepAction(0.00)
call CreateNUnitsAtLoc( 1, 'u000', ForcePickRandomPlayer(udg_EnemyPlayers), point, bj_UNIT_FACING )
call RemoveLocation(point)
endif
set point = null
endfunction
//===========================================================================
function InitTrig_walkin_2_wounded takes nothing returns nothing
set gg_trg_walkin_2_wounded = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_walkin_2_wounded, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_walkin_2_wounded, Condition( function Trig_walkin_2_wounded_Conditions ) )
call TriggerAddAction( gg_trg_walkin_2_wounded, function Trig_walkin_2_wounded_Actions )
endfunction
function Trig_mutated_2_walkin_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'u003' ) ) then
return false
endif
return true
endfunction
function Trig_mutated_2_walkin_Actions takes nothing returns nothing
local location point
set point = GetUnitLoc(GetTriggerUnit())
call TriggerSleepAction(0.00)
set bj_lastCreatedEffect = AddSpecialEffectLoc("Abilities\\Weapons\\MeatwagonMissile\\MeatwagonMissile.mdl", point)
call DestroyEffect(bj_lastCreatedEffect)
if ( GetRandomInt(1, 2) == 1 ) then
call CreateNUnitsAtLoc( 1, 'u001', ForcePickRandomPlayer(udg_EnemyPlayers), point, bj_UNIT_FACING )
else
call CreateNUnitsAtLoc( 1, 'u000', ForcePickRandomPlayer(udg_EnemyPlayers), point, bj_UNIT_FACING )
endif
call RemoveLocation(point)
endfunction
//===========================================================================
function InitTrig_mutated_2_walkin takes nothing returns nothing
set gg_trg_mutated_2_walkin = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_mutated_2_walkin, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_mutated_2_walkin, Condition( function Trig_mutated_2_walkin_Conditions ) )
call TriggerAddAction( gg_trg_mutated_2_walkin, function Trig_mutated_2_walkin_Actions )
endfunction