Name | Type | is_array | initial_value |
Ability_Load | real | No | |
AfterDamageEvent | real | No | |
AlreadyCarryingEquip_Armor | integer | No | |
AlreadyCarryingEquip_Helm | integer | No | |
AlreadyCarryingEquip_Ring | integer | No | |
AlreadyCarryingEquip_Shield | integer | No | |
AlreadyCarryingEquip_Weapon | integer | No | |
Armed | integer | No | |
Beasts | unitcode | Yes | |
BF_Caster | unit | No | |
BF_Target | unit | No | |
BlackSmith_Points | integer | No | |
Camera_Zome | integer | No | |
CB_Units | unit | Yes | |
CG_Angle | real | Yes | |
CG_AoE1 | real | No | |
CG_AoE2 | real | No | |
CG_Caster | unit | Yes | |
CG_Check | boolean | No | |
CG_Damage | real | Yes | |
CG_Distance | real | Yes | |
CG_Dummy | unit | Yes | |
CG_Index | integer | No | |
CG_Index2 | integer | No | |
CG_Index3 | integervar | No | |
CG_Jumps | integer | Yes | |
CG_Point1 | location | No | |
CG_Point2 | location | No | |
CG_Point3 | location | No | |
CG_Sound | sound | Yes | |
CG_Speed | real | No | |
CG_Target | unit | Yes | |
CG_UnitGroup | group | Yes | |
Chest | unit | No | |
ClearDamageEvent | trigger | No | |
COD_Point_1 | location | No | |
COD_Point_1Q | location | No | |
COD_Point_2 | location | No | |
COD_Point_2Q | location | No | |
COD_Point_3 | location | No | |
COD_Point_3Q | location | No | |
COD_Point_Furthering | location | No | |
COD_Point_FurtheringQ | location | No | |
COD_Point_FurtheringQ2 | location | No | |
COD_Point_Main | location | No | |
COD_Point_MainQ | location | No | |
COD_Real_Point_1 | real | No | |
COD_Real_Point_1Q | real | No | |
COD_Real_Point_2 | real | No | |
COD_Real_Point_2Q | real | No | |
COD_Special_Unit | unit | No | |
COD_Special_UnitQ | unit | No | |
COD_Special_UnitQ2 | unit | No | |
COD_Unit_Caster | unit | No | |
COD_Unit_CasterQ | unit | No | |
COD_UnitGroup | group | No | |
COD_UnitGroup_Q1 | group | No | |
COD_UnitGroup_Q2 | group | No | |
COD_X | real | No | |
COD_XQ | real | No | |
COD_Y | real | No | |
COD_YQ | real | No | |
Coin_Cache | integer | No | |
CP_HiddenItems | item | Yes | |
CP_HiddenItemsIndex | integer | No | |
CP_Item | item | No | |
CP_PointIsWalkable | boolean | No | |
CP_Rect | rect | No | |
Create_Game | button | No | |
Critical_Value | integer | No | |
d | real | No | |
DAMAGE_FACTOR_BRACERS | real | No | |
DAMAGE_FACTOR_ELUNES | real | No | |
DAMAGE_FACTOR_ETHEREAL | real | No | |
Damage_Fortify | real | No | |
Damage_Type | damagetype | No | |
DamageBlockingAbility | abilcode | No | |
damagecache | real | No | |
damagedcache | real | No | |
DamageEvent | real | No | |
DamageEventAmount | real | No | |
DamageEventOverride | boolean | No | |
DamageEventPrevAmt | real | No | |
DamageEventSource | unit | No | |
DamageEventsWasted | integer | No | |
DamageEventTarget | unit | No | |
DamageEventTrigger | trigger | No | |
DamageEventType | integer | No | |
DamageEventType_2 | integer | No | |
DamageModifierEvent | real | No | |
DamageTypeBlocked | integer | No | |
DamageTypeCriticalStrike | integer | No | |
DamageTypeExplosive | integer | No | |
DamageTypeHeal | integer | No | |
DamageTypeIncreased | integer | No | |
DamageTypeReduced | integer | No | |
DamageTypeSplash | integer | No | |
damagingcache | unit | No | |
Dark_Resistance | integer | No | |
DarkEmpowerment | boolean | No | |
ddd | integer | No | |
DE_C | unit | No | |
Death_Blow | integer | No | |
Death_Blow_Value | real | No | |
Dif_Dialog_Button_Easy | button | No | |
Dif_Dialog_Button_Hard | button | No | |
Dif_Dialog_Button_Nightmare | button | No | |
Dif_Dialog_Button_Normal | button | No | |
Difficulity | dialog | No | |
DmgEvBracers | itemcode | No | |
DmgEvRecursionN | integer | No | |
DmgEvRunning | boolean | No | |
DmgEvStarted | boolean | No | |
DmgEvTimer | timer | No | |
DmgEvTrig | trigger | No | |
E_Ability | abilcode | No | |
E_Caster | unit | Yes | |
E_CasterColor | real | Yes | |
E_CasterEruptionEffect | string | No | |
E_CasterEruptionEffectAttach | string | No | |
E_CasterPosition | location | No | |
E_CasterTransparency | real | Yes | |
E_CurrentIndex | integervar | No | |
E_EruptionDuration | real | Yes | |
E_EruptionDurationCounter | real | Yes | |
E_EruptionHandleEffect | effect | Yes | |
E_ImmolationAttackType | attacktype | No | |
E_ImmolationDamage | real | Yes | |
E_ImmolationDamageType | damagetype | No | |
E_ImmolationEffect | string | No | |
E_ImmolationEffectAttach | string | No | |
E_ImmolationGroup | group | No | |
E_ImmolationPickedUnit | unit | No | |
E_ImmolationRadius | real | Yes | |
E_ImmolationSpawnTime | real | Yes | |
E_IST | real | Yes | |
E_Level | integer | Yes | |
E_MaxIndex | integer | No | |
E_MiniShard_Rotation | real | Yes | |
E_MiniShardAcceleration | real | Yes | |
E_MiniShardAmount | integer | Yes | |
E_MiniShardAttackType | attacktype | No | |
E_MiniShardCircleAngle | real | No | |
E_MiniShardCircular | boolean | No | |
E_MiniShardDamageType | damagetype | No | |
E_MiniShardDestroyTrees | boolean | No | |
E_MiniShardDummy | unit | No | |
E_MiniShardImpactDamage | real | Yes | |
E_MiniShardImpactEffect | string | No | |
E_MiniShardImpactRadius | real | Yes | |
E_MiniShardInt | integervar | No | |
E_MiniShardMaxHeight | real | Yes | |
E_MiniShardModel | string | No | |
E_MiniShardRange | real | Yes | |
E_MiniShardSize | real | Yes | |
E_MiniShardSpawnCircleLocation | location | No | |
E_MiniShardSpawnTime | real | Yes | |
E_MiniShardSpeed | real | Yes | |
E_MSSTC | real | Yes | |
E_NormalColor | real | Yes | |
E_Player | player | Yes | |
E_S | real | Yes | |
E_ScorchedAttackType | attacktype | No | |
E_ScorchedDamage | real | Yes | |
E_ScorchedDamageType | damagetype | No | |
E_ScorchedDummy | unit | No | |
E_ScorchedFinalRange | real | No | |
E_ScorchedGroup | group | No | |
E_ScorchedInt | integervar | No | |
E_ScorchedMaximumRange | real | Yes | |
E_ScorchedMinimumRange | real | Yes | |
E_ScorchedModel | string | No | |
E_ScorchedPerSpawnAmount | integer | Yes | |
E_ScorchedPickedUnit | unit | No | |
E_ScorchedPosition | location | No | |
E_ScorchedRadius | real | Yes | |
E_ScorchedScaleRatio | real | No | |
E_ScorchedSpawnLocation | location | No | |
E_ScorchedSpawnTime | real | Yes | |
E_ShardAmount | integer | Yes | |
E_ShardAttackType | attacktype | No | |
E_ShardConstantAcceleration | real | Yes | |
E_ShardDamageType | damagetype | No | |
E_ShardDestroyTrees | boolean | No | |
E_ShardDummy | unit | No | |
E_ShardFinalRange | real | No | |
E_ShardImpactDamage | real | Yes | |
E_ShardImpactEffect | string | No | |
E_ShardImpactRadius | real | Yes | |
E_ShardInt | integervar | No | |
E_ShardMaxHeight | real | Yes | |
E_ShardModel | string | No | |
E_ShardRangeMaximum | real | Yes | |
E_ShardRangeMinimum | real | Yes | |
E_ShardSize | real | Yes | |
E_ShardSpawnTime | real | Yes | |
E_ShardSpeed | real | Yes | |
E_SPUEffect | string | No | |
E_SPUEffectAttach | string | No | |
E_SSTC | real | Yes | |
E_VexorianDummyType | unitcode | No | |
EB_Points | location | Yes | |
EB_Units | unit | Yes | |
EBCastPoint | location | No | |
EBDamage | real | No | |
EBGroup | group | No | |
EBRuneGroup | group | No | |
Faith_of_Fire_Caster | unit | No | |
Fame_Value | integer | No | |
FFF | real | No | |
Fire_Resistance | integer | No | |
Fog | boolean | No | |
Fortify_Chance_Table | real | No | |
Fortify_Reduced_Table | real | No | |
FOS_Group | group | No | |
FOS_Integer_Array | integer | Yes | |
FOS_Point_Angel_Distance | real | No | |
FOS_Point_Final | location | Yes | |
FOS_Point_Main | location | No | |
FOS_Point_Target | location | No | |
g | group | No | |
G_K | integer | Yes | |
Game | string | No | A Way To Light demo V.0.11 |
Game_Select | dialog | No | |
GDD__Integers | integer | Yes | |
GDD__LeftMapGroup | group | No | |
GDD__TriggerArray | trigger | Yes | |
GDD__UnitArray | unit | Yes | |
GDD_Damage | real | No | |
GDD_DamagedUnit | unit | No | |
GDD_DamageSource | unit | No | |
GDD_Event | real | No | |
ggg | gamecache | No | |
Gold_Cache | integer | No | |
H_S_P | boolean | No | false |
H_S_P_Level | integer | No | 0 |
H_S_P_Level_2 | integer | No | 5 |
HC_Caster | unit | No | |
Heal_Integer | integer | No | |
HeavyStrike_Load | integer | No | |
HELMITEM | unit | No | |
Hero | unit | No | |
Hero_1 | unit | No | |
Hero_10 | unit | No | |
Hero_2 | unit | No | |
Hero_3 | unit | No | |
Hero_4 | unit | No | |
Hero_5 | unit | No | |
Hero_6 | unit | No | |
Hero_7 | unit | No | |
Hero_8 | unit | No | |
Hero_9 | unit | No | |
Hero_Level | integer | No | |
HideDamageFrom | boolean | Yes | |
HMDamage | real | No | |
HMGroup | group | No | |
HMGroup2 | group | No | |
HMGroup3 | group | No | |
HMHealAmount | real | No | |
HMPoint | location | No | |
i | integer | No | |
I_H | hashtable | No | |
Ice_Resistance | integer | No | |
Impact_Value | real | No | |
Init_Dialog | dialog | No | |
Init_Dialog_Button | button | No | |
IsDamageSpell | boolean | No | |
Item_Splash_Amount | real | No | |
Item_Splash_Special | string | No | |
Job | dialog | No | |
Job_Dialog_Button_Knight | button | No | |
Job_Dialog_Button_Paladin | button | No | |
Job_Dialog_Button_Warrior | button | No | |
Job_String | string | No | |
KB3D_Accel | real | No | |
KB3D_AllowOutSiding | boolean | No | |
KB3D_Angle | real | No | |
KB3D_AoE | real | No | |
KB3D_AoEDamage | real | No | |
KB3D_AoEEndDamage | real | No | |
KB3D_AoEEndFx | string | No | |
KB3D_AoEKB | boolean | No | |
KB3D_AoEKB_Power | real | No | |
KB3D_Arc | real | No | |
KB3D_Attach | string | No | |
KB3D_AttackType | attacktype | No | |
KB3D_B | boolean | No | |
KB3D_Bounce_Fx | string | No | |
KB3D_Bounce_Power | real | No | |
KB3D_Bounce_Target | boolean | No | |
KB3D_Bounce_Unit | boolean | No | |
KB3D_Counter | integer | No | |
KB3D_D_ALLY | boolean | No | |
KB3D_D_ENEMY | boolean | No | |
KB3D_D_FLYING | boolean | No | |
KB3D_D_MAGIC_IMMINUE | boolean | No | |
KB3D_D_MECHANICAL | boolean | No | |
KB3D_D_RESISTANT | boolean | No | |
KB3D_D_STRUCTURE | boolean | No | |
KB3D_Damager | unit | No | |
KB3D_DamageType | damagetype | No | |
KB3D_DestroyDestructables | boolean | No | |
KB3D_DestroyTree | boolean | No | |
KB3D_DisableUnit | boolean | No | |
KB3D_EndFx | string | No | |
KB3D_EndOnObstacle | boolean | No | |
KB3D_EndOnTargetBounce | boolean | No | |
KB3D_EndTrigger | trigger | No | |
KB3D_EndwhenDead | boolean | No | |
KB3D_EndWhenHit | boolean | No | |
KB3D_FaceAngle | boolean | No | |
KB3D_Fx | string | No | |
KB3D_Fx_Attach | string | No | |
KB3D_g | group | No | |
KB3D_GroundDamage | boolean | No | |
KB3D_HA | hashtable | No | |
KB3D_Harvester | unit | No | |
KB3D_HomingMissile | boolean | No | |
KB3D_iKB | boolean | No | |
KB3D_ImpactDamage | real | No | |
KB3D_Instances | integer | No | |
KB3D_JumpOverCliff | boolean | No | |
KB3D_KBTarget | boolean | No | |
KB3D_KillatEnd | boolean | No | |
KB3D_KillatTime | real | No | |
KB3D_KillifOutSider | boolean | No | |
KB3D_KillWhenHit | boolean | No | |
KB3D_Line_Fx | string | No | |
KB3D_LineDamage | real | No | |
KB3D_LoopDamage | real | No | |
KB3D_Range | real | No | |
KB3D_Reals | real | Yes | |
KB3D_Registration | trigger | No | |
KB3D_Speed | real | No | |
KB3D_Speed_Changer | boolean | No | |
KB3D_StopTime | real | No | |
KB3D_TargetDamage | real | No | |
KB3D_Targeted_Unit | unit | No | |
KB3D_Time | real | No | |
KB3D_Timer | timer | No | |
KB3D_TrailFx | string | No | |
KB3D_Unit | unit | No | |
KB3D_UnpathableStop | boolean | No | |
KB3D_Zoffset | real | No | |
KB_Angle | real | Yes | |
KB_Casters | unit | Yes | |
KB_CountBuffs | integer | No | |
KB_Damage | real | No | |
KB_DestroyTrees | boolean | Yes | |
KB_EffectCounter | integer | Yes | |
KB_EffectCounter2 | integer | Yes | |
KB_Effects_1 | string | Yes | |
KB_Effects_2 | string | Yes | |
KB_GeneralIntegers | integervar | Yes | |
KB_KnockbackedUnits | group | No | |
KB_Levels | integer | Yes | |
KB_MaxDistance | real | Yes | |
KB_ReachedDistance | real | Yes | |
KB_ReducedReal | real | No | |
KB_ReduceSpeedReal | real | Yes | |
KB_SpecificSpeed | real | Yes | |
KB_StartPositions | location | Yes | |
KB_TempPoint | location | Yes | |
KB_TempReal | real | No | |
KB_TotalKnockUnits | integer | No | |
KB_Units | unit | Yes | |
KBA_Caster | unit | No | |
KBA_DestroyTrees | boolean | No | |
KBA_DistancePerLevel | real | No | |
KBA_Level | integer | No | |
KBA_SpecialEffects | string | Yes | |
KBA_Speed | real | No | |
KBA_StartingPosition | location | No | |
KBA_TargetUnit | unit | No | |
Knight | unitcode | No | H003 |
LastDamageHP | real | No | |
LastDmgPrevAmount | real | Yes | |
LastDmgPrevType | integer | Yes | |
LastDmgSource | unit | Yes | |
LastDmgTarget | unit | Yes | |
LastDmgValue | real | Yes | |
LastDmgWasSpell | boolean | Yes | |
Light_Resistance | integer | No | |
Lighting_Resistance | integer | No | |
lkj | attacktype | No | AttackTypeNormal |
Load_Game | button | No | |
M | integer | No | |
MET_Ardeconika | integer | No | |
MET_BloodSteel | integer | No | |
MET_BloodStone | integer | No | |
MET_BoltStone | integer | No | |
MET_DarkIron | integer | No | |
MET_DarkSilver | integer | No | |
MET_DarkSteel | integer | No | |
MET_DemonicSteel | integer | No | |
MET_DragonBone | integer | No | |
MET_DragonScale | integer | No | |
MET_DragonStone | integer | No | |
MET_DrakeBone | integer | No | |
MET_DrakeScale | integer | No | |
MET_EvilStone | integer | No | |
MET_FlameStone | integer | No | |
MET_Gold | integer | No | |
MET_HolyStone | integer | No | |
MET_Iron | integer | No | |
MET_Leather | integer | No | |
MET_MagicStone | integer | No | |
MET_MoonStone | integer | No | |
MET_OrcishIron | integer | No | |
MET_OrcishSteel | integer | No | |
MET_QuickSilver | integer | No | |
MET_RawStone | integer | No | |
MET_Silver | integer | No | |
MET_SilverMoon | integer | No | |
MET_SilverSteel | integer | No | |
MET_Steel | integer | No | |
MET_SunStone | integer | No | |
MO_S_H | unit | No | |
Montharas_Damage_Value | real | No | |
MS | integer | No | |
MultiBoard | multiboard | No | |
Name | string | No | |
NextDamageOverride | boolean | No | |
NextDamageType | integer | No | |
ODDamage | real | No | |
P | integer | No | |
Paladin | unitcode | No | H000 |
PlayerColors | string | Yes | |
Poison_Resistance | integer | No | |
POLDamage | real | Yes | |
POLFacing | real | No | |
POLFinalGroup | group | No | |
POLGroup | group | Yes | |
POLPoint | location | No | |
POLPoint2 | location | No | |
POLTarget | location | Yes | |
Power_Slam_Ability_Level | integer | No | |
Power_Slam_Ability_Level2 | integer | No | |
Power_Slam_Caster | unit | No | |
Power_Slam_Damage | real | No | |
Power_Slam_Damage_Multiplier | real | No | |
Power_Slam_Dummy | unit | No | |
Power_Slam_Dummy_Ability | abilcode | No | |
Power_Slam_Dummy_Ability2 | abilcode | No | |
Power_Slam_Location | location | No | |
Power_Slam_Owner | player | No | |
Power_Slam_Strength | integer | No | |
Power_Slam_Target | unit | No | |
Quest_001 | quest | No | |
r | rect | No | |
S_1 | effect | No | |
Save_Name | string | No | |
SaveLoadEvent | real | No | |
SaveLoadEvent_Code | string | No | |
SaveLoadEvent_Player | player | No | |
SaveTempInt | integer | No | |
SH_A_U | unit | No | |
Shalamayn_Damage_Value | real | No | |
Silver_Cache | integer | No | |
Smooth | string | No | |
SoulOmnistrikeG1 | group | No | |
SoulOmnistrikeG2 | group | No | |
SoulOmniStrikeSFX | effect | No | |
SoulOmnistrikeTarget | unit | No | |
SoulShieldCaster | unit | No | |
SoulShieldDone | boolean | No | |
SoulShieldSFX | effect | No | |
SpellDamageAbility | abilcode | No | |
Splash_Attacked | unit | No | |
Splash_Group | group | No | |
sss | effect | No | |
T_D | real | No | |
TDn | real | No | |
tempGroup | group | No | |
TempX | real | No | |
TempY | real | No | |
Text_Duration | real | No | |
TextSize_dmg | real | No | |
TextSize_spells | real | No | |
Timer | timer | No | |
Timer_Revive | integer | No | |
Timer_Window_1 | timerdialog | No | |
U_D_Bandit_001 | integer | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UMovNext | integer | Yes | |
UMovPrev | integer | Yes | |
UnitDamageRegistered | boolean | Yes | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
UnitIndexLock | integer | Yes | |
UnitMoving | boolean | Yes | |
UnitMovingEvent | real | No | |
UnitMovingX | real | Yes | |
UnitMovingY | real | Yes | |
uuu | unit | No | |
VIS_1 | fogmodifier | No | |
Warrior | unitcode | No | H002 |
Weapon_Damage | integer | No | |
Xp_Rating | real | No | |
Xp_Value | integer | No | |
Xp_Value_10 | integer | No | |
Xp_Value_2 | integer | No | |
Xp_Value_3 | integer | No | |
Xp_Value_4 | integer | No | |
Xp_Value_5 | integer | No | |
Xp_Value_6 | integer | No | |
Xp_Value_7 | integer | No | |
Xp_Value_8 | integer | No | |
Xp_Value_9 | integer | No | |
XSoulShieldDamageInput | real | No | |
XSoulShieldDamageMax | real | No |
function Trig_Initialization_Func027A takes nothing returns nothing
call UnitAddAbilityBJ( 'Avul', GetEnumUnit() )
endfunction
function Trig_Initialization_Actions takes nothing returns nothing
call SetTimeOfDay( 19.00 )
call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_883", "TRIGSTR_884", "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp" )
call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_875", "TRIGSTR_876", "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp" )
call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_877", "TRIGSTR_878", "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp" )
call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_879", "TRIGSTR_880", "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp" )
call CreateQuestBJ( bj_QUESTTYPE_OPT_DISCOVERED, "TRIGSTR_881", "TRIGSTR_882", "ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp" )
set udg_Camera_Zome = 2200
call AddSpecialEffectTargetUnitBJ( "overhead", gg_unit_H004_0019, "Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl" )
set udg_S_1 = GetLastCreatedEffectBJ()
call CameraSetSmoothingFactorBJ( 1.50 )
call SetPlayerColorBJ( Player(1), PLAYER_COLOR_BROWN, true )
call UnitAddItemByIdSwapped( 'I001', gg_unit_H004_0019 )
call SetItemDroppableBJ( GetLastCreatedItem(), false )
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_FOOD_CAP, 0 )
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_GOLD, 70 )
call SetCameraTargetControllerNoZForPlayer( Player(0), gg_unit_H001_0001, 0, 0, false )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(gg_unit_H001_0001), 0 )
call StopMusicBJ( false )
call DialogSetMessageBJ( udg_Init_Dialog, "TRIGSTR_003" )
call DialogAddButtonBJ( udg_Init_Dialog, "TRIGSTR_004" )
set udg_Init_Dialog_Button = GetLastCreatedButtonBJ()
call DialogDisplayBJ( true, udg_Init_Dialog, Player(0) )
call PlaySoundBJ( gg_snd_The_Begining )
call SetSoundVolumeBJ( gg_snd_The_Begining, 100 )
call CreateFogModifierRectBJ( true, Player(0), FOG_OF_WAR_VISIBLE, gg_rct_Creating_Hero_Region )
call FogModifierStart( GetLastCreatedFogModifier() )
call CreateFogModifierRectBJ( true, Player(0), FOG_OF_WAR_VISIBLE, gg_rct_Silver_Shine_Valley )
call FogModifierStart( GetLastCreatedFogModifier() )
call CreateFogModifierRectBJ( true, Player(0), FOG_OF_WAR_VISIBLE, gg_rct_Chest_Region )
call FogModifierStart( GetLastCreatedFogModifier() )
call ForGroupBJ( GetUnitsInRectOfPlayer(GetPlayableMapRect(), Player(1)), function Trig_Initialization_Func027A )
call CreateTextTagUnitBJ( "TRIGSTR_046", gg_unit_n001_0018, 0, 8.75, 50.00, 100, 5.00, 0 )
call CreateTextTagUnitBJ( "TRIGSTR_159", gg_unit_hfoo_0021, 0, 8.75, 50.00, 100, 5.00, 0 )
call CreateTextTagUnitBJ( "TRIGSTR_859", gg_unit_n002_0036, 0, 8.75, 75.00, 100, 0.00, 0 )
endfunction
//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
set gg_trg_Initialization = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Initialization, 0.01 )
call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
endfunction
//Lord Mahdi.
function Trig_Camera_Actions takes nothing returns nothing
call SetCameraFieldForPlayer( Player(0), CAMERA_FIELD_TARGET_DISTANCE, I2R(udg_Camera_Zome), 0 )
endfunction
//===========================================================================
function InitTrig_Camera takes nothing returns nothing
set gg_trg_Camera = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Camera, 0.01 )
call TriggerAddAction( gg_trg_Camera, function Trig_Camera_Actions )
endfunction
function Trig_Update_Variables_Actions takes nothing returns nothing
set udg_H_S_P_Level = GetHeroLevel(udg_Hero)
set udg_Hero_Level = GetHeroLevel(udg_Hero)
set udg_P = GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD)
set udg_Coin_Cache = GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD)
set udg_Silver_Cache = GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_LUMBER)
set udg_Gold_Cache = GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_FOOD_CAP)
set udg_MS = R2I(GetUnitMoveSpeed(udg_Hero))
endfunction
//===========================================================================
function InitTrig_Update_Variables takes nothing returns nothing
set gg_trg_Update_Variables = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Update_Variables, 0.01 )
call TriggerAddAction( gg_trg_Update_Variables, function Trig_Update_Variables_Actions )
endfunction
function Trig_Init_Dialog_Conditions takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Init_Dialog_Button ) ) then
return false
endif
return true
endfunction
function Trig_Init_Dialog_Actions takes nothing returns nothing
call PlayMusicBJ( "music" )
call StopSoundBJ( gg_snd_The_Begining, false )
call DialogClearBJ( udg_Init_Dialog )
call DialogDisplayBJ( false, udg_Init_Dialog, Player(0) )
call DialogSetMessageBJ( udg_Game_Select, "TRIGSTR_382" )
call DialogAddButtonBJ( udg_Game_Select, "TRIGSTR_383" )
set udg_Create_Game = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_Game_Select, "TRIGSTR_384" )
set udg_Load_Game = GetLastCreatedButtonBJ()
call DialogDisplayBJ( true, udg_Game_Select, Player(0) )
endfunction
//===========================================================================
function InitTrig_Init_Dialog takes nothing returns nothing
set gg_trg_Init_Dialog = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_Init_Dialog, udg_Init_Dialog )
call TriggerAddCondition( gg_trg_Init_Dialog, Condition( function Trig_Init_Dialog_Conditions ) )
call TriggerAddAction( gg_trg_Init_Dialog, function Trig_Init_Dialog_Actions )
endfunction
function Trig_Game_Select_Func001C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Create_Game ) ) then
return false
endif
return true
endfunction
function Trig_Game_Select_Func002Func025C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Game_Select_Func002C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Load_Game ) ) then
return false
endif
return true
endfunction
function Trig_Game_Select_Actions takes nothing returns nothing
if ( Trig_Game_Select_Func001C() ) then
call FlushGameCacheBJ( udg_ggg )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 3600.00, ( "|c00FFFF6C" + ( GetPlayerName(Player(0)) + " please enter your name. ( first press \"Enter\" key then enter your hero's name)" ) ) )
call EnableTrigger( gg_trg_Step_1 )
else
endif
if ( Trig_Game_Select_Func002C() ) then
call ReloadGameCachesFromDisk( )
call InitGameCacheBJ( "Mahdi1411203125.w3v" )
call RestoreUnitLocFacingAngleBJ( "q", "M", GetLastCreatedGameCacheBJ(), Player(0), GetRectCenter(gg_rct_Start), 0 )
set udg_Hero = GetLastRestoredUnitBJ()
set udg_Name = GetStoredStringBJ("w", "M", GetLastCreatedGameCacheBJ())
set udg_Job_String = GetStoredStringBJ("e", "M", GetLastCreatedGameCacheBJ())
set udg_ddd = GetStoredIntegerBJ("u", "B", GetLastCreatedGameCacheBJ())
call ConditionalTriggerExecute( gg_trg_Difficulity_Load_Game )
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_GOLD, GetStoredIntegerBJ("r", "N", GetLastCreatedGameCacheBJ()) )
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_LUMBER, GetStoredIntegerBJ("t", "N", GetLastCreatedGameCacheBJ()) )
call SetPlayerStateBJ( Player(0), PLAYER_STATE_RESOURCE_FOOD_CAP, GetStoredIntegerBJ("y", "N", GetLastCreatedGameCacheBJ()) )
set udg_Fame_Value = GetStoredIntegerBJ("i", "B", GetLastCreatedGameCacheBJ())
set udg_HeavyStrike_Load = GetStoredIntegerBJ("h", "s", GetLastCreatedGameCacheBJ())
set udg_H_S_P = GetStoredBooleanBJ("o", "B", GetLastCreatedGameCacheBJ())
set udg_Xp_Rating = GetStoredRealBJ("p", "V", GetLastCreatedGameCacheBJ())
set udg_Fog = GetStoredBooleanBJ("Fog1", "Fog2", GetLastCreatedGameCacheBJ())
call ConditionalTriggerExecute( gg_trg_Fog_Enable )
call SetPlayerHandicapXPBJ( Player(0), udg_Xp_Rating )
call RemoveUnit( gg_unit_H001_0001 )
call RemoveUnit( udg_uuu )
set udg_Ability_Load = 1.00
call UnitRemoveItemFromSlotSwapped( 1, udg_Hero )
call UnitRemoveItemFromSlotSwapped( 2, udg_Hero )
call UnitRemoveItemFromSlotSwapped( 3, udg_Hero )
call UnitRemoveItemFromSlotSwapped( 4, udg_Hero )
call UnitRemoveItemFromSlotSwapped( 5, udg_Hero )
call UnitRemoveItemFromSlotSwapped( 6, udg_Hero )
call ConditionalTriggerExecute( gg_trg_Heavy_Strike_Load )
call TriggerSleepAction( 0.01 )
if ( Trig_Game_Select_Func002Func025C() ) then
call CreateFogModifierRectBJ( false, Player(0), FOG_OF_WAR_VISIBLE, gg_rct_Creating_Hero_Region )
call SetUnitPositionLoc( udg_Hero, GetRectCenter(gg_rct_Start) )
call DialogDisplayBJ( false, udg_Job, Player(0) )
call DialogClearBJ( udg_Job )
call ResetToGameCameraForPlayer( Player(0), 0 )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(udg_Hero), 0 )
call CreateMultiboardBJ( 3, 6, "TRIGSTR_411" )
set udg_MultiBoard = GetLastCreatedMultiboard()
// Name
call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 1, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 1, "ReplaceableTextures\\CommandButtons\\BTNArthas.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 1, ( "|c00FFFF6CName: |r" + udg_Name ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 1, 13.00 )
// Job
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 2, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 2, "ReplaceableTextures\\CommandButtons\\BTNBansheeAdept.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 2, ( "|c00FFFF6CJob: |r" + udg_Job_String ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 2, 13.00 )
// Fame
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 3, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 3, "ReplaceableTextures\\CommandButtons\\BTNOrcBattleStandard.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 3, ( "|c00FFFF6CFame: |r" + I2S(udg_Fame_Value) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 3, 13.00 )
// Xp Rate
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 4, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 4, "ReplaceableTextures\\CommandButtons\\BTNBookOfTheDead.blp" )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 4, 13.00 )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 4, ( "|c00FFFF6CExp Rate: |r" + ( I2S(R2I(udg_Xp_Rating)) + " %" ) ) )
// Death Blow
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 1, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 1, "ReplaceableTextures\\CommandButtons\\BTNCleavingAttack.blp" )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 1, 13.00 )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 1, ( "|c00FFFF6CDeath Blow: |r" + ( I2S(udg_Death_Blow) + " %" ) ) )
// Critical Strike
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 2, "ReplaceableTextures\\CommandButtons\\BTNCriticalStrike.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 2, ( "|c00FFFF6CCritical Strike: |r" + ( I2S(udg_Critical_Value) + " %" ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 2, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 2, true, true )
// Impact
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 3, "ReplaceableTextures\\CommandButtons\\BTNBash.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 3, ( "|c00FFFF6CImpact: |r" + ( R2S(udg_Impact_Value) + " %" ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 3, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 3, true, true )
// Fortify
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 4, "ReplaceableTextures\\CommandButtons\\BTNReincarnation.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 4, ( "|c00FFFF6CFortify: |r" + ( R2S(udg_Fortify_Reduced_Table) + " %" ) ))
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 4, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 4, true, true )
// Fortify chance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 5, "ReplaceableTextures\\CommandButtons\\BTNRaiseDead.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 5, ( "|c00FFFF6CFortify C: |r" + ( R2S(udg_Fortify_Chance_Table) + " %" ) ))
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 5, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 5, true, true )
// Move Speed
call MultiboardSetItemStyleBJ( udg_MultiBoard, 2, 6, true, true )
call MultiboardSetItemIconBJ( udg_MultiBoard, 2, 6, "ReplaceableTextures\\CommandButtons\\BTNBoots.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 6, ( "|c00FFFF6CSpeed: |r" + I2S(udg_MS) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 6, 13.00 )
// Fire Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 1, "ReplaceableTextures\\CommandButtons\\BTNOrbOfFire.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 1, ( "|c00FFFF6CFire Resistance: |r" + ( "|c007C0116" + I2S(udg_Fire_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 1, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 1, true, true )
// Ice Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 2, "ReplaceableTextures\\CommandButtons\\BTNOrbOfFrost.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 2, ( "|c00FFFF6CIce Resistance: |r" + ( "|c00178BFF" + I2S(udg_Ice_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 2, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 2, true, true )
// Lighting Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 3, "ReplaceableTextures\\CommandButtons\\BTNOrbOfLightning.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 3, ( "|c00FFFF6CLighting Resistance: |r" + I2S(udg_Lighting_Resistance) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 3, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 3, true, true )
// Light Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 4, "ReplaceableTextures\\CommandButtons\\BTNHeartOfAszune.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 4, ( "|c00FFFF6CLight Resistance: |r" + ( "|cffffcc00" + I2S(udg_Light_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 4, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 4, true, true )
// Dark Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 5, "ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 5, ( "|c00FFFF6CDark Resistance: |r" + ( "|c007D7D7D" + I2S(udg_Dark_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 5, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 5, true, true )
// Poison Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 6, "ReplaceableTextures\\CommandButtons\\BTNOrbOfVenom.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 6, ( "|c00FFFF6CPoison Resistance: |r" + ( "|c0000AE00" + I2S(udg_Poison_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 6, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 6, true, true )
// End
call MultiboardMinimizeBJ( true, GetLastCreatedMultiboard() )
call EnableTrigger( gg_trg_Armors_1 )
call EnableTrigger( gg_trg_Armors_2 )
else
endif
else
endif
endfunction
//===========================================================================
function InitTrig_Game_Select takes nothing returns nothing
set gg_trg_Game_Select = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_Game_Select, udg_Game_Select )
call TriggerAddAction( gg_trg_Game_Select, function Trig_Game_Select_Actions )
endfunction
function Trig_Step_1_Actions takes nothing returns nothing
set udg_Name = GetEventPlayerChatString()
call ClearTextMessagesBJ( bj_FORCE_PLAYER[0] )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, ( ( "Your name is " + ( "|c00FFFF6C" + udg_Name ) ) + "!" ) )
call CreateTextTagUnitBJ( GetEventPlayerChatString(), gg_unit_H001_0001, 0, 11.00, 100, 100, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 5 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 3.00 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 3.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 6.00, ( ( "|c00FFFF6CAll right " + udg_Name ) + " Now set difficulity." ) )
call TriggerSleepAction( 6.00 )
call DialogSetMessageBJ( udg_Init_Dialog, "TRIGSTR_018" )
call DialogAddButtonBJ( udg_Difficulity, "TRIGSTR_019" )
set udg_Dif_Dialog_Button_Easy = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_Difficulity, "TRIGSTR_020" )
set udg_Dif_Dialog_Button_Normal = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_Difficulity, "TRIGSTR_021" )
set udg_Dif_Dialog_Button_Hard = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_Difficulity, "TRIGSTR_022" )
set udg_Dif_Dialog_Button_Nightmare = GetLastCreatedButtonBJ()
call DialogDisplayBJ( true, udg_Difficulity, Player(0) )
endfunction
//===========================================================================
function InitTrig_Step_1 takes nothing returns nothing
set gg_trg_Step_1 = CreateTrigger( )
call DisableTrigger( gg_trg_Step_1 )
call TriggerRegisterPlayerChatEvent( gg_trg_Step_1, Player(0), "", true )
call TriggerAddAction( gg_trg_Step_1, function Trig_Step_1_Actions )
endfunction
function Trig_Difficulity_Func001C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Dif_Dialog_Button_Easy ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Func002C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Dif_Dialog_Button_Normal ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Func003C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Dif_Dialog_Button_Hard ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Func004C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Dif_Dialog_Button_Nightmare ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Actions takes nothing returns nothing
if ( Trig_Difficulity_Func001C() ) then
call SetPlayerHandicapBJ( Player(9), 75.00 )
call SetPlayerHandicapBJ( Player(8), 75.00 )
call SetPlayerHandicapBJ( Player(7), 75.00 )
call SetPlayerHandicapBJ( Player(6), 75.00 )
call SetPlayerHandicapBJ( Player(0), 125.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_023" )
call SetPlayerHandicapXPBJ( Player(0), 95.00 )
set udg_ddd = 1
else
endif
if ( Trig_Difficulity_Func002C() ) then
call SetPlayerHandicapBJ( Player(9), 100.00 )
call SetPlayerHandicapBJ( Player(8), 100.00 )
call SetPlayerHandicapBJ( Player(7), 100.00 )
call SetPlayerHandicapBJ( Player(6), 100.00 )
call SetPlayerHandicapBJ( Player(0), 100.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_024" )
call SetPlayerHandicapXPBJ( Player(0), 100 )
set udg_ddd = 2
else
endif
if ( Trig_Difficulity_Func003C() ) then
call SetPlayerHandicapBJ( Player(9), 150.00 )
call SetPlayerHandicapBJ( Player(8), 150.00 )
call SetPlayerHandicapBJ( Player(7), 150.00 )
call SetPlayerHandicapBJ( Player(6), 150.00 )
call SetPlayerHandicapBJ( Player(0), 95.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_025" )
call SetPlayerHandicapXPBJ( Player(0), 105.00 )
set udg_ddd = 3
else
endif
if ( Trig_Difficulity_Func004C() ) then
call SetPlayerHandicapBJ( Player(9), 200.00 )
call SetPlayerHandicapBJ( Player(8), 200.00 )
call SetPlayerHandicapBJ( Player(7), 200.00 )
call SetPlayerHandicapBJ( Player(6), 200.00 )
call SetPlayerHandicapBJ( Player(0), 90.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_026" )
call SetPlayerHandicapXPBJ( Player(0), 110.00 )
set udg_ddd = 4
else
endif
call TriggerSleepAction( 10.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 6.00, ( "|c00FFFF6CVery well " + ( udg_Name + " Now choice a job." ) ) )
call TriggerSleepAction( 6.00 )
call DialogSetMessageBJ( udg_Job, "TRIGSTR_027" )
call DialogAddButtonBJ( udg_Job, "TRIGSTR_028" )
set udg_Job_Dialog_Button_Warrior = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_Job, "TRIGSTR_029" )
set udg_Job_Dialog_Button_Knight = GetLastCreatedButtonBJ()
call DialogAddButtonBJ( udg_Job, "TRIGSTR_030" )
set udg_Job_Dialog_Button_Paladin = GetLastCreatedButtonBJ()
call DialogDisplayBJ( true, udg_Job, Player(0) )
call DialogDisplayBJ( false, udg_Difficulity, Player(0) )
call DialogClearBJ( udg_Difficulity )
endfunction
//===========================================================================
function InitTrig_Difficulity takes nothing returns nothing
set gg_trg_Difficulity = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_Difficulity, udg_Difficulity )
call TriggerAddAction( gg_trg_Difficulity, function Trig_Difficulity_Actions )
endfunction
function Trig_Difficulity_Load_Game_Func001C takes nothing returns boolean
if ( not ( udg_ddd == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Load_Game_Func002C takes nothing returns boolean
if ( not ( udg_ddd == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Load_Game_Func003C takes nothing returns boolean
if ( not ( udg_ddd == 3 ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Load_Game_Func004C takes nothing returns boolean
if ( not ( udg_ddd == 4 ) ) then
return false
endif
return true
endfunction
function Trig_Difficulity_Load_Game_Actions takes nothing returns nothing
if ( Trig_Difficulity_Load_Game_Func001C() ) then
call SetPlayerHandicapBJ( Player(9), 75.00 )
call SetPlayerHandicapBJ( Player(8), 75.00 )
call SetPlayerHandicapBJ( Player(7), 75.00 )
call SetPlayerHandicapBJ( Player(6), 75.00 )
call SetPlayerHandicapBJ( Player(0), 125.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_464" )
call SetPlayerHandicapXPBJ( Player(0), 95.00 )
else
endif
if ( Trig_Difficulity_Load_Game_Func002C() ) then
call SetPlayerHandicapBJ( Player(9), 100.00 )
call SetPlayerHandicapBJ( Player(8), 100.00 )
call SetPlayerHandicapBJ( Player(7), 100.00 )
call SetPlayerHandicapBJ( Player(6), 100.00 )
call SetPlayerHandicapBJ( Player(0), 100.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_465" )
call SetPlayerHandicapXPBJ( Player(0), 100 )
else
endif
if ( Trig_Difficulity_Load_Game_Func003C() ) then
call SetPlayerHandicapBJ( Player(9), 150.00 )
call SetPlayerHandicapBJ( Player(8), 150.00 )
call SetPlayerHandicapBJ( Player(7), 150.00 )
call SetPlayerHandicapBJ( Player(6), 150.00 )
call SetPlayerHandicapBJ( Player(0), 95.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_466" )
call SetPlayerHandicapXPBJ( Player(0), 105.00 )
else
endif
if ( Trig_Difficulity_Load_Game_Func004C() ) then
call SetPlayerHandicapBJ( Player(9), 200.00 )
call SetPlayerHandicapBJ( Player(8), 200.00 )
call SetPlayerHandicapBJ( Player(7), 200.00 )
call SetPlayerHandicapBJ( Player(6), 200.00 )
call SetPlayerHandicapBJ( Player(0), 90.00 )
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "TRIGSTR_467" )
call SetPlayerHandicapXPBJ( Player(0), 110.00 )
else
endif
endfunction
//===========================================================================
function InitTrig_Difficulity_Load_Game takes nothing returns nothing
set gg_trg_Difficulity_Load_Game = CreateTrigger( )
call DisableTrigger( gg_trg_Difficulity_Load_Game )
call TriggerAddAction( gg_trg_Difficulity_Load_Game, function Trig_Difficulity_Load_Game_Actions )
endfunction
function Trig_Job_Select_Func001C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Job_Dialog_Button_Warrior ) ) then
return false
endif
return true
endfunction
function Trig_Job_Select_Func002C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Job_Dialog_Button_Knight ) ) then
return false
endif
return true
endfunction
function Trig_Job_Select_Func003C takes nothing returns boolean
if ( not ( GetClickedButtonBJ() == udg_Job_Dialog_Button_Paladin ) ) then
return false
endif
return true
endfunction
function Trig_Job_Select_Func006C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Job_Select_Actions takes nothing returns nothing
if ( Trig_Job_Select_Func001C() ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 15.00, "TRIGSTR_407" )
call ReplaceUnitBJ( gg_unit_H001_0001, 'H002', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_Hero = GetLastReplacedUnitBJ()
set udg_Job_String = "Warrior"
else
endif
if ( Trig_Job_Select_Func002C() ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 15.00, "TRIGSTR_408" )
call ReplaceUnitBJ( gg_unit_H001_0001, 'H003', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_Hero = GetLastReplacedUnitBJ()
set udg_Job_String = "Knight"
else
endif
if ( Trig_Job_Select_Func003C() ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 15.00, "TRIGSTR_409" )
call ReplaceUnitBJ( gg_unit_H001_0001, 'H000', bj_UNIT_STATE_METHOD_RELATIVE )
set udg_Hero = GetLastReplacedUnitBJ()
set udg_Job_String = "Paladin"
else
endif
call SetUnitOwner( udg_Hero, Player(0), true )
call TriggerSleepAction( 6.00 )
if ( Trig_Job_Select_Func006C() ) then
call CreateFogModifierRectBJ( false, Player(0), FOG_OF_WAR_VISIBLE, gg_rct_Creating_Hero_Region )
call SetUnitPositionLoc( udg_Hero, GetRectCenter(gg_rct_Start) )
call DialogDisplayBJ( false, udg_Job, Player(0) )
call DialogClearBJ( udg_Job )
call ResetToGameCameraForPlayer( Player(0), 0 )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(udg_Hero), 0 )
call CreateMultiboardBJ( 3, 6, "TRIGSTR_410" )
set udg_MultiBoard = GetLastCreatedMultiboard()
// Name
call MultiboardDisplayBJ( true, GetLastCreatedMultiboard() )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 1, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 1, "ReplaceableTextures\\CommandButtons\\BTNArthas.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 1, ( "|c00FFFF6CName: |r" + udg_Name ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 1, 13.00 )
// Job
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 2, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 2, "ReplaceableTextures\\CommandButtons\\BTNBansheeAdept.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 2, ( "|c00FFFF6CJob: |r" + udg_Job_String ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 2, 13.00 )
// Fame
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 3, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 3, "ReplaceableTextures\\CommandButtons\\BTNOrcBattleStandard.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 3, ( "|c00FFFF6CFame: |r" + I2S(udg_Fame_Value) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 3, 13.00 )
// Xp Rating
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 1, 4, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 1, 4, "ReplaceableTextures\\CommandButtons\\BTNBookOfTheDead.blp" )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, 4, ( "|c00FFFF6CExp Rate: |r" + ( I2S(R2I(udg_Xp_Rating)) + " %" ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 1, 4, 13.00 )
// Death Blow
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 1, true, true )
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 1, "ReplaceableTextures\\CommandButtons\\BTNCleavingAttack.blp" )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 1, 13.00 )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 1, ( "|c00FFFF6CDeath Blow: |r" + ( I2S(udg_Death_Blow) + " %" ) ) )
// Critical Strike
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 2, "ReplaceableTextures\\CommandButtons\\BTNCriticalStrike.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 2, ( "|c00FFFF6CCritical Strike: |r" + ( I2S(udg_Critical_Value) + " %" ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 2, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 2, true, true )
// Impact
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 3, "ReplaceableTextures\\CommandButtons\\BTNBash.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 3, ( "|c00FFFF6CImpact: |r" + ( R2S(udg_Impact_Value) + " %" ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 3, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 3, true, true )
// Fortify
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 4, "ReplaceableTextures\\CommandButtons\\BTNReincarnation.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 4, ( "|c00FFFF6CFortify: |r" + ( R2S(udg_Fortify_Reduced_Table) + " %" ) ))
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 4, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 4, true, true )
// Fortify chance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 2, 5, "ReplaceableTextures\\CommandButtons\\BTNRaiseDead.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 5, ( "|c00FFFF6CFortify C: |r" + ( R2S(udg_Fortify_Chance_Table) + " %" ) ))
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 5, 13.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 2, 5, true, true )
// Move Speed
call MultiboardSetItemStyleBJ( udg_MultiBoard, 2, 6, true, true )
call MultiboardSetItemIconBJ( udg_MultiBoard, 2, 6, "ReplaceableTextures\\CommandButtons\\BTNBoots.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 6, ( "|c00FFFF6CSpeed: |r" + I2S(udg_MS) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 6, 13.00 )
// Fire Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 1, "ReplaceableTextures\\CommandButtons\\BTNOrbOfFire.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 1, ( "|c00FFFF6CFire Resistance: |r" + ( "|c007C0116" + I2S(udg_Fire_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 1, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 1, true, true )
// Ice Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 2, "ReplaceableTextures\\CommandButtons\\BTNOrbOfFrost.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 2, ( "|c00FFFF6CIce Resistance: |r" + ( "|c00178BFF" + I2S(udg_Ice_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 2, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 2, true, true )
// Lighting Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 3, "ReplaceableTextures\\CommandButtons\\BTNOrbOfLightning.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 3, ( "|c00FFFF6CLighting Resistance: |r" + I2S(udg_Lighting_Resistance) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 3, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 3, true, true )
// Light Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 4, "ReplaceableTextures\\CommandButtons\\BTNHeartOfAszune.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 4, ( "|c00FFFF6CLight Resistance: |r" + ( "|cffffcc00" + I2S(udg_Light_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 4, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 4, true, true )
// Dark Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 5, "ReplaceableTextures\\CommandButtons\\BTNOrbOfDarkness.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 5, ( "|c00FFFF6CDark Resistance: |r" + ( "|c007D7D7D" + I2S(udg_Dark_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 5, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 5, true, true )
// Poison Resistance
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, 6, "ReplaceableTextures\\CommandButtons\\BTNOrbOfVenom.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 6, ( "|c00FFFF6CPoison Resistance: |r" + ( "|c0000AE00" + I2S(udg_Poison_Resistance) ) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 3, 6, 16.00 )
call MultiboardSetItemStyleBJ( GetLastCreatedMultiboard(), 3, 6, true, true )
// End
call MultiboardMinimizeBJ( true, GetLastCreatedMultiboard() )
call SetTerrainFogExBJ( 0, 1215.00, 3515.00, 0.78, 36.00, 36.00, 36.00 )
call EnableTrigger( gg_trg_Armors_1 )
call EnableTrigger( gg_trg_Armors_2 )
else
endif
endfunction
//===========================================================================
function InitTrig_Job_Select takes nothing returns nothing
set gg_trg_Job_Select = CreateTrigger( )
call TriggerRegisterDialogEventBJ( gg_trg_Job_Select, udg_Job )
call TriggerAddAction( gg_trg_Job_Select, function Trig_Job_Select_Actions )
endfunction
function Trig_MultiBoard_Update_Actions takes nothing returns nothing
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 1, ( "|c00FFFF6CDeath Blow: |r" + ( I2S(udg_Death_Blow) + " %" ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 2, ( "|c00FFFF6CCritical Strike: |r" + ( I2S(udg_Critical_Value) + " %" ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 3, ( "|c00FFFF6CImpact: |r" + ( R2S(udg_Impact_Value) + " %" ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 4, ( "|c00FFFF6CFortify: |r" + ( R2S(udg_Fortify_Reduced_Table) + " %" ) ))
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 5, ( "|c00FFFF6CFortify C: |r" + ( R2S(udg_Fortify_Chance_Table) + " %" ) ))
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 6, ( "|c00FFFF6CSpeed:|r" + I2S(udg_MS) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 1, 3, ( "|c00FFFF6CFame: |r" + I2S(udg_Fame_Value) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 1, 4, ( "|c00FFFF6CExp Rate: |r" + ( I2S(R2I(udg_Xp_Rating)) + " %" ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 1, ( "|c00FFFF6CFire Resistance: |r" + ( "|c007C0116" + I2S(udg_Fire_Resistance) ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 2, ( "|c00FFFF6CIce Resistance: |r" + ( "|c00178BFF" + I2S(udg_Ice_Resistance) ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 3, ( "|c00FFFF6CLighting Resistance: |r" + I2S(udg_Lighting_Resistance) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 4, ( "|c00FFFF6CLight Resistance: |r" + ( "|cffffcc00" + I2S(udg_Light_Resistance) ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 5, ( "|c00FFFF6CDark Resistance: |r" + ( "|c007D7D7D" + I2S(udg_Dark_Resistance) ) ) )
call MultiboardSetItemValueBJ( udg_MultiBoard, 3, 6, ( "|c00FFFF6CPoison Resistance: |r" + ( "|c0000AE00" + I2S(udg_Poison_Resistance) ) ) )
endfunction
//===========================================================================
function InitTrig_MultiBoard_Update takes nothing returns nothing
set gg_trg_MultiBoard_Update = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_MultiBoard_Update, 0.01 )
call TriggerAddAction( gg_trg_MultiBoard_Update, function Trig_MultiBoard_Update_Actions )
endfunction
function Trig_Level_Up_Conditions takes nothing returns boolean
if ( not ( GetLevelingUnit() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Level_Up_Actions takes nothing returns nothing
call CreateTextTagUnitBJ( "TRIGSTR_327", GetLevelingUnit(), 0, 10, 25.00, 100, 0.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 68.00, 94.00 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 5 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 4 )
call PlaySoundBJ( gg_snd_ArrangedTeamInvitation )
call SetSoundPitchBJ( gg_snd_ArrangedTeamInvitation, 60.00 )
endfunction
//===========================================================================
function InitTrig_Level_Up takes nothing returns nothing
set gg_trg_Level_Up = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Level_Up, EVENT_PLAYER_HERO_LEVEL )
call TriggerAddCondition( gg_trg_Level_Up, Condition( function Trig_Level_Up_Conditions ) )
call TriggerAddAction( gg_trg_Level_Up, function Trig_Level_Up_Actions )
endfunction
//===========================================================================
//Mahdi Dehghan
//MdProjects
function Trig_XpRating_Increase_Func001C takes nothing returns boolean
if ( not ( udg_ddd == 1 ) ) then
return false
endif
return true
endfunction
function Trig_XpRating_Increase_Func002C takes nothing returns boolean
if ( not ( udg_ddd == 2 ) ) then
return false
endif
return true
endfunction
function Trig_XpRating_Increase_Func003C takes nothing returns boolean
if ( not ( udg_ddd == 3 ) ) then
return false
endif
return true
endfunction
function Trig_XpRating_Increase_Func004C takes nothing returns boolean
if ( not ( udg_ddd == 4 ) ) then
return false
endif
return true
endfunction
function Trig_XpRating_Increase_Actions takes nothing returns nothing
if ( Trig_XpRating_Increase_Func001C() ) then
call SetPlayerHandicapXPBJ( Player(0), ( 95.00 + I2R(( GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, false) / 10 )) ) )
else
endif
if ( Trig_XpRating_Increase_Func002C() ) then
call SetPlayerHandicapXPBJ( Player(0), ( 100.00 + I2R(( GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, false) / 10 )) ) )
else
endif
if ( Trig_XpRating_Increase_Func003C() ) then
call SetPlayerHandicapXPBJ( Player(0), ( 105.00 + I2R(( GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, false) / 10 )) ) )
else
endif
if ( Trig_XpRating_Increase_Func004C() ) then
call SetPlayerHandicapXPBJ( Player(0), ( 110.00 + I2R(( GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, false) / 10 )) ) )
else
endif
set udg_Xp_Rating = GetPlayerHandicapXPBJ(Player(0))
endfunction
//===========================================================================
function InitTrig_XpRating_Increase takes nothing returns nothing
set gg_trg_XpRating_Increase = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_XpRating_Increase, 0.10 )
call TriggerAddAction( gg_trg_XpRating_Increase, function Trig_XpRating_Increase_Actions )
endfunction
//===========================================================================
//Mahdi Dehghan
//MdProjects
function Trig_Attack_Disable_Conditions takes nothing returns boolean
if ( not ( GetAttacker() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Disable_Func001C takes nothing returns boolean
if ( not ( udg_Armed == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Disable_Actions takes nothing returns nothing
if ( Trig_Attack_Disable_Func001C() ) then
call IssueImmediateOrderBJ( udg_Hero, "stop" )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_509" )
else
endif
endfunction
//===========================================================================
function InitTrig_Attack_Disable takes nothing returns nothing
set gg_trg_Attack_Disable = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Disable, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Disable, Condition( function Trig_Attack_Disable_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Disable, function Trig_Attack_Disable_Actions )
endfunction
function Trig_Thirst_Eyes_Receive_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_H004_0019 ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_Maxweel_Region, udg_Hero) == true ) ) then
return false
endif
return true
endfunction
function Trig_Thirst_Eyes_Receive_Actions takes nothing returns nothing
call DestroyEffectBJ( udg_S_1 )
call CinematicModeBJ( true, GetPlayersAll() )
call SetUnitFacingToFaceLocTimed( udg_Hero, GetUnitLoc(gg_unit_H004_0019), 0.50 )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_H004_0019, "TRIGSTR_335", null, "TRIGSTR_336", bj_TIMETYPE_ADD, 4.00, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_Hero, StringCase(udg_Name, false), null, ( ( "I am " + udg_Name ) + ( " a novice " + ( udg_Job_String + " from Stormwind." ) ) ), bj_TIMETYPE_ADD, 4.00, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_H004_0019, "TRIGSTR_339", null, "TRIGSTR_340", bj_TIMETYPE_ADD, 4.00, true )
call IssuePointOrderLocBJ( udg_Hero, "move", GetRectCenter(gg_rct_Region_007) )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_H004_0019, "TRIGSTR_341", null, "TRIGSTR_342", bj_TIMETYPE_ADD, 2.00, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_H004_0019, "TRIGSTR_343", null, "TRIGSTR_344", bj_TIMETYPE_ADD, 3.00, true )
call SetUnitFacingToFaceLocTimed( udg_Hero, GetUnitLoc(gg_unit_H004_0019), 0.65 )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_Hero, udg_Name, null, "TRIGSTR_346", bj_TIMETYPE_ADD, 1.00, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_H004_0019, "TRIGSTR_347", null, "TRIGSTR_348", bj_TIMETYPE_ADD, 8.00, true )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), udg_Hero, udg_Name, null, "TRIGSTR_349", bj_TIMETYPE_ADD, 1.00, true )
call CinematicModeBJ( false, GetPlayersAll() )
call CreateQuestBJ( bj_QUESTTYPE_REQ_DISCOVERED, "TRIGSTR_350", "TRIGSTR_351", "ReplaceableTextures\\CommandButtons\\BTNAmbush.blp" )
set udg_Quest_001 = GetLastCreatedQuestBJ()
call QuestSetEnabledBJ( true, GetLastCreatedQuestBJ() )
call PingMinimapLocForForce( GetPlayersAll(), GetRectCenter(gg_rct_Quest_Ping_001), 6.00 )
call FlashQuestDialogButtonBJ( )
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Bandit_Die_001 )
call EnableTrigger( gg_trg_Thirst_Eyes )
endfunction
//===========================================================================
function InitTrig_Thirst_Eyes_Receive takes nothing returns nothing
set gg_trg_Thirst_Eyes_Receive = CreateTrigger( )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Thirst_Eyes_Receive, Player(0), true )
call TriggerAddCondition( gg_trg_Thirst_Eyes_Receive, Condition( function Trig_Thirst_Eyes_Receive_Conditions ) )
call TriggerAddAction( gg_trg_Thirst_Eyes_Receive, function Trig_Thirst_Eyes_Receive_Actions )
endfunction
function Trig_Bandit_Die_001_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'H008' ) ) then
return false
endif
return true
endfunction
function Trig_Bandit_Die_001_Actions takes nothing returns nothing
set udg_U_D_Bandit_001 = 1
call QuestSetDescriptionBJ( udg_Quest_001, "TRIGSTR_768" )
call QuestSetCompletedBJ( udg_Quest_001, true )
call FlashQuestDialogButtonBJ( )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_352" )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Bandit_Die_001 takes nothing returns nothing
set gg_trg_Bandit_Die_001 = CreateTrigger( )
call DisableTrigger( gg_trg_Bandit_Die_001 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bandit_Die_001, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Bandit_Die_001, Condition( function Trig_Bandit_Die_001_Conditions ) )
call TriggerAddAction( gg_trg_Bandit_Die_001, function Trig_Bandit_Die_001_Actions )
endfunction
function Trig_Thirst_Eyes_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == gg_unit_H004_0019 ) ) then
return false
endif
if ( not ( RectContainsUnit(gg_rct_Maxweel_Region, udg_Hero) == true ) ) then
return false
endif
return true
endfunction
function Trig_Thirst_Eyes_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call CinematicModeBJ( true, GetPlayersAll() )
call TransmissionFromUnitWithNameBJ( GetPlayersAll(), gg_unit_H004_0019, "TRIGSTR_353", null, "TRIGSTR_354", bj_TIMETYPE_ADD, 2.00, true )
call AdjustPlayerStateBJ( 35, Player(0), PLAYER_STATE_RESOURCE_GOLD )
call AddHeroXPSwapped( 200, udg_Hero, true )
set udg_Fame_Value = ( udg_Fame_Value + 1 )
call DestroyQuestBJ( udg_Quest_001 )
call CinematicModeBJ( false, GetPlayersAll() )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_355" )
endfunction
//===========================================================================
function InitTrig_Thirst_Eyes takes nothing returns nothing
set gg_trg_Thirst_Eyes = CreateTrigger( )
call DisableTrigger( gg_trg_Thirst_Eyes )
call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Thirst_Eyes, Player(0), true )
call TriggerAddCondition( gg_trg_Thirst_Eyes, Condition( function Trig_Thirst_Eyes_Conditions ) )
call TriggerAddAction( gg_trg_Thirst_Eyes, function Trig_Thirst_Eyes_Actions )
endfunction
function Trig_Death_Blow_Conditions takes nothing returns boolean
if ( not ( GetAttacker() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Death_Blow_Func001C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) < udg_Death_Blow ) ) then
return false
endif
return true
endfunction
function Trig_Death_Blow_Actions takes nothing returns nothing
if ( Trig_Death_Blow_Func001C() ) then
call SetUnitAnimation( GetAttacker(), "Slam" )
set udg_Death_Blow_Value = ( 10.00 + ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, GetAttacker(), false)) * ( 10.00 + GetRandomReal(0, 1.05) ) ) )
call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), udg_Death_Blow_Value, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "Chest", GetAttackedUnitBJ(), "Objects\\Spawnmodels\\Orc\\Orcblood\\BattrollBlood.mdl" )
call CreateTextTagUnitBJ( I2S(R2I(udg_Death_Blow_Value)), GetAttackedUnitBJ(), 0, 10.00, 100, 35.00, 10.00, 0 )
call SetTextTagSuspendedBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 90 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 4.00 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 3.00 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 5.00 )
call EnableTrigger( GetTriggeringTrigger() )
else
endif
endfunction
//===========================================================================
function InitTrig_Death_Blow takes nothing returns nothing
set gg_trg_Death_Blow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Blow, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Death_Blow, Condition( function Trig_Death_Blow_Conditions ) )
call TriggerAddAction( gg_trg_Death_Blow, function Trig_Death_Blow_Actions )
endfunction
function Trig_Items_1_Func002C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I000') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func003C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I007') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func004C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00E') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func005C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00C') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func006C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00D') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func007C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00F') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func008C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00B') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func009C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I006') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func010C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I001') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func011C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I004') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func012C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I005') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func013C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00G') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Func014C takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(udg_Hero, 'I00N') == true ) ) then
return false
endif
return true
endfunction
function Trig_Items_1_Actions takes nothing returns nothing
// Weapons
if ( Trig_Items_1_Func002C() ) then
set udg_Weapon_Damage = 11
set udg_Death_Blow = 2
set udg_Impact_Value = 1.25
set udg_Critical_Value = 5
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func003C() ) then
set udg_Weapon_Damage = 57
set udg_Death_Blow = 1
set udg_Impact_Value = 3.15
set udg_Critical_Value = 1
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func004C() ) then
set udg_Weapon_Damage = 53
set udg_Death_Blow = 2
set udg_Impact_Value = 1.75
set udg_Critical_Value = 6
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func005C() ) then
set udg_Weapon_Damage = 58
set udg_Death_Blow = 2
set udg_Impact_Value = 2.00
set udg_Critical_Value = 7
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func006C() ) then
set udg_Weapon_Damage = 68
set udg_Death_Blow = 3
set udg_Impact_Value = 2.15
set udg_Critical_Value = 8
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func007C() ) then
set udg_Weapon_Damage = 77
set udg_Death_Blow = 3
set udg_Impact_Value = 2.30
set udg_Critical_Value = 9
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func008C() ) then
set udg_Weapon_Damage = 87
set udg_Death_Blow = 4
set udg_Impact_Value = 2.60
set udg_Critical_Value = 10
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func009C() ) then
set udg_Weapon_Damage = 17
set udg_Death_Blow = 1
set udg_Impact_Value = 0.75
set udg_Critical_Value = 6
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func010C() ) then
set udg_Weapon_Damage = 323
set udg_Critical_Value = 12
set udg_Death_Blow = 8
set udg_Impact_Value = 6.75
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func011C() ) then
set udg_Weapon_Damage = 1518
set udg_Critical_Value = 25
set udg_Death_Blow = 12
set udg_Impact_Value = 12.00
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func012C() ) then
set udg_Weapon_Damage = 2237
set udg_Critical_Value = 30
set udg_Death_Blow = 15
set udg_Impact_Value = 15.00
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func013C() ) then
set udg_Weapon_Damage = 2228
set udg_Critical_Value = 28
set udg_Death_Blow = 13
set udg_Impact_Value = 13.00
set udg_Armed = 1
else
endif
if ( Trig_Items_1_Func014C() ) then
set udg_Weapon_Damage = 89
set udg_Critical_Value = 4
set udg_Death_Blow = 3
set udg_Impact_Value = 2.25
set udg_Armed = 1
else
endif
endfunction
//===========================================================================
function InitTrig_Items_1 takes nothing returns nothing
set gg_trg_Items_1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Items_1, 0.01 )
call TriggerAddAction( gg_trg_Items_1, function Trig_Items_1_Actions )
endfunction
function Trig_Items_2_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I000' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func002C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I007' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func003C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00E' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func004C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00C' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func005C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00D' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func006C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00F' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func007C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00B' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func008C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I006' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func009C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I001' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func010C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I004' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func011C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I005' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func012C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00G' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Func013C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00N' ) ) then
return false
endif
return true
endfunction
function Trig_Items_2_Actions takes nothing returns nothing
if ( Trig_Items_2_Func001C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func002C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func003C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func004C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func005C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func006C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func007C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func008C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func009C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func010C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func011C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func012C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
if ( Trig_Items_2_Func013C() ) then
set udg_Critical_Value = 0
set udg_Death_Blow = 0
set udg_Impact_Value = 0.00
set udg_Weapon_Damage = 0
set udg_Armed = 0
else
endif
endfunction
//===========================================================================
function InitTrig_Items_2 takes nothing returns nothing
set gg_trg_Items_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Items_2, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( gg_trg_Items_2, Condition( function Trig_Items_2_Conditions ) )
call TriggerAddAction( gg_trg_Items_2, function Trig_Items_2_Actions )
endfunction
function Trig_Shalamyne_2_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I004') == true ) ) then
return false
endif
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_SUMMONED) == true ) ) then
return false
endif
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_HERO) != true ) ) then
return false
endif
return true
endfunction
function Trig_Shalamyne_2_Func001C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) < 50 ) ) then
return false
endif
return true
endfunction
function Trig_Shalamyne_2_Actions takes nothing returns nothing
if ( Trig_Shalamyne_2_Func001C() ) then
call AddSpecialEffectTargetUnitBJ( "origin", GetAttackedUnitBJ(), "Abilities\\Spells\\Items\\AIso\\AIsoTarget.mdl" )
call TriggerSleepAction( 1.25 )
call KillUnit( GetAttackedUnitBJ() )
else
endif
endfunction
//===========================================================================
function InitTrig_Shalamyne_2 takes nothing returns nothing
set gg_trg_Shalamyne_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shalamyne_2, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Shalamyne_2, Condition( function Trig_Shalamyne_2_Conditions ) )
call TriggerAddAction( gg_trg_Shalamyne_2, function Trig_Shalamyne_2_Actions )
endfunction
function Trig_Entharas_Conditions takes nothing returns boolean
if ( not ( UnitHasItemOfTypeBJ(GetAttacker(), 'I00G') == true ) ) then
return false
endif
return true
endfunction
function Trig_Entharas_Func001Func001C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) < 75 ) ) then
return false
endif
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(GetAttacker())) == true ) ) then
return false
endif
return true
endfunction
function Trig_Entharas_Func001A takes nothing returns nothing
if ( Trig_Entharas_Func001Func001C() ) then
call UnitDamageTargetBJ( GetAttacker(), GetEnumUnit(), ( I2R(GetHeroLevel(GetEnumUnit())) * GetRandomReal(100.00, 125.00) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "origin", GetAttackedUnitBJ(), "Abilities\\Spells\\Items\\ResourceItems\\ResourceEffectTarget.mdl" )
call TriggerSleepAction( 2.00 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
endfunction
function Trig_Entharas_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocAll(225.00, GetUnitLoc(GetAttackedUnitBJ())), function Trig_Entharas_Func001A )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 10.00 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Entharas takes nothing returns nothing
set gg_trg_Entharas = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Entharas, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Entharas, Condition( function Trig_Entharas_Conditions ) )
call TriggerAddAction( gg_trg_Entharas, function Trig_Entharas_Actions )
endfunction
function Trig_Flame_Of_Shalamyne_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A011' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Of_Shalamyne_Func006Func006Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(GetSpellAbilityUnit())) == true ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Of_Shalamyne_Func006Func006A takes nothing returns nothing
if ( Trig_Flame_Of_Shalamyne_Func006Func006Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( ( I2R(udg_Weapon_Damage) / 2.50 ) + ( I2R(GetHeroLevel(GetSpellAbilityUnit())) * 11.00 ) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_FIRE )
else
endif
endfunction
function Trig_Flame_Of_Shalamyne_Actions takes nothing returns nothing
call SetUnitAnimation( GetSpellAbilityUnit(), "attack" )
set udg_FOS_Point_Main = GetUnitLoc(GetTriggerUnit())
set udg_FOS_Point_Target = GetSpellTargetLoc()
set udg_FOS_Point_Angel_Distance = AngleBetweenPoints(udg_FOS_Point_Main, udg_FOS_Point_Target)
set udg_FOS_Integer_Array[GetForLoopIndexA()] = 10
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_FOS_Point_Final[GetForLoopIndexA()] = PolarProjectionBJ(udg_FOS_Point_Main, ( 50.00 + ( 125.00 * I2R(GetForLoopIndexA()) ) ), udg_FOS_Point_Angel_Distance)
call CreateNUnitsAtLoc( 1, 'h00A', GetOwningPlayer(GetSpellAbilityUnit()), udg_FOS_Point_Final[GetForLoopIndexA()], bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_FOS_Group )
call AddSpecialEffectLocBJ( GetUnitLoc(GetLastCreatedUnit()), "Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl" )
call ForGroupBJ( GetUnitsInRangeOfLocAll(225.00, GetUnitLoc(GetLastCreatedUnit())), function Trig_Flame_Of_Shalamyne_Func006Func006A )
call TriggerSleepAction( 0.01 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 3.00 )
call ResetUnitAnimation( GetSpellAbilityUnit() )
endfunction
//===========================================================================
function InitTrig_Flame_Of_Shalamyne takes nothing returns nothing
set gg_trg_Flame_Of_Shalamyne = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Of_Shalamyne, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flame_Of_Shalamyne, Condition( function Trig_Flame_Of_Shalamyne_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Of_Shalamyne, function Trig_Flame_Of_Shalamyne_Actions )
endfunction
function Trig_Armors_1_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Armors_1_Func004C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I002' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_1_Func005C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00J' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_1_Func006C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I009' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_1_Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00I' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_1_Func003C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00K' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_1_Actions takes nothing returns nothing
// Armors
if ( Trig_Armors_1_Func004C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance + 23 )
set udg_Ice_Resistance = ( udg_Ice_Resistance + 13 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance - 32 )
set udg_Poison_Resistance = ( udg_Poison_Resistance + 3 )
set udg_Dark_Resistance = ( udg_Dark_Resistance + 7 )
set udg_Light_Resistance = ( udg_Light_Resistance + 13 )
else
endif
if ( Trig_Armors_1_Func005C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance + 28 )
set udg_Ice_Resistance = ( udg_Ice_Resistance + 16 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance - 53 )
set udg_Poison_Resistance = ( udg_Poison_Resistance + 5 )
set udg_Dark_Resistance = ( udg_Dark_Resistance + 9 )
set udg_Light_Resistance = ( udg_Light_Resistance + 13 )
else
endif
if ( Trig_Armors_1_Func001C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance + 30 )
set udg_Ice_Resistance = ( udg_Ice_Resistance + 15 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance - 29 )
set udg_Poison_Resistance = ( udg_Poison_Resistance + 4 )
set udg_Dark_Resistance = ( udg_Dark_Resistance + 8 )
set udg_Light_Resistance = ( udg_Light_Resistance + 11 )
else
endif
// Helms
if ( Trig_Armors_1_Func006C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance + 7 )
set udg_Ice_Resistance = ( udg_Ice_Resistance + 4 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance - 9 )
set udg_Poison_Resistance = ( udg_Poison_Resistance + 1 )
set udg_Dark_Resistance = ( udg_Dark_Resistance + 3 )
set udg_Light_Resistance = ( udg_Light_Resistance + 5 )
else
endif
if ( Trig_Armors_1_Func003C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance + 10 )
set udg_Ice_Resistance = ( udg_Ice_Resistance + 6 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance - 15 )
set udg_Poison_Resistance = ( udg_Poison_Resistance + 2 )
set udg_Dark_Resistance = ( udg_Dark_Resistance + 4 )
set udg_Light_Resistance = ( udg_Light_Resistance + 6 )
else
endif
endfunction
//===========================================================================
function InitTrig_Armors_1 takes nothing returns nothing
set gg_trg_Armors_1 = CreateTrigger( )
call DisableTrigger( gg_trg_Armors_1 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Armors_1, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Armors_1, Condition( function Trig_Armors_1_Conditions ) )
call TriggerAddAction( gg_trg_Armors_1, function Trig_Armors_1_Actions )
endfunction
function Trig_Armors_2_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Armors_2_Func002C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I002' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_2_Func005C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00J' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_2_Func004C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I009' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_2_Func001C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00I' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_2_Func003C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00K' ) ) then
return false
endif
return true
endfunction
function Trig_Armors_2_Actions takes nothing returns nothing
// Armors
if ( Trig_Armors_2_Func002C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance - 23 )
set udg_Ice_Resistance = ( udg_Ice_Resistance - 13 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance + 32 )
set udg_Poison_Resistance = ( udg_Poison_Resistance - 3 )
set udg_Dark_Resistance = ( udg_Dark_Resistance - 7 )
set udg_Light_Resistance = ( udg_Light_Resistance - 13 )
else
endif
if ( Trig_Armors_2_Func005C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance - 28 )
set udg_Ice_Resistance = ( udg_Ice_Resistance - 16 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance + 53 )
set udg_Poison_Resistance = ( udg_Poison_Resistance - 5 )
set udg_Dark_Resistance = ( udg_Dark_Resistance - 9 )
set udg_Light_Resistance = ( udg_Light_Resistance - 13 )
else
endif
if ( Trig_Armors_2_Func001C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance - 30 )
set udg_Ice_Resistance = ( udg_Ice_Resistance - 15 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance + 29 )
set udg_Poison_Resistance = ( udg_Poison_Resistance - 4 )
set udg_Dark_Resistance = ( udg_Dark_Resistance - 8 )
set udg_Light_Resistance = ( udg_Light_Resistance - 11 )
else
endif
// Helms
if ( Trig_Armors_2_Func004C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance - 7 )
set udg_Ice_Resistance = ( udg_Ice_Resistance - 4 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance + 9 )
set udg_Poison_Resistance = ( udg_Poison_Resistance - 1 )
set udg_Dark_Resistance = ( udg_Dark_Resistance - 3 )
set udg_Light_Resistance = ( udg_Light_Resistance - 5 )
else
endif
if ( Trig_Armors_2_Func003C() ) then
set udg_Fire_Resistance = ( udg_Fire_Resistance - 10 )
set udg_Ice_Resistance = ( udg_Ice_Resistance - 6 )
set udg_Lighting_Resistance = ( udg_Lighting_Resistance + 15 )
set udg_Poison_Resistance = ( udg_Poison_Resistance - 2 )
set udg_Dark_Resistance = ( udg_Dark_Resistance - 4 )
set udg_Light_Resistance = ( udg_Light_Resistance - 6 )
else
endif
endfunction
//===========================================================================
function InitTrig_Armors_2 takes nothing returns nothing
set gg_trg_Armors_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Armors_2 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Armors_2, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddCondition( gg_trg_Armors_2, Condition( function Trig_Armors_2_Conditions ) )
call TriggerAddAction( gg_trg_Armors_2, function Trig_Armors_2_Actions )
endfunction
function Trig_Heavy_Strike_P_1_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I003' ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_1_Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == udg_Warrior ) ) then
return false
endif
if ( not ( udg_H_S_P == false ) ) then
return false
endif
if ( not ( udg_H_S_P_Level >= udg_H_S_P_Level_2 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_1_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == udg_Warrior ) ) then
return false
endif
if ( not ( udg_H_S_P_Level < udg_H_S_P_Level_2 ) ) then
return false
endif
if ( not ( udg_H_S_P == false ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_1_Actions takes nothing returns nothing
if ( Trig_Heavy_Strike_P_1_Func001C() ) then
set udg_H_S_P_Level_2 = ( udg_H_S_P_Level_2 + 5 )
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I003') )
call RemoveItemFromAllStock( 'I003' )
set udg_HeavyStrike_Load = 1
call UnitAddAbilityBJ( 'A005', udg_Hero )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(udg_Hero), 0 )
call AddSpecialEffectTargetUnitBJ( "origin", udg_Hero, "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl" )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_121" )
call RemoveItemFromStockBJ( 'I003', gg_unit_hfoo_0021 )
call TriggerSleepAction( 0.01 )
set udg_H_S_P = true
call EnableTrigger( gg_trg_Heavy_Strike_P_2 )
call EnableTrigger( gg_trg_Heavy_Strike_P_3 )
else
call DoNothing( )
endif
if ( Trig_Heavy_Strike_P_1_Func002C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I003') )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_333" )
call AdjustPlayerStateBJ( 50, Player(0), PLAYER_STATE_RESOURCE_GOLD )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Heavy_Strike_P_1 takes nothing returns nothing
set gg_trg_Heavy_Strike_P_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heavy_Strike_P_1, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Heavy_Strike_P_1, Condition( function Trig_Heavy_Strike_P_1_Conditions ) )
call TriggerAddAction( gg_trg_Heavy_Strike_P_1, function Trig_Heavy_Strike_P_1_Actions )
endfunction
function Trig_Heavy_Strike_P_2_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I003' ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_2_Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == udg_Warrior ) ) then
return false
endif
if ( not ( udg_H_S_P == true ) ) then
return false
endif
if ( not ( udg_H_S_P_Level >= udg_H_S_P_Level_2 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_2_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == udg_Warrior ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A005', udg_Hero) == 10 ) ) then
return false
endif
if ( not ( udg_H_S_P == true ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_2_Actions takes nothing returns nothing
if ( Trig_Heavy_Strike_P_2_Func001C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I003') )
call RemoveItemFromAllStock( 'I003' )
call SetUnitAbilityLevelSwapped( 'A005', GetManipulatingUnit(), ( GetUnitAbilityLevelSwapped('A005', GetManipulatingUnit()) + 1 ) )
set udg_HeavyStrike_Load = ( udg_HeavyStrike_Load + 1 )
call PanCameraToTimedLocForPlayer( Player(0), GetUnitLoc(udg_Hero), 0 )
call AddSpecialEffectTargetUnitBJ( "origin", udg_Hero, "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl" )
call DisplayTextToForce( bj_FORCE_PLAYER[0], ( "|cffffcc00Heavy Strike " + ( "Upgraded to " + ( "Level " + I2S(GetUnitAbilityLevelSwapped('A005', GetManipulatingUnit())) ) ) ) )
call RemoveItemFromStockBJ( 'I003', gg_unit_hfoo_0021 )
set udg_H_S_P = true
call TriggerSleepAction( 1.5 )
set udg_H_S_P_Level_2 = ( udg_H_S_P_Level_2 + 5 )
call DoNothing( )
else
call DoNothing( )
endif
if ( Trig_Heavy_Strike_P_2_Func002C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I003') )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_330" )
call AdjustPlayerStateBJ( 50, Player(0), PLAYER_STATE_RESOURCE_GOLD )
call DoNothing( )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Heavy_Strike_P_2 takes nothing returns nothing
set gg_trg_Heavy_Strike_P_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Heavy_Strike_P_2 )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heavy_Strike_P_2, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Heavy_Strike_P_2, Condition( function Trig_Heavy_Strike_P_2_Conditions ) )
call TriggerAddAction( gg_trg_Heavy_Strike_P_2, function Trig_Heavy_Strike_P_2_Actions )
endfunction
function Trig_Heavy_Strike_P_3_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == udg_Warrior ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I003' ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_3_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetManipulatingUnit()) == udg_Warrior ) ) then
return false
endif
if ( not ( udg_H_S_P_Level < udg_H_S_P_Level_2 ) ) then
return false
endif
if ( not ( udg_H_S_P == true ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_P_3_Actions takes nothing returns nothing
if ( Trig_Heavy_Strike_P_3_Func003C() ) then
call RemoveItem( GetItemOfTypeFromUnitBJ(GetManipulatingUnit(), 'I003') )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "TRIGSTR_334" )
call AdjustPlayerStateBJ( 50, Player(0), PLAYER_STATE_RESOURCE_GOLD )
call DoNothing( )
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Heavy_Strike_P_3 takes nothing returns nothing
set gg_trg_Heavy_Strike_P_3 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heavy_Strike_P_3, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Heavy_Strike_P_3, Condition( function Trig_Heavy_Strike_P_3_Conditions ) )
call TriggerAddAction( gg_trg_Heavy_Strike_P_3, function Trig_Heavy_Strike_P_3_Actions )
endfunction
function Trig_Heavy_Strike_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A005' ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_Actions takes nothing returns nothing
call AddSpecialEffectTargetUnitBJ( "weapon", GetSpellAbilityUnit(), "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set udg_sss = GetLastCreatedEffectBJ()
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetSpellTargetUnit(), I2R(( ( ( GetHeroStatBJ(bj_HEROSTAT_STR, GetSpellAbilityUnit(), false) * 2 ) * GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) + udg_Weapon_Damage )), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl" )
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl" )
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodLarge0.mdl" )
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidRaven.mdl" )
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodHeroFarSeer.mdl" )
call AddSpecialEffectTargetUnitBJ( "chest", GetSpellTargetUnit(), "Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl" )
call TriggerSleepAction( 1.00 )
call DestroyEffectBJ( udg_sss )
endfunction
//===========================================================================
function InitTrig_Heavy_Strike takes nothing returns nothing
set gg_trg_Heavy_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heavy_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Heavy_Strike, Condition( function Trig_Heavy_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Heavy_Strike, function Trig_Heavy_Strike_Actions )
endfunction
function Trig_Soul_Strike_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00P' ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Strike_Func006Func001Func002002003 takes nothing returns boolean
return ( GetEnumUnit() != GetSpellAbilityUnit() )
endfunction
function Trig_Soul_Strike_Func006Func001Func004A takes nothing returns nothing
set udg_SoulOmnistrikeTarget = GetEnumUnit()
call SelectUnitRemove( GetTriggerUnit() )
call AddSpecialEffectTargetUnitBJ( "Origin", GetTriggerUnit(), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call SetUnitPositionLoc( GetTriggerUnit(), PolarProjectionBJ(GetUnitLoc(udg_SoulOmnistrikeTarget), 100.00, GetRandomReal(1.00, 360.00)) )
call SetUnitFacingToFaceUnitTimed( GetTriggerUnit(), udg_SoulOmnistrikeTarget, 0 )
call SetUnitAnimation( GetTriggerUnit(), "attack" )
call AddSpecialEffectTargetUnitBJ( "chest", udg_SoulOmnistrikeTarget, "Abilities\\Dark Magic Shield.mdx" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamageTargetBJ( GetTriggerUnit(), udg_SoulOmnistrikeTarget, ( I2R(( GetUnitAbilityLevelSwapped('A00P', GetSpellAbilityUnit()) * ( udg_Weapon_Damage / 8 ) )) + GetRandomReal(25.00, 75.00) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "chest", udg_SoulOmnistrikeTarget, "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl" )
call DestroyGroup( udg_SoulOmnistrikeG1 )
call DestroyGroup( udg_SoulOmnistrikeG2 )
endfunction
function Trig_Soul_Strike_Func006C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Strike_Actions takes nothing returns nothing
call SetUnitTimeScalePercent( GetTriggerUnit(), 200.00 )
call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 80.00, 80.00, 50.00 )
call AddSpecialEffectTargetUnitBJ( "weapon", GetTriggerUnit(), "Abilities\\DarkArrowMissile.mdx" )
set udg_SoulOmniStrikeSFX = GetLastCreatedEffectBJ()
call SetUnitInvulnerable( GetTriggerUnit(), true )
if ( Trig_Soul_Strike_Func006C() ) then
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call PolledWait( 0.35 )
set udg_SoulOmnistrikeG1 = GetUnitsInRangeOfLocMatching(700.00, GetUnitLoc(GetSpellAbilityUnit()), Condition(function Trig_Soul_Strike_Func006Func001Func002002003))
set udg_SoulOmnistrikeG2 = GetUnitsInRangeOfLocAll(700.00, GetUnitLoc(GetTriggerUnit()))
call ForGroupBJ( udg_SoulOmnistrikeG1, function Trig_Soul_Strike_Func006Func001Func004A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
endif
call SetUnitTimeScalePercent( GetTriggerUnit(), 100.00 )
call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, 0.00 )
call DestroyEffectBJ( udg_SoulOmniStrikeSFX )
call SetUnitInvulnerable( GetTriggerUnit(), false )
call SelectUnitAdd( GetTriggerUnit() )
call SelectUnitForPlayerSingle( GetTriggerUnit(), GetOwningPlayer(GetTriggerUnit()) )
endfunction
//===========================================================================
function InitTrig_Soul_Strike takes nothing returns nothing
set gg_trg_Soul_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Soul_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Soul_Strike, Condition( function Trig_Soul_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Soul_Strike, function Trig_Soul_Strike_Actions )
endfunction
//===========================================================================
//Mahdi Dehghan
//MdProjects
function Trig_Soul_Strike_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00P' ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Strike_Copy_Func006Func001Func002002003 takes nothing returns boolean
return ( GetEnumUnit() != GetSpellAbilityUnit() )
endfunction
function Trig_Soul_Strike_Copy_Func006Func001Func004A takes nothing returns nothing
set udg_SoulOmnistrikeTarget = GetEnumUnit()
call SelectUnitRemove( GetTriggerUnit() )
call AddSpecialEffectTargetUnitBJ( "Origin", GetTriggerUnit(), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call SetUnitPositionLoc( GetTriggerUnit(), PolarProjectionBJ(GetUnitLoc(udg_SoulOmnistrikeTarget), 100.00, GetRandomReal(1.00, 360.00)) )
call SetUnitFacingToFaceUnitTimed( GetTriggerUnit(), udg_SoulOmnistrikeTarget, 0 )
call SetUnitAnimation( GetTriggerUnit(), "attack" )
call AddSpecialEffectTargetUnitBJ( "chest", udg_SoulOmnistrikeTarget, "Abilities\\Dark Magic Shield.mdx" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamageTargetBJ( GetTriggerUnit(), udg_SoulOmnistrikeTarget, ( I2R(( GetUnitAbilityLevelSwapped('A00P', GetSpellAbilityUnit()) * ( udg_Weapon_Damage / 8 ) )) + GetRandomReal(25.00, 75.00) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "chest", udg_SoulOmnistrikeTarget, "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl" )
call DestroyGroup( udg_SoulOmnistrikeG1 )
call DestroyGroup( udg_SoulOmnistrikeG2 )
endfunction
function Trig_Soul_Strike_Copy_Func006C takes nothing returns boolean
if ( not ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Strike_Copy_Actions takes nothing returns nothing
call SetUnitTimeScalePercent( GetTriggerUnit(), 200.00 )
call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 80.00, 80.00, 50.00 )
call AddSpecialEffectTargetUnitBJ( "weapon", GetTriggerUnit(), "Abilities\\DarkArrowMissile.mdx" )
set udg_SoulOmniStrikeSFX = GetLastCreatedEffectBJ()
call SetUnitInvulnerable( GetTriggerUnit(), true )
if ( Trig_Soul_Strike_Copy_Func006C() ) then
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call PolledWait( 0.35 )
set udg_SoulOmnistrikeG1 = GetUnitsInRangeOfLocMatching(700.00, GetUnitLoc(GetSpellAbilityUnit()), Condition(function Trig_Soul_Strike_Copy_Func006Func001Func002002003))
set udg_SoulOmnistrikeG2 = GetUnitsInRangeOfLocAll(700.00, GetUnitLoc(GetTriggerUnit()))
call ForGroupBJ( udg_SoulOmnistrikeG1, function Trig_Soul_Strike_Copy_Func006Func001Func004A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
else
endif
call SetUnitTimeScalePercent( GetTriggerUnit(), 100.00 )
call SetUnitVertexColorBJ( GetTriggerUnit(), 100, 100, 100, 0.00 )
call DestroyEffectBJ( udg_SoulOmniStrikeSFX )
call SetUnitInvulnerable( GetTriggerUnit(), false )
call SelectUnitAdd( GetTriggerUnit() )
call SelectUnitForPlayerSingle( GetTriggerUnit(), GetOwningPlayer(GetTriggerUnit()) )
endfunction
//===========================================================================
function InitTrig_Soul_Strike_Copy takes nothing returns nothing
set gg_trg_Soul_Strike_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Soul_Strike_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Soul_Strike_Copy, Condition( function Trig_Soul_Strike_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Soul_Strike_Copy, function Trig_Soul_Strike_Copy_Actions )
endfunction
function Trig_Bulls_Strike_1_Func001C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Q' ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_1_Actions takes nothing returns nothing
if ( Trig_Bulls_Strike_1_Func001C() ) then
set udg_KBA_Caster = GetTriggerUnit()
set udg_KBA_TargetUnit = GetSpellTargetUnit()
set udg_KBA_StartingPosition = GetUnitLoc(GetSpellAbilityUnit())
set udg_KBA_Level = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())
set udg_KBA_Speed = 9.00
set udg_KBA_DistancePerLevel = 50.00
set udg_KBA_SpecialEffects[1] = "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl"
set udg_KBA_SpecialEffects[2] = "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl"
set udg_KBA_DestroyTrees = true
set udg_KB_Damage = ( ( I2R(( GetHeroStatBJ(bj_HEROSTAT_STR, udg_KBA_Caster, false) * GetUnitAbilityLevelSwapped('A00Q', udg_KBA_Caster) )) + I2R(udg_Weapon_Damage) ) / 12.00 )
call ConditionalTriggerExecute( gg_trg_Bulls_Strike_2 )
call TriggerSleepAction( 0.05 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 15.00 )
call EnableTrigger( GetTriggeringTrigger() )
else
endif
endfunction
//===========================================================================
function InitTrig_Bulls_Strike_1 takes nothing returns nothing
set gg_trg_Bulls_Strike_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bulls_Strike_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Bulls_Strike_1, function Trig_Bulls_Strike_1_Actions )
endfunction
function Trig_Bulls_Strike_2_Func001Func003Func001C takes nothing returns boolean
if ( not ( udg_KB_Units[udg_KB_GeneralIntegers[1]] == udg_KBA_TargetUnit ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_2_Func001Func004C takes nothing returns boolean
if ( not ( udg_KB_TotalKnockUnits > udg_KB_GeneralIntegers[1] ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_2_Func001Func007C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_2_Func001C takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_KBA_TargetUnit, udg_KB_KnockbackedUnits) == true ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_2_Func002C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_2_Actions takes nothing returns nothing
if ( Trig_Bulls_Strike_2_Func001C() ) then
call GroupRemoveUnitSimple( udg_KBA_TargetUnit, udg_KB_KnockbackedUnits )
set udg_KB_CountBuffs = ( udg_KB_CountBuffs - 1 )
set udg_KB_GeneralIntegers[2] = 1
loop
exitwhen udg_KB_GeneralIntegers[2] > udg_KB_TotalKnockUnits
if ( Trig_Bulls_Strike_2_Func001Func003Func001C() ) then
set udg_KB_GeneralIntegers[1] = udg_KB_GeneralIntegers[2]
set udg_KB_GeneralIntegers[2] = udg_KB_TotalKnockUnits
else
endif
set udg_KB_GeneralIntegers[2] = udg_KB_GeneralIntegers[2] + 1
endloop
if ( Trig_Bulls_Strike_2_Func001Func004C() ) then
set udg_KB_Levels[udg_KB_GeneralIntegers[1]] = udg_KB_Levels[udg_KB_TotalKnockUnits]
set udg_KB_Units[udg_KB_GeneralIntegers[1]] = udg_KB_Units[udg_KB_TotalKnockUnits]
set udg_KB_Angle[udg_KB_GeneralIntegers[1]] = udg_KB_Angle[udg_KB_TotalKnockUnits]
set udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] = udg_KB_MaxDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = udg_KB_ReachedDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = udg_KB_ReduceSpeedReal[udg_KB_TotalKnockUnits]
set udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] = udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits]
set udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_1[udg_KB_TotalKnockUnits]
set udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_2[udg_KB_TotalKnockUnits]
set udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] = udg_KB_DestroyTrees[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter2[udg_KB_TotalKnockUnits]
set udg_KB_GeneralIntegers[1] = ( udg_KB_GeneralIntegers[1] - 1 )
else
endif
set udg_KB_Units[udg_KB_TotalKnockUnits] = null
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits - 1 )
if ( Trig_Bulls_Strike_2_Func001Func007C() ) then
set udg_KB_TotalKnockUnits = 0
call DisableTrigger( gg_trg_Bulls_Strike_3 )
else
endif
else
endif
if ( Trig_Bulls_Strike_2_Func002C() ) then
call EnableTrigger( gg_trg_Bulls_Strike_3 )
else
endif
set udg_KB_CountBuffs = ( udg_KB_CountBuffs + 1 )
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits + 1 )
set udg_KB_Casters[udg_KB_TotalKnockUnits] = udg_KBA_Caster
set udg_KB_Levels[udg_KB_TotalKnockUnits] = udg_KBA_Level
set udg_KB_Units[udg_KB_TotalKnockUnits] = udg_KBA_TargetUnit
set udg_KB_StartPositions[udg_KB_TotalKnockUnits] = udg_KBA_StartingPosition
set udg_KB_TempPoint[udg_KB_TotalKnockUnits] = GetUnitLoc(udg_KBA_TargetUnit)
set udg_KB_Angle[udg_KB_TotalKnockUnits] = AngleBetweenPoints(udg_KB_StartPositions[udg_KB_TotalKnockUnits], udg_KB_TempPoint[udg_KB_TotalKnockUnits])
set udg_KB_MaxDistance[udg_KB_TotalKnockUnits] = ( udg_KBA_DistancePerLevel * I2R(udg_KBA_Level) )
set udg_KB_ReachedDistance[udg_KB_TotalKnockUnits] = 0.00
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = 0.00
set udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits] = udg_KBA_Speed
set udg_KB_Effects_1[udg_KB_TotalKnockUnits] = udg_KBA_SpecialEffects[1]
set udg_KB_Effects_2[udg_KB_TotalKnockUnits] = udg_KBA_SpecialEffects[2]
set udg_KB_DestroyTrees[udg_KB_TotalKnockUnits] = udg_KBA_DestroyTrees
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = 0
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = 0
call GroupAddUnitSimple( udg_KBA_TargetUnit, udg_KB_KnockbackedUnits )
call RemoveLocation (udg_KBA_StartingPosition)
call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
endfunction
//===========================================================================
function InitTrig_Bulls_Strike_2 takes nothing returns nothing
set gg_trg_Bulls_Strike_2 = CreateTrigger( )
call TriggerAddAction( gg_trg_Bulls_Strike_2, function Trig_Bulls_Strike_2_Actions )
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func003C takes nothing returns boolean
if ( not ( udg_KB_TotalKnockUnits > udg_KB_GeneralIntegers[1] ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func006C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func014Func002A takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func014C takes nothing returns boolean
if ( not ( udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] == true ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func015C takes nothing returns boolean
if ( not ( udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] == 6 ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func016C takes nothing returns boolean
if ( not ( udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] == 8 ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func017Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_KBA_Caster)) == true ) ) then
return false
endif
if ( not ( GetEnumUnit() != udg_KBA_TargetUnit ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002Func017A takes nothing returns nothing
if ( Trig_Bulls_Strike_3_Func001Func001Func002Func017Func001C() ) then
call UnitDamageTargetBJ( udg_KBA_Caster, GetEnumUnit(), ( udg_KB_Damage / 2.00 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitPropWindowBJ( GetEnumUnit(), ( GetUnitFacing(GetEnumUnit()) + GetRandomReal(-2.00, 2.00) ) )
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
endfunction
function Trig_Bulls_Strike_3_Func001Func001Func002C takes nothing returns boolean
if ( not ( udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] >= udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_KnockbackedUnits) == true ) ) then
return false
endif
return true
endfunction
function Trig_Bulls_Strike_3_Actions takes nothing returns nothing
set udg_KB_GeneralIntegers[1] = 1
loop
exitwhen udg_KB_GeneralIntegers[1] > udg_KB_TotalKnockUnits
if ( Trig_Bulls_Strike_3_Func001Func001C() ) then
if ( Trig_Bulls_Strike_3_Func001Func001Func002C() ) then
call GroupRemoveUnitSimple( udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_KnockbackedUnits )
set udg_KB_CountBuffs = ( udg_KB_CountBuffs - 1 )
if ( Trig_Bulls_Strike_3_Func001Func001Func002Func003C() ) then
set udg_KB_Levels[udg_KB_GeneralIntegers[1]] = udg_KB_Levels[udg_KB_TotalKnockUnits]
set udg_KB_Units[udg_KB_GeneralIntegers[1]] = udg_KB_Units[udg_KB_TotalKnockUnits]
set udg_KB_Angle[udg_KB_GeneralIntegers[1]] = udg_KB_Angle[udg_KB_TotalKnockUnits]
set udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] = udg_KB_MaxDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = udg_KB_ReachedDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = udg_KB_ReduceSpeedReal[udg_KB_TotalKnockUnits]
set udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] = udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits]
set udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_1[udg_KB_TotalKnockUnits]
set udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_2[udg_KB_TotalKnockUnits]
set udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] = udg_KB_DestroyTrees[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter2[udg_KB_TotalKnockUnits]
set udg_KB_GeneralIntegers[1] = ( udg_KB_GeneralIntegers[1] - 1 )
else
endif
set udg_KB_Units[udg_KB_TotalKnockUnits] = null
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits - 1 )
if ( Trig_Bulls_Strike_3_Func001Func001Func002Func006C() ) then
set udg_KB_TotalKnockUnits = 0
call DisableTrigger( GetTriggeringTrigger() )
else
endif
else
set udg_KB_ReducedReal = ( ( udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] / udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] ) * udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] )
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = ( udg_KB_ReducedReal - ( udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] * 0.10 ) )
set udg_KB_TempReal = ( ( udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] - udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] ) * 2.00 )
set udg_KB_TempPoint[1] = GetUnitLoc(udg_KB_Units[udg_KB_GeneralIntegers[1]])
set udg_KB_TempPoint[2] = PolarProjectionBJ(udg_KB_TempPoint[1], udg_KB_TempReal, udg_KB_Angle[udg_KB_GeneralIntegers[1]])
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = ( udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] + 1 )
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = ( udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] + 1 )
if ( Trig_Bulls_Strike_3_Func001Func001Func002Func014C() ) then
call EnumDestructablesInCircleBJ( 200.00, udg_KB_TempPoint[2], function Trig_Bulls_Strike_3_Func001Func001Func002Func014Func002A )
else
endif
if ( Trig_Bulls_Strike_3_Func001Func001Func002Func015C() ) then
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = 0
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] )
call UnitDamageTargetBJ( udg_KBA_Caster, udg_KBA_TargetUnit, udg_KB_Damage, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
if ( Trig_Bulls_Strike_3_Func001Func001Func002Func016C() ) then
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = 0
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
call ForGroupBJ( GetUnitsInRangeOfLocAll(250.00, GetUnitLoc(udg_KBA_TargetUnit)), function Trig_Bulls_Strike_3_Func001Func001Func002Func017A )
call SetUnitPositionLoc( udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_TempPoint[2] )
call RemoveLocation (udg_KB_TempPoint[1])
call RemoveLocation (udg_KB_TempPoint[2])
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = ( udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] + udg_KB_TempReal )
endif
else
endif
set udg_KB_GeneralIntegers[1] = udg_KB_GeneralIntegers[1] + 1
endloop
endfunction
//===========================================================================
function InitTrig_Bulls_Strike_3 takes nothing returns nothing
set gg_trg_Bulls_Strike_3 = CreateTrigger( )
call DisableTrigger( gg_trg_Bulls_Strike_3 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Bulls_Strike_3, 0.02 )
call TriggerAddAction( gg_trg_Bulls_Strike_3, function Trig_Bulls_Strike_3_Actions )
endfunction
function Trig_Pick_Item_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00R' ) ) then
return false
endif
return true
endfunction
function Trig_Pick_Item_Actions takes nothing returns nothing
call UnitAddItemSwapped( GetSpellTargetItem(), GetSpellAbilityUnit() )
set udg_Chest = GetSpellAbilityUnit()
endfunction
//===========================================================================
function InitTrig_Pick_Item takes nothing returns nothing
set gg_trg_Pick_Item = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pick_Item, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Pick_Item, Condition( function Trig_Pick_Item_Conditions ) )
call TriggerAddAction( gg_trg_Pick_Item, function Trig_Pick_Item_Actions )
endfunction
function Trig_Give_Items_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00S' ) ) then
return false
endif
return true
endfunction
function Trig_Give_Items_1_Actions takes nothing returns nothing
call UnitAddItemSwapped( UnitItemInSlotBJ(udg_Chest, 1), udg_Hero )
endfunction
//===========================================================================
function InitTrig_Give_Items_1 takes nothing returns nothing
set gg_trg_Give_Items_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Give_Items_1, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Give_Items_1, Condition( function Trig_Give_Items_1_Conditions ) )
call TriggerAddAction( gg_trg_Give_Items_1, function Trig_Give_Items_1_Actions )
endfunction
function Trig_Give_Items_2_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Y' ) ) then
return false
endif
return true
endfunction
function Trig_Give_Items_2_Actions takes nothing returns nothing
call UnitAddItemSwapped( UnitItemInSlotBJ(udg_Chest, 2), udg_Hero )
endfunction
//===========================================================================
function InitTrig_Give_Items_2 takes nothing returns nothing
set gg_trg_Give_Items_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Give_Items_2, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Give_Items_2, Condition( function Trig_Give_Items_2_Conditions ) )
call TriggerAddAction( gg_trg_Give_Items_2, function Trig_Give_Items_2_Actions )
endfunction
function Trig_Give_Items_3_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00T' ) ) then
return false
endif
return true
endfunction
function Trig_Give_Items_3_Actions takes nothing returns nothing
call UnitAddItemSwapped( UnitItemInSlotBJ(udg_Chest, 3), udg_Hero )
endfunction
//===========================================================================
function InitTrig_Give_Items_3 takes nothing returns nothing
set gg_trg_Give_Items_3 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Give_Items_3, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Give_Items_3, Condition( function Trig_Give_Items_3_Conditions ) )
call TriggerAddAction( gg_trg_Give_Items_3, function Trig_Give_Items_3_Actions )
endfunction
function Trig_Give_Items_4_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00U' ) ) then
return false
endif
return true
endfunction
function Trig_Give_Items_4_Actions takes nothing returns nothing
call UnitAddItemSwapped( UnitItemInSlotBJ(udg_Chest, 4), udg_Hero )
endfunction
//===========================================================================
function InitTrig_Give_Items_4 takes nothing returns nothing
set gg_trg_Give_Items_4 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Give_Items_4, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Give_Items_4, Condition( function Trig_Give_Items_4_Conditions ) )
call TriggerAddAction( gg_trg_Give_Items_4, function Trig_Give_Items_4_Actions )
endfunction
function Trig_Give_Items_5_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00V' ) ) then
return false
endif
return true
endfunction
function Trig_Give_Items_5_Actions takes nothing returns nothing
call UnitAddItemSwapped( UnitItemInSlotBJ(udg_Chest, 5), udg_Hero )
endfunction
//===========================================================================
function InitTrig_Give_Items_5 takes nothing returns nothing
set gg_trg_Give_Items_5 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Give_Items_5, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Give_Items_5, Condition( function Trig_Give_Items_5_Conditions ) )
call TriggerAddAction( gg_trg_Give_Items_5, function Trig_Give_Items_5_Actions )
endfunction
function Trig_Heavy_Claw_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A020' ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_1_Actions takes nothing returns nothing
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetSpellTargetUnit(), ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, GetSpellAbilityUnit(), false)) * I2R(GetUnitAbilityLevelSwapped('A020', GetSpellAbilityUnit())) ) + 40.00 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
set udg_HC_Caster = GetSpellAbilityUnit()
endfunction
//===========================================================================
function InitTrig_Heavy_Claw_1 takes nothing returns nothing
set gg_trg_Heavy_Claw_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heavy_Claw_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Heavy_Claw_1, Condition( function Trig_Heavy_Claw_1_Conditions ) )
call TriggerAddAction( gg_trg_Heavy_Claw_1, function Trig_Heavy_Claw_1_Actions )
endfunction
function Trig_Heavy_Claw_2_Func001C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A020' ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_2_Actions takes nothing returns nothing
if ( Trig_Heavy_Claw_2_Func001C() ) then
set udg_KBA_Caster = GetTriggerUnit()
set udg_KBA_TargetUnit = GetSpellTargetUnit()
set udg_KBA_StartingPosition = GetUnitLoc(GetSpellAbilityUnit())
set udg_KBA_Level = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())
set udg_KBA_Speed = 9.00
set udg_KBA_DistancePerLevel = 37.50
set udg_KBA_SpecialEffects[1] = "Objects\\Spawnmodels\\Undead\\UndeadLargeDeathExplode\\UndeadLargeDeathExplode.mdl"
set udg_KBA_SpecialEffects[2] = "Objects\\Spawnmodels\\Undead\\UndeadLargeDeathExplode\\UndeadLargeDeathExplode.mdl"
set udg_KBA_DestroyTrees = true
set udg_KB_Damage = ( ( I2R(GetUnitAbilityLevelSwapped('A020', udg_HC_Caster)) * I2R(GetHeroStatBJ(bj_HEROSTAT_STR, udg_HC_Caster, false)) ) / 3.00 )
call ConditionalTriggerExecute( gg_trg_Bulls_Strike_2 )
call TriggerSleepAction( 0.05 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 15.00 )
call EnableTrigger( GetTriggeringTrigger() )
else
endif
endfunction
//===========================================================================
function InitTrig_Heavy_Claw_2 takes nothing returns nothing
set gg_trg_Heavy_Claw_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heavy_Claw_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Heavy_Claw_2, function Trig_Heavy_Claw_2_Actions )
endfunction
function Trig_Heavy_Claw_3_Func001Func003Func001C takes nothing returns boolean
if ( not ( udg_KB_Units[udg_KB_GeneralIntegers[1]] == udg_KBA_TargetUnit ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_3_Func001Func004C takes nothing returns boolean
if ( not ( udg_KB_TotalKnockUnits > udg_KB_GeneralIntegers[1] ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_3_Func001Func007C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_3_Func001C takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_KBA_TargetUnit, udg_KB_KnockbackedUnits) == true ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_3_Func002C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_3_Actions takes nothing returns nothing
if ( Trig_Heavy_Claw_3_Func001C() ) then
call GroupRemoveUnitSimple( udg_KBA_TargetUnit, udg_KB_KnockbackedUnits )
set udg_KB_CountBuffs = ( udg_KB_CountBuffs - 1 )
set udg_KB_GeneralIntegers[2] = 1
loop
exitwhen udg_KB_GeneralIntegers[2] > udg_KB_TotalKnockUnits
if ( Trig_Heavy_Claw_3_Func001Func003Func001C() ) then
set udg_KB_GeneralIntegers[1] = udg_KB_GeneralIntegers[2]
set udg_KB_GeneralIntegers[2] = udg_KB_TotalKnockUnits
else
endif
set udg_KB_GeneralIntegers[2] = udg_KB_GeneralIntegers[2] + 1
endloop
if ( Trig_Heavy_Claw_3_Func001Func004C() ) then
set udg_KB_Levels[udg_KB_GeneralIntegers[1]] = udg_KB_Levels[udg_KB_TotalKnockUnits]
set udg_KB_Units[udg_KB_GeneralIntegers[1]] = udg_KB_Units[udg_KB_TotalKnockUnits]
set udg_KB_Angle[udg_KB_GeneralIntegers[1]] = udg_KB_Angle[udg_KB_TotalKnockUnits]
set udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] = udg_KB_MaxDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = udg_KB_ReachedDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = udg_KB_ReduceSpeedReal[udg_KB_TotalKnockUnits]
set udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] = udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits]
set udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_1[udg_KB_TotalKnockUnits]
set udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_2[udg_KB_TotalKnockUnits]
set udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] = udg_KB_DestroyTrees[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter2[udg_KB_TotalKnockUnits]
set udg_KB_GeneralIntegers[1] = ( udg_KB_GeneralIntegers[1] - 1 )
else
endif
set udg_KB_Units[udg_KB_TotalKnockUnits] = null
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits - 1 )
if ( Trig_Heavy_Claw_3_Func001Func007C() ) then
set udg_KB_TotalKnockUnits = 0
call DisableTrigger( gg_trg_Heavy_Claw_3 )
else
endif
else
endif
if ( Trig_Heavy_Claw_3_Func002C() ) then
call EnableTrigger( gg_trg_Bulls_Strike_3 )
else
endif
set udg_KB_CountBuffs = ( udg_KB_CountBuffs + 1 )
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits + 1 )
set udg_KB_Casters[udg_KB_TotalKnockUnits] = udg_KBA_Caster
set udg_KB_Levels[udg_KB_TotalKnockUnits] = udg_KBA_Level
set udg_KB_Units[udg_KB_TotalKnockUnits] = udg_KBA_TargetUnit
set udg_KB_StartPositions[udg_KB_TotalKnockUnits] = udg_KBA_StartingPosition
set udg_KB_TempPoint[udg_KB_TotalKnockUnits] = GetUnitLoc(udg_KBA_TargetUnit)
set udg_KB_Angle[udg_KB_TotalKnockUnits] = AngleBetweenPoints(udg_KB_StartPositions[udg_KB_TotalKnockUnits], udg_KB_TempPoint[udg_KB_TotalKnockUnits])
set udg_KB_MaxDistance[udg_KB_TotalKnockUnits] = ( udg_KBA_DistancePerLevel * I2R(udg_KBA_Level) )
set udg_KB_ReachedDistance[udg_KB_TotalKnockUnits] = 0.00
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = 0.00
set udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits] = udg_KBA_Speed
set udg_KB_Effects_1[udg_KB_TotalKnockUnits] = udg_KBA_SpecialEffects[1]
set udg_KB_Effects_2[udg_KB_TotalKnockUnits] = udg_KBA_SpecialEffects[2]
set udg_KB_DestroyTrees[udg_KB_TotalKnockUnits] = udg_KBA_DestroyTrees
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = 0
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = 0
call GroupAddUnitSimple( udg_KBA_TargetUnit, udg_KB_KnockbackedUnits )
call RemoveLocation (udg_KBA_StartingPosition)
call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
endfunction
//===========================================================================
function InitTrig_Heavy_Claw_3 takes nothing returns nothing
set gg_trg_Heavy_Claw_3 = CreateTrigger( )
call TriggerAddAction( gg_trg_Heavy_Claw_3, function Trig_Heavy_Claw_3_Actions )
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func003C takes nothing returns boolean
if ( not ( udg_KB_TotalKnockUnits > udg_KB_GeneralIntegers[1] ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func006C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func014Func002A takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func014C takes nothing returns boolean
if ( not ( udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] == true ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func015C takes nothing returns boolean
if ( not ( udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] == 6 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func016C takes nothing returns boolean
if ( not ( udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] == 8 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func017Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_KBA_Caster)) == true ) ) then
return false
endif
if ( not ( GetEnumUnit() != udg_KBA_TargetUnit ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002Func017A takes nothing returns nothing
if ( Trig_Heavy_Claw_4_Func001Func001Func002Func017Func001C() ) then
call UnitDamageTargetBJ( udg_KBA_Caster, GetEnumUnit(), ( udg_KB_Damage / 2.00 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitPropWindowBJ( GetEnumUnit(), ( GetUnitFacing(GetEnumUnit()) + GetRandomReal(-2.00, 2.00) ) )
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
endfunction
function Trig_Heavy_Claw_4_Func001Func001Func002C takes nothing returns boolean
if ( not ( udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] >= udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_KnockbackedUnits) == true ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Claw_4_Actions takes nothing returns nothing
set udg_KB_GeneralIntegers[1] = 1
loop
exitwhen udg_KB_GeneralIntegers[1] > udg_KB_TotalKnockUnits
if ( Trig_Heavy_Claw_4_Func001Func001C() ) then
if ( Trig_Heavy_Claw_4_Func001Func001Func002C() ) then
call GroupRemoveUnitSimple( udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_KnockbackedUnits )
set udg_KB_CountBuffs = ( udg_KB_CountBuffs - 1 )
if ( Trig_Heavy_Claw_4_Func001Func001Func002Func003C() ) then
set udg_KB_Levels[udg_KB_GeneralIntegers[1]] = udg_KB_Levels[udg_KB_TotalKnockUnits]
set udg_KB_Units[udg_KB_GeneralIntegers[1]] = udg_KB_Units[udg_KB_TotalKnockUnits]
set udg_KB_Angle[udg_KB_GeneralIntegers[1]] = udg_KB_Angle[udg_KB_TotalKnockUnits]
set udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] = udg_KB_MaxDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = udg_KB_ReachedDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = udg_KB_ReduceSpeedReal[udg_KB_TotalKnockUnits]
set udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] = udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits]
set udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_1[udg_KB_TotalKnockUnits]
set udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_2[udg_KB_TotalKnockUnits]
set udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] = udg_KB_DestroyTrees[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter2[udg_KB_TotalKnockUnits]
set udg_KB_GeneralIntegers[1] = ( udg_KB_GeneralIntegers[1] - 1 )
else
endif
set udg_KB_Units[udg_KB_TotalKnockUnits] = null
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits - 1 )
if ( Trig_Heavy_Claw_4_Func001Func001Func002Func006C() ) then
set udg_KB_TotalKnockUnits = 0
call DisableTrigger( GetTriggeringTrigger() )
else
endif
else
set udg_KB_ReducedReal = ( ( udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] / udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] ) * udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] )
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = ( udg_KB_ReducedReal - ( udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] * 0.10 ) )
set udg_KB_TempReal = ( ( udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] - udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] ) * 2.00 )
set udg_KB_TempPoint[1] = GetUnitLoc(udg_KB_Units[udg_KB_GeneralIntegers[1]])
set udg_KB_TempPoint[2] = PolarProjectionBJ(udg_KB_TempPoint[1], udg_KB_TempReal, udg_KB_Angle[udg_KB_GeneralIntegers[1]])
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = ( udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] + 1 )
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = ( udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] + 1 )
if ( Trig_Heavy_Claw_4_Func001Func001Func002Func014C() ) then
call EnumDestructablesInCircleBJ( 200.00, udg_KB_TempPoint[2], function Trig_Heavy_Claw_4_Func001Func001Func002Func014Func002A )
else
endif
if ( Trig_Heavy_Claw_4_Func001Func001Func002Func015C() ) then
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = 0
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] )
call UnitDamageTargetBJ( udg_KBA_Caster, udg_KBA_TargetUnit, udg_KB_Damage, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
if ( Trig_Heavy_Claw_4_Func001Func001Func002Func016C() ) then
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = 0
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
call ForGroupBJ( GetUnitsInRangeOfLocAll(250.00, GetUnitLoc(udg_KBA_TargetUnit)), function Trig_Heavy_Claw_4_Func001Func001Func002Func017A )
call SetUnitPositionLoc( udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_TempPoint[2] )
call RemoveLocation (udg_KB_TempPoint[1])
call RemoveLocation (udg_KB_TempPoint[2])
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = ( udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] + udg_KB_TempReal )
endif
else
endif
set udg_KB_GeneralIntegers[1] = udg_KB_GeneralIntegers[1] + 1
endloop
endfunction
//===========================================================================
function InitTrig_Heavy_Claw_4 takes nothing returns nothing
set gg_trg_Heavy_Claw_4 = CreateTrigger( )
call DisableTrigger( gg_trg_Heavy_Claw_4 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Heavy_Claw_4, 0.02 )
call TriggerAddAction( gg_trg_Heavy_Claw_4, function Trig_Heavy_Claw_4_Actions )
endfunction
function Trig_Circle_of_Death_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AHtc' ) ) then
return false
endif
return true
endfunction
function Trig_Circle_of_Death_1_Func026A takes nothing returns nothing
call SetUnitAbilityLevelSwapped( 'A012', GetEnumUnit(), ( GetHeroLevel(GetSpellAbilityUnit()) / 10 ) )
endfunction
function Trig_Circle_of_Death_1_Func032A takes nothing returns nothing
call ExplodeUnitBJ( GetEnumUnit() )
endfunction
function Trig_Circle_of_Death_1_Actions takes nothing returns nothing
set udg_COD_X = 9.15
set udg_COD_Y = 1.50
set udg_COD_Unit_Caster = GetSpellAbilityUnit()
set udg_COD_Point_Main = GetUnitLoc(GetSpellAbilityUnit())
set udg_COD_Point_1 = PolarProjectionBJ(udg_COD_Point_Main, 0.00, GetUnitFacing(GetSpellAbilityUnit()))
set udg_COD_Point_2 = Location(0.00, 180.00)
set udg_COD_Point_3 = Location(180.00, 360.00)
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
set udg_COD_Special_Unit = GetLastCreatedUnit()
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call EnableTrigger( gg_trg_Circle_of_Death_2 )
call ForGroupBJ( udg_COD_UnitGroup, function Trig_Circle_of_Death_1_Func026A )
call TriggerSleepAction( 8.00 )
set udg_COD_X = -9.00
set udg_COD_Y = -1.50
call TriggerSleepAction( 8.00 )
call DisableTrigger( gg_trg_Circle_of_Death_2 )
call ForGroupBJ( udg_COD_UnitGroup, function Trig_Circle_of_Death_1_Func032A )
endfunction
//===========================================================================
function InitTrig_Circle_of_Death_1 takes nothing returns nothing
set gg_trg_Circle_of_Death_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Circle_of_Death_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Circle_of_Death_1, Condition( function Trig_Circle_of_Death_1_Conditions ) )
call TriggerAddAction( gg_trg_Circle_of_Death_1, function Trig_Circle_of_Death_1_Actions )
endfunction
function Trig_Circle_of_Death_2_Func001Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_COD_Unit_Caster)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Circle_of_Death_2_Func001A takes nothing returns nothing
if ( Trig_Circle_of_Death_2_Func001Func001C() ) then
call UnitDamageTargetBJ( udg_COD_Special_Unit, GetEnumUnit(), ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_COD_Unit_Caster, false)) / 5.00 ) + ( I2R(GetHeroLevel(udg_COD_Unit_Caster)) * GetRandomReal(0.80, 0.90) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
endfunction
function Trig_Circle_of_Death_2_Func007A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), udg_COD_Point_Furthering )
endfunction
function Trig_Circle_of_Death_2_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocAll(512, GetUnitLoc(udg_COD_Special_Unit)), function Trig_Circle_of_Death_2_Func001A )
call AddSpecialEffectLocBJ( GetUnitLoc(udg_COD_Special_Unit), "Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl" )
set udg_COD_Point_1 = PolarProjectionBJ(udg_COD_Point_Main, 0.00, GetUnitFacing(udg_COD_Unit_Caster))
set udg_COD_Real_Point_1 = ( udg_COD_Real_Point_1 + udg_COD_Y )
set udg_COD_Real_Point_2 = ( udg_COD_Real_Point_2 + udg_COD_X )
set udg_COD_Point_Furthering = PolarProjectionBJ(PolarProjectionBJ(udg_COD_Point_1, 155.00, udg_COD_Real_Point_2), udg_COD_Real_Point_1, udg_COD_Real_Point_2)
call ForGroupBJ( udg_COD_UnitGroup, function Trig_Circle_of_Death_2_Func007A )
call TriggerSleepAction( 1.35 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction
//===========================================================================
function InitTrig_Circle_of_Death_2 takes nothing returns nothing
set gg_trg_Circle_of_Death_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Circle_of_Death_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Circle_of_Death_2, 0.03 )
call TriggerAddAction( gg_trg_Circle_of_Death_2, function Trig_Circle_of_Death_2_Actions )
endfunction
function Trig_Circle_of_Life_1_Func026A takes nothing returns nothing
call SetUnitAbilityLevelSwapped( 'A012', GetEnumUnit(), ( GetHeroLevel(GetSpellAbilityUnit()) / 10 ) )
endfunction
function Trig_Circle_of_Life_1_Func032A takes nothing returns nothing
call ExplodeUnitBJ( GetEnumUnit() )
endfunction
function Trig_Circle_of_Life_1_Actions takes nothing returns nothing
set udg_COD_X = 7.25
set udg_COD_Y = 0.95
set udg_COD_Unit_Caster = GetSpellAbilityUnit()
set udg_COD_Point_Main = GetUnitLoc(GetSpellAbilityUnit())
set udg_COD_Point_1 = PolarProjectionBJ(udg_COD_Point_Main, 0.00, GetUnitFacing(GetSpellAbilityUnit()))
set udg_COD_Point_2 = Location(0.00, 180.00)
set udg_COD_Point_3 = Location(180.00, 360.00)
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call CreateNUnitsAtLoc( 1, 'h00C', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1, GetRandomReal(50.00, 150.00), GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
set udg_COD_Special_Unit = GetLastCreatedUnit()
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup )
call EnableTrigger( gg_trg_Circle_of_Death_2 )
call ForGroupBJ( udg_COD_UnitGroup, function Trig_Circle_of_Life_1_Func026A )
call TriggerSleepAction( 8.00 )
set udg_COD_X = -7.25
set udg_COD_Y = -0.95
call TriggerSleepAction( 8.00 )
call DisableTrigger( gg_trg_Circle_of_Death_2 )
call ForGroupBJ( udg_COD_UnitGroup, function Trig_Circle_of_Life_1_Func032A )
endfunction
//===========================================================================
function InitTrig_Circle_of_Life_1 takes nothing returns nothing
set gg_trg_Circle_of_Life_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Circle_of_Life_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Circle_of_Life_1, function Trig_Circle_of_Life_1_Actions )
endfunction
function Trig_Circle_of_Life_2_Func001Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_COD_Unit_Caster)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Circle_of_Life_2_Func001A takes nothing returns nothing
if ( Trig_Circle_of_Life_2_Func001Func001C() ) then
call UnitDamageTargetBJ( udg_COD_Special_Unit, GetEnumUnit(), 500.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
endfunction
function Trig_Circle_of_Life_2_Func007A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), udg_COD_Point_Furthering )
endfunction
function Trig_Circle_of_Life_2_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocAll(512, GetUnitLoc(udg_COD_Special_Unit)), function Trig_Circle_of_Life_2_Func001A )
call AddSpecialEffectLocBJ( GetUnitLoc(udg_COD_Special_Unit), "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl" )
set udg_COD_Point_1 = PolarProjectionBJ(udg_COD_Point_Main, 0.00, GetUnitFacing(udg_COD_Unit_Caster))
set udg_COD_Real_Point_1 = ( udg_COD_Real_Point_1 + udg_COD_Y )
set udg_COD_Real_Point_2 = ( udg_COD_Real_Point_2 + udg_COD_X )
set udg_COD_Point_Furthering = PolarProjectionBJ(PolarProjectionBJ(udg_COD_Point_1, 155.00, udg_COD_Real_Point_2), udg_COD_Real_Point_1, udg_COD_Real_Point_2)
call ForGroupBJ( udg_COD_UnitGroup, function Trig_Circle_of_Life_2_Func007A )
call TriggerSleepAction( 1.35 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction
//===========================================================================
function InitTrig_Circle_of_Life_2 takes nothing returns nothing
set gg_trg_Circle_of_Life_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Circle_of_Life_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Circle_of_Life_2, 0.03 )
call TriggerAddAction( gg_trg_Circle_of_Life_2, function Trig_Circle_of_Life_2_Actions )
endfunction
function Trig_Fire_and_Ice_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01Q' ) ) then
return false
endif
return true
endfunction
function Trig_Fire_and_Ice_1_Func029A takes nothing returns nothing
call ExplodeUnitBJ( GetEnumUnit() )
endfunction
function Trig_Fire_and_Ice_1_Func030A takes nothing returns nothing
call ExplodeUnitBJ( GetEnumUnit() )
endfunction
function Trig_Fire_and_Ice_1_Actions takes nothing returns nothing
set udg_COD_XQ = -10.00
set udg_COD_YQ = -1.85
set udg_COD_Unit_CasterQ = GetSpellAbilityUnit()
set udg_COD_Point_MainQ = GetUnitLoc(GetSpellAbilityUnit())
set udg_COD_Point_1Q = PolarProjectionBJ(udg_COD_Point_MainQ, 0.00, GetUnitFacing(GetSpellAbilityUnit()))
set udg_COD_Point_2Q = Location(0.00, 180.00)
set udg_COD_Point_3Q = Location(180.00, 360.00)
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q1 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q1 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q1 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
set udg_COD_Special_UnitQ2 = GetLastCreatedUnit()
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q1 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q2 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q2 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q2 )
call CreateNUnitsAtLoc( 1, 'h00D', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(udg_COD_Point_1Q, 1250.00, GetRandomReal(0, 90.00)), GetRandomReal(0, 90.00) )
set udg_COD_Special_UnitQ = GetLastCreatedUnit()
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_COD_UnitGroup_Q2 )
call EnableTrigger( gg_trg_Fire_and_Ice_2 )
call TriggerSleepAction( 9.00 )
call DisableTrigger( gg_trg_Fire_and_Ice_2 )
call ForGroupBJ( udg_COD_UnitGroup_Q1, function Trig_Fire_and_Ice_1_Func029A )
call ForGroupBJ( udg_COD_UnitGroup_Q2, function Trig_Fire_and_Ice_1_Func030A )
set udg_COD_Point_1Q = PolarProjectionBJ(udg_COD_Point_MainQ, 0.00, GetUnitFacing(GetSpellAbilityUnit()))
set udg_COD_Point_FurtheringQ = PolarProjectionBJ(PolarProjectionBJ(udg_COD_Point_1Q, 625.00, udg_COD_Real_Point_2Q), udg_COD_Real_Point_1Q, udg_COD_Real_Point_2Q)
set udg_COD_Point_FurtheringQ2 = PolarProjectionBJ(PolarProjectionBJ(udg_COD_Point_1Q, 625.00, ( udg_COD_Real_Point_2Q * 1.00 )), ( udg_COD_Real_Point_1Q * -1.00 ), ( udg_COD_Real_Point_2Q * -1.00 ))
set udg_COD_Real_Point_1Q = 0.00
set udg_COD_Real_Point_2Q = 0.00
call RemoveLocation (udg_COD_Point_1Q)
endfunction
//===========================================================================
function InitTrig_Fire_and_Ice_1 takes nothing returns nothing
set gg_trg_Fire_and_Ice_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_and_Ice_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fire_and_Ice_1, Condition( function Trig_Fire_and_Ice_1_Conditions ) )
call TriggerAddAction( gg_trg_Fire_and_Ice_1, function Trig_Fire_and_Ice_1_Actions )
endfunction
function Trig_Fire_and_Ice_2_Func001Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_COD_Unit_CasterQ)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Fire_and_Ice_2_Func001A takes nothing returns nothing
if ( Trig_Fire_and_Ice_2_Func001Func001C() ) then
call UnitDamageTargetBJ( udg_COD_Special_UnitQ, GetEnumUnit(), ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_COD_Unit_CasterQ, false)) / 6.00 ) + ( I2R(GetHeroLevel(udg_COD_Unit_CasterQ)) * GetRandomReal(0.70, 0.85) ) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_COLD )
else
endif
endfunction
function Trig_Fire_and_Ice_2_Func002Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(udg_COD_Unit_CasterQ)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Fire_and_Ice_2_Func002A takes nothing returns nothing
if ( Trig_Fire_and_Ice_2_Func002Func001C() ) then
call UnitDamageTargetBJ( udg_COD_Special_UnitQ, GetEnumUnit(), ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_COD_Unit_CasterQ, false)) / 6.00 ) + ( I2R(GetHeroLevel(udg_COD_Unit_CasterQ)) * GetRandomReal(0.70, 0.85) ) ), ATTACK_TYPE_HERO, DAMAGE_TYPE_FIRE )
else
endif
endfunction
function Trig_Fire_and_Ice_2_Func010A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), udg_COD_Point_FurtheringQ )
endfunction
function Trig_Fire_and_Ice_2_Func011A takes nothing returns nothing
call SetUnitPositionLoc( GetEnumUnit(), udg_COD_Point_FurtheringQ2 )
endfunction
function Trig_Fire_and_Ice_2_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocAll(275.00, GetUnitLoc(udg_COD_Special_UnitQ)), function Trig_Fire_and_Ice_2_Func001A )
call ForGroupBJ( GetUnitsInRangeOfLocAll(275.00, GetUnitLoc(udg_COD_Special_UnitQ2)), function Trig_Fire_and_Ice_2_Func002A )
call AddSpecialEffectLocBJ( GetUnitLoc(udg_COD_Special_UnitQ), "Objects\\Spawnmodels\\NightElf\\NEDeathSmall\\NEDeathSmall.mdl" )
call AddSpecialEffectLocBJ( GetUnitLoc(udg_COD_Special_UnitQ2), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set udg_COD_Point_1Q = PolarProjectionBJ(udg_COD_Point_MainQ, 0.00, GetUnitFacing(udg_COD_Unit_CasterQ))
set udg_COD_Real_Point_1Q = ( udg_COD_Real_Point_1Q + udg_COD_YQ )
set udg_COD_Real_Point_2Q = ( udg_COD_Real_Point_2Q + udg_COD_XQ )
set udg_COD_Point_FurtheringQ = PolarProjectionBJ(PolarProjectionBJ(udg_COD_Point_1Q, 675.00, udg_COD_Real_Point_2Q), udg_COD_Real_Point_1Q, udg_COD_Real_Point_2Q)
set udg_COD_Point_FurtheringQ2 = PolarProjectionBJ(PolarProjectionBJ(udg_COD_Point_1Q, 675.00, ( udg_COD_Real_Point_2Q * 1.00 )), ( udg_COD_Real_Point_1Q * -1.00 ), ( udg_COD_Real_Point_2Q * -1.00 ))
call ForGroupBJ( udg_COD_UnitGroup_Q1, function Trig_Fire_and_Ice_2_Func010A )
call ForGroupBJ( udg_COD_UnitGroup_Q2, function Trig_Fire_and_Ice_2_Func011A )
call TriggerSleepAction( 1.35 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction
//===========================================================================
function InitTrig_Fire_and_Ice_2 takes nothing returns nothing
set gg_trg_Fire_and_Ice_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Fire_and_Ice_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Fire_and_Ice_2, 0.03 )
call TriggerAddAction( gg_trg_Fire_and_Ice_2, function Trig_Fire_and_Ice_2_Actions )
endfunction
function Trig_MS_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), ( "Your speed is " + R2S(GetUnitMoveSpeed(udg_Hero)) ) )
endfunction
//===========================================================================
function InitTrig_MS takes nothing returns nothing
set gg_trg_MS = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_MS, Player(0), "-ms", true )
call TriggerAddAction( gg_trg_MS, function Trig_MS_Actions )
endfunction
//===========================================================================
//Lord Mahdi
function Trig_Power_within_Func001001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Power_within_Func001002 takes nothing returns nothing
call DisplayTextToForce( GetForceOfPlayer(GetTriggerPlayer()), ( ( GetHeroProperName(GetEnumUnit()) + " within power is " ) + R2S(( ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, GetEnumUnit(), false)) + I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetEnumUnit(), false)) ) + I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetEnumUnit(), false)) ) / 3.00 )) ) )
endfunction
function Trig_Power_within_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfPlayerMatching(GetTriggerPlayer(), Condition(function Trig_Power_within_Func001001002)), function Trig_Power_within_Func001002 )
endfunction
//===========================================================================
function InitTrig_Power_within takes nothing returns nothing
set gg_trg_Power_within = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(0), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(1), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(2), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(3), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(4), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(5), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(6), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(7), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(8), "-power", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Power_within, Player(9), "-power", true )
call TriggerAddAction( gg_trg_Power_within, function Trig_Power_within_Actions )
endfunction
function Trig_Item_Limit_helm_Func005C takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I009' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00K' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_helm_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() != gg_unit_hwtw_0028 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_helm_Func001Func001Func001C takes nothing returns boolean
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I009' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00K' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_helm_Func001Func001C takes nothing returns boolean
if ( not Trig_Item_Limit_helm_Func001Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_helm_Func002C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Helm > 1 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_helm_Func003C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Helm > 2 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_helm_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Item_Limit_helm_Func001Func001C() ) then
set udg_AlreadyCarryingEquip_Helm = ( udg_AlreadyCarryingEquip_Helm + 1 )
set udg_HELMITEM = GetManipulatingUnit()
else
set udg_HELMITEM = GetManipulatingUnit()
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( Trig_Item_Limit_helm_Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_133" )
else
endif
if ( Trig_Item_Limit_helm_Func003C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_134" )
else
endif
set udg_AlreadyCarryingEquip_Helm = 0
endfunction
//===========================================================================
function InitTrig_Item_Limit_helm takes nothing returns nothing
set gg_trg_Item_Limit_helm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Item_Limit_helm, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Item_Limit_helm, Condition( function Trig_Item_Limit_helm_Conditions ) )
call TriggerAddAction( gg_trg_Item_Limit_helm, function Trig_Item_Limit_helm_Actions )
endfunction
function Trig_Item_Limit_Weapon_Func006C takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I000' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I007' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I006' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I001' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I004' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I005' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00G' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00D' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00B' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00E' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00F' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00C' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00N' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_Weapon_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() != gg_unit_hwtw_0028 ) ) then
return false
endif
if ( not Trig_Item_Limit_Weapon_Func006C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Weapon_Func002Func001Func001C takes nothing returns boolean
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I000' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I007' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I006' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I001' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I004' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I005' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00G' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00D' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00B' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00E' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00F' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00C' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00N' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_Weapon_Func002Func001C takes nothing returns boolean
if ( not Trig_Item_Limit_Weapon_Func002Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Weapon_Func003C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Weapon > 1 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Weapon_Func004C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Weapon > 2 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Weapon_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Item_Limit_Weapon_Func002Func001C() ) then
set udg_AlreadyCarryingEquip_Weapon = ( udg_AlreadyCarryingEquip_Weapon + 1 )
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( Trig_Item_Limit_Weapon_Func003C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_586" )
else
endif
if ( Trig_Item_Limit_Weapon_Func004C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_587" )
else
endif
set udg_AlreadyCarryingEquip_Weapon = 0
endfunction
//===========================================================================
function InitTrig_Item_Limit_Weapon takes nothing returns nothing
set gg_trg_Item_Limit_Weapon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Item_Limit_Weapon, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Item_Limit_Weapon, Condition( function Trig_Item_Limit_Weapon_Conditions ) )
call TriggerAddAction( gg_trg_Item_Limit_Weapon, function Trig_Item_Limit_Weapon_Actions )
endfunction
function Trig_Item_Limit_Armor_Func006C takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I002' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00J' ) ) then
return true
endif
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I00I' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_Armor_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() != gg_unit_hwtw_0028 ) ) then
return false
endif
if ( not Trig_Item_Limit_Armor_Func006C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Armor_Func002Func001Func001C takes nothing returns boolean
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I002' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00J' ) ) then
return true
endif
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I00I' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_Armor_Func002Func001C takes nothing returns boolean
if ( not Trig_Item_Limit_Armor_Func002Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Armor_Func003C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Armor > 1 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Armor_Func004C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Armor > 2 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Armor_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Item_Limit_Armor_Func002Func001C() ) then
set udg_AlreadyCarryingEquip_Armor = ( udg_AlreadyCarryingEquip_Armor + 1 )
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( Trig_Item_Limit_Armor_Func003C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_137" )
else
endif
if ( Trig_Item_Limit_Armor_Func004C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_138" )
else
endif
set udg_AlreadyCarryingEquip_Armor = 0
endfunction
//===========================================================================
function InitTrig_Item_Limit_Armor takes nothing returns nothing
set gg_trg_Item_Limit_Armor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Item_Limit_Armor, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Item_Limit_Armor, Condition( function Trig_Item_Limit_Armor_Conditions ) )
call TriggerAddAction( gg_trg_Item_Limit_Armor, function Trig_Item_Limit_Armor_Actions )
endfunction
function Trig_Item_Limit_Shield_Func005C takes nothing returns boolean
if ( ( GetItemTypeId(GetManipulatedItem()) == 'I001' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_Shield_Conditions takes nothing returns boolean
if ( not Trig_Item_Limit_Shield_Func005C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Shield_Func001Func001Func001C takes nothing returns boolean
if ( ( GetItemTypeId(UnitItemInSlotBJ(GetManipulatingUnit(), GetForLoopIndexA())) == 'I001' ) ) then
return true
endif
return false
endfunction
function Trig_Item_Limit_Shield_Func001Func001C takes nothing returns boolean
if ( not Trig_Item_Limit_Shield_Func001Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Shield_Func002C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Shield > 1 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Shield_Func003C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Shield > 2 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Shield_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Item_Limit_Shield_Func001Func001C() ) then
set udg_AlreadyCarryingEquip_Shield = ( udg_AlreadyCarryingEquip_Shield + 1 )
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( Trig_Item_Limit_Shield_Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_139" )
else
endif
if ( Trig_Item_Limit_Shield_Func003C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_140" )
else
endif
set udg_AlreadyCarryingEquip_Shield = 0
endfunction
//===========================================================================
function InitTrig_Item_Limit_Shield takes nothing returns nothing
set gg_trg_Item_Limit_Shield = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Item_Limit_Shield, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Item_Limit_Shield, Condition( function Trig_Item_Limit_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Item_Limit_Shield, function Trig_Item_Limit_Shield_Actions )
endfunction
function Trig_Item_Limit_Ring_Func005C takes nothing returns boolean
return false
endfunction
function Trig_Item_Limit_Ring_Conditions takes nothing returns boolean
if ( not Trig_Item_Limit_Ring_Func005C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Ring_Func001Func001Func001C takes nothing returns boolean
return false
endfunction
function Trig_Item_Limit_Ring_Func001Func001C takes nothing returns boolean
if ( not Trig_Item_Limit_Ring_Func001Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Ring_Func002C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Ring > 2 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Ring_Func003C takes nothing returns boolean
if ( not ( udg_AlreadyCarryingEquip_Ring > 3 ) ) then
return false
endif
return true
endfunction
function Trig_Item_Limit_Ring_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Item_Limit_Ring_Func001Func001C() ) then
set udg_AlreadyCarryingEquip_Ring = ( udg_AlreadyCarryingEquip_Ring + 1 )
else
call DoNothing( )
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
if ( Trig_Item_Limit_Ring_Func002C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_141" )
else
endif
if ( Trig_Item_Limit_Ring_Func003C() ) then
call UnitRemoveItemSwapped( GetManipulatedItem(), GetManipulatingUnit() )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetManipulatingUnit())), "TRIGSTR_142" )
else
endif
set udg_AlreadyCarryingEquip_Ring = 0
endfunction
//===========================================================================
function InitTrig_Item_Limit_Ring takes nothing returns nothing
set gg_trg_Item_Limit_Ring = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Item_Limit_Ring, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Item_Limit_Ring, Condition( function Trig_Item_Limit_Ring_Conditions ) )
call TriggerAddAction( gg_trg_Item_Limit_Ring, function Trig_Item_Limit_Ring_Actions )
endfunction
function Trig_Xp_Value_1_Actions takes nothing returns nothing
set udg_Xp_Value = GetHeroXP(udg_Hero)
endfunction
//===========================================================================
function InitTrig_Xp_Value_1 takes nothing returns nothing
set gg_trg_Xp_Value_1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Xp_Value_1, 0.01 )
call TriggerAddAction( gg_trg_Xp_Value_1, function Trig_Xp_Value_1_Actions )
endfunction
function Trig_Xp_Value_2_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetKillingUnitBJ(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetKillingUnitBJ()) != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function Trig_Xp_Value_2_Func001C takes nothing returns boolean
if ( not ( GetKillingUnitBJ() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Xp_Value_2_Actions takes nothing returns nothing
if ( Trig_Xp_Value_2_Func001C() ) then
call CreateTextTagUnitBJ( ( ( "+ " + I2S(( GetHeroXP(GetKillingUnitBJ()) - udg_Xp_Value )) ) + " Xp" ), GetKillingUnitBJ(), 0, 8.50, 45.00, 45.00, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 100.00 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 4.00 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 3.00 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 0.05 )
call EnableTrigger( GetTriggeringTrigger() )
else
endif
endfunction
//===========================================================================
function InitTrig_Xp_Value_2 takes nothing returns nothing
set gg_trg_Xp_Value_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Xp_Value_2, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Xp_Value_2, Condition( function Trig_Xp_Value_2_Conditions ) )
call TriggerAddAction( gg_trg_Xp_Value_2, function Trig_Xp_Value_2_Actions )
endfunction
function Trig_Item_Text_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetItemTypeId(GetManipulatedItem()) != 'I008' ) ) then
return false
endif
return true
endfunction
function Trig_Item_Text_Actions takes nothing returns nothing
call CreateTextTagUnitBJ( GetItemName(GetManipulatedItem()), GetTriggerUnit(), 0, 9.00, 75.00, 100, 15.00, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 90 )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 5 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 4 )
endfunction
//===========================================================================
function InitTrig_Item_Text takes nothing returns nothing
set gg_trg_Item_Text = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Item_Text, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Item_Text, Condition( function Trig_Item_Text_Conditions ) )
call TriggerAddAction( gg_trg_Item_Text, function Trig_Item_Text_Actions )
endfunction
function GDD_RecycleRate takes nothing returns real //The rate at which the system checks units to see if they've been removed from the game
return 0.03
endfunction
function GDD_Filter takes unit u returns boolean //The condition a unit has to pass to have it registered for damage detection
return GetUnitAbilityLevel(u, 'Aloc') == 0 //By default, the system ignores Locust units, because they normally can't take damage anyway
endfunction
// globals
// real udg_GDD_Event = 0.
// real udg_GDD_Damage = 0.
// unit udg_GDD_DamagedUnit
// unit udg_GDD_DamageSource
// trigger array udg_GDD__TriggerArray
// integer array udg_GDD__Integers
// unit array udg_GDD__UnitArray
// group udg_GDD__LeftMapGroup = CreateGroup()
// endglobals
function GDD_Event takes nothing returns boolean
local unit damagedcache = udg_GDD_DamagedUnit
local unit damagingcache = udg_GDD_DamageSource
local real damagecache = udg_GDD_Damage
set udg_GDD_DamagedUnit = GetTriggerUnit()
set udg_GDD_DamageSource = GetEventDamageSource()
set udg_GDD_Damage = GetEventDamage()
set udg_GDD_Event = 1.
set udg_GDD_Event = 0.
set udg_GDD_DamagedUnit = damagedcache
set udg_GDD_DamageSource = damagingcache
set udg_GDD_Damage = damagecache
set damagedcache = null
set damagingcache = null
return false
endfunction
function GDD_AddDetection takes nothing returns boolean
// if(udg_GDD__Integers[0] > 8190) then
// call BJDebugMsg("GDD: Too many damage events! Decrease number of units present in the map or increase recycle rate.")
// ***Recycle rate is specified in the GDD_RecycleRate function at the top of the code. Smaller is faster.***
// return
// endif
if(IsUnitInGroup(GetFilterUnit(), udg_GDD__LeftMapGroup)) then
call GroupRemoveUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
elseif(GDD_Filter(GetFilterUnit())) then
set udg_GDD__Integers[0] = udg_GDD__Integers[0]+1
set udg_GDD__UnitArray[udg_GDD__Integers[0]] = GetFilterUnit()
set udg_GDD__TriggerArray[udg_GDD__Integers[0]] = CreateTrigger()
call TriggerRegisterUnitEvent(udg_GDD__TriggerArray[udg_GDD__Integers[0]], udg_GDD__UnitArray[udg_GDD__Integers[0]], EVENT_UNIT_DAMAGED)
call TriggerAddCondition(udg_GDD__TriggerArray[udg_GDD__Integers[0]], Condition(function GDD_Event))
endif
return false
endfunction
function GDD_PreplacedDetection takes nothing returns nothing
local group g = CreateGroup()
local integer i = 0
loop
call GroupEnumUnitsOfPlayer(g, Player(i), Condition(function GDD_AddDetection))
set i = i+1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call DestroyGroup(g)
set g = null
endfunction
function GDD_GroupRefresh takes nothing returns nothing
// Based on GroupRefresh by Captain Griffen on wc3c.net
if (bj_slotControlUsed[5063] == true) then
call GroupClear(udg_GDD__LeftMapGroup)
set bj_slotControlUsed[5063] = false
endif
call GroupAddUnit(udg_GDD__LeftMapGroup, GetEnumUnit())
endfunction
function GDD_Recycle takes nothing returns nothing
if(udg_GDD__Integers[0] <= 0) then
return
elseif(udg_GDD__Integers[1] <= 0) then
set udg_GDD__Integers[1] = udg_GDD__Integers[0]
endif
if(GetUnitTypeId(udg_GDD__UnitArray[udg_GDD__Integers[1]]) == 0) then
call DestroyTrigger(udg_GDD__TriggerArray[udg_GDD__Integers[1]])
set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = null
set udg_GDD__TriggerArray[udg_GDD__Integers[1]] = udg_GDD__TriggerArray[udg_GDD__Integers[0]]
set udg_GDD__UnitArray[udg_GDD__Integers[1]] = udg_GDD__UnitArray[udg_GDD__Integers[0]]
set udg_GDD__UnitArray[udg_GDD__Integers[0]] = null
set udg_GDD__Integers[0] = udg_GDD__Integers[0]-1
endif
set udg_GDD__Integers[1] = udg_GDD__Integers[1]-1
endfunction
function GDD_LeaveMap takes nothing returns boolean
local boolean cached = bj_slotControlUsed[5063]
if(udg_GDD__Integers[2] < 64) then
set udg_GDD__Integers[2] = udg_GDD__Integers[2]+1
else
set bj_slotControlUsed[5063] = true
call ForGroup(udg_GDD__LeftMapGroup, function GDD_GroupRefresh)
set udg_GDD__Integers[2] = 0
endif
call GroupAddUnit(udg_GDD__LeftMapGroup, GetFilterUnit())
set bj_slotControlUsed[5063] = cached
return false
endfunction
// ===========================================================================
function InitTrig_GUI_Friendly_Damage_Detection takes nothing returns nothing
local region r = CreateRegion()
call RegionAddRect(r, GetWorldBounds())
call TriggerRegisterEnterRegion(CreateTrigger(), r, Condition(function GDD_AddDetection))
call TriggerRegisterLeaveRegion(CreateTrigger(), r, Condition(function GDD_LeaveMap))
call GDD_PreplacedDetection()
call TimerStart(CreateTimer(), GDD_RecycleRate(), true, function GDD_Recycle)
set r = null
endfunction
function Trig_Floating_Spell_Name_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) != 'hpea' ) ) then
return false
endif
return true
endfunction
function Trig_Floating_Spell_Name_Actions takes nothing returns nothing
call CreateTextTagUnitBJ( ( udg_PlayerColors[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] + GetAbilityName(GetSpellAbilityId()) ), GetTriggerUnit(), 0.00, udg_TextSize_spells, 100.00, 100.00, 100.00, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100.00, 90.00 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), udg_Text_Duration )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 0.65 )
endfunction
//===========================================================================
function InitTrig_Floating_Spell_Name takes nothing returns nothing
set gg_trg_Floating_Spell_Name = CreateTrigger( )
call TriggerAddCondition( gg_trg_Floating_Spell_Name, Condition( function Trig_Floating_Spell_Name_Conditions ) )
call TriggerAddAction( gg_trg_Floating_Spell_Name, function Trig_Floating_Spell_Name_Actions )
endfunction
function Trig_Floating_Damage_Taken_Conditions takes nothing returns boolean
if ( not ( udg_GDD_Damage > 1.00 ) ) then
return false
endif
return true
endfunction
function Trig_Floating_Damage_Taken_Actions takes nothing returns nothing
call CreateTextTagUnitBJ( ( udg_PlayerColors[GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource))] + I2S(R2I(udg_GDD_Damage)) ), udg_GDD_DamagedUnit, 0.00, udg_TextSize_dmg, 100.00, 15.00, 0.00, 0 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 100.00, 90.00 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), udg_Text_Duration )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 0.65 )
endfunction
//===========================================================================
function InitTrig_Floating_Damage_Taken takes nothing returns nothing
set gg_trg_Floating_Damage_Taken = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_Floating_Damage_Taken, "udg_GDD_Event", EQUAL, 0 )
call TriggerAddCondition( gg_trg_Floating_Damage_Taken, Condition( function Trig_Floating_Damage_Taken_Conditions ) )
call TriggerAddAction( gg_trg_Floating_Damage_Taken, function Trig_Floating_Damage_Taken_Actions )
endfunction
function Trig_Configuration_Func002002 takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_Floating_Spell_Name, GetEnumUnit(), EVENT_UNIT_SPELL_EFFECT )
endfunction
function Trig_Configuration_Actions takes nothing returns nothing
set udg_tempGroup = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroupBJ( udg_tempGroup, function Trig_Configuration_Func002002 )
call DestroyGroup(udg_tempGroup)
// Configure the duration and size of the floating texts
set udg_Text_Duration = 2.00
set udg_TextSize_dmg = 7.50
set udg_TextSize_spells = 10.00
// -
// These are strings to make the floating texts use the matching players colors
// Neutral Hostile will be using white
set udg_PlayerColors[1] = "|cffffcc00"
set udg_PlayerColors[2] = "|c000042FF"
set udg_PlayerColors[3] = "|c001CE6B9"
set udg_PlayerColors[4] = "|c00540081"
set udg_PlayerColors[5] = "|c00FFFC01"
set udg_PlayerColors[6] = "|c00fEBA0E"
set udg_PlayerColors[7] = "|c0020C000"
set udg_PlayerColors[8] = "|c00E55BB0"
set udg_PlayerColors[9] = "|c00959697"
set udg_PlayerColors[10] = "|c007EBFF1"
set udg_PlayerColors[11] = "|c00106246"
set udg_PlayerColors[12] = "|c004E2A04"
endfunction
//===========================================================================
function InitTrig_Configuration takes nothing returns nothing
set gg_trg_Configuration = CreateTrigger( )
call TriggerAddAction( gg_trg_Configuration, function Trig_Configuration_Actions )
endfunction
function Trig_Configuration2_Actions takes nothing returns nothing
call TriggerRegisterUnitEvent( gg_trg_Floating_Spell_Name, GetTriggerUnit(), EVENT_UNIT_SPELL_EFFECT )
endfunction
//===========================================================================
function InitTrig_Configuration2 takes nothing returns nothing
set gg_trg_Configuration2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Configuration2, GetPlayableMapRect() )
call TriggerAddAction( gg_trg_Configuration2, function Trig_Configuration2_Actions )
endfunction
//TESH.scrollpos=148
//TESH.alwaysfold=0
//===========================================================================
// Damage Engine lets you detect, amplify, block or nullify damage. It even
// lets you detect if the damage was physical or from a spell. Just reference
// DamageEventAmount/Source/Target or the boolean IsDamageSpell, to get the
// necessary damage event data.
//
// - Detect damage: use the event "DamageEvent Equal to 1.00"
// - To change damage before it's dealt: use the event "DamageModifierEvent Equal to 1.00"
// - Detect damage after it was applied, use the event "AfterDamageEvent Equal to 1.00"
// - Detect spell damage: use the condition "IsDamageSpell Equal to True"
// - Detect zero-damage: use the event "DamageEvent Equal to 2.00" (an AfterDamageEvent will not fire for this)
//
// You can specify the DamageEventType before dealing triggered damage. To prevent an already-improbable error, I recommend running the trigger "ClearDamageEvent (Checking Conditions)" after dealing triggered damage from within a damage event:
// - Set NextDamageType = DamageTypeWhatever
// - Unit - Cause...
// - Trigger - Run ClearDamageEvent (Checking Conditions)
//
// You can modify the DamageEventAmount and the DamageEventType from a "DamageModifierEvent Equal to 1.00" trigger.
// - If the amount is modified to negative, it will count as a heal.
// - If the amount is set to 0, no damage will be dealt.
//
// If you need to reference the original in-game damage, use the variable "DamageEventPrevAmt".
//
//===========================================================================
// Programming note about "integer i" and "udg_DmgEvRecursionN": integer i
// ranges from -1 upwards. "udg_DmgEvRecursionN" ranges from 0 upwards.
// "integer i" is always 1 less than "udg_DmgEvRecursionN"
//
function DmgEvResetVars takes nothing returns nothing
local integer i = udg_DmgEvRecursionN - 2
set udg_DmgEvRecursionN = i + 1
if i >= 0 then
set udg_DamageEventPrevAmt = udg_LastDmgPrevAmount[i]
set udg_DamageEventAmount = udg_LastDmgValue[i]
set udg_DamageEventSource = udg_LastDmgSource[i]
set udg_DamageEventTarget = udg_LastDmgTarget[i]
set udg_IsDamageSpell = udg_LastDmgWasSpell[i]
set udg_DamageEventType = udg_LastDmgPrevType[i]
endif
endfunction
function CheckDamagedLifeEvent takes boolean clear returns nothing
if clear then
set udg_NextDamageOverride = false
set udg_NextDamageType = 0
endif
if udg_DmgEvTrig != null then
call DestroyTrigger(udg_DmgEvTrig)
set udg_DmgEvTrig = null
if udg_IsDamageSpell then
call SetWidgetLife(udg_DamageEventTarget, RMaxBJ(udg_LastDamageHP, 0.41))
if udg_LastDamageHP <= 0.405 then
if udg_DamageEventType < 0 then
call SetUnitExploded(udg_DamageEventTarget, true)
endif
//Kill the unit
call DisableTrigger(udg_DamageEventTrigger)
call UnitDamageTarget(udg_DamageEventSource, udg_DamageEventTarget, -999, false, false, null, DAMAGE_TYPE_UNIVERSAL, null)
call EnableTrigger(udg_DamageEventTrigger)
endif
elseif GetUnitAbilityLevel(udg_DamageEventTarget, udg_DamageBlockingAbility) > 0 then
call UnitRemoveAbility(udg_DamageEventTarget, udg_DamageBlockingAbility)
call SetWidgetLife(udg_DamageEventTarget, udg_LastDamageHP)
endif
if udg_DamageEventAmount != 0.00 and not udg_HideDamageFrom[GetUnitUserData(udg_DamageEventSource)] then
set udg_AfterDamageEvent = 0.00
set udg_AfterDamageEvent = 1.00
set udg_AfterDamageEvent = 0.00
endif
call DmgEvResetVars()
endif
endfunction
function DmgEvOnExpire takes nothing returns nothing
set udg_DmgEvStarted = false
call CheckDamagedLifeEvent(true)
endfunction
function PreCheckDamagedLifeEvent takes nothing returns boolean
call CheckDamagedLifeEvent(true)
return false
endfunction
function OnUnitDamage takes nothing returns boolean
local boolean override = udg_DamageEventOverride
local integer i = udg_DmgEvRecursionN - 1
local string s
local real prevAmount
local real life
local real prevLife
local unit u
call CheckDamagedLifeEvent(false) //in case the unit state event failed and the 0.00 second timer hasn't yet expired
if i >= 0 then
if i < 16 then
set udg_LastDmgPrevAmount[i]= udg_DamageEventPrevAmt
set udg_LastDmgValue[i] = udg_DamageEventAmount
set udg_LastDmgSource[i] = udg_DamageEventSource
set udg_LastDmgTarget[i] = udg_DamageEventTarget
set udg_LastDmgWasSpell[i] = udg_IsDamageSpell
set udg_LastDmgPrevType[i] = udg_DamageEventType
else
set s = "WARNING: Recursion error when dealing damage! Make sure when you deal damage from within a DamageEvent trigger, do it like this:\n\n"
set s = s + "Trigger - Turn off (This Trigger)\n"
set s = s + "Unit - Cause...\n"
set s = s + "Trigger - Turn on (This Trigger)"
//Delete the next couple of lines to disable the in-game recursion crash warnings
call ClearTextMessages()
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.00, 0.00, 999.00, s)
return false
endif
endif
set udg_DmgEvRecursionN = i + 2
set u = GetTriggerUnit()
set prevAmount = GetEventDamage()
set udg_DamageEventSource = GetEventDamageSource()
set udg_DamageEventAmount = prevAmount
set udg_DamageEventTarget = u
set udg_DamageEventType = udg_NextDamageType
set udg_NextDamageType = 0
set udg_DamageEventOverride = udg_NextDamageOverride
set udg_NextDamageOverride = false
if prevAmount == 0.00 then
if not udg_HideDamageFrom[GetUnitUserData(udg_DamageEventSource)] then
set udg_DamageEventPrevAmt = 0.00
set udg_DamageEvent = 0.00
set udg_DamageEvent = 2.00
set udg_DamageEvent = 0.00
endif
call DmgEvResetVars()
else
if not udg_DmgEvStarted then
set udg_DmgEvStarted = true
call TimerStart(udg_DmgEvTimer, 0.00, false, function DmgEvOnExpire)
endif
set udg_IsDamageSpell = prevAmount < 0.00
if udg_IsDamageSpell then
set prevAmount = -udg_DamageEventAmount
set life = 1.00
if IsUnitType(u, UNIT_TYPE_ETHEREAL) and not IsUnitType(u, UNIT_TYPE_HERO) then
set life = life*udg_DAMAGE_FACTOR_ETHEREAL //1.67
endif
if GetUnitAbilityLevel(u, 'Aegr') > 0 then
set life = life*udg_DAMAGE_FACTOR_ELUNES //0.80
endif
if udg_DmgEvBracers != 0 and IsUnitType(u, UNIT_TYPE_HERO) then
//Inline of UnitHasItemOfTypeBJ without the potential handle ID leak.
set i = 6
loop
set i = i - 1
if GetItemTypeId(UnitItemInSlot(u, i)) == udg_DmgEvBracers then
set life = life*udg_DAMAGE_FACTOR_BRACERS //0.67
exitwhen true
endif
exitwhen i == 0
endloop
endif
set udg_DamageEventAmount = prevAmount*life
endif
set udg_DamageEventPrevAmt = prevAmount
set udg_DamageModifierEvent = 0.00
if not udg_DamageEventOverride then
set udg_DamageModifierEvent = 1.00
if not udg_DamageEventOverride then
set udg_DamageModifierEvent = 2.00
set udg_DamageModifierEvent = 3.00
endif
endif
set udg_DamageEventOverride = override
if udg_DamageEventAmount > 0.00 then
set udg_DamageModifierEvent = 4.00
endif
set udg_DamageModifierEvent = 0.00
if not udg_HideDamageFrom[GetUnitUserData(udg_DamageEventSource)] then
set udg_DamageEvent = 0.00
set udg_DamageEvent = 1.00
set udg_DamageEvent = 0.00
endif
call CheckDamagedLifeEvent(true) //in case the unit state event failed from a recursive damage event
//All events have run and the damage amount is finalized.
set life = GetWidgetLife(u)
set udg_DmgEvTrig = CreateTrigger()
call TriggerAddCondition(udg_DmgEvTrig, Filter(function PreCheckDamagedLifeEvent))
if not udg_IsDamageSpell then
if udg_DamageEventAmount != prevAmount then
set life = life + prevAmount - udg_DamageEventAmount
if GetUnitState(u, UNIT_STATE_MAX_LIFE) < life then
set udg_LastDamageHP = life - prevAmount
call UnitAddAbility(u, udg_DamageBlockingAbility)
endif
call SetWidgetLife(u, RMaxBJ(life, 0.42))
endif
call TriggerRegisterUnitStateEvent(udg_DmgEvTrig, u, UNIT_STATE_LIFE, LESS_THAN, RMaxBJ(0.41, life - prevAmount/2.00))
else
set udg_LastDamageHP = GetUnitState(u, UNIT_STATE_MAX_LIFE)
set prevLife = life
if life + prevAmount*0.75 > udg_LastDamageHP then
set life = RMaxBJ(udg_LastDamageHP - prevAmount/2.00, 1.00)
call SetWidgetLife(u, life)
set life = (life + udg_LastDamageHP)/2.00
else
set life = life + prevAmount*0.50
endif
set udg_LastDamageHP = prevLife - (prevAmount - (prevAmount - udg_DamageEventAmount))
call TriggerRegisterUnitStateEvent(udg_DmgEvTrig, u, UNIT_STATE_LIFE, GREATER_THAN, life)
endif
set u = null
endif
return false
endfunction
function CreateDmgEvTrg takes nothing returns nothing
set udg_DamageEventTrigger = CreateTrigger()
call TriggerAddCondition(udg_DamageEventTrigger, Filter(function OnUnitDamage))
endfunction
function SetupDmgEv takes nothing returns boolean
local integer i = udg_UDex
local unit u
if udg_UnitIndexEvent == 1.00 then
set u = udg_UDexUnits[i]
if GetUnitAbilityLevel(u, 'Aloc') == 0 and TriggerEvaluate(gg_trg_Damage_Engine_Config) then
set udg_UnitDamageRegistered[i] = true
call TriggerRegisterUnitEvent(udg_DamageEventTrigger, u, EVENT_UNIT_DAMAGED)
call UnitAddAbility(u, udg_SpellDamageAbility)
call UnitMakeAbilityPermanent(u, true, udg_SpellDamageAbility)
endif
set u = null
else
set udg_HideDamageFrom[i] = false
if udg_UnitDamageRegistered[i] then
set udg_UnitDamageRegistered[i] = false
set udg_DamageEventsWasted = udg_DamageEventsWasted + 1
if udg_DamageEventsWasted == 32 then //After 32 registered units have been removed...
set udg_DamageEventsWasted = 0
//Rebuild the mass EVENT_UNIT_DAMAGED trigger:
call DestroyTrigger(udg_DamageEventTrigger)
call CreateDmgEvTrg()
set i = udg_UDexNext[0]
loop
exitwhen i == 0
if udg_UnitDamageRegistered[i] then
call TriggerRegisterUnitEvent(udg_DamageEventTrigger, udg_UDexUnits[i], EVENT_UNIT_DAMAGED)
endif
set i = udg_UDexNext[i]
endloop
endif
endif
endif
return false
endfunction
//===========================================================================
function InitTrig_Damage_Engine takes nothing returns nothing
local unit u = CreateUnit(Player(15), 'uloc', 0, 0, 0)
local integer i = 16
//Create this trigger with UnitIndexEvents in order add and remove units
//as they are created or removed.
local trigger t = CreateTrigger()
call TriggerRegisterVariableEvent(t, "udg_UnitIndexEvent", EQUAL, 1.00)
call TriggerRegisterVariableEvent(t, "udg_UnitIndexEvent", EQUAL, 2.00)
call TriggerAddCondition(t, Filter(function SetupDmgEv))
set t = null
//Run the configuration trigger to set all configurables:
if gg_trg_Damage_Engine_Config == null then
//It's possible this InitTrig_ function ran first, in which case use ExecuteFunc.
call ExecuteFunc("Trig_Damage_Engine_Config_Actions")
else
call TriggerExecute(gg_trg_Damage_Engine_Config)
endif
//Create trigger for storing all EVENT_UNIT_DAMAGED events.
call CreateDmgEvTrg()
//Create GUI-friendly trigger for cleaning up after UnitDamageTarget.
set udg_ClearDamageEvent = CreateTrigger()
call TriggerAddCondition(udg_ClearDamageEvent, Filter(function PreCheckDamagedLifeEvent))
//Disable SpellDamageAbility for every player.
loop
set i = i - 1
call SetPlayerAbilityAvailable(Player(i), udg_SpellDamageAbility, false)
exitwhen i == 0
endloop
//Preload abilities.
call UnitAddAbility(u, udg_DamageBlockingAbility)
call UnitAddAbility(u, udg_SpellDamageAbility)
call RemoveUnit(u)
set u = null
endfunction
function Trig_Actions_to_apply_Func001C takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A005' ) ) then
return false
endif
return true
endfunction
function Trig_Actions_to_apply_Actions takes nothing returns nothing
if ( Trig_Actions_to_apply_Func001C() ) then
set udg_KBA_Caster = GetTriggerUnit()
set udg_KBA_TargetUnit = GetSpellTargetUnit()
set udg_KBA_StartingPosition = GetUnitLoc(GetSpellAbilityUnit())
set udg_KBA_Level = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())
set udg_KBA_Speed = 6.00
set udg_KBA_DistancePerLevel = 50.00
set udg_KBA_SpecialEffects[1] = "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl"
set udg_KBA_SpecialEffects[2] = "Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl"
set udg_KBA_DestroyTrees = true
set udg_KB_Damage = ( ( I2R(( GetHeroStatBJ(bj_HEROSTAT_STR, udg_KBA_Caster, false) * GetUnitAbilityLevelSwapped('A005', udg_KBA_Caster) )) + I2R(udg_Weapon_Damage) ) / 14.00 )
call ConditionalTriggerExecute( gg_trg_Cast_A_Knockback )
call TriggerSleepAction( 0.05 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 15.00 )
call EnableTrigger( GetTriggeringTrigger() )
else
endif
endfunction
//===========================================================================
function InitTrig_Actions_to_apply takes nothing returns nothing
set gg_trg_Actions_to_apply = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Actions_to_apply, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Actions_to_apply, function Trig_Actions_to_apply_Actions )
endfunction
function Trig_Cast_A_Knockback_Func001Func003Func001C takes nothing returns boolean
if ( not ( udg_KB_Units[udg_KB_GeneralIntegers[1]] == udg_KBA_TargetUnit ) ) then
return false
endif
return true
endfunction
function Trig_Cast_A_Knockback_Func001Func004C takes nothing returns boolean
if ( not ( udg_KB_TotalKnockUnits > udg_KB_GeneralIntegers[1] ) ) then
return false
endif
return true
endfunction
function Trig_Cast_A_Knockback_Func001Func007C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Cast_A_Knockback_Func001C takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_KBA_TargetUnit, udg_KB_KnockbackedUnits) == true ) ) then
return false
endif
return true
endfunction
function Trig_Cast_A_Knockback_Func002C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Cast_A_Knockback_Actions takes nothing returns nothing
if ( Trig_Cast_A_Knockback_Func001C() ) then
call GroupRemoveUnitSimple( udg_KBA_TargetUnit, udg_KB_KnockbackedUnits )
set udg_KB_CountBuffs = ( udg_KB_CountBuffs - 1 )
set udg_KB_GeneralIntegers[2] = 1
loop
exitwhen udg_KB_GeneralIntegers[2] > udg_KB_TotalKnockUnits
if ( Trig_Cast_A_Knockback_Func001Func003Func001C() ) then
set udg_KB_GeneralIntegers[1] = udg_KB_GeneralIntegers[2]
set udg_KB_GeneralIntegers[2] = udg_KB_TotalKnockUnits
else
endif
set udg_KB_GeneralIntegers[2] = udg_KB_GeneralIntegers[2] + 1
endloop
if ( Trig_Cast_A_Knockback_Func001Func004C() ) then
set udg_KB_Levels[udg_KB_GeneralIntegers[1]] = udg_KB_Levels[udg_KB_TotalKnockUnits]
set udg_KB_Units[udg_KB_GeneralIntegers[1]] = udg_KB_Units[udg_KB_TotalKnockUnits]
set udg_KB_Angle[udg_KB_GeneralIntegers[1]] = udg_KB_Angle[udg_KB_TotalKnockUnits]
set udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] = udg_KB_MaxDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = udg_KB_ReachedDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = udg_KB_ReduceSpeedReal[udg_KB_TotalKnockUnits]
set udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] = udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits]
set udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_1[udg_KB_TotalKnockUnits]
set udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_2[udg_KB_TotalKnockUnits]
set udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] = udg_KB_DestroyTrees[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter2[udg_KB_TotalKnockUnits]
set udg_KB_GeneralIntegers[1] = ( udg_KB_GeneralIntegers[1] - 1 )
else
endif
set udg_KB_Units[udg_KB_TotalKnockUnits] = null
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits - 1 )
if ( Trig_Cast_A_Knockback_Func001Func007C() ) then
set udg_KB_TotalKnockUnits = 0
call DisableTrigger( gg_trg_Get_Knockback )
else
endif
else
endif
if ( Trig_Cast_A_Knockback_Func002C() ) then
call EnableTrigger( gg_trg_Get_Knockback )
else
endif
set udg_KB_CountBuffs = ( udg_KB_CountBuffs + 1 )
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits + 1 )
set udg_KB_Casters[udg_KB_TotalKnockUnits] = udg_KBA_Caster
set udg_KB_Levels[udg_KB_TotalKnockUnits] = udg_KBA_Level
set udg_KB_Units[udg_KB_TotalKnockUnits] = udg_KBA_TargetUnit
set udg_KB_StartPositions[udg_KB_TotalKnockUnits] = udg_KBA_StartingPosition
set udg_KB_TempPoint[udg_KB_TotalKnockUnits] = GetUnitLoc(udg_KBA_TargetUnit)
set udg_KB_Angle[udg_KB_TotalKnockUnits] = AngleBetweenPoints(udg_KB_StartPositions[udg_KB_TotalKnockUnits], udg_KB_TempPoint[udg_KB_TotalKnockUnits])
set udg_KB_MaxDistance[udg_KB_TotalKnockUnits] = ( udg_KBA_DistancePerLevel * I2R(udg_KBA_Level) )
set udg_KB_ReachedDistance[udg_KB_TotalKnockUnits] = 0.00
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = 0.00
set udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits] = udg_KBA_Speed
set udg_KB_Effects_1[udg_KB_TotalKnockUnits] = udg_KBA_SpecialEffects[1]
set udg_KB_Effects_2[udg_KB_TotalKnockUnits] = udg_KBA_SpecialEffects[2]
set udg_KB_DestroyTrees[udg_KB_TotalKnockUnits] = udg_KBA_DestroyTrees
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = 0
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = 0
call GroupAddUnitSimple( udg_KBA_TargetUnit, udg_KB_KnockbackedUnits )
call RemoveLocation (udg_KBA_StartingPosition)
call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
endfunction
//===========================================================================
function InitTrig_Cast_A_Knockback takes nothing returns nothing
set gg_trg_Cast_A_Knockback = CreateTrigger( )
call TriggerAddAction( gg_trg_Cast_A_Knockback, function Trig_Cast_A_Knockback_Actions )
endfunction
function Trig_Get_Knockback_Func001Func001Func002Func003C takes nothing returns boolean
if ( not ( udg_KB_TotalKnockUnits > udg_KB_GeneralIntegers[1] ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Func001Func001Func002Func006C takes nothing returns boolean
if ( not ( udg_KB_CountBuffs == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Func001Func001Func002Func014Func002A takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_Get_Knockback_Func001Func001Func002Func014C takes nothing returns boolean
if ( not ( udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] == true ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Func001Func001Func002Func015C takes nothing returns boolean
if ( not ( udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] == 6 ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Func001Func001Func002Func016C takes nothing returns boolean
if ( not ( udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] == 8 ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Func001Func001Func002C takes nothing returns boolean
if ( not ( udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] >= udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitInGroup(udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_KnockbackedUnits) == true ) ) then
return false
endif
return true
endfunction
function Trig_Get_Knockback_Actions takes nothing returns nothing
set udg_KB_GeneralIntegers[1] = 1
loop
exitwhen udg_KB_GeneralIntegers[1] > udg_KB_TotalKnockUnits
if ( Trig_Get_Knockback_Func001Func001C() ) then
if ( Trig_Get_Knockback_Func001Func001Func002C() ) then
call GroupRemoveUnitSimple( udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_KnockbackedUnits )
set udg_KB_CountBuffs = ( udg_KB_CountBuffs - 1 )
if ( Trig_Get_Knockback_Func001Func001Func002Func003C() ) then
set udg_KB_Levels[udg_KB_GeneralIntegers[1]] = udg_KB_Levels[udg_KB_TotalKnockUnits]
set udg_KB_Units[udg_KB_GeneralIntegers[1]] = udg_KB_Units[udg_KB_TotalKnockUnits]
set udg_KB_Angle[udg_KB_GeneralIntegers[1]] = udg_KB_Angle[udg_KB_TotalKnockUnits]
set udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] = udg_KB_MaxDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = udg_KB_ReachedDistance[udg_KB_TotalKnockUnits]
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = udg_KB_ReduceSpeedReal[udg_KB_TotalKnockUnits]
set udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] = udg_KB_SpecificSpeed[udg_KB_TotalKnockUnits]
set udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_1[udg_KB_TotalKnockUnits]
set udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] = udg_KB_Effects_2[udg_KB_TotalKnockUnits]
set udg_KB_DestroyTrees[udg_KB_GeneralIntegers[1]] = udg_KB_DestroyTrees[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter[udg_KB_TotalKnockUnits]
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = udg_KB_EffectCounter2[udg_KB_TotalKnockUnits]
set udg_KB_GeneralIntegers[1] = ( udg_KB_GeneralIntegers[1] - 1 )
else
endif
set udg_KB_Units[udg_KB_TotalKnockUnits] = null
set udg_KB_TotalKnockUnits = ( udg_KB_TotalKnockUnits - 1 )
if ( Trig_Get_Knockback_Func001Func001Func002Func006C() ) then
set udg_KB_TotalKnockUnits = 0
call DisableTrigger( GetTriggeringTrigger() )
else
endif
else
set udg_KB_ReducedReal = ( ( udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] / udg_KB_MaxDistance[udg_KB_GeneralIntegers[1]] ) * udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] )
set udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] = ( udg_KB_ReducedReal - ( udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] * 0.10 ) )
set udg_KB_TempReal = ( ( udg_KB_SpecificSpeed[udg_KB_GeneralIntegers[1]] - udg_KB_ReduceSpeedReal[udg_KB_GeneralIntegers[1]] ) * 2.00 )
set udg_KB_TempPoint[1] = GetUnitLoc(udg_KB_Units[udg_KB_GeneralIntegers[1]])
set udg_KB_TempPoint[2] = PolarProjectionBJ(udg_KB_TempPoint[1], udg_KB_TempReal, udg_KB_Angle[udg_KB_GeneralIntegers[1]])
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = ( udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] + 1 )
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = ( udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] + 1 )
if ( Trig_Get_Knockback_Func001Func001Func002Func014C() ) then
call EnumDestructablesInCircleBJ( 200.00, udg_KB_TempPoint[2], function Trig_Get_Knockback_Func001Func001Func002Func014Func002A )
else
endif
if ( Trig_Get_Knockback_Func001Func001Func002Func015C() ) then
set udg_KB_EffectCounter[udg_KB_GeneralIntegers[1]] = 0
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_1[udg_KB_GeneralIntegers[1]] )
call UnitDamageTargetBJ( udg_KBA_Caster, udg_KBA_TargetUnit, udg_KB_Damage, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
if ( Trig_Get_Knockback_Func001Func001Func002Func016C() ) then
set udg_KB_EffectCounter2[udg_KB_GeneralIntegers[1]] = 0
call AddSpecialEffectLocBJ( udg_KB_TempPoint[1], udg_KB_Effects_2[udg_KB_GeneralIntegers[1]] )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
endif
call SetUnitPositionLoc( udg_KB_Units[udg_KB_GeneralIntegers[1]], udg_KB_TempPoint[2] )
call RemoveLocation (udg_KB_TempPoint[1])
call RemoveLocation (udg_KB_TempPoint[2])
set udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] = ( udg_KB_ReachedDistance[udg_KB_GeneralIntegers[1]] + udg_KB_TempReal )
endif
else
endif
set udg_KB_GeneralIntegers[1] = udg_KB_GeneralIntegers[1] + 1
endloop
endfunction
//===========================================================================
function InitTrig_Get_Knockback takes nothing returns nothing
set gg_trg_Get_Knockback = CreateTrigger( )
call DisableTrigger( gg_trg_Get_Knockback )
call TriggerRegisterTimerEventPeriodic( gg_trg_Get_Knockback, 0.02 )
call TriggerAddAction( gg_trg_Get_Knockback, function Trig_Get_Knockback_Actions )
endfunction
function Trig_Xp_Giving_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Xp_Giving_Func001A takes nothing returns nothing
if ( Trig_Xp_Giving_Func001Func001C() ) then
call AddHeroXPSwapped( ( 1 + ( GetHeroLevel(GetEnumUnit()) / 5 ) ), GetEnumUnit(), false )
else
endif
endfunction
function Trig_Xp_Giving_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectOfPlayer(GetPlayableMapRect(), Player(2)), function Trig_Xp_Giving_Func001A )
endfunction
//===========================================================================
function InitTrig_Xp_Giving takes nothing returns nothing
set gg_trg_Xp_Giving = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Xp_Giving, 15.00 )
call TriggerAddAction( gg_trg_Xp_Giving, function Trig_Xp_Giving_Actions )
endfunction
function Trig_Unit_Hostile_Die_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(2) ) ) then
return false
endif
return true
endfunction
function Trig_Unit_Hostile_Die_Actions takes nothing returns nothing
call TriggerSleepAction( ( 80.00 + ( I2R(GetHeroLevel(GetDyingUnit())) * 2.00 ) ) )
call AddSpecialEffectLocBJ( GetUnitLoc(GetDyingUnit()), "Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl" )
call ReviveHeroLoc( GetDyingUnit(), GetUnitLoc(GetDyingUnit()), false )
endfunction
//===========================================================================
function InitTrig_Unit_Hostile_Die takes nothing returns nothing
set gg_trg_Unit_Hostile_Die = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Hostile_Die, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Unit_Hostile_Die, Condition( function Trig_Unit_Hostile_Die_Conditions ) )
call TriggerAddAction( gg_trg_Unit_Hostile_Die, function Trig_Unit_Hostile_Die_Actions )
endfunction
function Trig_Gate_1_Actions takes nothing returns nothing
call ModifyGateBJ( bj_GATEOPERATION_OPEN, gg_dest_B000_0689 )
call SetDestructableAnimationBJ( gg_dest_B000_0689, "stand alternate" )
endfunction
//===========================================================================
function InitTrig_Gate_1 takes nothing returns nothing
set gg_trg_Gate_1 = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Gate_1, 0.01 )
call TriggerAddAction( gg_trg_Gate_1, function Trig_Gate_1_Actions )
endfunction
function Trig_Guardsman_Actions takes nothing returns nothing
call IssuePointOrderLocBJ( gg_unit_H009_0024, "move", GetRandomLocInRect(gg_rct_Patrol_Region_001) )
call IssuePointOrderLocBJ( gg_unit_H009_0033, "patrol", GetRectCenter(gg_rct_Region_011) )
endfunction
//===========================================================================
function InitTrig_Guardsman takes nothing returns nothing
set gg_trg_Guardsman = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Guardsman, 30.00 )
call TriggerAddAction( gg_trg_Guardsman, function Trig_Guardsman_Actions )
endfunction
function Trig_Save_Actions takes nothing returns nothing
call ReloadGameCachesFromDisk( )
call InitGameCacheBJ( "Mahdi1411203125.w3v" )
call StoreUnitBJ( udg_Hero, "q", "M", GetLastCreatedGameCacheBJ() )
call StoreStringBJ( udg_Name, "w", "M", GetLastCreatedGameCacheBJ() )
call StoreStringBJ( udg_Job_String, "e", "M", GetLastCreatedGameCacheBJ() )
call StoreIntegerBJ( udg_Coin_Cache, "r", "N", GetLastCreatedGameCacheBJ() )
call StoreIntegerBJ( udg_Silver_Cache, "t", "N", GetLastCreatedGameCacheBJ() )
call StoreIntegerBJ( udg_Gold_Cache, "y", "N", GetLastCreatedGameCacheBJ() )
call StoreIntegerBJ( udg_ddd, "u", "B", GetLastCreatedGameCacheBJ() )
call StoreIntegerBJ( udg_Fame_Value, "i", "B", GetLastCreatedGameCacheBJ() )
call StoreIntegerBJ( udg_HeavyStrike_Load, "h", "s", GetLastCreatedGameCacheBJ() )
call StoreBooleanBJ( udg_H_S_P, "o", "B", GetLastCreatedGameCacheBJ() )
call StoreBooleanBJ( udg_Fog, "Fog1", "Fog2", GetLastCreatedGameCacheBJ() )
call StoreRealBJ( udg_Xp_Rating, "p", "V", GetLastCreatedGameCacheBJ() )
call SaveGameCacheBJ( GetLastCreatedGameCacheBJ() )
endfunction
//===========================================================================
function InitTrig_Save takes nothing returns nothing
set gg_trg_Save = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Save, 1.25 )
call TriggerAddAction( gg_trg_Save, function Trig_Save_Actions )
endfunction
function Trig_Wolf_Actions takes nothing returns nothing
call IssuePointOrderLocBJ( gg_unit_H00B_0029, "attack", GetRandomLocInRect(gg_rct_Region_010) )
call IssuePointOrderLocBJ( gg_unit_H00B_0030, "attack", GetRandomLocInRect(gg_rct_Region_010) )
endfunction
//===========================================================================
function InitTrig_Wolf takes nothing returns nothing
set gg_trg_Wolf = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Wolf, 8.00 )
call TriggerAddAction( gg_trg_Wolf, function Trig_Wolf_Actions )
endfunction
function Trig_Fire_Bolt_A_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A017' ) ) then
return false
endif
return true
endfunction
function Trig_Fire_Bolt_A_1_Func001C takes nothing returns boolean
if ( not ( GetSpellTargetUnit() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Fire_Bolt_A_1_Func002C takes nothing returns boolean
if ( not ( GetSpellTargetUnit() != udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Fire_Bolt_A_1_Actions takes nothing returns nothing
if ( Trig_Fire_Bolt_A_1_Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetSpellTargetUnit(), ( ( 17.00 * I2R(GetHeroLevel(GetSpellAbilityUnit())) ) - I2R(udg_Fire_Resistance) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
if ( Trig_Fire_Bolt_A_1_Func002C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetSpellTargetUnit(), ( ( 17.00 * I2R(GetHeroLevel(GetSpellAbilityUnit())) ) * 1.00 ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
call AddSpecialEffectTargetUnitBJ( "hand", GetSpellAbilityUnit(), "Abilities\\Spells\\Other\\BreathOfFire\\BreathOfFireDamage.mdl" )
call TriggerSleepAction( 1.25 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction
//===========================================================================
function InitTrig_Fire_Bolt_A_1 takes nothing returns nothing
set gg_trg_Fire_Bolt_A_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_Bolt_A_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fire_Bolt_A_1, Condition( function Trig_Fire_Bolt_A_1_Conditions ) )
call TriggerAddAction( gg_trg_Fire_Bolt_A_1, function Trig_Fire_Bolt_A_1_Actions )
endfunction
function Trig_Clear_Func001002 takes nothing returns nothing
call ClearTextMessagesBJ( GetForceOfPlayer(GetTriggerPlayer()) )
endfunction
function Trig_Clear_Actions takes nothing returns nothing
call ForForce( GetForceOfPlayer(GetTriggerPlayer()), function Trig_Clear_Func001002 )
endfunction
//===========================================================================
function InitTrig_Clear takes nothing returns nothing
set gg_trg_Clear = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(0), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(1), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(2), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(3), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(4), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(5), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(6), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(7), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(8), "-clear", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Clear, Player(9), "-clear", true )
call TriggerAddAction( gg_trg_Clear, function Trig_Clear_Actions )
endfunction
function Trig_Smooth_Actions takes nothing returns nothing
set udg_Smooth = SubStringBJ(GetEventPlayerChatString(), 9, 999)
call DisplayTextToForce( GetPlayersAll(), ( "Mouse smooth is now " + udg_Smooth ) )
call CameraSetSmoothingFactorBJ( S2R(udg_Smooth) )
endfunction
//===========================================================================
function InitTrig_Smooth takes nothing returns nothing
set gg_trg_Smooth = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Smooth, Player(0), "-Smooth", false )
call TriggerAddAction( gg_trg_Smooth, function Trig_Smooth_Actions )
endfunction
//===========================================================================
//Mahdi Dehghan
//MdProjects
function Trig_Dif_Func001C takes nothing returns boolean
if ( not ( udg_ddd == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Dif_Func002C takes nothing returns boolean
if ( not ( udg_ddd == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Dif_Func003C takes nothing returns boolean
if ( not ( udg_ddd == 3 ) ) then
return false
endif
return true
endfunction
function Trig_Dif_Func004C takes nothing returns boolean
if ( not ( udg_ddd == 4 ) ) then
return false
endif
return true
endfunction
function Trig_Dif_Actions takes nothing returns nothing
if ( Trig_Dif_Func001C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_468" )
else
endif
if ( Trig_Dif_Func002C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_469" )
else
endif
if ( Trig_Dif_Func003C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_472" )
else
endif
if ( Trig_Dif_Func004C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_473" )
else
endif
endfunction
//===========================================================================
function InitTrig_Dif takes nothing returns nothing
set gg_trg_Dif = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Dif, Player(0), "-Dif", true )
call TriggerAddAction( gg_trg_Dif, function Trig_Dif_Actions )
endfunction
function Trig_Camera_Set_Func001C takes nothing returns boolean
if ( not ( S2I(SubStringBJ(GetEventPlayerChatString(), 8, 12)) < 3350 ) ) then
return false
endif
if ( not ( S2I(SubStringBJ(GetEventPlayerChatString(), 8, 12)) > 655 ) ) then
return false
endif
return true
endfunction
function Trig_Camera_Set_Func002C takes nothing returns boolean
if ( not ( S2I(SubStringBJ(GetEventPlayerChatString(), 8, 12)) > 3350 ) ) then
return false
endif
return true
endfunction
function Trig_Camera_Set_Func003C takes nothing returns boolean
if ( not ( S2I(SubStringBJ(GetEventPlayerChatString(), 8, 12)) < 655 ) ) then
return false
endif
return true
endfunction
function Trig_Camera_Set_Actions takes nothing returns nothing
if ( Trig_Camera_Set_Func001C() ) then
set udg_Camera_Zome = S2I(SubStringBJ(GetEventPlayerChatString(), 8, 12))
call DisplayTextToForce( GetPlayersAll(), ( "Camera set to " + I2S(udg_Camera_Zome) ) )
else
endif
if ( Trig_Camera_Set_Func002C() ) then
set udg_Camera_Zome = 3350
call DisplayTextToForce( GetPlayersAll(), ( "Camera set to " + I2S(udg_Camera_Zome) ) )
else
endif
if ( Trig_Camera_Set_Func003C() ) then
set udg_Camera_Zome = 655
call DisplayTextToForce( GetPlayersAll(), ( "Camera set to " + I2S(udg_Camera_Zome) ) )
else
endif
endfunction
//===========================================================================
function InitTrig_Camera_Set takes nothing returns nothing
set gg_trg_Camera_Set = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Camera_Set, Player(0), "-Camera", false )
call TriggerAddAction( gg_trg_Camera_Set, function Trig_Camera_Set_Actions )
endfunction
function Trig_Damage_Increase_Conditions takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetDyingUnit()), GetOwningPlayer(udg_Hero)) == true ) ) then
return false
endif
if ( not ( GetKillingUnitBJ() == udg_Hero ) ) then
return false
endif
return true
endfunction
function Trig_Damage_Increase_Func001C takes nothing returns boolean
if ( not ( GetRandomInt(1, 100) < 15 ) ) then
return false
endif
return true
endfunction
function Trig_Damage_Increase_Actions takes nothing returns nothing
if ( Trig_Damage_Increase_Func001C() ) then
call UnitAddItemByIdSwapped( 'I008', udg_Hero )
else
endif
endfunction
//===========================================================================
function InitTrig_Damage_Increase takes nothing returns nothing
set gg_trg_Damage_Increase = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Damage_Increase, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Damage_Increase, Condition( function Trig_Damage_Increase_Conditions ) )
call TriggerAddAction( gg_trg_Damage_Increase, function Trig_Damage_Increase_Actions )
endfunction
//===========================================================================
//Mahdi Dehghan
//MdProjects
function Trig_Blacksmith_1_Conditions takes nothing returns boolean
if ( not ( GetManipulatingUnit() == gg_unit_hwtw_0028 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func002Func001C takes nothing returns boolean
if ( not ( udg_BlackSmith_Points >= 50 ) ) then
return false
endif
if ( not ( udg_BlackSmith_Points < 75 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func002Func002C takes nothing returns boolean
if ( not ( udg_BlackSmith_Points >= 75 ) ) then
return false
endif
if ( not ( udg_BlackSmith_Points < 100 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func002Func003C takes nothing returns boolean
if ( not ( udg_BlackSmith_Points >= 100 ) ) then
return false
endif
if ( not ( udg_BlackSmith_Points < 125 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func002Func004C takes nothing returns boolean
if ( not ( udg_BlackSmith_Points >= 125 ) ) then
return false
endif
if ( not ( udg_BlackSmith_Points < 150 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func002Func005C takes nothing returns boolean
if ( not ( udg_BlackSmith_Points >= 150 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func002C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00A' ) ) then
return false
endif
if ( not ( udg_MET_Iron >= 3 ) ) then
return false
endif
if ( not ( udg_MET_FlameStone >= 1 ) ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Func003Func003C takes nothing returns boolean
if ( ( udg_MET_Iron < 3 ) ) then
return true
endif
if ( ( udg_MET_FlameStone < 1 ) ) then
return true
endif
if ( ( udg_BlackSmith_Points < 50 ) ) then
return true
endif
return false
endfunction
function Trig_Blacksmith_1_Func003C takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'I00A' ) ) then
return false
endif
if ( not Trig_Blacksmith_1_Func003Func003C() ) then
return false
endif
return true
endfunction
function Trig_Blacksmith_1_Actions takes nothing returns nothing
// Flaming Sword
if ( Trig_Blacksmith_1_Func002C() ) then
if ( Trig_Blacksmith_1_Func002Func001C() ) then
call UnitAddItemByIdSwapped( 'I00E', udg_Hero )
call DisplayTimedTextToForce( GetPlayersAll(), 20.00, ( "Item Created: " + ( "|c00FFFF6C" + ( GetItemName(GetLastCreatedItem()) + " (Bad Quality)" ) ) ) )
set udg_BlackSmith_Points = ( udg_BlackSmith_Points + 1 )
set udg_MET_FlameStone = ( udg_MET_FlameStone - 1 )
set udg_MET_Iron = ( udg_MET_Iron - 3 )
else
endif
if ( Trig_Blacksmith_1_Func002Func002C() ) then
call UnitAddItemByIdSwapped( 'I00C', udg_Hero )
call DisplayTimedTextToForce( GetPlayersAll(), 20.00, ( "Item Created: " + ( "|c00FFFF6C" + ( GetItemName(GetLastCreatedItem()) + " (Normal Quality)" ) ) ) )
set udg_BlackSmith_Points = ( udg_BlackSmith_Points + 1 )
set udg_MET_FlameStone = ( udg_MET_FlameStone - 1 )
set udg_MET_Iron = ( udg_MET_Iron - 3 )
else
endif
if ( Trig_Blacksmith_1_Func002Func003C() ) then
call UnitAddItemByIdSwapped( 'I00D', udg_Hero )
call DisplayTimedTextToForce( GetPlayersAll(), 20.00, ( "Item Created: " + ( "|c00FFFF6C" + ( GetItemName(GetLastCreatedItem()) + " (Good Quality)" ) ) ) )
set udg_BlackSmith_Points = ( udg_BlackSmith_Points + 1 )
set udg_MET_FlameStone = ( udg_MET_FlameStone - 1 )
set udg_MET_Iron = ( udg_MET_Iron - 3 )
else
endif
if ( Trig_Blacksmith_1_Func002Func004C() ) then
call UnitAddItemByIdSwapped( 'I00F', udg_Hero )
call DisplayTimedTextToForce( GetPlayersAll(), 20.00, ( "Item Created: " + ( "|c00FFFF6C" + ( GetItemName(GetLastCreatedItem()) + " (Very Good Quality)" ) ) ) )
set udg_BlackSmith_Points = ( udg_BlackSmith_Points + 1 )
set udg_MET_FlameStone = ( udg_MET_FlameStone - 1 )
set udg_MET_Iron = ( udg_MET_Iron - 3 )
else
endif
if ( Trig_Blacksmith_1_Func002Func005C() ) then
call UnitAddItemByIdSwapped( 'I00B', udg_Hero )
call DisplayTimedTextToForce( GetPlayersAll(), 20.00, ( "Item Created: " + ( "|c00FFFF6C" + ( GetItemName(GetLastCreatedItem()) + " (Perfect Quality)" ) ) ) )
set udg_BlackSmith_Points = ( udg_BlackSmith_Points + 1 )
set udg_MET_FlameStone = ( udg_MET_FlameStone - 1 )
set udg_MET_Iron = ( udg_MET_Iron - 3 )
else
endif
else
endif
if ( Trig_Blacksmith_1_Func003C() ) then
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "TRIGSTR_525" )
else
endif
endfunction
//===========================================================================
function InitTrig_Blacksmith_1 takes nothing returns nothing
set gg_trg_Blacksmith_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blacksmith_1, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Blacksmith_1, Condition( function Trig_Blacksmith_1_Conditions ) )
call TriggerAddAction( gg_trg_Blacksmith_1, function Trig_Blacksmith_1_Actions )
endfunction
function Trig_Heavy_Strike_Load_Func001C takes nothing returns boolean
if ( not ( udg_HeavyStrike_Load >= 1 ) ) then
return false
endif
return true
endfunction
function Trig_Heavy_Strike_Load_Actions takes nothing returns nothing
if ( Trig_Heavy_Strike_Load_Func001C() ) then
call UnitAddAbilityBJ( 'A005', udg_Hero )
call SetUnitAbilityLevelSwapped( 'A005', udg_Hero, udg_HeavyStrike_Load )
else
endif
endfunction
//===========================================================================
function InitTrig_Heavy_Strike_Load takes nothing returns nothing
set gg_trg_Heavy_Strike_Load = CreateTrigger( )
call TriggerAddAction( gg_trg_Heavy_Strike_Load, function Trig_Heavy_Strike_Load_Actions )
endfunction
function Trig_Untitled_Trigger_003_Actions takes nothing returns nothing
call ConditionalTriggerExecute( gg_trg_Heavy_Strike_Load )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_003 takes nothing returns nothing
set gg_trg_Untitled_Trigger_003 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_003, function Trig_Untitled_Trigger_003_Actions )
endfunction
function Trig_Soul_Shield_Cast_Func004C takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(0) ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Shield_Cast_Func011Func003001003001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Soul_Shield_Cast_Func011Func003001003002001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_SoulShieldCaster)) == true )
endfunction
function Trig_Soul_Shield_Cast_Func011Func003001003002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Soul_Shield_Cast_Func011Func003001003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Soul_Shield_Cast_Func011Func003001003002001(), Trig_Soul_Shield_Cast_Func011Func003001003002002() )
endfunction
function Trig_Soul_Shield_Cast_Func011Func003001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Soul_Shield_Cast_Func011Func003001003001(), Trig_Soul_Shield_Cast_Func011Func003001003002() )
endfunction
function Trig_Soul_Shield_Cast_Func011Func003A takes nothing returns nothing
call CreateTextTagUnitBJ( R2S(udg_XSoulShieldDamageInput), GetTriggerUnit(), 0, 7.00, 100, 100, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 0.80 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 0.80 )
call UnitDamagePointLoc( GetSpellAbilityUnit(), 0, 512.00, GetUnitLoc(GetSpellAbilityUnit()), I2R(( GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), false) + ( GetHeroLevel(GetSpellAbilityUnit()) / 25 ) )), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "chest", GetEnumUnit(), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction
function Trig_Soul_Shield_Cast_Func011C takes nothing returns boolean
if ( not ( udg_SoulShieldDone == true ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Shield_Cast_Actions takes nothing returns nothing
set udg_SoulShieldCaster = GetTriggerUnit()
set udg_XSoulShieldDamageInput = 0.00
set udg_XSoulShieldDamageMax = 0.00
if ( Trig_Soul_Shield_Cast_Func004C() ) then
set udg_XSoulShieldDamageMax = ( GetRandomReal(80.00, 120.00) + I2R(GetHeroStatBJ(bj_HEROSTAT_STR, udg_SoulShieldCaster, true)) )
set udg_XSoulShieldDamageMax = ( I2R(R2I(udg_XSoulShieldDamageMax)) + ( GetRandomReal(100.00, 150.00) * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())) ) )
else
set udg_XSoulShieldDamageMax = ( GetRandomReal(80.00, 120.00) + I2R(GetHeroStatBJ(bj_HEROSTAT_STR, udg_SoulShieldCaster, true)) )
endif
call AddSpecialEffectTargetUnitBJ( "chest", GetEnumUnit(), "Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl" )
set udg_SoulShieldSFX = GetLastCreatedEffectBJ()
call PolledWait( 15.00 )
if ( Trig_Soul_Shield_Cast_Func011C() ) then
call DoNothing( )
else
call DestroyEffectBJ( udg_SoulShieldSFX )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(400.00, GetUnitLoc(udg_SoulShieldCaster), Condition(function Trig_Soul_Shield_Cast_Func011Func003001003)), function Trig_Soul_Shield_Cast_Func011Func003A )
set udg_XSoulShieldDamageInput = 0.00
set udg_SoulShieldDone = false
endif
endfunction
//===========================================================================
function InitTrig_Soul_Shield_Cast takes nothing returns nothing
set gg_trg_Soul_Shield_Cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Soul_Shield_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Soul_Shield_Cast, function Trig_Soul_Shield_Cast_Actions )
endfunction
function Trig_Soul_Shield_Start_Conditions takes nothing returns boolean
if ( not ( GetTriggerUnit() == udg_SoulShieldCaster ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Shield_Start_Func004Func003001003001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Soul_Shield_Start_Func004Func003001003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_SoulShieldCaster)) == true )
endfunction
function Trig_Soul_Shield_Start_Func004Func003001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Soul_Shield_Start_Func004Func003001003001(), Trig_Soul_Shield_Start_Func004Func003001003002() )
endfunction
function Trig_Soul_Shield_Start_Func004Func003A takes nothing returns nothing
call AddSpecialEffectTargetUnitBJ( "chest", GetEnumUnit(), "Units\\NightElf\\Wisp\\WispExplode.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), udg_XSoulShieldDamageInput, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call CreateTextTagUnitBJ( I2S(R2I(udg_XSoulShieldDamageInput)), GetTriggerUnit(), 0, 7.00, 100, 100, 100, 0 )
call SetTextTagPermanentBJ( GetLastCreatedTextTag(), false )
call SetTextTagLifespanBJ( GetLastCreatedTextTag(), 1.00 )
call SetTextTagFadepointBJ( GetLastCreatedTextTag(), 1.00 )
endfunction
function Trig_Soul_Shield_Start_Func004C takes nothing returns boolean
if ( not ( udg_XSoulShieldDamageInput >= udg_XSoulShieldDamageMax ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Shield_Start_Actions takes nothing returns nothing
call SetUnitLifeBJ( udg_SoulShieldCaster, ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_SoulShieldCaster) + GetEventDamage() ) )
set udg_XSoulShieldDamageInput = GetEventDamage()
if ( Trig_Soul_Shield_Start_Func004C() ) then
call DestroyEffectBJ( udg_SoulShieldSFX )
set udg_SoulShieldDone = true
call ForGroupBJ( GetUnitsInRangeOfLocMatching(400.00, GetUnitLoc(udg_SoulShieldCaster), Condition(function Trig_Soul_Shield_Start_Func004Func003001003)), function Trig_Soul_Shield_Start_Func004Func003A )
set udg_XSoulShieldDamageInput = 0.00
call DisableTrigger( GetTriggeringTrigger() )
else
endif
endfunction
//===========================================================================
function InitTrig_Soul_Shield_Start takes nothing returns nothing
set gg_trg_Soul_Shield_Start = CreateTrigger( )
call DisableTrigger( gg_trg_Soul_Shield_Start )
call TriggerAddCondition( gg_trg_Soul_Shield_Start, Condition( function Trig_Soul_Shield_Start_Conditions ) )
call TriggerAddAction( gg_trg_Soul_Shield_Start, function Trig_Soul_Shield_Start_Actions )
endfunction
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
call MultiboardSetItemStyleBJ( udg_MultiBoard, 2, 6, true, true )
call MultiboardSetItemIconBJ( udg_MultiBoard, 2, 6, "ReplaceableTextures\\CommandButtons\\BTNBoots.blp" )
call MultiboardSetItemValueBJ( udg_MultiBoard, 2, 6, ( "|c00FFFF6CSpeed:|r" + I2S(udg_MS) ) )
call MultiboardSetItemWidthBJ( GetLastCreatedMultiboard(), 2, 6, 13.00 )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
//TESH.scrollpos=630
//TESH.alwaysfold=0
////////////////////////////////////////////////////////////////////////////////////
//////////////////// I M P A C T [ JASS ] v 1 . 0a /////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// ~by jakeZinc AKA jake //////////////////////
////////////////////////////////////////////////////////////////////////////////////
// Requires: None //
////////////////////////////////////////////////////////////////////////////////////
// Purpose: Can be use in AoS Maps about chasing the runner or enemies if they're //
// far from you. It can release a explosion missile to the impact //
// Can Pull enemy units and cause massive knockback //
// Why JASS not GUI?: I code it JASS for efficiency and leakless // //
// //
// Changelogs: v1.0a = * Inlined the squareroot formula and reduced some locals //
// //
// //
// Importing Instructions: //
// Requires: //
// 1) Copy & Paste the Impact Ability to your map: Object Editor --> Abilities --> Impact
// 2) Copy & Paste the Impact ( Dummy Missile Unit ) to your map: Object Editor --> Units --> Impact ( Missile Dummy Unit )
// 3) Copy & Paste the Impact [ JASS ] v1.0a to your map: Trigger Editor --> Trigger Folder --> Impact [ JASS ] v1.0
// 4) Import the war3mapImported\dummy.mdx or dummy.mdx to your map: Import Manager ( F12 )
// Optional: If you want the default effect //
// 1) Import the war3mapImported\NewDirtEXNofire.mdx or NewDirtEXNofire.mdx to your map: Import Manager ( F12 )
// 2) Import the war3mapImported\OrbOfFire.mdx or OrbOfFire.mdx to your map: Import Manager ( F12 )
// //
// Credits: (Icon: Muoteck ) //
// (System: Jad ) //
// (Model: Vexorian ) //
// (Model: WILLTHEALMIGHTY ) //
// //
// Contacts: Contact the author via PM or VM in the www.hiveworkshop if you have //
// found a bugs or suggestions from the spell //
// ~ jakeZinc AKA jake //
// //
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////CONFIGURATION FIELD!!!////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// READ THE NOTES BEFORE CONFIGURING THE SPELL:
// NOTE FORMULATION: Base Value
// NOTE FORMULATION2: Base Value * The ability of the caster
// NOTE FORMULATION3: Base Value + Base Value Per Level * The ability of the caster
// NOTE MODEL_PATH: The model path in jass must contains between the aposthropy "" and it
// it doubled slash like this:
// Wrong:
// "Abilities\Weapons\DemolisherFireMissile\DemolisherFireMissile.mdl"
// Correct:
// "Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl"
// NOTE ATTACHMENT: The attachment must be inside the aposthropy ""
// Example: "origin" , "chest", "head", "overhead", "weapon".
// NOTE RAWCODE: The rawcode must have a '' between of the raw code.\ and it contains
// four characters:
// Example: 'u001', 'A000', 'o000', 'nghf', 'N450'.
//---------------------------------------------------------------------------------
constant function I_AbilityId takes nothing returns integer
// The ability's RAW CODE. The integer ID of the ability
// Simply go to object editor --> Abilities then press ctrl + D to show
// the raw codes of the ability. Ability Name: Impact
return 'A02F'
endfunction
//---------------------------------------------------------------------------------
constant function I_VexorianDummy takes nothing returns integer
// The impact explosion dummy unit that used as for missile and using
// the model of the vexorian: dummy.mdl.
// The rawcode of the dummy unit
// Simply go to object editor --> Units then press ctrl + D to show the
// raw codes of the units. Dummy Unit Name: Impact ( Missile Dummy Unit )
return 'u000'
endfunction
//---------------------------------------------------------------------------------
constant function I_CasterSpeed takes integer lvl returns real
// The speed of the caster that goes to initialize the starting speed
// to acceleration, distance per second
return 75.00 + ( 25. * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_TargetSpeed takes integer lvl returns real
// The speed of the target that goes to initialize the starting speed
// to acceleration, distance per second
return 75.00 + ( 25. * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_TargetDamage takes integer lvl returns real
// The dealing damage of the target in every 15% chance of 0.03125 second
return 15.00 + ( 5. * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_DetectBetweenRange takes integer lvl returns real
// The detect range between the position of the caster and the
// target, this is the range between of them to impact and release
// the explosion missiles
return 50.00 + 25 * lvl
endfunction
//---------------------------------------------------------------------------------
constant function I_AccelerationSpeed takes integer lvl returns real
// The acceleration speed of the caster and the target, It means that
// this is the increament of the base speed of the caster and the
// target every 0.03125 seconds.
return 18.00 * lvl
endfunction
//---------------------------------------------------------------------------------
constant function I_OverallMoveFx takes nothing returns string
// The special effect of the caster and the target
// while moving until it impacts.
// If you want some custom effects then follow the Note MODEL_PATH at the top
return "Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl"
endfunction
//---------------------------------------------------------------------------------
constant function I_OverallMoveFxAttach takes nothing returns string
// The attachment of special effect of the caster and the target
// while moving until it impacts.
// If you want some custom effects then follow the Note ATTACHMENT at the top
return "origin"
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactFx takes nothing returns string
// The special effect of the impact
// If you want some custom effects then follow the Note MODEL_PATH at the top
return "war3mapImported\\NewDirtEXNofire.mdx"
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactRadius takes integer lvl returns real
// The radius of the impact between
return 200.00 + ( 50.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactDamage takes integer lvl returns real
// The damage of the impact to the radius or area
return 75.00 + ( 25.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactAttackType takes nothing returns attacktype
return ATTACK_TYPE_CHAOS
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactDamageType takes nothing returns damagetype
return DAMAGE_TYPE_MAGIC
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackCasterRange takes integer lvl returns real
// The max impact knockback range of the caster
return 200.00 + ( 75.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackCasterSpeed takes integer lvl returns real
// The speed of the impact knockback of the caster, distance per second
return 500.00 + ( 75.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackCasterAcceleration takes integer lvl returns real
// The acceleration of the impact knockback of the caster
return 350.00 + ( 50.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackTargetRange takes integer lvl returns real
// The max impact knockback range of the target
return 125.00 + ( 75.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackTargetRangeAcceleration takes integer lvl returns real
// The accelerating speed of range, this is manipulated in the knockback range.
return 5.00 * lvl
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackTargetSpeed takes integer lvl returns real
// The speed of the impact knockback of the target, distance per second
return 500.00 + ( 75.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackTargetAcceleration takes integer lvl returns real
// The acceleration of the impact knockback of the target
// base acceleration + acceleration per level * the level of the ability of the caster
return 350.00 + ( 50.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactKnockbackTargetDamage takes integer lvl returns real
// It will damage the target while in the impact knockbacking, this is the
// value of the damage that deals to the target every 0.03125 second
// base damage + damage per level * the level of the ability of the caster
return 75.00 + ( 25.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileAmount takes integer lvl returns integer
// The amount of the explosion missiles when the impact executed
// If you make this value in 10 above it will make
// the spell to be lag
// If the value is 0 then no explosion missiles will be created
return 1 + ( 2 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileRangeMin takes nothing returns real
// The minimum range limit of the explosion missile or it is the min boundary
return 100.00
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileRangeMax takes nothing returns real
// The maximum range limit of the explosion missile or it is the max boundary
return 600.00
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileSpeed takes integer lvl returns real
// The speed of the explosion missile, distance per second
return 300 + ( 50.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileImpactDamage takes integer lvl returns real
// The damage of the Explosion Missile when it hits a ground
return 100 + ( 25.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileImpactRadius takes integer lvl returns real
// The area or the radius of the Explosion Missile when lands to the ground
return 100 + ( 25.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileZHeight takes integer lvl returns real
// The Z Offset :max height of the explosion missile
return 275.00 + ( 25.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileAcceleration takes integer lvl returns real
// The acceleration of the explosion missile
// It must be negative values or else it will cause some errors on the spell
return -27.50 + ( -2.50 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileAttackType takes nothing returns attacktype
return ATTACK_TYPE_CHAOS
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileDamageType takes nothing returns damagetype
return DAMAGE_TYPE_MAGIC
endfunction
//---------------------------------------------------------------------------------
constant function I_TargetAttackType takes nothing returns attacktype
return ATTACK_TYPE_CHAOS
endfunction
//---------------------------------------------------------------------------------
constant function I_TargetDamageType takes nothing returns damagetype
return DAMAGE_TYPE_MAGIC
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileEndFx takes nothing returns string
// The special effect of the explosion missile when it lands or
// it hits the ground.
// If you want some custom effects then follow the Note MODEL_PATH at the top
return "Abilities\\Weapons\\DemolisherFireMissile\\DemolisherFireMissile.mdl"
endfunction
//---------------------------------------------------------------------------------
constant function I_ExplosionMissileModel takes nothing returns string
// The model of the explosion missile
// If you want some custom effects then follow the Note MODEL_PATH at the top
return "war3mapImported\\OrbOfFire.mdx"
endfunction
//---------------------------------------------------------------------------------
constant function I_LightningModel takes nothing returns string
// The model of the lightning between the caster and the target
// If you want some custom effects then follow the Note MODEL_PATH at the top
return "SPLK"
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactPickedUnitRange takes integer lvl returns real
// The max distance or the range of the knockback from the picked units
// in the radius.
return 100.00 + ( 50.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactPickedUnitSpeed takes integer lvl returns real
// The speed of the knockback from the picked units
// distance per second
return 350.00 + ( 50.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactPickedUnitAcceleration takes integer lvl returns real
// The acceleration speed of the knockback from the picked units
return 150.00 + ( 25.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_ImpactPickedUnitCollision takes integer lvl returns real
// The collision size of the knockbacked units, this is the area of the
// unit. This is the radius of the impact knockbacked unit, this is the radius
// that will destroy trees.
return 50.00 + ( 15.00 * lvl )
endfunction
//---------------------------------------------------------------------------------
constant function I_IntervalPeriodic takes nothing returns real
// This the periodic interval of the loop of the spell
// The 0.03125000 is the recommended value due to the smoothest interval
// If the spell does lag, you can increase the amount of this value like:
// 0.04, 0.05, not recommended in the higher interval of 0.05 because it
// will make the spell looks ugly looking spell.
// If you does this to 0.02 seconds it will make looks the spell ugly to so
// 0.0312500 is the recommended value.
return 0.03125000
endfunction
//---------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////END OF CONFIGURATION!!!///////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////DON'T TOUCH BELOW OF THE CODE///////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////SPELL CODE////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// Filteration of the units
function I_Filteration takes unit pick, unit t returns boolean
return not IsUnitType( pick, UNIT_TYPE_DEAD ) and GetUnitTypeId( pick ) != 0 and not IsUnitType( pick, UNIT_TYPE_STRUCTURE ) and not IsUnitType( pick, UNIT_TYPE_MAGIC_IMMUNE ) and pick != t
endfunction
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
///////////////////////// S P E L L C O R E ///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// Spell Periodic Area
////////////////////////////////////////////////////////////////////////////////////
function ImpactPeriodic takes nothing returns nothing
// Timer
local timer t = GetExpiredTimer()
// ID
local integer ID = GetHandleId( t )
// Integer for looping explosion Missile
local integer i = 0
// Used for between of the coord
local real between
// Loading the caster and the target
local unit caster = LoadUnitHandle( udg_I_H, ID, 1 )
local unit target = LoadUnitHandle( udg_I_H, ID, 2 )
// Setting the picked variable unit
local unit f
// Explosion Missile dummy unit variable
local unit explosionMissile
// Loading the level of the caster
local integer level = LoadInteger( udg_I_H, ID, 3 )
// Loading the lightning handle
local lightning lt = LoadLightningHandle( udg_I_H, ID, 4 )
local unit explosionDummy
// Coordinates of the caster
local real x = GetUnitX( caster )
local real y = GetUnitY( caster )
local real z = GetUnitFlyHeight( caster ) + 45
// Coordinates of the target
local real x2 = GetUnitX( target )
local real y2 = GetUnitY( target )
local real z2 = GetUnitFlyHeight( target ) + 45
// Angles of caster and the target
local real moveCasterAngle = Atan2( y2 - y, x2 - x )
local real moveTargetAngle = Atan2( y - y2, x - x2 )
// Coordinates between offset of their coords
local real betweenX
local real betweenY
// Acceleration speed
local real casterAcceleration = LoadReal( udg_I_H, ID, 5 ) + I_AccelerationSpeed( level )
local real targetAcceleration = LoadReal( udg_I_H, ID, 6 ) + I_AccelerationSpeed( level )
local real impactRangeAcceleration = LoadReal( udg_I_H, ID, 8 ) + I_ImpactKnockbackTargetRangeAcceleration( level )
// Saving the acceleration changed values
call SaveReal( udg_I_H, ID, 5, casterAcceleration )
call SaveReal( udg_I_H, ID, 6, targetAcceleration )
call SaveReal( udg_I_H, ID, 8, impactRangeAcceleration )
// Moving the caster and setting it's facing
call SetUnitX( caster, x + ( casterAcceleration * I_IntervalPeriodic() ) * Cos( moveCasterAngle ) )
call SetUnitY( caster, y + ( casterAcceleration * I_IntervalPeriodic() ) * Sin( moveCasterAngle ) )
call SetUnitFacing( caster, moveCasterAngle * bj_RADTODEG )
// Moving the target and setting it's facing
call SetUnitX( target, x2 + ( targetAcceleration * I_IntervalPeriodic() ) * Cos( moveTargetAngle ) )
call SetUnitY( target, y2 + ( targetAcceleration * I_IntervalPeriodic() ) * Sin( moveTargetAngle ) )
call SetUnitFacing( target, moveTargetAngle * bj_RADTODEG )
if GetRandomReal( 0.00, 100.00 ) <= 15.00 then
// Damages the target
call UnitDamageTarget( caster, target, I_TargetDamage( level ), true, false, I_TargetAttackType(), I_TargetDamageType(), null )
endif
// Moving the lightning between the caster coordinates and target coordinates
call MoveLightningEx( lt, true, x, y, z, x2, y2, z2 )
// Adding a special effect both caster and the target
call DestroyEffect( AddSpecialEffectTarget( I_OverallMoveFx(), caster, I_OverallMoveFxAttach() ) )
call DestroyEffect( AddSpecialEffectTarget( I_OverallMoveFx(), target, I_OverallMoveFxAttach() ) )
// Distance between of their coordinates from the detect range
// Q:Why just don't use IsUnitInRange native?
// A: It will make the spell fvcking ugly from the formulation.
if SquareRoot( ( x2 - x ) * ( x2 - x ) + ( y2 - y ) * ( y2 - y ) ) <= I_DetectBetweenRange( level ) then
// Between of their coord
set between = SquareRoot( ( x2 - x ) * ( x2 - x ) + ( y2 - y ) * ( y2 - y ) ) / 2
set betweenX = x + between * Cos( moveCasterAngle * bj_RADTODEG )
set betweenY = y + between * Sin( moveCasterAngle * bj_RADTODEG )
// Creates Explosion Dummy
set explosionDummy = CreateUnit( LoadPlayerHandle( udg_I_H, ID, 7 ), I_VexorianDummy(), betweenX, betweenY, 0 )
// Setting the unit's size by percentage.
call SetUnitScale( explosionDummy, ( I_ImpactRadius( level ) * .53 ) * 0.01, 0, 0 )
// Special effects between to the coord
call DestroyEffect( AddSpecialEffectTarget( I_ImpactFx(), explosionDummy, "chest" ) )
// The caster will damage the target
call UnitDamageTarget( caster, target, I_ImpactDamage( level ), true, false, I_ImpactAttackType(),I_ImpactDamageType(), null )
// Group Enumerations
call GroupEnumUnitsInRange( bj_lastCreatedGroup, betweenX, betweenY, I_ImpactRadius( level ), null )
loop
set f = FirstOfGroup( bj_lastCreatedGroup )
exitwhen f == null
// Filter Condition
if I_Filteration( f, target ) and IsUnitEnemy( f, LoadPlayerHandle( udg_I_H, ID, 7 ) ) then
// Damages the picked units into the radius
call UnitDamageTarget( caster, f, I_ImpactDamage( level ), true, false, I_ImpactAttackType(),I_ImpactDamageType(), null )
// Knockbacking picked units.
set udg_KB3D_Unit = f
set udg_KB3D_Range = I_ImpactPickedUnitRange( level )
set udg_KB3D_Speed = I_ImpactPickedUnitSpeed( level )
set udg_KB3D_Angle = Atan2( GetUnitY( f ) - betweenY, GetUnitX( f ) - betweenX ) * bj_RADTODEG
set udg_KB3D_Accel = I_ImpactPickedUnitAcceleration( level )
set udg_KB3D_AoE = I_ImpactPickedUnitCollision( level )
set udg_KB3D_AttackType = I_TargetAttackType()
set udg_KB3D_DamageType = I_TargetDamageType()
set udg_KB3D_Damager = caster
set udg_KB3D_DestroyTree = true
set udg_KB3D_Fx = I_OverallMoveFx()
set udg_KB3D_Fx_Attach = "origin"
set udg_KB3D_UnpathableStop = true
call ConditionalTriggerExecute( gg_trg_Actions_to_apply )
endif
call GroupRemoveUnit( bj_lastCreatedGroup, f )
endloop
// Impacts Caster
set udg_KB3D_Unit = caster
set udg_KB3D_Range = I_ImpactKnockbackCasterRange( level )
set udg_KB3D_Speed = I_ImpactKnockbackCasterSpeed( level )
set udg_KB3D_Angle = moveTargetAngle * bj_RADTODEG
set udg_KB3D_KBTarget = true
set udg_KB3D_Accel = I_ImpactKnockbackCasterAcceleration( level )
set udg_KB3D_DestroyTree = true
set udg_KB3D_DisableUnit = false
set udg_KB3D_Fx = I_OverallMoveFx()
set udg_KB3D_Fx_Attach = I_OverallMoveFxAttach()
call TriggerEvaluate( udg_KB3D_Registration )
// Impacts Target
set udg_KB3D_Unit = target
set udg_KB3D_Range = impactRangeAcceleration
set udg_KB3D_Speed = I_ImpactKnockbackTargetSpeed( level )
set udg_KB3D_Angle = moveCasterAngle * bj_RADTODEG
set udg_KB3D_Accel = I_ImpactKnockbackTargetAcceleration( level )
set udg_KB3D_AttackType = I_TargetAttackType()
set udg_KB3D_DamageType = I_TargetDamageType()
set udg_KB3D_DestroyTree = true
set udg_KB3D_DisableUnit = false
set udg_KB3D_LoopDamage = I_ImpactKnockbackTargetDamage( level )
set udg_KB3D_Damager = caster
set udg_KB3D_Fx = I_OverallMoveFx()
set udg_KB3D_Fx_Attach = I_OverallMoveFxAttach()
call TriggerEvaluate( udg_KB3D_Registration )
// Explosion missile stage
loop
exitwhen i >= I_ExplosionMissileAmount( level )
set explosionMissile = CreateUnit( LoadPlayerHandle( udg_I_H, ID, 7 ), I_VexorianDummy(), betweenX, betweenY, 0 )
call SetUnitScale( explosionMissile, ( I_ExplosionMissileImpactRadius( level ) * .53 ) * .01, 0, 0 )
set udg_KB3D_Unit = explosionMissile
set udg_KB3D_Range = GetRandomReal( I_ExplosionMissileRangeMin(), I_ExplosionMissileRangeMax() )
set udg_KB3D_Speed = I_ExplosionMissileSpeed( level )
set udg_KB3D_Angle = GetRandomReal( 0.00, 360.00 )
set udg_KB3D_D_STRUCTURE = true
set udg_KB3D_EndFx = I_ExplosionMissileEndFx()
set udg_KB3D_AoEEndDamage = I_ExplosionMissileImpactDamage( level )
set udg_KB3D_EndwhenDead = true
set udg_KB3D_KillatEnd = true
set udg_KB3D_Accel = I_ExplosionMissileAcceleration( level )
set udg_KB3D_AoE = I_ExplosionMissileImpactRadius( level )
set udg_KB3D_AttackType = I_ExplosionMissileAttackType()
set udg_KB3D_DamageType = I_ExplosionMissileDamageType()
set udg_KB3D_Damager = caster
set udg_KB3D_DestroyTree = true
set udg_KB3D_DisableUnit = true
set udg_KB3D_FaceAngle = true
set udg_KB3D_Fx_Attach = "origin"
set udg_KB3D_TrailFx = I_ExplosionMissileModel()
set udg_KB3D_UnpathableStop = false
set udg_KB3D_Zoffset = I_ExplosionMissileZHeight( level )
call TriggerEvaluate( udg_KB3D_Registration )
set i = i + 1
endloop
// Destroying the lightning
call DestroyLightning( lt )
// Flushing keys
call FlushChildHashtable( udg_I_H, ID )
// Pause timer
call PauseTimer( t )
// Destroy Timer
call DestroyTimer( t )
// nulling timer
set t = null
endif
// Nullify handle variables
set caster = null
set target = null
set t = null
set lt = null
endfunction
////////////////////////////////////////////////////////////////////////////////////
// Spell Execution Area
////////////////////////////////////////////////////////////////////////////////////
function ImpactExecution takes nothing returns boolean
// The variable of the caster and the target
local unit caster
local unit target
// Facing angle of the caster
local real faceAngle
// Coordinates of the caster
local real x
local real y
local real z
// Coordinates of the target
local real x2
local real y2
local real z2
// The variable for acceleration speed
local real casterAcceleration
local real targetAcceleration
local real impactRangeAcceleration
// The variable for level
local integer level
// The variable for the lightning
local lightning lt
// The variable for the caster's player
local player p
// Timer and ID
local timer t
local integer ID
// Checking ability condition
if GetSpellAbilityId() == I_AbilityId() then
// Setting values from the variable
set caster = GetTriggerUnit()
set target = GetSpellTargetUnit()
set x = GetUnitX( caster )
set y = GetUnitY( caster )
set z = GetUnitFlyHeight( caster ) + 45
set x2 = GetUnitX( target )
set y2 = GetUnitY( target )
set z2 = GetUnitFlyHeight( target ) + 45
set faceAngle = ( Atan2( y2 - y, x2 - x ) * bj_RADTODEG )
// Getting the ability level of the spell to the caster
set level = GetUnitAbilityLevel( caster, I_AbilityId() )
set casterAcceleration = I_CasterSpeed( level )
set targetAcceleration = I_TargetSpeed( level )
set impactRangeAcceleration = I_ImpactKnockbackTargetRange( level )
// Make the caster face the angle
call SetUnitFacing( caster, faceAngle )
// Creates lightning
set lt = AddLightningEx( I_LightningModel(), true, x, y, z, x2, y2, z2 )
// Creates a caster's player
set p = GetTriggerPlayer()
// Creates timer and initialize the ID Key
set t = CreateTimer()
set ID = GetHandleId( t )
// Saving some datas that needed from the callback
call SaveUnitHandle( udg_I_H, ID, 1, caster )
call SaveUnitHandle( udg_I_H, ID, 2, target )
call SaveInteger( udg_I_H, ID, 3, level )
call SaveLightningHandle( udg_I_H, ID, 4, lt )
call SaveReal( udg_I_H, ID, 5, casterAcceleration )
call SaveReal( udg_I_H, ID, 6, targetAcceleration )
call SavePlayerHandle( udg_I_H, ID, 7, p )
call SaveReal( udg_I_H, ID, 8, impactRangeAcceleration )
// Starting the tiimer
call TimerStart( t, I_IntervalPeriodic(), true, function ImpactPeriodic )
// Nulling handle variables
set caster = null
set target = null
set lt = null
endif
return false
endfunction
////////////////////////////////////////////////////////////////////////////////////
// Spell Initialization Area
////////////////////////////////////////////////////////////////////////////////////
function InitTrig_Impact_JASS takes nothing returns nothing
// Creates a new trigger
local trigger trig = CreateTrigger( )
// Initializing Hashtable in the init
set udg_I_H = InitHashtable()
// Registering the event of the spell trigger
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
// Adding Condition of the spell trigger
call TriggerAddCondition( trig, Condition( function ImpactExecution ) )
/////////////////////////////////////////////////////////////////////////////
///////////////// PRELOADING AREA, PREFER DO NOT TOUCH!!! ///////////////////
/////////////////////////////////////////////////////////////////////////////
// Preloading file paths.
call Preload( I_ExplosionMissileModel() )
call Preload( I_ExplosionMissileEndFx() )
call Preload( I_OverallMoveFx() )
call Preload( I_ImpactFx() )
// Preloading lightning
set bj_lastCreatedLightning = AddLightningEx( I_LightningModel(), true, 0, 0, 0, 0, 0, 0 )
call DestroyLightning( bj_lastCreatedLightning )
// Preloading dummy and the ability.
set bj_lastCreatedUnit = CreateUnit( Player( 15 ), I_VexorianDummy(), 0, 0, 0 )
call UnitAddAbility( bj_lastCreatedUnit, I_AbilityId() )
call UnitApplyTimedLife( bj_lastCreatedUnit, 'BTLF', 1.00 )
endfunction