Name | Type | is_array | initial_value |
Array | integer | No | |
BadAssSentinel | unit | No | |
BB_Angle | real | Yes | |
BB_Caster | unit | Yes | |
BB_Check | boolean | Yes | |
BB_Damage | real | Yes | |
BB_Distance | real | Yes | |
BB_Integers | integer | Yes | |
BB_Interval | real | Yes | |
BB_Speed | real | Yes | |
BB_Timer | real | Yes | |
bf | integer | No | |
BF_DefautInterval | integer | No | |
BF_Hero | unit | Yes | |
BF_Max | integer | No | |
BF_SpecEffect1 | effect | Yes | |
BF_SpecEffect2 | effect | Yes | |
BF_Time | integer | Yes | |
Bishop | unit | No | |
BishopMana | real | No | |
BishopManaCurrent | real | No | |
BlinkPort | unit | Yes | |
BlinkPortal | location | No | |
BlinkPortal2 | location | No | |
bp | integer | No | |
bp2 | integer | No | |
BS_Active | boolean | Yes | |
BS_Caster | unit | Yes | |
BS_CurDamageIntevall | real | Yes | |
BS_Damage | real | Yes | |
BS_DamageIntevall | real | Yes | |
BS_Distance | real | Yes | |
BS_FlyingHight | real | Yes | |
BS_Height | real | Yes | |
BS_LeakPoint | location | Yes | |
BS_Lightning | lightning | Yes | |
BS_LoopIndex | integer | Yes | |
BS_Missle | unit | Yes | |
BS_MissleX | real | No | |
BS_MissleY | real | No | |
BS_MissleZ | real | No | |
BS_SFX | effect | Yes | |
BS_Target | unit | Yes | |
BS_TargetX | real | No | |
BS_TargetY | real | No | |
BS_TargetZ | real | No | |
BS_TempReal | real | Yes | |
BS_Timer | real | Yes | |
BS_XDegree | real | Yes | |
BS_XSpeed | real | Yes | |
BS_ZDegree | real | Yes | |
BS_ZSpeed | real | Yes | |
CardTossPt | location | No | |
CardTossTemp | group | No | |
CE_AOE | real | Yes | |
CE_CasterX | real | Yes | |
CE_CasterY | real | Yes | |
CE_ChaosEntityCount | integer | Yes | |
CE_CurrentDeathTimer | real | Yes | |
CE_CurrentEffect | effect | Yes | |
CE_CurrentProjectileDelay | real | Yes | |
CE_CurrentSize | real | Yes | |
CE_CurrentZ | real | Yes | |
CE_EffectedUnits | group | No | |
CE_GrowthRate | real | Yes | |
CE_HealthDamage | real | Yes | |
CE_iLevel | integer | Yes | |
CE_LaunchZ | real | Yes | |
CE_MagnetismStrength | real | Yes | |
CE_ManaDamage | real | Yes | |
CE_MapMaxX | real | No | |
CE_MapMaxY | real | No | |
CE_MapMinX | real | No | |
CE_MapMinY | real | No | |
CE_MaxIndex | integer | No | |
CE_OriginalCaster | unit | Yes | |
CE_Portal | unit | Yes | |
CE_rLevel | real | Yes | |
CE_StageID | integer | Yes | |
CE_TargetZ | real | Yes | |
CE_TempGroup | group | No | |
CE_TempGroup2 | group | No | |
CE_UnitIndex | unit | Yes | |
CE_XVelocity | real | Yes | |
CE_YVelocity | real | Yes | |
CE_ZLocation | location | No | |
CE_ZVelocity | real | Yes | |
Centre_Unit | unit | No | |
CL_AbilityLevel | integer | Yes | |
CL_AOE | real | Yes | |
CL_Caster | unit | Yes | |
CL_Count | integer | Yes | |
CL_Damage | integer | Yes | |
CL_FirstTarget | boolean | Yes | |
CL_Group | group | Yes | |
CL_Loc | location | Yes | |
CL_Player | player | Yes | |
CL_Slashes | integer | Yes | |
CL_Special | effect | Yes | |
CL_Target | unit | Yes | |
CL_Victim | unit | Yes | |
CLAnimation | string | No | |
CLAnimationIndex | integer | No | |
CLAnimationSpeed | real | No | |
CLAttach | string | No | |
CLAttachment | string | No | |
CLDamage | real | Yes | |
CLDuration | real | No | |
CLEffect | string | No | |
CLMaxSlashes | integer | Yes | |
CLMinimumDistance | real | No | |
CLSFX | string | No | |
CLSlashInterval | integer | No | |
CLSpeed | real | No | |
CLSpellLevel | integer | Yes | |
CLTransparency | real | No | |
CombineRegion | rect | No | |
DarkPheonix | unitcode | No | |
DarkPheonix2 | unitcode | No | |
DarkPheonix3 | unitcode | No | |
DE_AOE | real | Yes | |
DE_BaseVelocity | real | Yes | |
DE_CurrentDeathTimer | real | Yes | |
DE_CurrentDuration | real | Yes | |
DE_CurrentEffect | effect | Yes | |
DE_CurrentShardDelay | real | Yes | |
DE_CurrentZ | real | Yes | |
DE_Duration | real | Yes | |
DE_GravitatedShard | group | No | |
DE_HealthDamage | real | Yes | |
DE_LastNode | integer | No | |
DE_ManaDamage | real | Yes | |
DE_MapMaxX | real | No | |
DE_MapMaxY | real | No | |
DE_MapMinX | real | No | |
DE_MapMinY | real | No | |
DE_Mass | real | Yes | |
DE_NextNode | integer | Yes | |
DE_NodeNumber | integer | No | |
DE_OriginalCaster | unit | Yes | |
DE_Portal | unit | Yes | |
DE_PortalHeight | real | Yes | |
DE_PortalX | real | Yes | |
DE_PortalY | real | Yes | |
DE_PortalZ | real | Yes | |
DE_PrevNode | integer | Yes | |
DE_Radius | real | Yes | |
DE_RecycleableNodes | integer | No | |
DE_RecycleNodes | integer | Yes | |
DE_ShardAOE | real | Yes | |
DE_ShardScale | real | Yes | |
DE_SpawnRate | real | Yes | |
DE_SpellCounter | integer | No | |
DE_StageID | integer | Yes | |
DE_TempGroup | group | No | |
DE_Unit | unit | Yes | |
DE_XVelocity | real | Yes | |
DE_YVelocity | real | Yes | |
DE_ZLoc | location | No | |
DE_ZVelocity | real | Yes | |
DeadPool | unit | No | |
Deadpoolinbetween | real | No | |
DeadPoolInteger | integer | No | |
Deadpooltarget | location | No | |
DeadPoolTemp | group | No | |
Debug | integervar | No | |
DSB_Ability_ID | abilcode | No | |
DSB_Ability_Level | integer | Yes | |
DSB_Angle | real | Yes | |
DSB_Animation_Speed | real | No | |
DSB_AoE | real | No | |
DSB_Caster | unit | Yes | |
DSB_Conditions | boolean | Yes | |
DSB_Current_Index | integervar | No | |
DSB_Damage | real | Yes | |
DSB_Damage_Group | group | No | |
DSB_Destroy_Tree | boolean | No | |
DSB_Destroyer | unit | No | |
DSB_Distance | real | No | |
DSB_Dummy | unit | Yes | |
DSB_Dummy2 | unit | Yes | |
DSB_Dummy2_Animation | string | No | |
DSB_Dummy2_BLUE | real | No | |
DSB_Dummy2_GREEN | real | No | |
DSB_Dummy2_Lifetime | real | No | |
DSB_Dummy2_RED | real | No | |
DSB_Dummy2_Transparency | real | No | |
DSB_Dummy_Type | unitcode | No | |
DSB_Dummy_Type2 | unitcode | No | |
DSB_Max_Index | integer | No | |
DSB_Owner | player | Yes | |
DSB_Shadow | boolean | No | |
DSB_Shdow | boolean | Yes | |
DSB_SoundEffect | sound | No | |
DSB_Special_Effect | string | No | |
DSB_Special_Effect_Location | string | No | |
DSB_Stage | integer | Yes | |
DSB_Start_Range | real | No | |
DSB_UnDamage_Group | group | Yes | |
E0_AoE_Base | real | No | |
E0_AoE_Increment | real | No | |
E0_AttackType | attacktype | No | |
E0_DamageAmount_Base | real | No | |
E0_DamageAmount_Increment | real | No | |
E0_DamageDelay | real | No | |
E0_DamageType | damagetype | No | |
E0_DestroyTree | boolean | No | |
E0_Dummy_Size | real | No | |
E0_Duration_Base | real | No | |
E0_Duration_Increment | real | No | |
E0_LightningType | lightningtype | No | |
E0_MaxTargets_Base | integer | No | |
E0_MaxTargets_Increment | integer | No | |
E0_ProjectileImpactZ | real | No | |
E0_ProjectileLaunchZ | real | No | |
E0_ProjectileMaximumZ | real | No | |
E0_S_Chest_Alternative | string | No | |
E0_S_Chest_Enemy | string | No | |
E0_S_Chest_Primary | string | No | |
E0_S_DamageUnit | string | No | |
E0_S_Impact | string | No | |
E0_S_Origin | string | No | |
E0_Speed_Enemy | real | No | |
E0_Travel_Time | real | No | |
E0_TreeChecker | unit | No | |
E1_Angle | real | Yes | |
E1_AoE | real | Yes | |
E1_Boom | boolean | Yes | |
E1_Caster | unit | Yes | |
E1_Current | integer | No | |
E1_Damage | real | Yes | |
E1_Dummy | unit | Yes | |
E1_Duration | real | Yes | |
E1_Index_Itself | integer | Yes | |
E1_Index_Max | integer | No | |
E1_Index_Size | integer | No | |
E1_Level | integer | Yes | |
E1_Loop | integervar | No | |
E1_MaxTarget | integer | Yes | |
E1_SFX_Chest | effect | Yes | |
E1_SFX_Origin | effect | Yes | |
E1_Speed | real | Yes | |
E1_Splash | boolean | Yes | |
E1_ZDuration | real | Yes | |
E1_ZInterval | real | Yes | |
E1_ZMaxHeight | real | Yes | |
E2_Allow | boolean | No | |
E2_Angle | real | No | |
E2_Current | integer | No | |
E2_Duration | real | Yes | |
E2_Enemy | unit | Yes | |
E2_Index_Itself | integer | Yes | |
E2_Index_Max | integer | No | |
E2_Index_Size | integer | No | |
E2_Lightning | lightning | Yes | |
E2_Loop | integervar | No | |
E2_SFX_Enemy | effect | Yes | |
E2_Source | unit | Yes | |
E2_x1 | real | No | |
E2_x2 | real | No | |
E2_y1 | real | No | |
E2_y2 | real | No | |
fi | integer | No | |
FI_Angle | real | Yes | |
FI_AnimSpeed | real | Yes | |
FI_DefaultHeight | real | No | |
FI_EffectA | string | No | |
FI_EffectB | string | No | |
FI_FallHeight | real | No | |
FI_Height | real | Yes | |
FI_Hero | unit | Yes | |
FI_Max | integer | No | |
FI_Sound | string | No | |
FI_Vp | real | Yes | |
FI_Vz | real | Yes | |
FI_z | real | Yes | |
Fly_Buff | buffcode | No | |
Fly_Current_Index | integer | No | |
g | real | No | |
ga | integer | No | |
Gambit | unit | Yes | |
GambitPlayerDebug | player | No | |
Grenade | location | No | |
GrenadeGrp | group | No | |
group | group | No | |
HC_Angle | real | No | |
HC_Aoe | real | Yes | |
HC_AoeBase | real | No | |
HC_AoePerLevel | real | No | |
HC_BlastCap | real | No | |
HC_BlastDistance | real | Yes | |
HC_BlastDistanceBase | real | No | |
HC_BlastDistanceMultiplyer | real | No | |
HC_BlastSpeed | real | No | |
HC_BurnSFX | string | No | |
HC_Caster | unit | No | |
HC_ConditionConfig | boolean | Yes | |
HC_Core | unit | Yes | |
HC_CurrentAngle | real | Yes | |
HC_CurrentBlastDistance | real | Yes | |
HC_CurrentHeight | real | Yes | |
HC_CurrentMagnetism | real | No | |
HC_CurrentSunDistance | real | Yes | |
HC_Distance | real | Yes | |
HC_DummyExpirationTimers | real | No | |
HC_DummyType | unitcode | No | |
HC_EffectScalingBlast | real | No | |
HC_EffectScalingOrbs | real | No | |
HC_EffectScalingSun | real | No | |
HC_EffectScalingWind | real | No | |
HC_EffectZBlast | real | No | |
HC_EffectZOrbs | real | No | |
HC_EffectZSun | real | No | |
HC_EffectZWind | real | No | |
HC_ExplosionAOE | real | No | |
HC_ExplosionDamage | real | Yes | |
HC_ExplosionDamageBase | real | No | |
HC_ExplosionDamagePerLevel | real | No | |
HC_ExplosionSFX | string | No | |
HC_FireOrbSFX | string | No | |
HC_FireOrbSpinSpeed | real | No | |
HC_HeightMultiplyer | real | No | |
HC_Index | integervar | No | |
HC_MagnetismCap | real | No | |
HC_MagnetismDistanceMultiplyer | real | No | |
HC_MagnetismStrength | real | Yes | |
HC_MagnetismStrengthBase | real | No | |
HC_MagnetismStrengthPerLevel | real | No | |
HC_MaxHeight | real | Yes | |
HC_MaxIndex | integer | No | |
HC_OrbCountBase | integer | No | |
HC_OrbCountPerLevel | integer | No | |
HC_OrbDistance | real | No | |
HC_OriginalCaster | unit | Yes | |
HC_OwningPlayer | player | Yes | |
HC_SecondaryIndex | integervar | No | |
HC_SpecialEffect | effect | Yes | |
HC_Spell | abilcode | No | |
HC_StageID | integer | Yes | |
HC_SunSFX | string | No | |
HC_SunSpeed | real | No | |
HC_TempGroup | group | No | |
HC_TempInteger | integer | No | |
HC_TempInteger2 | integer | No | |
HC_TempPoint | location | No | |
HC_TempPoint2 | location | No | |
HC_TempReal | real | No | |
HC_TempUnit | unit | No | |
HC_TempUnit2 | unit | No | |
HC_TempX | real | No | |
HC_TempY | real | No | |
HC_TempZ | real | No | |
HC_UnitIndex | unit | Yes | |
HC_WindCountBase | integer | No | |
HC_WindCountPerLevel | integer | No | |
HC_WindDistance | real | No | |
HC_WindSFX | string | No | |
HC_WindSpinSpeed | real | No | |
HCS_Ange | real | Yes | |
HCS_Caster | unit | Yes | |
HCS_Check | boolean | Yes | |
HCS_Damage | real | Yes | |
HCS_Distance | real | Yes | |
HCS_Integers | integer | Yes | |
HCS_Interval | real | Yes | |
HCS_Speed | real | Yes | |
HCS_Timer | real | Yes | |
HealingAngle | real | Yes | |
HealingPortalGrp | group | No | |
HealingPt | location | No | |
HeroRevivalGrp | group | No | |
InfiniteSlashesAngle | real | Yes | |
InfiniteSlashesBol1 | boolean | Yes | |
InfiniteSlashesBol2 | boolean | Yes | |
InfiniteSlashesCaster | unit | Yes | |
InfiniteSlashesCasterLoc | location | No | |
InfiniteSlashesCasterLoc2 | location | No | |
InfiniteSlashesCount1 | integer | Yes | |
InfiniteSlashesCount2 | integer | Yes | |
InfiniteSlashesDistance | real | Yes | |
InfiniteSlashesIndex | integer | No | |
InfiniteSlashesLoop | integervar | No | |
InfiniteSlashesMui | integer | No | |
InfiniteSlashesSFX | effect | Yes | |
InfiniteSlashesTarget | unit | Yes | |
InfiniteSlashesTargetLoc | location | No | |
integer | integer | No | |
Intervals | timer | No | |
Ion_Canon_Ability_Level | integer | No | |
Ion_Canon_AoE | real | No | |
Ion_Canon_Base_Damage | real | No | |
Ion_Canon_Base_Mana_Burn | real | No | |
Ion_Canon_Caster | unit | No | |
Ion_Canon_Damage_Group | group | No | |
Ion_Canon_Distance | real | No | |
Ion_Canon_Location | location | No | |
Ion_Canon_Loop_Location | location | No | |
Ion_Canon_Loop_Number | integer | No | |
Ion_Canon_Total_Damage | real | No | |
Ion_Canon_Total_Mana_Burn | real | No | |
jg | integer | No | |
JG_Duration | real | Yes | |
JG_Hero | unit | Yes | |
JG_Max | integer | No | |
kb | integer | No | |
KB_Angle | real | Yes | |
KB_Dist | real | Yes | |
KB_Max | integer | No | |
KB_MaxDist | real | Yes | |
KB_Speed | real | Yes | |
KB_Unit | unit | Yes | |
Max_Index | integer | No | |
Moved_Unit | unit | No | |
Moved_Unit_ID | handle | No | |
MUI_1 | integer | No | |
MUI_2 | integer | Yes | |
MUI_3 | integervar | No | |
MVC_PickGroup | group | No | |
MVC_Point | location | Yes | |
MVC_UnitType | unitcode | Yes | |
Oblivion_Centre_ID | handle | No | |
Oblivion_Hashtable | hashtable | No | |
ph | integer | No | |
PheonixJean | unit | No | |
PheonixJeanPt | location | No | |
pi | integer | No | |
PlayerHero | player | No | |
point | location | No | |
Point1 | location | No | |
point2 | location | No | |
Point3 | location | No | |
PortalGrp | group | No | |
PortalKill | group | No | |
PortalKill2 | group | No | |
PortalSpecial | group | No | |
PortalUnit | unitcode | No | |
PortalUnit2 | unitcode | No | |
ProxiGrp | group | No | |
ProxiHero | unit | Yes | |
Proximity | location | Yes | |
RA_Color | real | Yes | |
RA_Counter | real | Yes | |
RA_Dummy | unit | Yes | |
RA_Duration | real | Yes | |
RA_HeightInc | boolean | Yes | |
RA_Integers | integer | Yes | |
RAS_Color | real | No | |
RAS_Dummy | unit | No | |
RAS_Duration | real | No | |
RAS_HeightInc | boolean | No | |
real | real | No | |
Real | real | No | |
real2 | real | No | |
Returning_to_normal_fly_height | group | No | |
Run_check | integer | No | |
SB_Angle | real | Yes | |
SB_Caster | unit | Yes | |
SB_Check | boolean | Yes | |
SB_CountMove | real | Yes | |
SB_Damage | real | Yes | |
SB_Distance | real | Yes | |
SB_Integers | integer | Yes | |
SB_Interval | real | Yes | |
SB_Point | location | Yes | |
SB_Speed | real | Yes | |
SB_Timer | real | Yes | |
SentinelBoss | unit | No | |
Sentinelmk2 | unit | No | |
Shake | real | No | |
Skill_BattleFurrySpeed | abilcode | No | |
Skill_BattleFury | abilcode | No | |
Skill_Bonebreaker | abilcode | No | |
Skill_FeralImpact | abilcode | No | |
Skill_Tornado | abilcode | No | |
Stage1 | quest | No | |
Stage1_1 | timer | No | |
Stage1_1Window | timerdialog | No | |
Stage3_3 | timer | No | |
Stage3_3Window | timerdialog | No | |
Stage4_4 | timer | No | |
Stage4_4Spawn | timer | No | |
Stage4_4SpawnWindow | timerdialog | No | |
Stage4_4Window | timerdialog | No | |
Stage4Vict | timer | No | |
Stage4VictWindow | timerdialog | No | |
Stage4wave10 | timer | No | |
Stage4wave11 | timer | No | |
Stage4wave2 | timer | No | |
Stage4wave3 | timer | No | |
Stage4wave4 | timer | No | |
Stage4wave5 | timer | No | |
Stage4wave6 | timer | No | |
Stage4wave7 | timer | No | |
Stage4wave8 | timer | No | |
Stage4wave9 | timer | No | |
Stage5_5 | timer | No | |
Stage5_5Window | timerdialog | No | |
Stage5Victory | timer | No | |
Stage5VictoryWindow | timerdialog | No | |
Stage6_6 | timer | No | |
Stage6_6Victory | timer | No | |
Stage6_6VictoryWindow | timerdialog | No | |
Stage6_6Window | timerdialog | No | |
Stage7_7 | timer | No | |
Stage7_7Victory | timer | No | |
Stage7_7VictoryWindow | timerdialog | No | |
Stage7_7Window | timerdialog | No | |
StK_Angle | real | Yes | |
StK_Attachment | string | Yes | |
StK_Attack_Type | attacktype | No | |
StK_Caster | unit | Yes | |
StK_Caster_Point | location | No | |
StK_Condition_Config | boolean | Yes | |
StK_Current_Index | integer | No | |
StK_Damage | real | Yes | |
StK_Damage_During_Run | real | Yes | |
StK_Distance | real | Yes | |
StK_Effect_Model | string | Yes | |
StK_Final_Animation_Type | string | No | |
StK_Group | group | Yes | |
StK_Index_Container | integer | Yes | |
StK_Index_Listener | integer | No | |
StK_Index_Size | integer | No | |
StK_Level | integer | Yes | |
StK_Loop | integervar | No | |
StK_Pick_Range | real | Yes | |
StK_Picked_Unit | unit | No | |
StK_Recycle_Container | integer | Yes | |
StK_Recycle_Size | integer | No | |
StK_Run_Animation_Speed | real | No | |
StK_Run_Animation_Type | string | No | |
StK_Run_Speed | real | Yes | |
StK_SE_1 | effect | Yes | |
StK_Spell | abilcode | No | |
StK_Target | unit | Yes | |
StK_Target_Point | location | No | |
SunSpot | unit | No | |
SunSpotInteger | integer | No | |
SunSpotPos | location | No | |
SunSpotTemp | group | No | |
target | location | Yes | |
Temp | integer | No | |
Temp_Group | group | No | |
Temp_Group_2 | group | No | |
Temp_Point | location | No | |
Temp_Point_2 | location | No | |
TempDest | destructable | No | |
TempPoint | location | No | |
TempPoint2 | location | No | |
TempPoint3 | location | No | |
TempUnit | unit | No | |
Timer | timer | No | |
TimerWindowStart | timerdialog | No | |
TK_AttackType | attacktype | No | |
TK_DamageType | damagetype | No | |
TK_FlyingUnits | group | No | |
TK_FSpeed | real | Yes | |
TK_HDmgInPercIncreasement | real | No | |
TK_HDmgInPercStart | real | No | |
TK_Hero | unit | Yes | |
TK_ImpactDmgIncreasement | real | No | |
TK_ImpactDmgStart | real | No | |
TK_ImpactSFX | string | No | |
TK_Integers | integer | Yes | |
TK_Interval | real | Yes | |
TK_Level | integer | Yes | |
TK_LiftSFX | string | No | |
TK_LiftSFXTimer | real | No | |
TK_LsfxT | real | Yes | |
TK_MaxHeight | real | Yes | |
TK_MaxHeightIncreasement | real | No | |
TK_MaxHeightStart | real | No | |
TK_MinHeightIncreasement | real | No | |
TK_MinHeightStart | real | No | |
TK_Pause | boolean | No | |
TK_Speed | real | No | |
TK_SpeedVariationPerc | real | No | |
TK_SpellAoEIncreasement | real | No | |
TK_SpellAoEStart | real | No | |
TK_StartSFX | string | No | |
TK_TempPoint | location | Yes | |
TK_Unit | unit | Yes | |
TK_UnitGroup | group | No | |
tmpCasterZ | real | No | |
tmpDiffHeight | real | No | |
tmpDistance | real | No | |
tmpHeight | real | No | |
tmpSound | sound | No | |
tmpTargetZ | real | No | |
tmpTime | real | No | |
TMS_ActivateEffects | real | No | |
TMS_Angle | real | No | |
TMS_Angle2 | real | No | |
TMS_AngleAlteration | real | Yes | |
TMS_AoeDamageDissapation | real | Yes | |
TMS_ArcFactor | real | Yes | |
TMS_AttackType | attacktype | Yes | |
TMS_BonusEffects | real | Yes | |
TMS_CarrierFacing | real | Yes | |
TMS_CarrierTypesCount | integer | No | |
TMS_CarrierUnitType | unitcode | Yes | |
TMS_CurrentDistance | real | Yes | |
TMS_CurrentEffect | effect | Yes | |
TMS_CurrentHeight | real | Yes | |
TMS_CurrentTurretCount | integer | Yes | |
TMS_CurrentWeight | integer | Yes | |
TMS_DamageType | damagetype | Yes | |
TMS_DeathModel | string | Yes | |
TMS_DeathScale | real | Yes | |
TMS_DeathTimer | real | No | |
TMS_DeathTimerCurrent | real | Yes | |
TMS_DefaultLimit | integer | No | |
TMS_DummyType | unitcode | No | |
TMS_ErrorMessages | string | Yes | |
TMS_FilterMode | integer | No | |
TMS_FireCooldown | real | Yes | |
TMS_FireCooldownCurrent | real | Yes | |
TMS_HaveDeathSfx | boolean | Yes | |
TMS_HaveHoming | boolean | Yes | |
TMS_HaveImpactSfx | boolean | Yes | |
TMS_HaveInaccuracy | boolean | Yes | |
TMS_HaveLaunchSfx | boolean | Yes | |
TMS_HaveProjectileArc | boolean | Yes | |
TMS_HaveRelativeDamage | boolean | Yes | |
TMS_HaveTargettingSfx | boolean | Yes | |
TMS_HaveTrueSpeed | boolean | Yes | |
TMS_HealthDamage | real | Yes | |
TMS_HeightCorrection | real | Yes | |
TMS_HeightLet | real | No | |
TMS_ImpactModel | string | Yes | |
TMS_ImpactScale | real | Yes | |
TMS_ImpactTime | real | Yes | |
TMS_Inaccuracy | real | Yes | |
TMS_Index | integer | No | |
TMS_LaunchModel | string | Yes | |
TMS_LaunchScale | real | Yes | |
TMS_ManaDamage | real | Yes | |
TMS_MaxDistance | real | Yes | |
TMS_MaxHeight | real | Yes | |
TMS_MaxIndex | integer | No | |
TMS_MountedUnit | unit | Yes | |
TMS_MountingHeight | real | Yes | |
TMS_MountingOffset | real | Yes | |
TMS_MovementSpeed | real | Yes | |
TMS_PositionAngle | real | Yes | |
TMS_ProjectileAOE | real | Yes | |
TMS_ProjectileFuel | real | Yes | |
TMS_ProjectileModel | string | Yes | |
TMS_ProjectileScale | real | Yes | |
TMS_ProjectileSpeed | real | Yes | |
TMS_Range | real | Yes | |
TMS_SecondaryIndex | integer | No | |
TMS_SelectedTarget | unit | Yes | |
TMS_SpeedLimit | real | Yes | |
TMS_SpeedOverTimeFixed | real | Yes | |
TMS_SpeedOverTimeMultiplyer | real | Yes | |
TMS_StackedCorrection | real | Yes | |
TMS_StageID | integer | Yes | |
TMS_TargetLock | boolean | Yes | |
TMS_TargetStatus | integer | Yes | |
TMS_TargettingEffect | effect | Yes | |
TMS_TargettingMethod | integer | Yes | |
TMS_TargettingModel | string | Yes | |
TMS_TargettingScale | real | Yes | |
TMS_TargettingUnit | unit | Yes | |
TMS_TargetType | integer | Yes | |
TMS_TempBoolean | boolean | No | |
TMS_TempGroup | group | No | |
TMS_TempInteger | integer | No | |
TMS_TempInteger2 | integer | No | |
TMS_TempPlayer | player | No | |
TMS_TempPoint | location | No | |
TMS_TempPoint2 | location | No | |
TMS_TempReal | real | No | |
TMS_TempReal2 | real | No | |
TMS_TempReal3 | real | No | |
TMS_TempUnit | unit | No | |
TMS_TempUnit2 | unit | No | |
TMS_TempUnit3 | unit | No | |
TMS_TempX | real | No | |
TMS_TempX2 | real | No | |
TMS_TempY | real | No | |
TMS_TempY2 | real | No | |
TMS_Timer | timer | No | |
TMS_TimerSpeed | real | No | |
TMS_TurretInit | integer | No | |
TMS_TurretLimit | integer | Yes | |
TMS_TurretModel | string | Yes | |
TMS_TurretName | string | Yes | |
TMS_TurretNumber | integer | No | |
TMS_TurretScale | real | Yes | |
TMS_TurretType | integer | Yes | |
TMS_TurretWeight | integer | Yes | |
TMS_UnitIndex | unit | Yes | |
TMS_ZHeight | real | Yes | |
to | integer | No | |
TO_Duration | real | Yes | |
TO_Hero | unit | Yes | |
TO_Max | integer | No | |
TS | integervar | No | |
TS_Angle | real | Yes | |
TS_Damage | real | Yes | |
TS_Distance | real | Yes | |
TS_Group | group | Yes | |
TS_Height | real | Yes | |
TS_Hero | unit | Yes | |
TS_MaxDistance | real | Yes | |
TS_Off | boolean | Yes | |
TS_Parabola | real | Yes | |
TS_Point | location | Yes | |
TS_Radius | real | Yes | |
TS_Skip | integer | No | |
TS_Slams | integer | Yes | |
TS_Speed | real | Yes | |
TS_Target | unit | Yes | |
TS_Times | integer | No | |
Underworld_Status | group | No |
/////////////////////////////////////
// //
// Turret Mounting System README //
// //
/////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// If your World Editor does not create variables automatically from JASS variables //
// remember to follow the instructions in "Information" and import TMS_VariableCreator //
// and it can be deleted after importing as it serves no other function //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// The following information is to explain setting up and using your turrets and carriers //
// to allow the most desireable setup for you map. Firstly a brief explanation of what //
// carriers are in this system: //
// //
// Carriers are units which serve as centers for turrets, the turrets should be mounted on //
// them, around them or above them. Each carrier has a limit amount of turrets it can //
// have mounted at any given time, and destruction of the carrier, will automatically //
// destroy all the turrets that are associated with it. //
// //
// Setting up carrier units: //
// Carriers have only two variables necessary to run in the system: //
// the udg_TMS_CarrierUnitType vairable and udg_TMS_TurretLimit //
// //
// udg_TMS_CarrierUnitType: This variable should be set to the data value of your carrier //
//, to find the data value, press Ctrl + D //
// udg_TMS_TurretLimit: This variable should be set to the maximum number of turrets //
// you want your carrier to carry //
// //
// To register a unit you use the function "call TMS_RegisterCarrier(UnitID, TurretLimit) //
// the first value is for the unit type, the second is for the turret limit that you will be //
// using for this specific carrier unit, everything else is doen for you //
// //
// This ends the section on carriers //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Setting up turrets: //
// This section covers creating a turret with the specific features that you wish it to have //
// //
// Setting Turret name: //
// set udg_TMS_TurretName[udg_TMS_TurretInit] = "Input turret name" //
// //
// This should be unique to every turret, it can be used to find the turret using the //
// TMS_GetTurretByName function, to allow you to find the turret when you don't know the //
// registry number assigned to it, if you want to assign players to it (i.e. have one for //
// each player so they can be upgraded seperately) it's recommended you add a player number //
// to the end of it through a variable or another function i.e. "GetOwningPlayer(unit)" //
// so you'd have the name set as "MyTurretName" + GetOwningPlayer(unit) or something similar //
// to give greater use the system, and allowing players to seperately upgrade //
// //
// Setting up Models: //
// set udg_TMS_TurretModel[udg_TMS_TurretInit] = "Input turret model" //
// set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Input projectile model" //
// set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Input launch effect model" //
// set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Input impact effect model" //
// set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Input death effect model" //
// set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model" //
// //
// to input a model, go into the object editor and select a unit (one you can quickly change //
// back to default, and change it's model to the desired model for each feature of the //
// turret, press enter twice and then copy the model path, go into your trigger, highlight //
// the text, and paste the filepath,next make sure each "\" is a "\\" or it will not work //
// by default, model paths will use a single "\", so in almost all cases, you will need to //
// change them you do not need the extra "\"s if you're using the GUI version of setting up //
// //
// Setting Model scales: //
// set udg_TMS_TurretScale[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_DeathScale[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 0.00 //
// //
// Each real is a value of 100% where 1.00 == 1% of the models normal size, set these to //
// your desired sizes, (20% - 40% tends to work pretty well) //
// //
// Setting Turret features: //
// set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = false //
// set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = false //
// set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00 //
// //
// The first three booleans determine whether or not those sfx's are displayed on the turret //
// if they are set to false, then there is no need to set a modelpath for the corresponding //
// feature. //
// HaveHoming: Determines if your missile homes in on the target (ignores accuracy modifers) //
// HaveRelativeDamage: Determines if units further away from the center of the projectile //
// impact, take a reduced amount of damage //
// HaveInaccuracy: Determines if projectiles stay off course slightly or not //
// HaveProjectileArc: Determines if projectiles go directly to their target, or arc to them //
// HaveTrueSpeed: Determines if a projectile has a fixed speed, or a relative speed based //
// on how far it has to travel to reach the target //
// BonusEffects: Determines if the ProjectileEffects function runs upon projectile //
// impact, setting to a value to higher than 0.00 by default, read the bottom for more info //
// //
// Setting Real values: //
// set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_Range[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_SpeedOverTimeMultipler[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 0.00 //
// set udg_TMS_TurretWeight[udg_TMS_TurretIniit] = 0 //
// //
// MountingHeight: How heigh the turret is placed (added on to carrier fly height) //
// MountingOffset: How far from the carrier the turret is placed //
// ProjectileAOE: Area of effect (damage) the projectile has //
// AoeDamageDissapation: (Requires HaveRelativeDamage) determines rate of damage loss //
// Inaccuracy: (Requires HaveInaccuracy) determines how inaccurate a projectile is //
// ArcFactor: (Requires HaveProjectileArc) determines the ratio of distance to Arc height //
// Range: Determines how far the turret can search for a target/can fire //
// ProjectileSpeed: (Requires HaveTrueSpeed = true) sets how fast the projectile travels //
// SpeedOverTimeMultipler: Exponentially changes the speed of your missile (1 is normal) //
// SpeedOverTimeFixed: Adds this value to your projectile speed each cycle //
// SpeedLimit: Projectiles with changing speed, will not be able to supass this number //
// ImpactTime: (Requires HaveTrueSpeed = false) how fast a projectile hits it's target //
// HealthDamage: Determines damage done to health upon impact with projectile //
// ManaDamage: Determines damage done to mana upon impact with projectile //
// FireCooldown: Determines the firing rate of the turret //
// TurretWeight: Determines how many turret slots it uses (1 is standard) //
// //
// Every time based variable (i.e. FireCooldown) is in seconds //
// //
// Setting Targetting information: //
// set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 0 //
// set udg_TMS_TargetType[udg_TMS_TurretInit] = 0 //
// set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 0 //
// set udg_TMS_TargetLock[udg_TMS_TurretInit] = false //
// //
// TargettingMethod: //
// 1 - Target Enemy with highest max health //
// 2 - Target Enemy with highest current health //
// 3 - Target Enemy with lowest max health //
// 4 - Target Enemy with lowest current health //
// 5 - Target Enemy with highest max mana //
// 6 - Target Enemy with highest current mana //
// 7 - Target Enemy with lowest max mana //
// 8 - Target Enemy with lowest current mana //
// 9 - Target closest Enemy //
// 10 - Target furthest away Enemy //
// 11 - Manual Targetting (Target must be selected by a trigger function elsewhere) //
// //
// TargetType: //
// 1 - Target is an Enemy //
// 2 - Target is an Enemy Hero //
// 3 - Target is a Normal Unit //
// //
// TargetStatus: //
// 1 - will mean your turret will only attack/target flyers //
// 2 - will mean your turret will only attack/target ground units //
// 3 - will mean your turret will attack/target both ground and flying units //
// 4 - will mean your turret will only attack/target ground units and structures //
// 5 - will mean your turret will only attack/target flyers and structures //
// 6 - will mean your turret will attack only structures //
// 7 - will mean your turret will attack/target ground units, flyers and structures //
// //
// TargetLock: //
// True - Will target one unit, and constantly attack it until it dies or leaves range //
// False - Will constantly retarget to attack the target most fitting to its targetting AI //
// //
// When you have set all these variables to what you want in a trigger, use the function //
// call TMS_RegisterTurret(0) //
// It will take the data you have set above the function, and create a turret with it //
// allowing you to then use the turret for your carriers //
// //
// This concludes the guide on setting up your turret, if anything remains unclear, playing //
// with the configurables will soon explain what each one does //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Attack and Damage Type: //
// set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL //
// set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL //
// //
// Setting these types will change resistances of your targets, MAGIC damage will not hurt //
// magic immune targets, and as such, turrets with that damage type, will not target them //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Adding a turret to a carrier: //
// call TMS_AddTurret(Unit, TurretNumber, TurretAmount) //
// //
// Calling this function will add TurretAmount turrets of type TurretNumber, to Unit //
// E.g. call TMS_AddTurret(u, 1, 3) //
// The above example will add 3 turrets of type 1 to unit u //
// //
// If you add more turrets than a unit has room for, you will recieve an error message for //
// every extra turret that you tried to add //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Removing a turret from a carrier //
// call TMS_DestroyTurrets(Unit, TurretNumber, TurretAmount) //
// //
// The same deal with this function, TurretAmount turrets of TurretNumber removed from unit //
// E.g. call TMS_DestroyTurrets(u, 1, 3) //
// The above example will remove 3 turrets of type 1 from unit u //
// //
// If you remove more turrets from a unit than it has, then it will remove all the ones of //
// that type that it is carrying //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Updating a turret //
// //
// Some of you may have noticed that earlier in the "Creating a turret" section that the //
// function at the end (TMS_RegisterTurret) was passed a 0 this is because the system also //
// supports turret updating, allowing you to change already existing turrets, to a new form //
// you do this by passing the number of the turret you want to update to the function //
// so if you want to update turret 1, pass a 1 to the function like so: //
// call TMS_RegisterTurret(1) //
// //
// However, some maps will not know which order the turrets were necessarily registered in //
// (say, a player had to "Buy" them in the map to unlock them, and then they bought an //
// upgrade) well, the system also comes with the handy function of TMS_GetTurretByName //
// the function will need to be passed the name of your turret, and it will automatically //
// find the turret for you in the system, and return the number of the turret, which makes //
// it much easier to update turrets when you don't necessarily know their position //
// //
// Example: //
// call TMS_RegisterTurret(TMS_GetTurretByName("MyTurret")) //
// //
// Slightly more costly on your processor to run the extra functions, but makes things much //
// easier, but lets say you want an upgrade to only happen for one person? //
// well, the easiest way to go about this, is to - when you register a turret, to append //
// a player number to the end, i.e. "MyTurret1" for player 1 and such, well by utilising //
// the TMS_GetTurretByName function, this is also relatively easy to do by using a //
// combinations of strings, you can do this by setting a variable to the player number //
// or, if you know what you're doing with them, use a function to get the player number //
// within the function call //
// //
// Examples: //
// call TMS_RegisterTurret(TMS_GetTurretByName("MyTurret" + udg_TMS_TempPlayer)) //
// call TMS_RegiserTurret(TMS_GetTurretByName("MyTurret" + GetOwningPlayer(Unit))) //
// //
// Using the update fuction cal also help you recycle turrets, though, it'd require a bit of //
// programming knowledge, you could set a variable to the "Next turret" to be recyled's name //
// and then when registering the new turret to replace the old one, you can again use the //
// TMS_GetTurretByName function, to replace it, though, this is not recommended to do, if //
// any of those turrets which are to be replaced, are currently in use, as they will change //
// automatically, to match the new turret, hence it's primary design, is for updating //
// turrets, into upgraded forms //
// //
// If no turret is found by TMS_GetTurretByName it returns 0 (TMS_RegisterTurret will create //
// a new turret in this case) //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Functions List: //
// call TMS_RegisterCarrier(UnitID, TurretLimit) //
// call TMS_RegisterTurret() //
// call TMS_AddTurret(Unit, TurretType, Amount) //
// call TMS_DestroyTurrets(Unit, TurretType, Amount) //
// call TMS_GetTurretByName(Name) //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Bonus effects: //
// //
// This variable is used to allow building off from the system when your projectile lands //
// to give additional effects to them, allowing more interesting and advanced projectiles //
// to use, in your turret setup set udg_TMS_BonusEffects[udg_TMS_TurretInit] = (number //
// which is higher than 0) remember this number, then you can either write your own JASS //
// functions, or GUI trigger, using the event "Game - udg_TMS_ActivateEffects becomes //
// (your number)" when a projectile lands, ActivateEffectes becomes the same as the number //
// you chose, so doing this will cause those effects to run when the projectile lands //
// //
// Additional Information: //
// //
// udg_TMS_TempX and udg_TMS_TempY will already be set to the co-ordinates of the impact //
// udg_TMS_TurretType will already be set to the TurretType associated with the projectile //
// These variables can help you make your function/trigger more efficient and easier to //
// write on your part, so don't be shy to use them when you feel the need to //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// En masse: //
// //
// This system is NOT designed for large amounts of units all mounting turrets in it's //
// current form (with the AI and most things trigger controlled) if you are intending //
// to use it for many units then there are a few changes that can be made to keep this //
// from slowing down your computer, though you will lose quite a large amount of the //
// functionality, while maintaining the concept (turrets mounted on other units //
// firstly: you can delete all of the code in the system marked with //*+ to //*- //
// read through the script and delete all code which appears between these markers* //
// secondly, you will need to modify the TMS_CreateTurrets() function to create different //
// unit types other than dummies (all turret registering data can be deleted other than the //
// ID and you will need to add your own variable to note the unit to be attached) //
// basically, all trigger functions except keeping the turrets mounted will become object //
// data //
// //
// This section is only suggested to those with triggering knowledge to be able to carry it //
// out correctly. //
// //
// *Some may be necessary - it's hard to tell due to the length but I'm pretty certain that //
// which is marked it fine to delete - just keep a reference of the original incase I'm //
// wrong about that //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////
// //
// Thank you for reading the //
// TurretSystem Readme //
// //
/////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Turret Mounting System V1.10 //
// Author: Tank-Commander //
// Requirements: Dummy.mdl //
// //
// Purpose: Allow players to mount turrets onto their normal units to make bosses and such //
// //
// Comments: - Credits must be given if you use this system in your map //
// - Read the readme section on how to set up your own turrets and carriers //
// - Use the function TMS_AddTurret (Unit, TurretNumber, TurretCount) //
// - Functions explained in the Readme //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////
// //
// Configuration //
// //
/////////////////////
function InitTrig_TMS_TurretMountingSystem takes nothing returns nothing
//Error messages for the system
set udg_TMS_ErrorMessages[0] = "This unit cannot have turrets mounted"
set udg_TMS_ErrorMessages[1] = "Turret limit reached"
set udg_TMS_ErrorMessages[2] = "You need to specify the number of turrets to mount"
set udg_TMS_ErrorMessages[3] = "You need to specify the turret type number"
//Determines the default limit for units not registered in the Carrier Units setup
set udg_TMS_DefaultLimit = 0
// Determines the how long death effects play for before the unit is removed
set udg_TMS_DeathTimer = 1.00
// Determines the dummy used for the turrets
set udg_TMS_DummyType = 'u00D'
// Determines the height proximity a projectile can have, to it's target to make contact with it
set udg_TMS_HeightLet = 75
// --------
// Determines the Speed of the loop trigger
set udg_TMS_TimerSpeed = 0.031250000
endfunction
////////////////////////////
// //
// End of configuration //
// //
////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Below is the script to run the system, unless you want to make a modification to how //
// the system works, it's highly recommended that you do not bother scrolling further //
// - Tank-Commander //
// //
/////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function which can be used to locate a turret in the registry, based on the name of the //
// turret you have used, names should be unique to every turret in the registry, like the //
// number, returns the number in the registry //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_GetTurretByName takes string Name returns integer
set udg_TMS_Index = 1
loop
exitwhen udg_TMS_Index > udg_TMS_TurretNumber
if (udg_TMS_TurretName[udg_TMS_Index] == Name) then
return udg_TMS_Index
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
return 0
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function which updates pre-existing turrets, when a change is made to that turret in the //
// registry, specifically, this is for updating the turret model, and size //
/////////////////////////////////////////////////////////////////////////////////////////////////
//*+
function TMS_UpdateTurrets takes integer UpdatedTurretType returns nothing
set udg_TMS_Index = 1
loop
exitwhen udg_TMS_Index > udg_TMS_MaxIndex
if (udg_TMS_TurretType[udg_TMS_Index] == UpdatedTurretType) and (udg_TMS_StageID[udg_TMS_Index] == 2)then
call DestroyEffect(udg_TMS_CurrentEffect[udg_TMS_Index])
set udg_TMS_CurrentEffect[udg_TMS_Index] = AddSpecialEffectTarget(udg_TMS_TurretModel[UpdatedTurretType], udg_TMS_UnitIndex[udg_TMS_Index], "origin")
call SetUnitScale(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_TurretScale[UpdatedTurretType] * 0.01, 0.00, 0.00)
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
endfunction
//*-
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function ussed for registering Turrets into the system //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_RegisterTurret takes integer RegisterNumber returns nothing
if (RegisterNumber == 0) then
set udg_TMS_TurretNumber = ( udg_TMS_TurretNumber + 1 )
set udg_TMS_TempInteger = udg_TMS_TurretNumber
else
set udg_TMS_TempInteger = RegisterNumber
endif
set udg_TMS_TurretName[udg_TMS_TempInteger] = udg_TMS_TurretName[udg_TMS_TurretInit]
//*+
set udg_TMS_TurretModel[udg_TMS_TempInteger] = udg_TMS_TurretModel[udg_TMS_TurretInit]
set udg_TMS_ProjectileModel[udg_TMS_TempInteger] = udg_TMS_ProjectileModel[udg_TMS_TurretInit]
set udg_TMS_LaunchModel[udg_TMS_TempInteger] = udg_TMS_LaunchModel[udg_TMS_TurretInit]
set udg_TMS_ImpactModel[udg_TMS_TempInteger] = udg_TMS_ImpactModel[udg_TMS_TurretInit]
set udg_TMS_DeathModel[udg_TMS_TempInteger] = udg_TMS_DeathModel[udg_TMS_TurretInit]
set udg_TMS_TargettingModel[udg_TMS_TempInteger] = udg_TMS_TargettingModel[udg_TMS_TurretInit]
set udg_TMS_TurretScale[udg_TMS_TempInteger] = udg_TMS_TurretScale[udg_TMS_TurretInit]
set udg_TMS_ProjectileScale[udg_TMS_TempInteger] = udg_TMS_ProjectileScale[udg_TMS_TurretInit]
set udg_TMS_LaunchScale[udg_TMS_TempInteger] = udg_TMS_LaunchScale[udg_TMS_TurretInit]
set udg_TMS_ImpactScale[udg_TMS_TempInteger] = udg_TMS_ImpactScale[udg_TMS_TurretInit]
set udg_TMS_DeathScale[udg_TMS_TempInteger] = udg_TMS_DeathScale[udg_TMS_TurretInit]
set udg_TMS_TargettingScale[udg_TMS_TempInteger] = udg_TMS_TargettingScale[udg_TMS_TurretInit]
set udg_TMS_HaveLaunchSfx[udg_TMS_TempInteger] = udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit]
set udg_TMS_HaveImpactSfx[udg_TMS_TempInteger] = udg_TMS_HaveImpactSfx[udg_TMS_TurretInit]
set udg_TMS_HaveDeathSfx[udg_TMS_TempInteger] = udg_TMS_HaveDeathSfx[udg_TMS_TurretInit]
set udg_TMS_HaveTargettingSfx[udg_TMS_TempInteger] = udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit]
set udg_TMS_HaveHoming[udg_TMS_TempInteger] = udg_TMS_HaveHoming[udg_TMS_TurretInit]
set udg_TMS_HaveRelativeDamage[udg_TMS_TempInteger] = udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit]
set udg_TMS_HaveInaccuracy[udg_TMS_TempInteger] = udg_TMS_HaveInaccuracy[udg_TMS_TurretInit]
set udg_TMS_HaveProjectileArc[udg_TMS_TempInteger] = udg_TMS_HaveProjectileArc[udg_TMS_TurretInit]
set udg_TMS_HaveTrueSpeed[udg_TMS_TempInteger] = udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit]
set udg_TMS_BonusEffects[udg_TMS_TempInteger] = udg_TMS_BonusEffects[udg_TMS_TurretInit]
set udg_TMS_MountingHeight[udg_TMS_TempInteger] = udg_TMS_MountingHeight[udg_TMS_TurretInit]
set udg_TMS_MountingOffset[udg_TMS_TempInteger] = udg_TMS_MountingOffset[udg_TMS_TurretInit]
set udg_TMS_ProjectileAOE[udg_TMS_TempInteger] = udg_TMS_ProjectileAOE[udg_TMS_TurretInit]
set udg_TMS_AoeDamageDissapation[udg_TMS_TempInteger] = udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit]
set udg_TMS_Inaccuracy[udg_TMS_TempInteger] = udg_TMS_Inaccuracy[udg_TMS_TurretInit]
set udg_TMS_ArcFactor[udg_TMS_TempInteger] = udg_TMS_ArcFactor[udg_TMS_TurretInit]
set udg_TMS_Range[udg_TMS_TempInteger] = udg_TMS_Range[udg_TMS_TurretInit]
set udg_TMS_ProjectileSpeed[udg_TMS_TempInteger] = udg_TMS_ProjectileSpeed[udg_TMS_TurretInit]
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TempInteger] = udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit]
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TempInteger] = udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit]
set udg_TMS_SpeedLimit[udg_TMS_TempInteger] = udg_TMS_SpeedLimit[udg_TMS_TurretInit]
set udg_TMS_ProjectileFuel[udg_TMS_TempInteger] = udg_TMS_ProjectileFuel[udg_TMS_TurretInit]
set udg_TMS_ImpactTime[udg_TMS_TempInteger] = udg_TMS_ImpactTime[udg_TMS_TurretInit]
set udg_TMS_HealthDamage[udg_TMS_TempInteger] = udg_TMS_HealthDamage[udg_TMS_TurretInit]
set udg_TMS_ManaDamage[udg_TMS_TempInteger] = udg_TMS_ManaDamage[udg_TMS_TurretInit]
set udg_TMS_FireCooldown[udg_TMS_TempInteger] = udg_TMS_FireCooldown[udg_TMS_TurretInit]
//*-
set udg_TMS_TurretWeight[udg_TMS_TempInteger] = udg_TMS_TurretWeight[udg_TMS_TurretInit]
//*+
set udg_TMS_TargettingMethod[udg_TMS_TempInteger] = udg_TMS_TargettingMethod[udg_TMS_TurretInit]
set udg_TMS_TargetType[udg_TMS_TempInteger] = udg_TMS_TargetType[udg_TMS_TurretInit]
set udg_TMS_TargetStatus[udg_TMS_TempInteger] = udg_TMS_TargetStatus[udg_TMS_TurretInit]
set udg_TMS_TargetLock[udg_TMS_TempInteger] = udg_TMS_TargetLock[udg_TMS_TurretInit]
set udg_TMS_AttackType[udg_TMS_TempInteger] = udg_TMS_AttackType[udg_TMS_TurretInit]
set udg_TMS_DamageType[udg_TMS_TempInteger] = udg_TMS_DamageType[udg_TMS_TurretInit]
call TMS_UpdateTurrets(udg_TMS_TempInteger)
//*-
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function ussed for registering Carriers into the system //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_RegisterCarrier takes integer UnitID, integer CarryNumber returns nothing
set udg_TMS_TempInteger = -1
set udg_TMS_Index = 1
loop
exitwhen udg_TMS_Index > udg_TMS_CarrierTypesCount or udg_TMS_TempInteger != -1
if (UnitID == udg_TMS_CarrierUnitType[udg_TMS_Index]) then
set udg_TMS_TempInteger = udg_TMS_Index
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
if (udg_TMS_TempInteger == -1) then
set udg_TMS_CarrierTypesCount = udg_TMS_CarrierTypesCount + 1
set udg_TMS_TempInteger = udg_TMS_CarrierTypesCount
endif
set udg_TMS_CarrierUnitType[udg_TMS_TempInteger] = UnitID
set udg_TMS_TurretLimit[udg_TMS_TempInteger] = CarryNumber
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function used for managing the data filtered by TMS_TargetFilers //
/////////////////////////////////////////////////////////////////////////////////////////////////
//*+
function TMS_FilterData takes unit u returns nothing
set udg_TMS_TempReal2 = udg_TMS_TempReal
set udg_TMS_TempUnit3 = u
set u = null
endfunction
//*-
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function used for identifying targets for turrets, and those who take damage from the //
// impact from a projectile of those turrets, also tells turrets when they need to retarget //
// upon the death of those targets. //
/////////////////////////////////////////////////////////////////////////////////////////////////
//*+
function TMS_TargetFilter takes unit u returns nothing
set udg_TMS_TempPlayer = GetOwningPlayer(udg_TMS_MountedUnit[udg_TMS_Index])
if (IsUnitEnemy(u, udg_TMS_TempPlayer)) and (GetUnitState(u, UNIT_STATE_LIFE) > 0) then
if(udg_TMS_TargetType[udg_TMS_TurretType[udg_TMS_Index]] == 2 and not IsUnitType(u, UNIT_TYPE_HERO)) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
elseif (udg_TMS_TargetType[udg_TMS_TurretType[udg_TMS_Index]] == 3 and IsUnitType(u, UNIT_TYPE_HERO)) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
if ((udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 1) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 5) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 6)) and (IsUnitType(u, UNIT_TYPE_GROUND)) then
if ((udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 5) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 6)) and (not IsUnitType(u, UNIT_TYPE_STRUCTURE)) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
endif
if (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 2) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 4) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 6) and (IsUnitType(u, UNIT_TYPE_FLYING)) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
if (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 1) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 2) or (udg_TMS_TargetStatus[udg_TMS_TurretType[udg_TMS_Index]] == 3) and (IsUnitType(u, UNIT_TYPE_STRUCTURE)) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
if (udg_TMS_DamageType[udg_TMS_TurretType[udg_TMS_Index]] == DAMAGE_TYPE_MAGIC) and (IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
if (IsUnitInGroup(u, udg_TMS_TempGroup)) then
if (udg_TMS_FilterMode == 2) then
if (udg_TMS_HaveRelativeDamage[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_TempX = GetUnitX(udg_TMS_UnitIndex[udg_TMS_Index])
set udg_TMS_TempY = GetUnitY(udg_TMS_UnitIndex[udg_TMS_Index])
set udg_TMS_TempX2 = GetUnitX(u)
set udg_TMS_TempY2 = GetUnitY(u)
set udg_TMS_TempReal = SquareRoot(((udg_TMS_TempX2 - udg_TMS_TempX) * (udg_TMS_TempX2 - udg_TMS_TempX)) + ((udg_TMS_TempY2 - udg_TMS_TempY) * (udg_TMS_TempY2 - udg_TMS_TempY)))
set udg_TMS_TempReal = udg_TMS_TempReal / udg_TMS_AoeDamageDissapation[udg_TMS_TurretType[udg_TMS_Index]]
if (udg_TMS_TempReal < 1.00) then
set udg_TMS_TempReal = 1.00
endif
set udg_TMS_TempReal2 = udg_TMS_ManaDamage[udg_TMS_TurretType[udg_TMS_Index]] / udg_TMS_TempReal
set udg_TMS_TempReal3 = udg_TMS_HealthDamage[udg_TMS_TurretType[udg_TMS_Index]] / udg_TMS_TempReal
else
set udg_TMS_TempReal2 = udg_TMS_ManaDamage[udg_TMS_TurretType[udg_TMS_Index]]
set udg_TMS_TempReal3 = udg_TMS_HealthDamage[udg_TMS_TurretType[udg_TMS_Index]]
endif
call UnitDamageTarget(udg_TMS_MountedUnit[udg_TMS_Index], u, udg_TMS_TempReal3, true, false, udg_TMS_AttackType[udg_TMS_TurretType[udg_TMS_Index]], udg_TMS_DamageType[udg_TMS_TurretType[udg_TMS_Index]], null)
call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u, UNIT_STATE_MANA) - udg_TMS_TempReal2)
if (IsUnitType(u, UNIT_TYPE_DEAD)) and ((GetUnitTypeId(u) != 0)) then
set udg_TMS_SecondaryIndex = 1
loop
exitwhen udg_TMS_SecondaryIndex > udg_TMS_MaxIndex
if(u == udg_TMS_SelectedTarget[udg_TMS_SecondaryIndex]) then
set udg_TMS_SelectedTarget[udg_TMS_SecondaryIndex] = null
endif
set udg_TMS_SecondaryIndex = udg_TMS_SecondaryIndex + 1
endloop
endif
else
if (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 1) then
set udg_TMS_TempReal = GetUnitState(u, UNIT_STATE_MAX_LIFE)
if (udg_TMS_TempReal <= udg_TMS_TempReal2) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
else
call TMS_FilterData(u)
endif
elseif(udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 2) then
set udg_TMS_TempReal = GetWidgetLife(u)
if (udg_TMS_TempReal <= udg_TMS_TempReal2) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
else
call TMS_FilterData(u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 3) then
set udg_TMS_TempReal = GetUnitState(u, UNIT_STATE_MAX_LIFE)
if (udg_TMS_TempReal < udg_TMS_TempReal2) or (udg_TMS_TempReal2 == -1.00) then
call TMS_FilterData(u)
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 4) then
set udg_TMS_TempReal = GetWidgetLife(u)
if (udg_TMS_TempReal < udg_TMS_TempReal2) or (udg_TMS_TempReal2 == -1.00) then
call TMS_FilterData(u)
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 5) then
set udg_TMS_TempReal = GetUnitState(u, UNIT_STATE_MAX_MANA)
if (udg_TMS_TempReal <= udg_TMS_TempReal2) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
else
call TMS_FilterData(u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 6) then
set udg_TMS_TempReal = GetUnitState(u, UNIT_STATE_MANA)
if (udg_TMS_TempReal <= udg_TMS_TempReal2) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
else
call TMS_FilterData(u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 7) then
set udg_TMS_TempReal = GetUnitState(u, UNIT_STATE_MAX_MANA)
if (udg_TMS_TempReal < udg_TMS_TempReal2) or (udg_TMS_TempReal2 == -1.00) then
call TMS_FilterData(u)
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 8) then
set udg_TMS_TempReal = GetUnitState(u, UNIT_STATE_MANA)
if (udg_TMS_TempReal < udg_TMS_TempReal2) or (udg_TMS_TempReal2 == -1.00) then
call TMS_FilterData(u)
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 9) then
set udg_TMS_TempX = GetUnitX(udg_TMS_MountedUnit[udg_TMS_Index])
set udg_TMS_TempY = GetUnitY(udg_TMS_MountedUnit[udg_TMS_Index])
set udg_TMS_TempX2 = GetUnitX(u)
set udg_TMS_TempY2 = GetUnitY(u)
set udg_TMS_TempReal = ((udg_TMS_TempX2 - udg_TMS_TempX) * (udg_TMS_TempX2 - udg_TMS_TempX)) + ((udg_TMS_TempY2 - udg_TMS_TempY) * (udg_TMS_TempY2 - udg_TMS_TempY))
if (udg_TMS_TempReal < udg_TMS_TempReal2) or (udg_TMS_TempReal2 == -1.00) then
call TMS_FilterData(u)
else
call GroupRemoveUnit(udg_TMS_TempGroup, u)
endif
elseif (udg_TMS_TargettingMethod[udg_TMS_TurretType[udg_TMS_Index]] == 10) then
set udg_TMS_TempX = GetUnitX(udg_TMS_MountedUnit[udg_TMS_Index])
set udg_TMS_TempY = GetUnitY(udg_TMS_MountedUnit[udg_TMS_Index])
set udg_TMS_TempX2 = GetUnitX(u)
set udg_TMS_TempY2 = GetUnitY(u)
set udg_TMS_TempReal = ((udg_TMS_TempX2 - udg_TMS_TempX) * (udg_TMS_TempX2 - udg_TMS_TempX)) + ((udg_TMS_TempY2 - udg_TMS_TempY) * (udg_TMS_TempY2 - udg_TMS_TempY))
if (udg_TMS_TempReal <= udg_TMS_TempReal2) then
call GroupRemoveUnit(udg_TMS_TempGroup, u)
else
call TMS_FilterData(u)
endif
endif
endif
endif
set u = null
endfunction
//*-
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function used to retarget the turrets attached to a carrier, calls the TargetFilter //
// function to identify valid targets for that specific turret type //
/////////////////////////////////////////////////////////////////////////////////////////////////
//*+
function TMS_FindTarget takes integer TurretNumber returns unit
set udg_TMS_TempReal2 = -1.00
set udg_TMS_FilterMode = 1
set udg_TMS_TempUnit2 = null
set udg_TMS_TempUnit3 = null
call GroupEnumUnitsInRange(udg_TMS_TempGroup, udg_TMS_TempX, udg_TMS_TempY, udg_TMS_Range[TurretNumber], null)
loop
set udg_TMS_TempUnit2 = FirstOfGroup(udg_TMS_TempGroup)
exitwhen udg_TMS_TempUnit2 == null
call TMS_TargetFilter(udg_TMS_TempUnit2)
call GroupRemoveUnit(udg_TMS_TempGroup, udg_TMS_TempUnit2)
endloop
return udg_TMS_TempUnit3
endfunction
//*-
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function that controls the creation of new projectiles, sets their trajectory and speeds //
// depending on the configuration set up by the user, does not call any other functions //
/////////////////////////////////////////////////////////////////////////////////////////////////
//*+
function TMS_FireProjectile takes unit Turret, unit Target returns nothing
local real X = GetUnitX(Turret)
local real X2 = GetUnitX(Target)
local real Y = GetUnitY(Turret)
local real Y2 = GetUnitY(Target)
local real dx
local real dy
if (udg_TMS_HaveInaccuracy[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_Angle = GetRandomReal(-bj_PI, bj_PI)
set X2 = X2 + GetRandomReal(-bj_PI, udg_TMS_Inaccuracy[udg_TMS_TurretType[udg_TMS_Index]]) * Cos(udg_TMS_Angle)
set Y2 = Y2 + GetRandomReal(-bj_PI, udg_TMS_Inaccuracy[udg_TMS_TurretType[udg_TMS_Index]]) * Sin(udg_TMS_Angle)
endif
set dx = X2 - X
set dy = Y2 - Y
set udg_TMS_Angle = Atan2(dy, dx)
set udg_TMS_MaxIndex = udg_TMS_MaxIndex + 1
set udg_TMS_TurretType[udg_TMS_MaxIndex] = udg_TMS_TurretType[udg_TMS_Index]
set udg_TMS_MaxDistance[udg_TMS_MaxIndex] = SquareRoot(dx * dx + dy * dy)
set udg_TMS_MaxHeight[udg_TMS_MaxIndex] = udg_TMS_MaxDistance[udg_TMS_MaxIndex] * udg_TMS_ArcFactor[udg_TMS_TurretType[udg_TMS_MaxIndex]]
set udg_TMS_CurrentDistance[udg_TMS_MaxIndex] = 0.00
set udg_TMS_StackedCorrection[udg_TMS_MaxIndex] = 0.00
set udg_TMS_CurrentHeight[udg_TMS_MaxIndex] = udg_TMS_ZHeight[udg_TMS_Index]
set udg_TMS_SelectedTarget[udg_TMS_MaxIndex] = udg_TMS_SelectedTarget[udg_TMS_Index]
set udg_TMS_TempReal2 = GetUnitFlyHeight(udg_TMS_SelectedTarget[udg_TMS_Index])
set udg_TMS_StageID[udg_TMS_MaxIndex] = 3
set udg_TMS_MountedUnit[udg_TMS_MaxIndex] = udg_TMS_MountedUnit[udg_TMS_Index]
set udg_TMS_PositionAngle[udg_TMS_MaxIndex] = udg_TMS_Angle
set udg_TMS_ZHeight[udg_TMS_MaxIndex] = udg_TMS_ZHeight[udg_TMS_Index]
set udg_TMS_UnitIndex[udg_TMS_MaxIndex] = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), udg_TMS_DummyType, X, Y, udg_TMS_Angle * bj_RADTODEG)
if UnitAddAbility(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 'Amrf') then
endif
if (udg_TMS_HaveHoming[udg_TMS_TurretType[udg_TMS_Index]]) then
call UnitApplyTimedLife(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 1, udg_TMS_ProjectileFuel[udg_TMS_TurretType[udg_TMS_MaxIndex]])
endif
set udg_TMS_CurrentEffect[udg_TMS_MaxIndex] = AddSpecialEffectTarget(udg_TMS_ProjectileModel[udg_TMS_TurretType[udg_TMS_MaxIndex]], udg_TMS_UnitIndex[udg_TMS_MaxIndex], "origin")
call SetUnitScale(udg_TMS_UnitIndex[udg_TMS_MaxIndex], udg_TMS_ProjectileScale[udg_TMS_TurretType[udg_TMS_MaxIndex]] * 0.01, 0.00, 0.00)
if (udg_TMS_HaveTrueSpeed[udg_TMS_TurretType[udg_TMS_MaxIndex]]) then
set udg_TMS_MovementSpeed[udg_TMS_MaxIndex] = udg_TMS_ProjectileSpeed[udg_TMS_TurretType[udg_TMS_MaxIndex]]
else
set udg_TMS_MovementSpeed[udg_TMS_MaxIndex] = (udg_TMS_MaxDistance[udg_TMS_MaxIndex] / udg_TMS_ImpactTime[udg_TMS_TurretType[udg_TMS_MaxIndex]]) * udg_TMS_TimerSpeed
endif
set udg_TMS_HeightCorrection[udg_TMS_MaxIndex] = (udg_TMS_TempReal2 - udg_TMS_CurrentHeight[udg_TMS_MaxIndex]) / (udg_TMS_MaxDistance[udg_TMS_MaxIndex] / udg_TMS_MovementSpeed[udg_TMS_MaxIndex])
if (udg_TMS_HaveTargettingSfx[udg_TMS_TurretType[udg_TMS_Index]]) then
if (udg_TMS_HaveHoming[udg_TMS_TurretType[udg_TMS_MaxIndex]]) then
set udg_TMS_TargettingEffect[udg_TMS_MaxIndex] = AddSpecialEffectTarget(udg_TMS_TargettingModel[udg_TMS_TurretType[udg_TMS_MaxIndex]], Target, "origin")
else
set udg_TMS_TempUnit3 = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), udg_TMS_DummyType, X2, Y2, udg_TMS_Angle * bj_RADTODEG)
set udg_TMS_TargettingUnit[udg_TMS_MaxIndex] = udg_TMS_TempUnit3
set udg_TMS_TargettingEffect[udg_TMS_MaxIndex] = AddSpecialEffectTarget(udg_TMS_TargettingModel[udg_TMS_TurretType[udg_TMS_MaxIndex]], udg_TMS_TargettingUnit[udg_TMS_MaxIndex], "origin")
call SetUnitScale(udg_TMS_TargettingUnit[udg_TMS_MaxIndex], udg_TMS_TargettingScale[udg_TMS_TurretType[udg_TMS_MaxIndex]] * 0.01, 0.00, 0.00)
call SetUnitFlyHeight(udg_TMS_TargettingUnit[udg_TMS_MaxIndex], udg_TMS_TempReal2, 0.00)
set udg_TMS_MaxIndex = udg_TMS_MaxIndex + 1
set udg_TMS_StageID[udg_TMS_MaxIndex] = 5
set udg_TMS_UnitIndex[udg_TMS_MaxIndex] = udg_TMS_TempUnit3
endif
endif
if (udg_TMS_HaveLaunchSfx[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_MaxIndex = udg_TMS_MaxIndex + 1
set udg_TMS_StageID[udg_TMS_MaxIndex] = 4
set udg_TMS_TurretType[udg_TMS_MaxIndex] = udg_TMS_TurretType[udg_TMS_Index]
set udg_TMS_UnitIndex[udg_TMS_MaxIndex] = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), udg_TMS_DummyType, X, Y, udg_TMS_Angle * bj_RADTODEG)
if UnitAddAbility(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 'Amrf') then
endif
call SetUnitFlyHeight(udg_TMS_UnitIndex[udg_TMS_MaxIndex], udg_TMS_ZHeight[udg_TMS_Index], 0.00)
call SetUnitScale(udg_TMS_UnitIndex[udg_TMS_MaxIndex], udg_TMS_LaunchScale[udg_TMS_TurretType[udg_TMS_MaxIndex]] * 0.01, 0.00, 0.00)
call DestroyEffect(AddSpecialEffectTarget(udg_TMS_LaunchModel[udg_TMS_TurretType[udg_TMS_MaxIndex]], udg_TMS_UnitIndex[udg_TMS_MaxIndex], "origin"))
endif
if (not udg_TMS_HaveProjectileArc[udg_TMS_TurretType[udg_TMS_MaxIndex]]) then
set udg_TMS_TempReal3 = (Atan(4 * udg_TMS_CurrentHeight[udg_TMS_MaxIndex] / udg_TMS_MaxDistance[udg_TMS_MaxIndex] - 8 * udg_TMS_CurrentHeight[udg_TMS_MaxIndex] * udg_TMS_CurrentDistance[udg_TMS_MaxIndex] / (udg_TMS_MaxDistance[udg_TMS_MaxIndex] * udg_TMS_MaxDistance[udg_TMS_MaxIndex])) * bj_RADTODEG + 0.5) + 45
call SetUnitAnimationByIndex(udg_TMS_UnitIndex[udg_TMS_MaxIndex],R2I(udg_TMS_TempReal3))
endif
set Turret = null
set Target = null
endfunction
//*-
/////////////////////////////////////////////////////////////////////////////////////////////////
// function used for controlling the facing of turrets when they have or find a target //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_TurretFacing takes nothing returns nothing
set udg_TMS_TempX2 = GetUnitX(udg_TMS_SelectedTarget[udg_TMS_Index])
set udg_TMS_TempY2 = GetUnitY(udg_TMS_SelectedTarget[udg_TMS_Index])
set udg_TMS_TempReal = udg_TMS_TempX2 - udg_TMS_TempX
set udg_TMS_TempReal2 = udg_TMS_TempY2 - udg_TMS_TempY
set udg_TMS_Angle2 = Atan2(udg_TMS_TempReal2, udg_TMS_TempReal) * bj_RADTODEG
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Main looping function, controls the fixation of the turrets to their carrier, the //
// cooldowns of the turrets, and the movement and arcs of their projectiles, calls the unit //
// find target, and the FireProjectile Functions //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_Loop takes nothing returns nothing
set udg_TMS_Index = 1
loop
exitwhen udg_TMS_Index > udg_TMS_MaxIndex
set udg_TMS_TempUnit = udg_TMS_UnitIndex[udg_TMS_Index]
if (udg_TMS_StageID[udg_TMS_Index] == 1) then
if (GetUnitTypeId(udg_TMS_TempUnit) != udg_TMS_DummyType) then
set udg_TMS_SecondaryIndex = 1
set udg_TMS_TempX = GetUnitX(udg_TMS_TempUnit)
set udg_TMS_TempY = GetUnitY(udg_TMS_TempUnit)
set udg_TMS_TempPoint = Location(udg_TMS_TempX, udg_TMS_TempY)
set udg_TMS_TempReal = GetLocationZ(udg_TMS_TempPoint)
call RemoveLocation(udg_TMS_TempPoint)
set udg_TMS_TempPoint = null
loop
exitwhen udg_TMS_SecondaryIndex > udg_TMS_MaxIndex
set udg_TMS_SecondaryIndex = udg_TMS_SecondaryIndex + 1
if (udg_TMS_TempUnit == udg_TMS_MountedUnit[udg_TMS_SecondaryIndex]) and (udg_TMS_StageID[udg_TMS_SecondaryIndex] == 2) then
if (GetWidgetLife(udg_TMS_TempUnit) <= 0) then
call SetWidgetLife(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex], 0.00)
endif
set udg_TMS_AngleAlteration[udg_TMS_SecondaryIndex] = (udg_TMS_CarrierFacing[udg_TMS_Index] - GetUnitFacing(udg_TMS_UnitIndex[udg_TMS_Index]))
set udg_TMS_TempReal2 = udg_TMS_PositionAngle[udg_TMS_SecondaryIndex] - (udg_TMS_AngleAlteration[udg_TMS_SecondaryIndex] * bj_DEGTORAD)
call SetUnitX(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex], udg_TMS_TempX + udg_TMS_MountingOffset[udg_TMS_TurretType[udg_TMS_SecondaryIndex]] * Cos(udg_TMS_TempReal2))
call SetUnitY(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex], udg_TMS_TempY + udg_TMS_MountingOffset[udg_TMS_TurretType[udg_TMS_SecondaryIndex]] * Sin(udg_TMS_TempReal2))
set udg_TMS_TempPoint2 = Location(GetUnitX(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex]), GetUnitY(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex]))
set udg_TMS_TempReal2 = GetLocationZ(udg_TMS_TempPoint2)
call SetUnitFlyHeight(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex], (udg_TMS_TempReal - udg_TMS_TempReal2) + udg_TMS_ZHeight[udg_TMS_SecondaryIndex], 0.00)
endif
endloop
if (IsUnitType(udg_TMS_TempUnit, UNIT_TYPE_DEAD)) then
set udg_TMS_StageID[udg_TMS_Index] = 4
endif
endif
elseif (udg_TMS_StageID[udg_TMS_Index] == 2) then
if (not IsUnitType(udg_TMS_TempUnit, UNIT_TYPE_DEAD)) then
//*+
if (udg_TMS_FireCooldownCurrent[udg_TMS_Index] >= udg_TMS_FireCooldown[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_FireCooldownCurrent[udg_TMS_Index] = 0.00
set udg_TMS_TempX = GetUnitX(udg_TMS_TempUnit)
set udg_TMS_TempY = GetUnitY(udg_TMS_TempUnit)
call TMS_TurretFacing()
set udg_TMS_TempReal3 = (udg_TMS_TempReal2 * udg_TMS_TempReal2) + (udg_TMS_TempReal * udg_TMS_TempReal)
if (udg_TMS_SelectedTarget[udg_TMS_Index] == null) or (not udg_TMS_TargetLock[udg_TMS_TurretType[udg_TMS_Index]]) or (udg_TMS_TempReal3 > udg_TMS_Range[udg_TMS_TurretType[udg_TMS_Index]] * udg_TMS_Range[udg_TMS_TurretType[udg_TMS_Index]]) then
if (udg_TMS_TargettingMethod[udg_TMS_Index] == 11) then
set udg_TMS_SelectedTarget[udg_TMS_Index] = null
else
set udg_TMS_SelectedTarget[udg_TMS_Index] = TMS_FindTarget(udg_TMS_TurretType[udg_TMS_Index])
endif
if (udg_TMS_SelectedTarget[udg_TMS_Index] != null) then
call TMS_TurretFacing()
call SetUnitFacing(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_Angle2)
call TMS_FireProjectile(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_SelectedTarget[udg_TMS_Index])
else
set udg_TMS_TempReal2 = (udg_TMS_PositionAngle[udg_TMS_Index] * bj_RADTODEG) - udg_TMS_AngleAlteration[udg_TMS_Index]
call SetUnitFacing(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_TempReal2)
endif
else
call SetUnitFacing(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_Angle2)
call TMS_FireProjectile(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_SelectedTarget[udg_TMS_Index])
endif
else
set udg_TMS_FireCooldownCurrent[udg_TMS_Index] = udg_TMS_FireCooldownCurrent[udg_TMS_Index] + udg_TMS_TimerSpeed
endif
//*-
else
//*+
call DestroyEffect(udg_TMS_CurrentEffect[udg_TMS_Index])
if (udg_TMS_HaveDeathSfx[udg_TMS_TurretType[udg_TMS_Index]]) then
call DestroyEffect(AddSpecialEffectTarget(udg_TMS_DeathModel[udg_TMS_TurretType[udg_TMS_MaxIndex]], udg_TMS_UnitIndex[udg_TMS_Index], "origin"))
call SetUnitScale(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_DeathScale[udg_TMS_TurretType[udg_TMS_Index]] * 0.01, udg_TMS_DeathScale[udg_TMS_TurretType[udg_TMS_Index]] * 0.01, udg_TMS_DeathScale[udg_TMS_TurretType[udg_TMS_Index]] * 0.01)
endif
//*-
set udg_TMS_StageID[udg_TMS_Index] = 4
endif
//*+
elseif (udg_TMS_StageID[udg_TMS_Index] == 3) then
set udg_TMS_TempX = GetUnitX(udg_TMS_TempUnit)
set udg_TMS_TempY = GetUnitY(udg_TMS_TempUnit)
if (udg_TMS_HaveHoming[udg_TMS_TurretType[udg_TMS_Index]]) then
if (udg_TMS_SelectedTarget[udg_TMS_Index] == null) or (IsUnitType(udg_TMS_TempUnit, UNIT_TYPE_DEAD)) then
set udg_TMS_StageID[udg_TMS_Index] = 4
call DestroyEffect (udg_TMS_CurrentEffect[udg_TMS_Index])
if (udg_TMS_HaveTargettingSfx[udg_TMS_TurretType[udg_TMS_Index]]) then
call DestroyEffect(udg_TMS_TargettingEffect[udg_TMS_Index])
set udg_TMS_SecondaryIndex = 1
loop
if (udg_TMS_UnitIndex[udg_TMS_SecondaryIndex] == udg_TMS_TargettingUnit[udg_TMS_Index]) and (udg_TMS_StageID[udg_TMS_SecondaryIndex] == 5) then
set udg_TMS_StageID[udg_TMS_SecondaryIndex] = 4
set udg_TMS_DeathTimerCurrent[udg_TMS_SecondaryIndex] = 0.00
endif
exitwhen udg_TMS_UnitIndex[udg_TMS_SecondaryIndex] == udg_TMS_TargettingUnit[udg_TMS_Index]
set udg_TMS_SecondaryIndex = udg_TMS_SecondaryIndex + 1
endloop
endif
else
set udg_TMS_TempX2 = GetUnitX(udg_TMS_SelectedTarget[udg_TMS_Index])
set udg_TMS_TempY2 = GetUnitY(udg_TMS_SelectedTarget[udg_TMS_Index])
set udg_TMS_Angle = Atan2(udg_TMS_TempY2 - udg_TMS_TempY, udg_TMS_TempX2 - udg_TMS_TempX)
set udg_TMS_PositionAngle[udg_TMS_Index] = udg_TMS_Angle
call SetUnitFacing(udg_TMS_TempUnit, udg_TMS_Angle * bj_RADTODEG)
set udg_TMS_MaxDistance[udg_TMS_Index] = udg_TMS_CurrentDistance[udg_TMS_Index] + SquareRoot((udg_TMS_TempX2 - udg_TMS_TempX) * (udg_TMS_TempX2 - udg_TMS_TempX) + (udg_TMS_TempY2 - udg_TMS_TempY) * (udg_TMS_TempY2 - udg_TMS_TempY))
set udg_TMS_MaxHeight[udg_TMS_Index] = udg_TMS_MaxDistance[udg_TMS_Index] * udg_TMS_ArcFactor[udg_TMS_TurretType[udg_TMS_Index]]
endif
endif
if (udg_TMS_MovementSpeed[udg_TMS_Index] >= udg_TMS_SpeedLimit[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_MovementSpeed[udg_TMS_Index] = udg_TMS_SpeedLimit[udg_TMS_TurretType[udg_TMS_Index]]
else
set udg_TMS_MovementSpeed[udg_TMS_Index] = (udg_TMS_MovementSpeed[udg_TMS_Index] + udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretType[udg_TMS_Index]]) * udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretType[udg_TMS_Index]]
endif
set udg_TMS_TempReal3 = GetUnitFlyHeight(udg_TMS_SelectedTarget[udg_TMS_Index])
if ((udg_TMS_CurrentHeight[udg_TMS_Index] <= udg_TMS_TempReal3 + udg_TMS_HeightLet) and (udg_TMS_CurrentHeight[udg_TMS_Index] >= udg_TMS_TempReal3 - udg_TMS_HeightLet) and (udg_TMS_CurrentDistance[udg_TMS_Index] >= udg_TMS_MaxDistance[udg_TMS_Index])) or (udg_TMS_CurrentDistance[udg_TMS_Index] >= udg_TMS_Range[udg_TMS_TurretType[udg_TMS_Index]]) or (udg_TMS_CurrentHeight[udg_TMS_Index] < 0)then
call DestroyEffect (udg_TMS_CurrentEffect[udg_TMS_Index])
call GroupEnumUnitsInRange(udg_TMS_TempGroup, udg_TMS_TempX, udg_TMS_TempY, udg_TMS_ProjectileAOE[udg_TMS_TurretType[udg_TMS_Index]], null)
set udg_TMS_FilterMode = 2
set udg_TMS_TempUnit2 = null
set udg_TMS_TempUnit3 = null
loop
set udg_TMS_TempUnit2 = FirstOfGroup(udg_TMS_TempGroup)
exitwhen udg_TMS_TempUnit2 == null
call TMS_TargetFilter(udg_TMS_TempUnit2)
call GroupRemoveUnit(udg_TMS_TempGroup, udg_TMS_TempUnit2)
endloop
if (udg_TMS_HaveImpactSfx[udg_TMS_TurretType[udg_TMS_Index]]) then
call DestroyEffect(AddSpecialEffectTarget(udg_TMS_ImpactModel[udg_TMS_TurretType[udg_TMS_Index]], udg_TMS_UnitIndex[udg_TMS_Index], "origin"))
call SetUnitScale(udg_TMS_UnitIndex[udg_TMS_Index], udg_TMS_ImpactScale[udg_TMS_TurretType[udg_TMS_Index]] * 0.01, 0.00, 0.00)
endif
if (udg_TMS_HaveTargettingSfx[udg_TMS_TurretType[udg_TMS_Index]]) then
call DestroyEffect(udg_TMS_TargettingEffect[udg_TMS_Index])
if (not udg_TMS_HaveHoming[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_SecondaryIndex = 1
loop
if (udg_TMS_UnitIndex[udg_TMS_SecondaryIndex] == udg_TMS_TargettingUnit[udg_TMS_Index]) and (udg_TMS_StageID[udg_TMS_SecondaryIndex] == 5) then
set udg_TMS_StageID[udg_TMS_SecondaryIndex] = 4
set udg_TMS_DeathTimerCurrent[udg_TMS_SecondaryIndex] = 0.00
endif
exitwhen udg_TMS_SecondaryIndex >= udg_TMS_MaxIndex or udg_TMS_UnitIndex[udg_TMS_SecondaryIndex] == udg_TMS_TargettingUnit[udg_TMS_Index]
set udg_TMS_SecondaryIndex = udg_TMS_SecondaryIndex + 1
endloop
endif
endif
set udg_TMS_StageID[udg_TMS_Index] = 4
set udg_TMS_ActivateEffects = udg_TMS_BonusEffects[udg_TMS_TurretType[udg_TMS_Index]]
set udg_TMS_ActivateEffects = 0.00
else
if (udg_TMS_SelectedTarget[udg_TMS_Index] != null) then
set udg_TMS_HeightCorrection[udg_TMS_Index] = ((GetUnitFlyHeight(udg_TMS_SelectedTarget[udg_TMS_Index]) - udg_TMS_ZHeight[udg_TMS_Index]) - udg_TMS_StackedCorrection[udg_TMS_Index]) / ((udg_TMS_MaxDistance[udg_TMS_Index] - udg_TMS_CurrentDistance[udg_TMS_Index]) / udg_TMS_MovementSpeed[udg_TMS_Index])
endif
call SetUnitX(udg_TMS_TempUnit, udg_TMS_TempX + udg_TMS_MovementSpeed[udg_TMS_Index] * Cos(udg_TMS_PositionAngle[udg_TMS_Index]))
call SetUnitY(udg_TMS_TempUnit, udg_TMS_TempY + udg_TMS_MovementSpeed[udg_TMS_Index] * Sin(udg_TMS_PositionAngle[udg_TMS_Index]))
set udg_TMS_CurrentDistance[udg_TMS_Index] = udg_TMS_CurrentDistance[udg_TMS_Index] + udg_TMS_MovementSpeed[udg_TMS_Index]
if (udg_TMS_HaveProjectileArc[udg_TMS_TurretType[udg_TMS_Index]]) then
set udg_TMS_StackedCorrection[udg_TMS_Index] = udg_TMS_StackedCorrection[udg_TMS_Index] + udg_TMS_HeightCorrection[udg_TMS_Index]
set udg_TMS_StackedCorrection[udg_TMS_Index] = udg_TMS_StackedCorrection[udg_TMS_Index] + udg_TMS_HeightCorrection[udg_TMS_Index]
set udg_TMS_TempReal = (((4 * udg_TMS_MaxHeight[udg_TMS_Index]) / udg_TMS_MaxDistance[udg_TMS_Index]) * (udg_TMS_MaxDistance[udg_TMS_Index] - udg_TMS_CurrentDistance[udg_TMS_Index]) * (udg_TMS_CurrentDistance[udg_TMS_Index] / udg_TMS_MaxDistance[udg_TMS_Index])) + udg_TMS_ZHeight[udg_TMS_Index] + udg_TMS_StackedCorrection[udg_TMS_Index]
set udg_TMS_TempReal3 = (Atan(4 * udg_TMS_CurrentHeight[udg_TMS_Index] / udg_TMS_MaxDistance[udg_TMS_Index] - 12 * udg_TMS_CurrentHeight[udg_TMS_Index] * udg_TMS_CurrentDistance[udg_TMS_Index] / (udg_TMS_MaxDistance[udg_TMS_Index] * udg_TMS_MaxDistance[udg_TMS_Index])) * bj_RADTODEG + 0.5) + 90
call SetUnitAnimationByIndex(udg_TMS_TempUnit,R2I(udg_TMS_TempReal3))
else
set udg_TMS_StackedCorrection[udg_TMS_Index] = udg_TMS_StackedCorrection[udg_TMS_Index] + udg_TMS_HeightCorrection[udg_TMS_Index]
set udg_TMS_TempReal = udg_TMS_CurrentHeight[udg_TMS_Index] + udg_TMS_HeightCorrection[udg_TMS_Index]
endif
call SetUnitFlyHeight(udg_TMS_TempUnit, udg_TMS_TempReal, 0.00)
set udg_TMS_CurrentHeight[udg_TMS_Index] = udg_TMS_TempReal
endif
//*-
elseif (udg_TMS_DeathTimerCurrent[udg_TMS_Index] == udg_TMS_DeathTimer) and (udg_TMS_StageID[udg_TMS_Index] == 4) then
call RemoveUnit(udg_TMS_TempUnit)
set udg_TMS_DeathTimerCurrent[udg_TMS_Index] = udg_TMS_DeathTimerCurrent[udg_TMS_MaxIndex]
set udg_TMS_DeathTimerCurrent[udg_TMS_MaxIndex] = 0.00
//*+
set udg_TMS_FireCooldownCurrent[udg_TMS_Index] = udg_TMS_FireCooldownCurrent[udg_TMS_MaxIndex]
//*-
set udg_TMS_StageID[udg_TMS_Index] = udg_TMS_StageID[udg_TMS_MaxIndex]
//*+
set udg_TMS_CurrentHeight[udg_TMS_Index] = udg_TMS_CurrentHeight[udg_TMS_MaxIndex]
set udg_TMS_MaxHeight[udg_TMS_Index] = udg_TMS_MaxHeight[udg_TMS_MaxIndex]
set udg_TMS_CurrentDistance[udg_TMS_Index] = udg_TMS_CurrentDistance[udg_TMS_MaxIndex]
set udg_TMS_MaxDistance[udg_TMS_Index] = udg_TMS_MaxDistance[udg_TMS_MaxIndex]
set udg_TMS_HeightCorrection[udg_TMS_Index] = udg_TMS_HeightCorrection[udg_TMS_MaxIndex]
set udg_TMS_StackedCorrection[udg_TMS_Index] = udg_TMS_StackedCorrection[udg_TMS_MaxIndex]
set udg_TMS_MovementSpeed[udg_TMS_Index] = udg_TMS_MovementSpeed[udg_TMS_MaxIndex]
//*-
set udg_TMS_MountedUnit[udg_TMS_Index] = udg_TMS_MountedUnit[udg_TMS_MaxIndex]
set udg_TMS_PositionAngle[udg_TMS_Index] = udg_TMS_PositionAngle[udg_TMS_MaxIndex]
//*+
set udg_TMS_SelectedTarget[udg_TMS_Index] = udg_TMS_SelectedTarget[udg_TMS_MaxIndex]
set udg_TMS_TargettingEffect[udg_TMS_Index] = udg_TMS_TargettingEffect[udg_TMS_MaxIndex]
set udg_TMS_TargettingUnit[udg_TMS_Index] = udg_TMS_TargettingUnit[udg_TMS_MaxIndex]
//*-
set udg_TMS_TurretType[udg_TMS_Index] = udg_TMS_TurretType[udg_TMS_MaxIndex]
set udg_TMS_UnitIndex[udg_TMS_Index] = udg_TMS_UnitIndex[udg_TMS_MaxIndex]
//*+
set udg_TMS_CurrentEffect[udg_TMS_Index] = udg_TMS_CurrentEffect[udg_TMS_MaxIndex]
//*-
set udg_TMS_CurrentTurretCount[udg_TMS_Index] = udg_TMS_CurrentTurretCount[udg_TMS_MaxIndex]
set udg_TMS_ZHeight[udg_TMS_Index] = udg_TMS_ZHeight[udg_TMS_MaxIndex]
set udg_TMS_CarrierFacing[udg_TMS_Index] = udg_TMS_CarrierFacing[udg_TMS_MaxIndex]
set udg_TMS_AngleAlteration[udg_TMS_Index] = udg_TMS_AngleAlteration[udg_TMS_MaxIndex]
set udg_TMS_CurrentWeight[udg_TMS_Index] = udg_TMS_CurrentWeight[udg_TMS_MaxIndex]
set udg_TMS_MaxIndex = udg_TMS_MaxIndex - 1
set udg_TMS_Index = udg_TMS_Index - 1
if (udg_TMS_MaxIndex == 0) then
call PauseTimer(udg_TMS_Timer)
endif
else
set udg_TMS_DeathTimerCurrent[udg_TMS_Index] = udg_TMS_DeathTimerCurrent[udg_TMS_Index] + udg_TMS_TimerSpeed
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function that runs rearrangement of the turrets on a particular carrier (u) called by //
// CreateTurrets and DestroyTurrets functions //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_ReArrangeTurrets takes unit u returns nothing
set udg_TMS_SecondaryIndex = 1
set udg_TMS_Angle = udg_TMS_CarrierFacing[udg_TMS_Index]
loop
exitwhen udg_TMS_SecondaryIndex > udg_TMS_MaxIndex
if (u == udg_TMS_MountedUnit[udg_TMS_SecondaryIndex]) and (udg_TMS_StageID[udg_TMS_SecondaryIndex] == 2) and (udg_TMS_UnitIndex[udg_TMS_SecondaryIndex] != udg_TMS_TempUnit3) then
set udg_TMS_Angle = udg_TMS_Angle + (360 / udg_TMS_CurrentTurretCount[udg_TMS_Index])
set udg_TMS_PositionAngle[udg_TMS_SecondaryIndex] = udg_TMS_Angle * bj_DEGTORAD
call SetUnitFacing(udg_TMS_UnitIndex[udg_TMS_SecondaryIndex], udg_TMS_Angle)
endif
set udg_TMS_SecondaryIndex = udg_TMS_SecondaryIndex + 1
endloop
set u = null
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function that creates new turrets and attached them to the specified carrier unit, called //
// by AddTurrets, sets up turrets, and gives an error message when the limit has been reached //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_CreateTurrets takes unit u, integer TurretNumber, integer TurretCount returns nothing
set udg_TMS_SecondaryIndex = 1
set udg_TMS_TempReal3 = GetUnitFlyHeight(u)
set udg_TMS_TempPlayer = GetOwningPlayer(u)
loop
exitwhen udg_TMS_SecondaryIndex > TurretCount
if (udg_TMS_CurrentWeight[udg_TMS_Index] < udg_TMS_TempInteger) then
set udg_TMS_CurrentTurretCount[udg_TMS_Index] = udg_TMS_CurrentTurretCount[udg_TMS_Index] + 1
set udg_TMS_CurrentWeight[udg_TMS_Index] = udg_TMS_CurrentWeight[udg_TMS_Index] + udg_TMS_TurretWeight[TurretNumber]
set udg_TMS_MaxIndex = udg_TMS_MaxIndex + 1
set udg_TMS_MountedUnit[udg_TMS_MaxIndex] = u
set udg_TMS_TurretType[udg_TMS_MaxIndex] = TurretNumber
set udg_TMS_SelectedTarget[udg_TMS_MaxIndex] = null
set udg_TMS_StageID[udg_TMS_MaxIndex] = 2
set udg_TMS_ZHeight[udg_TMS_MaxIndex] = udg_TMS_TempReal3 + udg_TMS_MountingHeight[TurretNumber]
set udg_TMS_UnitIndex[udg_TMS_MaxIndex] = CreateUnit(udg_TMS_TempPlayer, udg_TMS_DummyType, GetUnitX(u), GetUnitY(u), 0.00)
if UnitAddAbility(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_TMS_UnitIndex[udg_TMS_MaxIndex], 'Amrf') then
endif
//*+
set udg_TMS_CurrentEffect[udg_TMS_MaxIndex] = AddSpecialEffectTarget(udg_TMS_TurretModel[TurretNumber], udg_TMS_UnitIndex[udg_TMS_MaxIndex], "origin")
call SetUnitFlyHeight(udg_TMS_UnitIndex[udg_TMS_MaxIndex], udg_TMS_ZHeight[udg_TMS_MaxIndex], 0.00)
call SetUnitScale(udg_TMS_UnitIndex[udg_TMS_MaxIndex], udg_TMS_TurretScale[TurretNumber] * 0.01, 0.00, 0.00)
//*-
else
call DisplayTextToPlayer(udg_TMS_TempPlayer, 0, 0, udg_TMS_ErrorMessages[1])
endif
set udg_TMS_SecondaryIndex = udg_TMS_SecondaryIndex + 1
endloop
set udg_TMS_TempUnit3 = null
call TMS_ReArrangeTurrets(u)
set u = null
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function used to remove turrets from a carrier unit and change the arrnagements of the //
// turrets to match the new number of them, removes the passed number of the passed type of //
// the passed unit //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_DestroyTurrets takes unit u, integer TurretNumber, integer TurretCount returns nothing
local integer Removed = 0
set udg_TMS_Index = 1
loop
exitwhen udg_TMS_Index > udg_TMS_MaxIndex
if (u == udg_TMS_UnitIndex[udg_TMS_Index]) then
set udg_TMS_TempInteger = 1
loop
exitwhen udg_TMS_TempInteger > udg_TMS_MaxIndex
if (u == udg_TMS_MountedUnit[udg_TMS_TempInteger]) and (udg_TMS_StageID[udg_TMS_TempInteger] == 2) and (udg_TMS_TurretType[udg_TMS_TempInteger] == TurretNumber) and (Removed < TurretCount) then
set Removed = Removed + 1
//*+
call DestroyEffect (udg_TMS_CurrentEffect[udg_TMS_TempInteger])
//*-
set udg_TMS_CurrentTurretCount[udg_TMS_Index] = udg_TMS_CurrentTurretCount[udg_TMS_Index] - 1
set udg_TMS_StageID[udg_TMS_TempInteger] = 4
set udg_TMS_CurrentWeight[udg_TMS_Index] = udg_TMS_CurrentWeight[udg_TMS_Index] - udg_TMS_TurretWeight[TurretNumber]
call SetUnitState(udg_TMS_UnitIndex[udg_TMS_TempInteger], UNIT_STATE_LIFE, 0.00)
set udg_TMS_TempUnit3 = udg_TMS_UnitIndex[udg_TMS_TempInteger]
set udg_TMS_CarrierFacing[udg_TMS_Index] = GetUnitFacing(udg_TMS_UnitIndex[udg_TMS_Index])
call TMS_ReArrangeTurrets(u)
endif
set udg_TMS_TempInteger = udg_TMS_TempInteger + 1
endloop
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
set u = null
set udg_TMS_TempUnit3 = null
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// Function Used to determine if a unit can hold any more turrets/can hold any turrets //
// if so, then calls CreateTurrets, passing the necessary parameters to create new turrets //
// then starts the loop timer for the system to run, if it was not already //
/////////////////////////////////////////////////////////////////////////////////////////////////
function TMS_AddTurret takes unit u, integer TurretNumber, integer TurretCount returns nothing
if (TurretCount > 0) and (TurretNumber > 0) then
set udg_TMS_TempBoolean = false
set udg_TMS_Index = 1
loop
exitwhen udg_TMS_Index > udg_TMS_CarrierTypesCount
if (GetUnitTypeId(u) == udg_TMS_CarrierUnitType[udg_TMS_Index]) then
set udg_TMS_TempBoolean = true
set udg_TMS_TempInteger = udg_TMS_TurretLimit[udg_TMS_Index]
elseif not udg_TMS_TempBoolean then
set udg_TMS_TempInteger = udg_TMS_DefaultLimit
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
if (udg_TMS_TempInteger > 0) then
set udg_TMS_Index = 1
set udg_TMS_TempBoolean = false
loop
exitwhen udg_TMS_Index > udg_TMS_MaxIndex
if (u == udg_TMS_UnitIndex[udg_TMS_Index]) then
set udg_TMS_TempBoolean = true
set udg_TMS_CarrierFacing[udg_TMS_Index] = GetUnitFacing(udg_TMS_UnitIndex[udg_TMS_Index])
call TMS_CreateTurrets(u, TurretNumber, TurretCount)
endif
set udg_TMS_Index = udg_TMS_Index + 1
endloop
if (not udg_TMS_TempBoolean) then
set udg_TMS_MaxIndex = udg_TMS_MaxIndex + 1
set udg_TMS_UnitIndex[udg_TMS_MaxIndex] = u
set udg_TMS_CurrentTurretCount[udg_TMS_MaxIndex] = 0
set udg_TMS_StageID[udg_TMS_MaxIndex] = 1
set udg_TMS_CarrierFacing[udg_TMS_MaxIndex] = GetUnitFacing(udg_TMS_UnitIndex[udg_TMS_MaxIndex])
set udg_TMS_Index = udg_TMS_MaxIndex
if (udg_TMS_MaxIndex == 1) then
call TimerStart(udg_TMS_Timer, udg_TMS_TimerSpeed, true, function TMS_Loop)
endif
call TMS_CreateTurrets(u, TurretNumber, TurretCount)
endif
else
call DisplayTextToPlayer(GetOwningPlayer(u), 0, 0, udg_TMS_ErrorMessages[0])
endif
elseif (TurretCount < 1) then
call DisplayTextToPlayer(GetOwningPlayer(u), 0, 0, udg_TMS_ErrorMessages[2])
else
call DisplayTextToPlayer(GetOwningPlayer(u), 0, 0, udg_TMS_ErrorMessages[3])
endif
set u = null
endfunction
/////////////////////////////////////////////////////////////////////////////////////////////////
// End of the system //
/////////////////////////////////////////////////////////////////////////////////////////////////
function InitTrig_Register_Data takes nothing returns nothing
// calling RegisterCarrier to add the carrier to the system
call TMS_RegisterCarrier('h013', 2)
// calling RegisterCarrier to add the turret to the system
call TMS_RegisterCarrier('h00R', 5)
// calling RegisterCarrier to add the turret to the system
call TMS_RegisterCarrier('h00S', 5)
// calling RegisterCarrier to add the turret to the system
call TMS_RegisterCarrier('h011', 5)
// calling RegisterCarrier to add the turret to the system
call TMS_RegisterCarrier('h012', 5)
//setting up data for turrets
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Anti-Ground Plasma Cannon"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "war3mapImported\\vulcan-B.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\LavaSpawnMissile\\LavaSpawnMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "war3mapImported\\RedFireringMissile.mdx"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Orc\\FeralSpirit\\feralspirittarget.mdl"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 60.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 75.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 60.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 10.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 20.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 10.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = false
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = true
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = false
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 380.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 70.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 100.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 10.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 200.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.10
set udg_TMS_Range[udg_TMS_TurretInit] = 800.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 20.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 40.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 1.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 50.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 0.40
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 4
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 2
set udg_TMS_TargetLock[udg_TMS_TurretInit] = false
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//NextTurret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Flak Copter"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "war3mapImported\\ship_ionturret.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\LavaSpawnMissile\\LavaSpawnMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "war3mapImported\\RedFireringMissile.mdx"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Other\\Incinerate\\FireLordDeathExplode.mdl"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 40.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 60.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 10.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 20.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = true
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = false
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 200.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 0.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 70.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 10.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 20.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.00
set udg_TMS_Range[udg_TMS_TurretInit] = 800.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 40.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 40.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.50
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 20.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 0.30
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 4
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 2
set udg_TMS_TargetLock[udg_TMS_TurretInit] = false
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//NextTurret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Crusher Artillery Launcher"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "units\\orc\\catapult\\catapult_V1.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "abilities\\weapons\\DemolisherMissile\\DemolisherMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Input death effect model"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = true
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = true
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 90.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 45.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 150.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 10.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 250.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.75
set udg_TMS_Range[udg_TMS_TurretInit] = 1500.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 15.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 15.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 300.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 3.00
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 1
set udg_TMS_TargetType[udg_TMS_TurretInit] = 3
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 6
set udg_TMS_TargetLock[udg_TMS_TurretInit] = true
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Energy Sap Zepplin"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "war3mapImported\\SpaceOrc_AttackHelicopter_Condor.mdx"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Other\\TinkerRocket\\TinkerRocketMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Units\\NightElf\\Wisp\\WispExplode.mdl"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Other\\Charm\\CharmTarget.mdl"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Abilities\\Spells\\NightElf\\TrueshotAura\\TrueshotAura.mdl"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 40.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 80.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 40.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 80.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 25.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = false
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = true
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 480.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 45.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 190.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 20.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 100.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.20
set udg_TMS_Range[udg_TMS_TurretInit] = 800.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 300.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 40.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 130.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 4.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 5.50
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 10
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 3
set udg_TMS_TargetLock[udg_TMS_TurretInit] = false
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Spider Spit Launcher"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "units\\creeps\\SpiderGreen\\SpiderGreen.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\ChimaeraAcidMissile\\ChimaeraAcidMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Input launch effect model"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Input impact effect model"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 30.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 30.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = false
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = true
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 100.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 45.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 50.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 0.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 70.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.30
set udg_TMS_Range[udg_TMS_TurretInit] = 1100.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 20.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 20.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 5.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 25.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 0.25
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 2
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 7
set udg_TMS_TargetLock[udg_TMS_TurretInit] = false
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Armageddon Cannon"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "units\\creeps\\FelstalkerPurple\\FelstalkerPurple.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Undead\\OrbOfDeath\\AnnihilationMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Undead\\DarkRitual\\DarkRitualTarget.mdl"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 90.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 150.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 200.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 200.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 90.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = true
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = false
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 100.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 10.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 400.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 50.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 200.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.00
set udg_TMS_Range[udg_TMS_TurretInit] = 800.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 90.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 90.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.40
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 4000.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 2.50
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 5
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 4
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 4
set udg_TMS_TargetLock[udg_TMS_TurretInit] = true
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Eliminator Missile Platform"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "Input"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\RocketMissile\\RocketMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Input launch effect model"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Input death effect model"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 150.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = false
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = true
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = true
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = true
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 90.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 45.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 250.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 10.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 150.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.35
set udg_TMS_Range[udg_TMS_TurretInit] = 1500.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 3.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.10
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 30.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 500.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 4.00
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 10
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 2
set udg_TMS_TargetLock[udg_TMS_TurretInit] = false
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Seeker Bolt Elemental"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "units\\human\\WaterElemental\\WaterElemental.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Other\\CrushingWave\\CrushingWaveDamage.mdl"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Input impact effect model"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Input death effect model"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 35.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 100.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 50.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 20.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = true
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = false
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = false
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = false
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 90.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 45.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 150.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 0.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 0.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.00
set udg_TMS_Range[udg_TMS_TurretInit] = 1100.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 25.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 10.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 7.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 50.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 2.00
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 1
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 2
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 4
set udg_TMS_TargetLock[udg_TMS_TurretInit] = false
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
set udg_TMS_TurretName[udg_TMS_TurretInit] = "Archer Tower"
set udg_TMS_TurretModel[udg_TMS_TurretInit] = "units\\nightelf\\Archer\\Archer.mdl"
set udg_TMS_ProjectileModel[udg_TMS_TurretInit] = "Abilities\\Weapons\\Arrow\\ArrowMissile.mdl"
set udg_TMS_LaunchModel[udg_TMS_TurretInit] = "Input launch effect model"
set udg_TMS_ImpactModel[udg_TMS_TurretInit] = "Input impact effect model"
set udg_TMS_DeathModel[udg_TMS_TurretInit] = "Input death effect model"
set udg_TMS_TargettingModel[udg_TMS_TurretInit] = "Input targetting effect model"
set udg_TMS_TurretScale[udg_TMS_TurretInit] = 75.00
set udg_TMS_ProjectileScale[udg_TMS_TurretInit] = 150.00
set udg_TMS_LaunchScale[udg_TMS_TurretInit] = 50.00
set udg_TMS_ImpactScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_DeathScale[udg_TMS_TurretInit] = 0.00
set udg_TMS_TargettingScale[udg_TMS_TurretInit] = 20.00
set udg_TMS_HaveLaunchSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveImpactSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveDeathSfx[udg_TMS_TurretInit] = false
set udg_TMS_HaveTargettingSfx[udg_TMS_TurretInit] = true
set udg_TMS_HaveHoming[udg_TMS_TurretInit] = true
set udg_TMS_HaveRelativeDamage[udg_TMS_TurretInit] = false
set udg_TMS_HaveInaccuracy[udg_TMS_TurretInit] = false
set udg_TMS_HaveProjectileArc[udg_TMS_TurretInit] = true
set udg_TMS_HaveTrueSpeed[udg_TMS_TurretInit] = true
set udg_TMS_BonusEffects[udg_TMS_TurretInit] = 0.00
set udg_TMS_MountingHeight[udg_TMS_TurretInit] = 160.00
set udg_TMS_MountingOffset[udg_TMS_TurretInit] = 0.00
set udg_TMS_ProjectileAOE[udg_TMS_TurretInit] = 100.00
set udg_TMS_AoeDamageDissapation[udg_TMS_TurretInit] = 0.00
set udg_TMS_Inaccuracy[udg_TMS_TurretInit] = 0.00
set udg_TMS_ArcFactor[udg_TMS_TurretInit] = 0.40
set udg_TMS_Range[udg_TMS_TurretInit] = 800.00
set udg_TMS_ProjectileSpeed[udg_TMS_TurretInit] = 45.00
set udg_TMS_SpeedOverTimeMultiplyer[udg_TMS_TurretInit] = 1.00
set udg_TMS_SpeedOverTimeFixed[udg_TMS_TurretInit] = 0.00
set udg_TMS_SpeedLimit[udg_TMS_TurretInit] = 45.00
set udg_TMS_ProjectileFuel[udg_TMS_TurretInit] = 0.00
set udg_TMS_ImpactTime[udg_TMS_TurretInit] = 0.00
set udg_TMS_HealthDamage[udg_TMS_TurretInit] = 90.00
set udg_TMS_ManaDamage[udg_TMS_TurretInit] = 0.00
set udg_TMS_FireCooldown[udg_TMS_TurretInit] = 1.50
set udg_TMS_TurretWeight[udg_TMS_TurretInit] = 0
set udg_TMS_TargettingMethod[udg_TMS_TurretInit] = 11
set udg_TMS_TargetType[udg_TMS_TurretInit] = 1
set udg_TMS_TargetStatus[udg_TMS_TurretInit] = 4
set udg_TMS_TargetLock[udg_TMS_TurretInit] = true
set udg_TMS_AttackType[udg_TMS_TurretInit] = ATTACK_TYPE_NORMAL
set udg_TMS_DamageType[udg_TMS_TurretInit] = DAMAGE_TYPE_NORMAL
//Calling the register function after you've set up your turret
call TMS_RegisterTurret(0)
//Next Turret
endfunction
////////////////////////////////////////////////////////////////////
// CHAOS ENVOY V1.00 //
// //
// Author: Tank-Commander //
// Requires: Dummy.mdl //
// Purpose: Hero Ultimate, very powerful manipulation ability //
// //
// Notes: //
// - It's a channeling spell //
// - Read the readme before you try modifying the config //
// - Use the "Helpful files" to help you import the spell //
// //
// Credits: //
// - (Dummy.mdl) Vexorian //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Chaos Envoy README //
// //
// This spell has a lot to configure so this readme will help //
// you set up your own Chaos Envoy spell to your liking //
// please read this through -fully- before attempting to change //
// the configuration //
// //
// If your editor does not automatically create variables for //
// JASS resources, please enable "automatically create unknown //
// variables while pasting trigger data" in the following path: //
// File -> Preferences -> General //
// //
// Once that is enabled, paste in the Variable Creator //
// (it can be deleted afterwards, it's just to create variables //
// and serves no other purpose) //
// //
// Contents: //
// //
// 1-- Setting SpellID and DummyID //
// 2-- Timer and Order //
// 3-- AOE //
// 4-- Magnetism //
// 5-- Aesthetics //
// 6-- Main Damage //
// 7-- Chaos Entity control //
// 8-- Chais Entity damage //
// 9-- Gravity, terrain and units //
// 10-- Attack, Damage, and weapon types //
// 11-- Unit Indexers //
// //
//-------------------------------1--------------------------------//
// Setting SpellID and DummyID: //
// To do this, find the spell you wish to set as the dummy //
// (or unit) then, find the data value of the spell/unit //
// if your editor is not already displaying data values then //
// you can enable the display by pressing Ctrl + D //
// before you panic, pressing Ctrl + D again, will revert the //
// the data value you're looking for will be in the unit //
// box in the object editor it should look like something //
// like this: u000 //
// //
// there may be something after that like :uloc and then the //
// actual name in brackets, but you want this four character //
// code. To set it remeber the code and put it between //
// these two characters: ' ' //
// e.g.: //
// 'u000' //
// //
// Now, you can take that, and place it in the respective ID //
// return function the line should look like this: //
// return 'u000' //
// //
// When you have completed this you are ready to move on to //
// the next part. //
// //
//-------------------------------2--------------------------------//
// Timer and Order: //
// This spell has two timers and one order, one of the timers //
// is for how fast the loop runs, the other, is how long //
// after a unit is removed, is the instance recycled //
// (it has a timer so that death effects can play) //
// //
// The first timer, will need to be set to something low //
// but not below 0.03 to prevent lag, setting it to //
// something high (above 0.05) may remove some of the //
// smoothness of the effects, it's recommended that you leave //
// the value at 0.03, but you may wish to change it //
// //
// The second timer, can technically be any number you like //
// and in most cases, it won't make any difference provided //
// it's over a second, and if not, the only change is that //
// some effects to not display properly due to the unit being //
// removed before they finish playing, it is in seconds //
// so 1.00 == 1 second, pretty simple and straightforward //
// //
// The order: This is a bit more complex though still fairly //
// straightforward, find your spell in the object editor //
// you're looking for "Text - Order string - Use/turn on" //
// in most cases this should be "channel" because the spell //
// needs to be channeled to word, but if you want to change //
// it you can, though it's not recommended //
// //
//-------------------------------3--------------------------------//
// AOE: //
// The AOE configurables essentially control the area of the //
// magnetism, rather than the spread of the projectiles //
// as for the projectiles, that will be covered later //
// for now, this section will focus on the magnetism AOE //
// //
// The AOE controls how far away from the portal you can be //
// and still be affected by it's AOE, if a unit leaves the //
// portal AOE, then it will be dropped by the portal //
// The AOE variables ought to manage to keep the projectiles //
// within the portal, if it is too small in relation to the //
// other factors, the entities will also fall out, as well as //
// any units which were taken for the ride //
// //
// "AOE Central" referrs to the boarders and how far they are //
// from the middle of the portal (also how far the entities //
// are created from the middle) experimenting with that may //
// give some interesting results, but remember the default //
// value of 100.00 //
// //
//-------------------------------4--------------------------------//
// Magnetism: //
// The Magnetism values need to be high,the base value should //
// be at least 10000.00 for it work correctly, having too //
// much magnetism (80000+) may cause some unforseen effects //
// Like units flying out of the top of the Map Z height, so //
// it's not really recommended (though you never know) //
// the increment can be anything really, the magnetism itself //
// will however alter the spread of the projectiles and units //
// if it is changed, if you want a maintained (or roughly //
// maintained pattern) I suggest an increment under 10000.00 //
// //
// Magnetism Decay: this works a little differently, unlike //
// normal gravity where it is stronger the closer to the //
// center, this spell has an inverted gravity, it's stronger //
// the further away a unit is, and weaker in the center //
// the decay controls how the distance from the target is //
// divided up, i.e. the default value is 400 //
// say a unit 1200 points apart is in range, the strength of //
// the magnetism they experience is: //
// MagnetismStrength * (1200/400) = MagnetismStrength * 3 //
// //
// So they experience 3x the normal magnetism strength where //
// as if they were at range 400, they'd experience normal //
// magnetism, and less if they were even closer than that //
// //
//-------------------------------5--------------------------------//
// Aesthetics: //
// There's a large number of aesthetic options available in //
// this spell, designed to give the user, the maximum amount //
// of options //
// //
// Portal Angle: Controls the pitch angle of the portal, 90 //
// is the upright position, 0 is on it's side //
// and so on //
// //
// Portal scale: Controls the size of the portal, growing //
// rates should be 0.00(i) i.e. 0.005 as to not make the //
// the portal grow too large 1 == 100%, 0.001 = 1% //
// //
// Portal Height: Controls how high from the terrain height //
// the portal is placed, having a low value here will cause //
// projectiles to instantly/quickly hit the ground, and units //
// will have lower(or possibly no) arc, will also mean more //
// units will be successfully caught by the terrain and not //
// pulled if you have TerrainMatters set to true, will also //
// effect the AOE of the projectiles (lower to the ground //
// means tighter spread, higher up means further apart) //
// //
// Portal/Boarder models: Set these to the model paths of the //
// models you desire, if you are getting them from the object //
// editor, remember to add a "\" to the pathname everywhere //
// there is already one, i.e. "path\path\path.mdl" //
// needs to be changed to "path\\path\\path.mdl" //
// //
// Boarder scale works the same way the portal scale does //
// so just follow the same steps, 0.25 to 0.50 works well for //
// boarders //
// //
// the space taken per segment works in a way that 6.00 means //
// you will have 6 boarder pieces, setting to something like //
// 100.00 will mean 100 segments, a number between 5 and 10 //
// works well here (as to not flood with effects) keep it //
// relative to the scale you set up //
// //
// Boarder height, again, works in the same way as a portal //
// height, should be roughly portal height + 50, but, if it //
// better suits your portal model, it can theoretically be //
// anything without having any impact to the rest of the //
// spell //
// //
// Chaos Entity model: same as the other model sets, with //
// the filepaths, also consider that this is a projectile so //
// you ought to set it to something which'd work as a //
// projectile, like prehaps nether drakes, locusts, rockets //
// anything really which isn't a building or a ground unit //
// //
// Chaos Entity scale neednot explain how this works a third //
// time //
// //
// Chaos Entity Z control, determines how much Z Velocity //
// each entity starts with, this in turn controls how far //
// out from the middle it goes and respectively how much //
// lower from the middle the projectiles go, setting this to //
// 0 will mean they maintain their height throughout and do //
// not go up/down as normal, default is 6.00, playing around //
// with this can have unexpected results, to invert the flow //
// use a negative value //
//-------------------------------6--------------------------------//
// Main Damage: //
// These controllers are all for the crush damage dealt by //
// units being thrown around by the spell, they do -not- //
// effect how much damage each entity does. //
// //
// All of these are relatively self-explanatory, you can deal //
// both health and mana damage with these configurables //
// damagetypes/weapontypes/attacktypes are set later which //
// will control the multiplyers of all these things //
// //
//-------------------------------7--------------------------------//
// Chaos Entity Control: //
// These controllers are primarily for controlling the number //
// of chaos entities and how fast they appear //
// //
// ChaosEntityCount: these controllers determine how many //
// leak through the portal each cycle of creation, having //
// a number higher than 45 at the max level as that will //
// cause lag on most machines (especially if multicasted //
// or other similar spells are around) 15 is the default at //
// level 3, anything under 30 is a relatively safe number //
// //
// ChaosEntityAOE: Controls how much area each missile covers //
// upon impact, anywhere from 50-120 is realistic, try to //
// keep it relative to the missile size (if it's large //
// 150-200 may be more appropriate) //
// //
// ChaosEntityRate: How long (in seconds) there is between //
// cycles of ChaosEntity leaks, 1-2 seconds works pretty well //
// remember to change the channelling duration of the spell //
// to match this (the longer the duration, the more cycled //
// leaks) //
// //
//-------------------------------8--------------------------------//
// Chaos Entity Damage: //
// Like the other fairly straight forward, health and mana //
// damage, base and per level values, does not effect the //
// main damage (unit throwing around damage) at all, each //
// projectile individually will have this damage, it is not //
// relative to the distance from the projectile //
// //
//-------------------------------9--------------------------------//
// Gravity, terrain and units: //
// These control optional features and projectile fall arcs //
// //
// Gravity: This is the strength of the terrain gravity which //
// causes entities and units to fall at a given rate, higher //
// means a stronger gravity and the faster projectiles come //
// back down, 20 is Low gravity, negative numbers are //
// Antigrav (you will crash the map doing this, so don't) //
// 60+ is high gravity, as such these will alter the spread //
// and AOE of your projectiles, as this is what determines //
// how fast they come back down //
// //
// TerrainMatters: This function poses a question, do you //
// want terrain to matter, or do you want units pulled from //
// wherever they are, regardless of the terrain height they //
// at it by relativity, changing this to true or false will //
// not alter projectile destruction when falling, though will //
// when they're in the portal (none will be destroyed until //
// they start falling) true will let units brace against the //
// ground to prevent being pulled, false will mean they can't //
// //
// EffectsUnits: This function poses a different question, do //
// you want units effected at all, or do you just want your //
// flurry of projectiles to be the only means of damage, if //
// you don't want units to be effected, it's suggested you //
// lower the projectile interval time (or increase the //
// channeling time) and increase the damage &/or AOE of your //
// spell to still give it that ultimate-level power, except //
// if you don't intend to use this ability as an ultimate //
// //
//------------------------------10--------------------------------//
// Attack, Damage, and Weapon types: //
// These features will determine your spells damage //
// multiplyers, you have controls for all three of these //
// things //
// //
// However, knowing all of these different types takes quite //
// a bit of knowledge, however they are listed here to make //
// it easier: //
// //
// Attack types all start with "ATTACK_TYPE_" //
// CHAOS, HERO, MAGIC, MELEE, NORMAL, PIERCE, SIEGE //
// //
// Damage types all start with "DAMAGE_TYPE_" //
// ACID, COLD, DEATH, DEFENSIVE, DEMOLITION, DISEASE, DIVINE //
// ENHANCED, FIRE, FORCE, LIGHTNING, MAGIC, MIND, NORMAL //
// PLANT, POSION, SHADOW_STRIKE, SLOW_POISON, SONIC //
// SPIRIT_LINK, UNIVERSAL, UNKNOWN //
// //
// Weapon types all start with "WEAPON_TYPE_" //
// Then add one of the following types: //
// AXE, CLAW, METAL, ROCK, WOOD. //
// Then add one of the classifications (note, some types do //
// not have any of these) //
// HEAVY, MEDIUM, LIGHT //
// Then add one of these: //
// CHOP, SLICE, BASH, STAB //
// //
// Remember to include underscores "_" between each word //
// and if you don't care for weapon types, you can always use //
// WEAPON_TYPE_WHOKNOWS, or even better: null //
// //
//-------------------------------11-------------------------------//
// Unit Indexers: //
// general unit indexers, neednot include any of the units //
// created by this spell, also, due to the high number of //
// entities created, intentionally excluding them, may be //
// benefiticial to your map. //
// to disclude these units from any unit indexer you may have //
// you can add this condition: //
// //
// and (GetUnitTypeId([unit variable]) != CE_DummyId()) then //
// //
// Adding that line to the end of your selection if statement //
// should prevent any of these units being added, remember to //
// change "[unit variable]" to match whatever variable you //
// stored the unit in i.e. TempUnit, Unit, u, U, etc. //
// (disclude the square brackets as well) //
// //
// if you are using this with a GUI unit indexer, then you //
// will need to add some additional lines for this to work: //
// //
// Custom Script: set [variable] = CE_DummyId() //
// Custom Script: set [variable2] = GetUnitTypeId(unit) //
// //
// then if your if statement, check that those two variables //
// are not the same (also, both variables are integers) //
// //
//----------------------------------------------------------------//
// //
// That concludes the readme for the CHAOS ENVOY spell //
// thank you for reading and enjoy the spell //
// //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Configuration of the spell can be done here, consult the //
// readme for more information on how to do this //
////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////
// Controller for the spell to be used as the //
// dummy ability and unit as the dummy unit //
//////////////////////////////////////////////////
constant function CE_SpellID takes nothing returns integer
return 'A011'
endfunction
constant function CE_DummyID takes nothing returns integer
return 'u004'
endfunction
//////////////////////////////////////////////////
// Controller for the timer speed (0.03 is //
// the standard timeout) //
//////////////////////////////////////////////////
constant function CE_TimerSpeed takes nothing returns real
return 0.03
endfunction
//////////////////////////////////////////////////
// Controller for how long a unit lasts //
// after it's usefulness has expired //
// (mostly for effects to play) //
//////////////////////////////////////////////////
constant function CE_DeathTimer takes nothing returns real
return 2.00
endfunction
//////////////////////////////////////////////////
// Controller for the order attached to the //
// Dummy ability //
//////////////////////////////////////////////////
constant function CE_Order takes nothing returns integer
return OrderId("channel")
endfunction
//////////////////////////////////////////////////
// Controllers for the Portal AOE (magnetism) //
// projectiles will ignore this AOE other //
// than for staying attached to the portal //
// until it disappates, if this value is //
// too small, projectiles will "fall out" //
//////////////////////////////////////////////////
constant function CE_AOEBase takes nothing returns real
return 250.00
endfunction
constant function CE_AOEPerLevel takes nothing returns real
return 100.00
endfunction
//////////////////////////////////////////////////
// Controllers for the centre of the portal //
//////////////////////////////////////////////////
constant function CE_AOECentral takes nothing returns real
return 100.00
endfunction
//////////////////////////////////////////////////
// Controllers for the magnetism strength //
// of the portal (playing around may give //
// odd results) //
//////////////////////////////////////////////////
constant function CE_MagnetismBase takes nothing returns real
return 30000.00
endfunction
constant function CE_MagnetismPerLevel takes nothing returns real
return 7500.00
endfunction
//////////////////////////////////////////////////
// Controllerfor the Magnetism decay, this is //
// how far from the portal, until a larger //
// proportion of magnetism is used //
// (exponential) //
//////////////////////////////////////////////////
constant function CE_MagnetismDecay takes nothing returns real
return 400.00
endfunction
//////////////////////////////////////////////////
// Constrollers for the portal aesthetics //
//////////////////////////////////////////////////
//////////////////////////////////////////////////
// Constroller for the angle of the model //
// (90 is upright) //
//////////////////////////////////////////////////
constant function CE_PortalAngle takes nothing returns integer
return 90
endfunction
//////////////////////////////////////////////////
// Controllers for the scale of the portal //
//////////////////////////////////////////////////
constant function CE_PortalStartScale takes nothing returns real
return 2.00
endfunction
constant function CE_PortalGrowthRateBase takes nothing returns real
return 0.003
endfunction
constant function CE_PortalGrowthRatePerLevel takes nothing returns real
return 0.002
endfunction
//////////////////////////////////////////////////
// Controller for how heigh up the portal is //
// (will change how units/projectiles behave //
// with the portal) //
//////////////////////////////////////////////////
constant function CE_PortalHeight takes nothing returns real
return 400.00
endfunction
//////////////////////////////////////////////////
// Controllers for the models used for the //
// portal and it's boarders //
//////////////////////////////////////////////////
constant function CE_PortalModel takes nothing returns string
return "Abilities\\Spells\\Undead\\Possession\\PossessionCaster.mdl"
endfunction
constant function CE_PortalBoarderModel takes nothing returns string
return "Abilities\\Spells\\Undead\\AntiMagicShell\\AntiMagicShell.mdl"
endfunction
//////////////////////////////////////////////////
// Controller for the size of the boarders //
//////////////////////////////////////////////////
constant function CE_PortalBoarderScale takes nothing returns real
return 0.25
endfunction
//////////////////////////////////////////////////
// Controller for how many boarder segments //
// the spell has (6.00 gives 6 boarders) //
//////////////////////////////////////////////////
constant function CE_PortalBoarderSpaceTakenPerSegment takes nothing returns real
return 6.00
endfunction
//////////////////////////////////////////////////
// Controller for how heigh the boarders of //
// the portal are set (should be about the //
// height of the poral + 50) //
//////////////////////////////////////////////////
constant function CE_PortalBoarderHeight takes nothing returns real
return 450.00
endfunction
//////////////////////////////////////////////////
// Controllers for the size of the projectiles //
//////////////////////////////////////////////////
constant function CE_ChaosEntityScaleBase takes nothing returns real
return 0.75
endfunction
constant function CE_ChaosEntityScalePerLevel takes nothing returns real
return 0.00
endfunction
//////////////////////////////////////////////////
// Controller for the models of the //
// projectiles //
//////////////////////////////////////////////////
constant function CE_ChaosEntityModel takes nothing returns string
return "Abilities\\Spells\\Undead\\DarkSummoning\\DarkSummonMissile.mdl"
endfunction
//////////////////////////////////////////////////
// Controller for the initial z velocity of //
// chaos entities, changes the aesthetic look //
// and the damage spread of the spell //
//////////////////////////////////////////////////
constant function CE_ChaosEntityZControl takes nothing returns real
return 6.00
endfunction
//////////////////////////////////////////////////
// End of the aesthetics configuration //
//////////////////////////////////////////////////
//////////////////////////////////////////////////
// Controllers for spell damage //
// (Non projectile) //
//////////////////////////////////////////////////
constant function CE_HealthDamageBase takes nothing returns real
return 200.00
endfunction
constant function CE_HealthDamagePerLevel takes nothing returns real
return 200.00
endfunction
constant function CE_ManaDamageBase takes nothing returns real
return 0.00
endfunction
constant function CE_ManaDamagePerLevel takes nothing returns real
return 0.00
endfunction
//////////////////////////////////////////////////
// Controllers for the number of projectiles //
// generated by the spell per cycle //
//////////////////////////////////////////////////
constant function CE_ChaosEntityCountBase takes nothing returns integer
return 0
endfunction
constant function CE_ChaosEntityCountPerLevel takes nothing returns integer
return 5
endfunction
//////////////////////////////////////////////////
// Controller for the AOE of the chaos //
// entities //
//////////////////////////////////////////////////
constant function CE_ChaosEntityAOE takes nothing returns real
return 125.00
endfunction
//////////////////////////////////////////////////
// Controller for the Chaos entity creation //
// rate (in seconds) //
//////////////////////////////////////////////////
constant function CE_ChaosEntityRate takes nothing returns real
return 1.50
endfunction
//////////////////////////////////////////////////
// Controllers for the damage dealt by the //
// Projectiles //
//////////////////////////////////////////////////
constant function CE_ChaosEntityHealthDamageBase takes nothing returns real
return 30.00
endfunction
constant function CE_ChaosEntityHealthDamagePerLevel takes nothing returns real
return 30.00
endfunction
constant function CE_ChaosEntityManaDamageBase takes nothing returns real
return 0.00
endfunction
constant function CE_ChaosEntityManaDamagePerLevel takes nothing returns real
return 0.00
endfunction
//////////////////////////////////////////////////
// Controller for how strong the terrain //
// gravity is (makes units return to the //
// ground when the rip ends) //
//////////////////////////////////////////////////
constant function CE_Gravity takes nothing returns real
return 40.00 * CE_TimerSpeed()
endfunction
//////////////////////////////////////////////////
// Controller for whether or not the terrain //
// heights effect the spell (arcs hitting //
// into it and such) //
//////////////////////////////////////////////////
constant function CE_TerrainMatters takes nothing returns boolean
return true
endfunction
//////////////////////////////////////////////////
// Controller for whether or not units are //
// pulled into the Portal //
//////////////////////////////////////////////////
constant function CE_EffectsUnits takes nothing returns boolean
return true
endfunction
//////////////////////////////////////////////////
// Controllers for the damage types and such //
//////////////////////////////////////////////////
constant function CE_MainDamageType takes nothing returns damagetype
return DAMAGE_TYPE_MAGIC
endfunction
constant function CE_ChaosEntityDamageType takes nothing returns damagetype
return DAMAGE_TYPE_NORMAL
endfunction
constant function CE_MainAttackType takes nothing returns attacktype
return ATTACK_TYPE_MAGIC
endfunction
constant function CE_ChaosEntityAttackType takes nothing returns attacktype
return ATTACK_TYPE_NORMAL
endfunction
constant function CE_MainWeaponType takes nothing returns weapontype
return null
endfunction
constant function CE_ChaosEntityWeaponType takes nothing returns weapontype
return null
endfunction
////////////////////////////////////////////////////////////////////
// End of the configuration of the spell, beyond this is the //
// programming used to run the spell, if you do not understand //
// JASS, then it is not recommended that you scroll any further //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function used to get the Z height of locations needed //
////////////////////////////////////////////////////////////////////
function CE_GetZ takes real x, real y returns real
call MoveLocation(udg_CE_ZLocation, x, y)
return (GetLocationZ(udg_CE_ZLocation))
endfunction
////////////////////////////////////////////////////////////////////
// Function used to identify targets for the magnetism or //
// damage of the spell depanding on what the current stage is //
////////////////////////////////////////////////////////////////////
function CE_TargetFilter takes unit u, player pl returns nothing
//Checks if the unit can be used as a target
if (IsUnitType(u, UNIT_TYPE_GROUND)) and (not IsUnitType(u, UNIT_TYPE_STRUCTURE)) and (not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)) and (IsUnitEnemy(u, pl)) and (GetUnitTypeId(u) != CE_DummyID()) and (not IsUnitInGroup(u, udg_CE_EffectedUnits)) and (not IsUnitType(u, UNIT_TYPE_DEAD)) then
call GroupAddUnit(udg_CE_TempGroup, u)
endif
endfunction
////////////////////////////////////////////////////////////////////
// Function used to move units currently affected by a portal //
// while not allowing them outside of map bounds //
////////////////////////////////////////////////////////////////////
function CE_GravityMove takes real Magnetism, real Radian, real Angle, real Angle2, real x, real y, real x2, real y2, real z, integer index returns nothing
//Setting the new locations X and Y for this instance
set x2 = x + udg_CE_XVelocity[index]
set y2 = y + udg_CE_YVelocity[index]
//Calculating the new velocities (will be used next time this runs)
set udg_CE_ZVelocity[index] = udg_CE_ZVelocity[index] + ((Magnetism / Radian) * CE_TimerSpeed()) * Sin(Angle2)
set udg_CE_XVelocity[index] = udg_CE_XVelocity[index] + ((Magnetism / Radian) * CE_TimerSpeed()) * Cos(Angle) * Cos(Angle2)
set udg_CE_YVelocity[index] = udg_CE_YVelocity[index] + ((Magnetism / Radian) * CE_TimerSpeed()) * Sin(Angle) * Cos(Angle2)
//Makes sure the new location is within the map bounds
if ((udg_CE_MapMinX <= x2) and (x2 <= udg_CE_MapMaxX) and (udg_CE_MapMinY <= y2)and (y2 <= udg_CE_MapMaxY)) then
call SetUnitX(udg_CE_UnitIndex[index], x2)
call SetUnitY(udg_CE_UnitIndex[index], y2)
endif
//Sets the correct fly height
call SetUnitFlyHeight(udg_CE_UnitIndex[index], udg_CE_CurrentZ[index] - z, 0.00)
endfunction
////////////////////////////////////////////////////////////////////
// Function used to detect if projectiles have crashed into //
// the ground and therefore need to either deal damage or be //
// damaged depending on what type of unit they are (unit or //
// chaos entity) //
////////////////////////////////////////////////////////////////////
function CE_ProjectileImpactDetection takes real z, real x, real y, integer index returns nothing
//Creates locals
local unit u
local player pl
//Checks if there has been a crash
if (udg_CE_CurrentZ[index] - z < 5.00) then
//Yes it crashed, deassociating the unit
set udg_CE_StageID[index] = 4
set udg_CE_Portal[index] = null
set pl = GetOwningPlayer(udg_CE_OriginalCaster[index])
if (GetUnitTypeId(udg_CE_UnitIndex[index]) == CE_DummyID()) then
call DestroyEffect(udg_CE_CurrentEffect[index])
//Select Units to damage
call GroupEnumUnitsInRange(udg_CE_TempGroup2, x, y, CE_ChaosEntityAOE(), null)
loop
//Scanning through
set u = FirstOfGroup(udg_CE_TempGroup2)
exitwhen u == null
call CE_TargetFilter(u, pl)
call GroupRemoveUnit(udg_CE_TempGroup2, u)
//Select all the units which are to be damaged
if (IsUnitInGroup(u, udg_CE_TempGroup)) then
//Dealing health and mana damage
call UnitDamageTarget(udg_CE_OriginalCaster[index], u, udg_CE_HealthDamage[index], true, false, CE_ChaosEntityAttackType(), CE_ChaosEntityDamageType(), CE_ChaosEntityWeaponType())
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u,UNIT_STATE_MANA) - udg_CE_ManaDamage[index]))
call GroupRemoveUnit(udg_CE_TempGroup, u)
endif
endloop
//Removes the projectile
call KillUnit(udg_CE_UnitIndex[index])
else
//Dealing health and mana damage
call UnitDamageTarget(udg_CE_OriginalCaster[index], udg_CE_UnitIndex[index], udg_CE_HealthDamage[index], true, false, CE_MainAttackType(), CE_MainDamageType(), CE_MainWeaponType())
call SetUnitState(udg_CE_UnitIndex[index], UNIT_STATE_MANA, (GetUnitState(udg_CE_UnitIndex[index],UNIT_STATE_MANA) - udg_CE_ManaDamage[index]))
//Allowing the unit to be reselected as a target for another instance
call GroupRemoveUnit(udg_CE_EffectedUnits, udg_CE_UnitIndex[index])
//Enabling the unit's pathing again
call SetUnitPathing(udg_CE_UnitIndex[index], true )
endif
endif
//Nulls variables
set u = null
set pl = null
endfunction
////////////////////////////////////////////////////////////////////
// Function used to clear instances of portals (when a portal //
// ends or if a new instance is casted when one is already //
// active, unit moves, etc.) //
////////////////////////////////////////////////////////////////////
function CE_EndPortal takes unit u returns nothing
//Creating local
local integer index = 0
//Deassociating all the units involves with this unit (will allow units and projectiles to fall)
loop
set index = index + 1
exitwhen index > udg_CE_MaxIndex
//Finds units with association to the eliminator unit (either the caster or the portal)
if (udg_CE_OriginalCaster[index] == u) then
set udg_CE_Portal[index] = null
//Finds portal edges
if (udg_CE_StageID[index] == 7) then
//Removes those edges
set udg_CE_StageID[index] = 4
call DestroyEffect(udg_CE_CurrentEffect[index])
elseif (udg_CE_StageID[index] != 4) then
//Everything else
set udg_CE_StageID[index] = 3
endif
endif
endloop
endfunction
////////////////////////////////////////////////////////////////////
// Function used to register new units (projectiles and //
// affected units) into the array so that the behave properly //
////////////////////////////////////////////////////////////////////
function CE_RegisterUnit takes integer index, real z, real x2, real y2, unit u, real YVel, real XVel, real ZVel returns nothing
//Sets up data for the next magnetised unit
set udg_CE_LaunchZ[udg_CE_MaxIndex] = CE_GetZ(x2, y2)
set udg_CE_TargetZ[udg_CE_MaxIndex] = z
//Sets up data for caster and portal it's being pulled into
set udg_CE_OriginalCaster[udg_CE_MaxIndex] = udg_CE_OriginalCaster[index]
set udg_CE_Portal[udg_CE_MaxIndex] = udg_CE_UnitIndex[index]
set udg_CE_AOE[udg_CE_MaxIndex] = udg_CE_AOE[index]
set udg_CE_CasterX[udg_CE_MaxIndex] = udg_CE_CasterX[index]
set udg_CE_CasterY[udg_CE_MaxIndex] = udg_CE_CasterY[index]
//Sets up the magnetism
set udg_CE_MagnetismStrength[udg_CE_MaxIndex] = udg_CE_MagnetismStrength[index]
set udg_CE_CurrentZ[udg_CE_MaxIndex] = udg_CE_LaunchZ[udg_CE_MaxIndex] + GetUnitFlyHeight(u)
set udg_CE_YVelocity[udg_CE_MaxIndex] = YVel
set udg_CE_XVelocity[udg_CE_MaxIndex] = XVel
set udg_CE_ZVelocity[udg_CE_MaxIndex] = ZVel
endfunction
////////////////////////////////////////////////////////////////////
// Main looping function, controls things from the magnetism //
// of the portal to the damage and projectile control within //
// the Chaos Rip //
////////////////////////////////////////////////////////////////////
function CE_Loop takes nothing returns nothing
//Setting up the local variables
local integer index = 0
local integer secondaryindex = 0
local real x
local real x2
local real y
local real y2
local real z
local real dx
local real dy
local real Dist
local real Angle
local real Angle2
local real Magnetism
local real Radian
local player pl
local unit u
//Loops through all the units within the system
loop
set index = index + 1
exitwhen index > udg_CE_MaxIndex
set x = GetUnitX(udg_CE_UnitIndex[index])
set y = GetUnitY(udg_CE_UnitIndex[index])
//Note: Stages are arranged in order of most used (for efficiency)
// They are numbered in order of appearence in an instance
//Finds units which are to be effected by the magnetism
if (udg_CE_StageID[index] == 2) then
//Initialises Magnetism factors
set x2 = GetUnitX(udg_CE_Portal[index])
set y2 = GetUnitY(udg_CE_Portal[index])
//Sets up this instance of the movement
set udg_CE_CurrentZ[index] = udg_CE_CurrentZ[index] + udg_CE_ZVelocity[index]
//Sets up calculating the next movement
set z = CE_GetZ(x, y)
set dy = y2 - y
set dx = x2 - x
set Dist = SquareRoot(dx * dx + dy * dy)
set Angle = Atan2(dy, dx)
set Angle2 = Atan2(udg_CE_TargetZ[index] - udg_CE_CurrentZ[index], Dist)
set Radian = SquareRoot((dx * dx) + (dy * dy) + (udg_CE_TargetZ[index] - udg_CE_CurrentZ[index]) * (udg_CE_TargetZ[index] - udg_CE_CurrentZ[index]))
//Calculates the magnetism strength for this instance
set Magnetism = udg_CE_MagnetismStrength[index] * (Dist / CE_MagnetismDecay())
if (Dist > udg_CE_AOE[index]) or (GetUnitCurrentOrder(udg_CE_OriginalCaster[index]) != CE_Order()) or (GetUnitX(udg_CE_OriginalCaster[index]) != udg_CE_CasterX[index]) or (GetUnitY(udg_CE_OriginalCaster[index]) != udg_CE_CasterY[index]) then
set udg_CE_StageID[index] = 3
endif
//Checks if the unit or entity have crashed
call CE_ProjectileImpactDetection(z, x, y, index)
//Moves the unit or entity around the Portal
call CE_GravityMove(Magnetism, Radian, Angle, Angle2, x, y, x2, y2, z, index)
//Checks if the unit is an entity - if it is, then setting its animation and facing direction
if (GetUnitTypeId(udg_CE_UnitIndex[index]) == CE_DummyID()) then
call SetUnitAnimationByIndex(udg_CE_UnitIndex[index], R2I(Atan2(udg_CE_ZVelocity[index], SquareRoot((udg_CE_XVelocity[index] * udg_CE_XVelocity[index]) + (udg_CE_YVelocity[index] * udg_CE_YVelocity[index]))) * bj_RADTODEG + 0.5) + 90)
call SetUnitFacing(udg_CE_UnitIndex[index], Angle * bj_RADTODEG)
endif
//Finds units which are falling out of the sky
elseif (udg_CE_StageID[index] == 3) then
set z = CE_GetZ(x, y)
set x2 = x + udg_CE_XVelocity[index]
set y2 = y + udg_CE_YVelocity[index]
set udg_CE_ZVelocity[index] = udg_CE_ZVelocity[index] - CE_Gravity()
set udg_CE_CurrentZ[index] = udg_CE_CurrentZ[index] + udg_CE_ZVelocity[index]
//Makes sure the projectile or unit does not leave the map bounds (may look a bit odd but is necessary)
if ((udg_CE_MapMinX <= x) and (x <= udg_CE_MapMaxX) and (udg_CE_MapMinY <= y) and (y <= udg_CE_MapMaxY)) then
call SetUnitX(udg_CE_UnitIndex[index], x2)
call SetUnitY(udg_CE_UnitIndex[index], y2)
endif
call SetUnitFlyHeight(udg_CE_UnitIndex[index], udg_CE_CurrentZ[index] - z, 0.00)
call CE_ProjectileImpactDetection(z, x, y, index)
set Angle = Atan2(y2 - y, x2 - x)
if (GetUnitTypeId(udg_CE_UnitIndex[index]) == CE_DummyID()) then
call SetUnitAnimationByIndex(udg_CE_UnitIndex[index], R2I(Atan2(udg_CE_ZVelocity[index], SquareRoot((udg_CE_XVelocity[index] * udg_CE_XVelocity[index]) + (udg_CE_YVelocity[index] * udg_CE_YVelocity[index]))) * bj_RADTODEG + 0.5) + 90)
call SetUnitFacing(udg_CE_UnitIndex[index], Angle * bj_RADTODEG)
endif
//Finds units which are initial portals of an instance
elseif (udg_CE_StageID[index] == 1) then
if (GetUnitCurrentOrder(udg_CE_OriginalCaster[index]) != CE_Order()) or (GetUnitX(udg_CE_OriginalCaster[index]) != udg_CE_CasterX[index]) or (GetUnitY(udg_CE_OriginalCaster[index]) != udg_CE_CasterY[index]) then
set udg_CE_StageID[index] = 4
call DestroyEffect(udg_CE_CurrentEffect[index])
call CE_EndPortal(udg_CE_OriginalCaster[index])
else
//Initialising data and increasing the portal size
set z = CE_GetZ(x, y) + CE_PortalHeight()
set u = udg_CE_UnitIndex[index]
set udg_CE_CurrentSize[index] = udg_CE_CurrentSize[index] + udg_CE_GrowthRate[index]
set pl = GetOwningPlayer(udg_CE_OriginalCaster[index])
call SetUnitScale(udg_CE_UnitIndex[index], udg_CE_CurrentSize[index], 0.00, 0.00)
if (udg_CE_CurrentProjectileDelay[index] > CE_ChaosEntityRate()) then
//Creating New projectile wave
set Angle = 0
//Reset the delay timer
set udg_CE_CurrentProjectileDelay[index] = 0.00
loop
//Calculating position and initialising
set Angle = Angle + (360.00 / udg_CE_ChaosEntityCount[index])
set secondaryindex = secondaryindex + 1
set x2 = x + CE_AOECentral() * Cos(Angle * bj_DEGTORAD)
set y2 = y + CE_AOECentral() * Sin(Angle * bj_DEGTORAD)
set udg_CE_MaxIndex = udg_CE_MaxIndex + 1
set udg_CE_UnitIndex[udg_CE_MaxIndex] = CreateUnit(Player(14), CE_DummyID(), x2, y2, Angle)
set udg_CE_CurrentEffect[udg_CE_MaxIndex] = AddSpecialEffectTarget(CE_ChaosEntityModel(), udg_CE_UnitIndex[udg_CE_MaxIndex], "origin")
set udg_CE_HealthDamage[udg_CE_MaxIndex] = CE_ChaosEntityHealthDamageBase() + (CE_ChaosEntityHealthDamagePerLevel() * udg_CE_rLevel[index])
set udg_CE_ManaDamage[udg_CE_MaxIndex] = CE_ChaosEntityManaDamageBase() + (CE_ChaosEntityManaDamagePerLevel() * udg_CE_rLevel[index])
set udg_CE_CurrentDeathTimer[udg_CE_MaxIndex] = 0.00
set udg_CE_StageID[udg_CE_MaxIndex] = 2
set udg_CE_Portal[udg_CE_MaxIndex] = u
//Makes terrain height changing possible if not already
if UnitAddAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') then
endif
//Applying Aesthetics
call SetUnitScale(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_ChaosEntityScaleBase() + (CE_ChaosEntityScalePerLevel() * udg_CE_rLevel[index]), 0.00, 0.00)
call SetUnitFlyHeight(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalHeight(), 0.00)
call SetUnitAnimationByIndex(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalAngle())
//Setting up data of the new magnetised unit
call CE_RegisterUnit(index, z, x2, y2, u, 0.00, 0.00, CE_ChaosEntityZControl())
call GroupAddUnit(udg_CE_EffectedUnits, udg_CE_UnitIndex[index])
exitwhen secondaryindex == udg_CE_ChaosEntityCount[index]
endloop
set secondaryindex = 0
else
//Increase the delay timer on the projectiles
set udg_CE_CurrentProjectileDelay[index] = udg_CE_CurrentProjectileDelay[index] + CE_TimerSpeed()
endif
if (CE_EffectsUnits()) then
call GroupEnumUnitsInRange(udg_CE_TempGroup2, x, y, udg_CE_AOE[index], null)
//Filters through all the units within the range of the portal which can be used as targets
loop
set u = FirstOfGroup(udg_CE_TempGroup2)
exitwhen u == null
call CE_TargetFilter(u, pl)
call GroupRemoveUnit(udg_CE_TempGroup2, u)
//Actions for units which have been found to be viable targets
if (IsUnitInGroup(u, udg_CE_TempGroup)) and (not IsUnitInGroup(u, udg_CE_EffectedUnits)) then
//Data initialisation
set x2 = GetUnitX(u)
set y2 = GetUnitY(u)
set dx = x2 - x
set dy = y2 - y
set Angle = Atan2(dy, dx)
set Dist = SquareRoot(dx * dx + dy * dy)
set udg_CE_MaxIndex = udg_CE_MaxIndex + 1
set udg_CE_UnitIndex[udg_CE_MaxIndex] = u
set udg_CE_CurrentDeathTimer[udg_CE_MaxIndex] = 0.00
set udg_CE_HealthDamage[udg_CE_MaxIndex] = udg_CE_HealthDamage[index]
set udg_CE_ManaDamage[udg_CE_MaxIndex] = udg_CE_ManaDamage[index]
//Makes terrain height changing possible if not already
if UnitAddAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') then
endif
call SetUnitPathing(u, false )
set udg_CE_StageID[udg_CE_MaxIndex] = 2
//Sets up data for the next magnetised unit
call CE_RegisterUnit(index, z, x2, y2, u, 0.00, 0.00, 6.00)
//Makes this unit unselectable as a target until the end of this spell instance
call GroupAddUnit(udg_CE_EffectedUnits, u)
call GroupRemoveUnit(udg_CE_TempGroup, u)
endif
endloop
endif
endif
//Finds units which need to be recycled
elseif (udg_CE_StageID[index] == 4) then
//Checks if the death timer has expired
if (udg_CE_CurrentDeathTimer[index] >= CE_DeathTimer()) then
set udg_CE_CurrentDeathTimer[index] = 0.00
//Removing projectiles from the game
if (GetUnitTypeId(udg_CE_UnitIndex[index]) == CE_DummyID()) then
call RemoveUnit(udg_CE_UnitIndex[index])
endif
//Recycling the instance of the spell
set udg_CE_AOE[index] = udg_CE_AOE[udg_CE_MaxIndex]
set udg_CE_CasterX[index] = udg_CE_CasterX[udg_CE_MaxIndex]
set udg_CE_CasterY[index] = udg_CE_CasterY[udg_CE_MaxIndex]
set udg_CE_ChaosEntityCount[index] = udg_CE_ChaosEntityCount[udg_CE_MaxIndex]
set udg_CE_CurrentDeathTimer[index] = udg_CE_CurrentDeathTimer[udg_CE_MaxIndex]
set udg_CE_CurrentEffect[index] = udg_CE_CurrentEffect[udg_CE_MaxIndex]
set udg_CE_CurrentProjectileDelay[index] = udg_CE_CurrentProjectileDelay[udg_CE_MaxIndex]
set udg_CE_CurrentSize[index] = udg_CE_CurrentSize[udg_CE_MaxIndex]
set udg_CE_CurrentZ[index] = udg_CE_CurrentZ[udg_CE_MaxIndex]
set udg_CE_GrowthRate[index] = udg_CE_GrowthRate[udg_CE_MaxIndex]
set udg_CE_HealthDamage[index] = udg_CE_HealthDamage[udg_CE_MaxIndex]
set udg_CE_LaunchZ[index] = udg_CE_LaunchZ[udg_CE_MaxIndex]
set udg_CE_MagnetismStrength[index] = udg_CE_MagnetismStrength[udg_CE_MaxIndex]
set udg_CE_ManaDamage[index] = udg_CE_ManaDamage[udg_CE_MaxIndex]
set udg_CE_OriginalCaster[index] = udg_CE_OriginalCaster[udg_CE_MaxIndex]
set udg_CE_Portal[index] = udg_CE_Portal[udg_CE_MaxIndex]
set udg_CE_StageID[index] = udg_CE_StageID[udg_CE_MaxIndex]
set udg_CE_TargetZ[index] = udg_CE_TargetZ[udg_CE_MaxIndex]
set udg_CE_UnitIndex[index] = udg_CE_UnitIndex[udg_CE_MaxIndex]
set udg_CE_XVelocity[index] = udg_CE_XVelocity[udg_CE_MaxIndex]
set udg_CE_YVelocity[index] = udg_CE_YVelocity[udg_CE_MaxIndex]
set udg_CE_ZVelocity[index] = udg_CE_ZVelocity[udg_CE_MaxIndex]
set udg_CE_iLevel[index] = udg_CE_iLevel[udg_CE_MaxIndex]
set udg_CE_rLevel[index] = udg_CE_rLevel[udg_CE_MaxIndex]
set udg_CE_MaxIndex = udg_CE_MaxIndex - 1
set index = index - 1
//Stopping the timer if there are no more instances to run
if (udg_CE_MaxIndex == 0) then
call DestroyTimer(GetExpiredTimer())
endif
else
//If the death timer has not expired, increase how long it's been running
set udg_CE_CurrentDeathTimer[index] = udg_CE_CurrentDeathTimer[index] + CE_TimerSpeed()
endif
endif
endloop
//Nulls variables
set u = null
endfunction
////////////////////////////////////////////////////////////////////
// Function ran to create a new instance of the spell, inits a //
// portal, giving it the starting information it requires //
////////////////////////////////////////////////////////////////////
function TrigCE_AllocateData takes nothing returns boolean
// Sets up the variables required for creating units
local unit u
local integer index
local integer iLevel
local real rLevel
local real x
local real x2
local real y
local real y2
local real Angle
// Checks if the ability casted was the correct one
if (GetSpellAbilityId() == CE_SpellID()) then
//Assigning data to locals
set u = GetTriggerUnit()
set iLevel = GetUnitAbilityLevel(u, CE_SpellID())
set rLevel = R2I(iLevel)
set x = GetSpellTargetX()
set x2 = GetUnitX(u)
set y = GetSpellTargetY()
set y2 = GetUnitY(u)
set Angle = 0.00
//Ends all previous instances of the spell associated with the unit
call CE_EndPortal(u)
// Initialises new spell instance
set udg_CE_MaxIndex = udg_CE_MaxIndex + 1
set udg_CE_UnitIndex[udg_CE_MaxIndex] = CreateUnit(Player(14), CE_DummyID(), x, y, Atan2(y - y2, x - x2))
set udg_CE_AOE[udg_CE_MaxIndex] = CE_AOEBase() + (CE_AOEPerLevel() * rLevel)
set udg_CE_CurrentEffect[udg_CE_MaxIndex] = AddSpecialEffectTarget(CE_PortalModel(), udg_CE_UnitIndex[udg_CE_MaxIndex], "origin")
set udg_CE_MagnetismStrength[udg_CE_MaxIndex] = CE_MagnetismBase() + (CE_MagnetismPerLevel() * rLevel)
set udg_CE_GrowthRate[udg_CE_MaxIndex] = CE_PortalGrowthRateBase() + (CE_PortalGrowthRatePerLevel() * rLevel)
set udg_CE_ChaosEntityCount[udg_CE_MaxIndex] = CE_ChaosEntityCountBase() + (CE_ChaosEntityCountPerLevel() * iLevel)
set udg_CE_CurrentSize[udg_CE_MaxIndex]= CE_PortalStartScale()
set udg_CE_CurrentProjectileDelay[udg_CE_MaxIndex] = 0.00
set udg_CE_CurrentDeathTimer[udg_CE_MaxIndex] = 0.00
set udg_CE_OriginalCaster[udg_CE_MaxIndex] = u
set udg_CE_CasterX[udg_CE_MaxIndex] = x2
set udg_CE_CasterY[udg_CE_MaxIndex] = y2
set udg_CE_Portal[udg_CE_MaxIndex] = null
set udg_CE_iLevel[udg_CE_MaxIndex] = iLevel
set udg_CE_rLevel[udg_CE_MaxIndex] = rLevel
set udg_CE_StageID[udg_CE_MaxIndex] = 1
set udg_CE_HealthDamage[udg_CE_MaxIndex] = CE_HealthDamageBase() + (CE_HealthDamagePerLevel() * rLevel)
set udg_CE_ManaDamage[udg_CE_MaxIndex] = CE_ManaDamageBase() + (CE_ManaDamagePerLevel() * rLevel)
//Makes terrain height changing possible if not already
if UnitAddAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') then
endif
//Sets up the aesthetics of the portal
call SetUnitScale(udg_CE_UnitIndex[udg_CE_MaxIndex], udg_CE_CurrentSize[udg_CE_MaxIndex], 0.00, 0.00)
call SetUnitFlyHeight(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalHeight(), 0.00)
call SetUnitAnimationByIndex(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalAngle())
//If no timer is currently running (Max Index was 0 before this) create a new one
if (udg_CE_MaxIndex == 1) then
call TimerStart(CreateTimer(), CE_TimerSpeed(), true, function CE_Loop)
endif
set u = udg_CE_UnitIndex[udg_CE_MaxIndex]
//Creating Aesthetic portal boarder
loop
//Calculating position and initialising
set Angle = Angle + (360.00 / CE_PortalBoarderSpaceTakenPerSegment())
set x2 = x + CE_AOECentral() * Cos(Angle * bj_DEGTORAD)
set y2 = y + CE_AOECentral() * Sin(Angle * bj_DEGTORAD)
set udg_CE_MaxIndex = udg_CE_MaxIndex + 1
set udg_CE_UnitIndex[udg_CE_MaxIndex] = CreateUnit(Player(14), CE_DummyID(), x2, y2, Angle)
set udg_CE_CurrentEffect[udg_CE_MaxIndex] = AddSpecialEffectTarget(CE_PortalBoarderModel(), udg_CE_UnitIndex[udg_CE_MaxIndex], "origin")
set udg_CE_OriginalCaster[udg_CE_MaxIndex] = GetTriggerUnit()
set udg_CE_CurrentDeathTimer[udg_CE_MaxIndex] = 0.00
set udg_CE_StageID[udg_CE_MaxIndex] = 7
set udg_CE_Portal[udg_CE_MaxIndex] = u
//Makes terrain height changing possible if not already
if UnitAddAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') and UnitRemoveAbility(udg_CE_UnitIndex[udg_CE_MaxIndex], 'Amrf') then
endif
//Applying Aesthetics
call SetUnitScale(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalBoarderScale(), 0.00, 0.00)
call SetUnitFlyHeight(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalBoarderHeight(), 0.00)
call SetUnitAnimationByIndex(udg_CE_UnitIndex[udg_CE_MaxIndex], CE_PortalAngle())
exitwhen Angle >= 360.00
endloop
endif
//Nulls variables
set u = null
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function used to start up the spell, initialises events //
// and conditions needed for the spell to run correctly //
////////////////////////////////////////////////////////////////////
function InitTrig_CE_ChaosEnvoy takes nothing returns nothing
local trigger CE = CreateTrigger()
local integer index = 0
//Initialise the event for every player
loop
call TriggerRegisterPlayerUnitEvent(CE, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(CE, Condition(function TrigCE_AllocateData))
//Sets up the map bounds the spell with use
set udg_CE_MapMaxX = GetRectMaxX(bj_mapInitialPlayableArea)
set udg_CE_MapMinX = GetRectMinX(bj_mapInitialPlayableArea)
set udg_CE_MapMaxY = GetRectMaxY(bj_mapInitialPlayableArea)
set udg_CE_MapMinY = GetRectMinY(bj_mapInitialPlayableArea)
//Sets up the Z location finder
set udg_CE_ZLocation = Location(0,0)
//Nulls variables
set CE = null
endfunction
////////////////////////////////////////////////////////////////////
// DEVASTATION ENVOY V1.00 //
// //
// Author: Tank-Commander //
// Requires: Dummy.mdl //
// Purpose: Spam-cast spell //
// //
// Notes: //
// - Read the readme before you try modifying the config //
// - Use the "Helpful files" to help you import the spell //
// //
// Credits: //
// - (Dummy.mdl) Vexorian //
// //
// //
// If you have used this spell in your map, you are required //
// to give credits to Tank-Commander for the creation of it //
// If you take a snippet from this code for physics reasons //
// or whatever else, if possible, also give credit for its //
// source origin //
// //
// Importing: Remember to import Dummy.mdl and possibly the //
// object data when importing this spell (just the ability and //
// dummy unit) note that importing the dummy unit object should //
// be done AFTER importing Dummy.mdl, if not, then you will //
// need to set the model of the dummy to Dummy.mdl yourself, if //
// you would like to change what your dummy unit is you can, //
// but it will still need Dummy.mdl for this spell to work //
// If you have problems, make sure you read the readme first //
// and follow it to the best of your abilities before posting //
// comments //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// README: //
// Before modifying this spell a few things need to be //
// understood and read, this is one of those things, while //
// most modification can be considered intuitive, it still //
// helps to read through these intstructions, as they will //
// inform you about how to configure this spell to your //
// desire. //
//----------------------------------------------------------------//
// Initial importing: The variable creator trigger can be //
// imported first and if you have the correct settings (file, //
// preferences, General, automatically create unknown variables //
// checked, then when you pasta in the variable creator it //
// will automatically give you all the variables you need for //
// this spell //
//----------------------------------------------------------------//
// This configuration is ordered by category of use, and not //
// alphabetically, the ones you're most likely to want to //
// change, are earlier in the readme, the most essential being //
// first. These categories are: //
// //
// - Data Values: The most essential to change, otherwise the //
// spell will simply not function //
// //
// - ChronoKinetic: Fancy word for affecting the flow of time //
// Contains things like the duration of the //
// spell, the Timer speed and Shard Spawn rate //
// //
// - Power: Controls the aspects of the speed of the shards //
// based on the Mass, and Radius of the Portal //
// //
// - Damage: Controls the AOE and damage (health and mana) //
// values each individual Shard has //
// //
// - Aesthetics: Controls the Appearences of the ability - the //
// models used, the scales of those models and //
// so on //
// //
// - Damage Information: Contains things like weapontypes and //
// damage types, etc. //
// //
// - Other Attributes: Contains the world gravity, death timer //
// Height let and the celestial Gravitational //
// constant. //
//----------------------------------------------------------------//
// DATA VALUES //
//----------------------------------------------------------------//
// Dummy ID: This is the raw data of the dummy unit, to see //
// raw data in the object editor, press Ctrl + D, doing this //
// again will switch it back, if you want to change this dummy //
// unit, follow as displayed (use the first 4 characters in //
// the raw data and put them in ' markers) //
constant function DE_DummyID takes nothing returns integer
return 'u002'
endfunction
//----------------------------------------------------------------//
// Spell ID: This is done in the same manner as the Dummy ID //
// except that this time, you're doing it with ability raw //
// data, see the dummy unit if you do not know already how to //
// view raw data //
constant function DE_SpellID takes nothing returns integer
return 'A00T'
endfunction
//----------------------------------------------------------------//
// CHRONOKINETIC //
//----------------------------------------------------------------//
// Timer Speed: The default for this is 0.03, it determines how //
// many times per second these triggers are ran, normally you //
// want to leave this at 0.03, but 0.04 and prehaps 0.05 //
// would be good options if you computer lags a bit. //
constant function DE_TimerSpeed takes nothing returns real
return 0.03
endfunction
//----------------------------------------------------------------//
// Duration Base: Determines how long each cast will last as a //
// base value - this is to help give better control when //
// scaling abilities while not having to change values for each //
// level, cutting out a lot of configuration time, the value is //
// in seconds (1.00 = 1second) //
constant function DE_DurationBase takes nothing returns real
return 1.50
endfunction
//----------------------------------------------------------------//
// Duration Per Level: Deter,omes jpw ;pmg eacj casy wo;; as a //
// per level value - at level one this will be applied once, //
// twice at level two and so forth, it is added on to the base //
// value to come to the actual duration of the spell instance //
constant function DE_DurationPerLevel takes nothing returns real
return 0.50
endfunction
//----------------------------------------------------------------//
// Spawn Rate Base: A base value, this controls how many //
// seconds there are between each Shard being created, if this //
// is the same or lower (the sum total of the Base and Per //
// Level) is lower or equal to the timer speed, then one Shard //
// will be made every Timer Speed seconds (Time is a decimal //
// value, 0.5 is half a second) //
constant function DE_SpawnRateBase takes nothing returns real
return 0.15
endfunction
//----------------------------------------------------------------//
// Spawn Rate Per Level: The other part to the spawn rate //
// remember that it's a decimal value and the lower it is, the //
// faster Shards are created, so for this per level you'll //
// normally either want a negative value, or 0.00, though you //
// are not limited to such values //
constant function DE_SpawnRatePerLevel takes nothing returns real
return -0.02
endfunction
//----------------------------------------------------------------//
// POWER //
//----------------------------------------------------------------//
// Radius Base: This Base value determines how far out from the //
// center the shards are created, it also affects the gravity //
// strength of the Portal - the smaller the radius in relation //
// to it's Mass, the higher the gravitational effect and the //
// more volatile the Shards will be //
constant function DE_RadiusBase takes nothing returns real
return 100.00
endfunction
//----------------------------------------------------------------//
// Radius Per Level: The per level component to the Radius, //
// works the same all the other per level factors, giving this //
// a negative value will make your Portal smaller but more //
// volatile each level, and a positive value will make it large //
// and more stable //
constant function DE_RadiusPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Mass Base: the Mass within the Portal, the main strength of //
// the gravitational pull, larger numbers will decrease //
// stability and increase the speed the Shards move, lowering //
// it makes it more stable, but unlike the Radius, it does not //
// affect the size of your Portal, works well for a baseline //
// when testing different levels of instability or stability //
// when getting your preferences for the spell //
constant function DE_MassBase takes nothing returns real
return 800.00
endfunction
//----------------------------------------------------------------//
// Mass Per Level: the Per level component of the Mass can make //
// the spell more stable or volatile as it levels up without //
// changing it's size, remember that it is applied once at level //
// one, so the values 800 and 400 (the defaults) yeild 1200 //
// Mass at level one //
constant function DE_MassPerLevel takes nothing returns real
return 400.00
endfunction
//----------------------------------------------------------------//
// DAMAGE //
//----------------------------------------------------------------//
// Shard AOE Base: Determines the area of effect of the shards //
// 90 is melee range, 40 is directly on top, 20 is probably too //
// small an area to work and 400 to large, try different values //
// and see what you like //
constant function DE_ShardAOEBase takes nothing returns real
return 175.00
endfunction
//----------------------------------------------------------------//
// Shard AEO Per Level: Normally not used, but here for your //
// preferences, allows you to adjust the area of effect of your //
// shards as they level up, normally only making the area larger //
// makes logical sense, or not changing it at all //
constant function DE_ShardAOEPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Health Damage Base: This is the damage the spell deals to //
// all the units within the AOE on impact with a shard, you'll //
// want to make this fairly relative to the number of shards //
// you have, 75 shards with 100 damage each is 7500 damage in //
// one cast of the spell - that's a lot of potential damage in //
// a spell which has no cooldown by default, note that this //
// damage is not true damage - enemies will have their armour //
// applied and reduce this damage based on their armour type //
// vs your damage type //
constant function DE_HealthDamageBase takes nothing returns real
return 75.00
endfunction
//----------------------------------------------------------------//
// Health Damage Per Level: For changing the amount of damage //
// you want to deal with each shard as you level up, normally //
// this is your main source of increased damage as the spell //
// levels up rather than the other factors, it makes little //
// sense to not have this as a positive value of some number //
// (25% of your total level 1 damage seems like a good number, //
// i.e. if your combined level one damage is 100, roughly 25 of //
// that damage should probably be coming from this per level //
// value //
constant function DE_HealthDamagePerLevel takes nothing returns real
return 25.00
endfunction
//----------------------------------------------------------------//
// Mana Damage Base: Unlike Health damage the mana damage is //
// true damage - no matter how much armour they have, exactly //
// these values will be subtracted from their mana, normally //
// this is 0 as mana damage is mostly useless except vs certain //
// enemies, but it's still good to have the option to be able //
// to have it if you want //
constant function DE_ManaDamageBase takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Mana Damage Per Level: Per level component of the normally //
// disused mana damage, not any real sense in having a below 0 //
// amount here, since it'll only make it weaker, like the //
// health damage I suggest this to be 25% of your total mana //
// damage of your level 1 version //
constant function DE_ManaDamagePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// AESTHETICS //
//----------------------------------------------------------------//
// Portal Model: This determines the model used for your //
// main portal, you want to use the model path and paste it //
// into the double quotes or " markers, if the path has only //
// single slashes (\) you'll need to changeb it to double slash //
// (\\) before you save, the spell will not work if you do not //
// do this (if you acidentally save with the single slash (\) //
// it will still save but you may find yourself having a //
// lingering Progress bar at full percentage, you can ignore it //
// for the most part, but if you have it, you probably haven't //
// entered this field correctly. Get the model paths from the //
// Object editor - find the model you want (the model, not the //
// unit, in the models list, select it and hit enter twice, //
// then select the path (will look similar to this default //
// value, and paste in it here) I suggest doing this with a //
// unit of no value (changing the model to get the model path) //
// and then reset the field afterwards to get the unit back to //
// normal //
constant function DE_PortalModel takes nothing returns string
return "Abilities\\Weapons\\WitchDoctorMissile\\WitchDoctorMissile.mdl"
endfunction
//----------------------------------------------------------------//
// Shard Model: The model used for your individual shards, //
// follow the steps in the "Portal Model" section if you need //
// information on how to change these values successfully //
constant function DE_ShardModel takes nothing returns string
return "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl"
endfunction
//----------------------------------------------------------------//
// Impact Model: The model used for your individual shards, //
// follow the steps in the "Portal Model" section if you need //
// information on how to change these values successfully //
constant function DE_ImpactModel takes nothing returns string
return "Abilities\\Spells\\Undead\\AnimateDead\\AnimateDeadTarget.mdl"
endfunction
//----------------------------------------------------------------//
// Attachment Point: This determines where on the unit the //
// model is placed, "origin", "chest", "head", "overhead" are //
// all good places to put the model, switch them around to see //
// which you prefer the most, "foot" and "hand" are less so as //
// they're offsetted from the center //
constant function DE_AttachmentPoint takes nothing returns string
return "origin"
endfunction
//----------------------------------------------------------------//
// Portal Height Base: This is how height the portal is off the //
// floor (it is added onto the terrain Z) you'll want it a good //
// distance off the ground (unles you want Shards to smack into //
// the ground while the spell is still going off, which is a //
// viable thing to do for this spell) but not so high as to //
// send the Shards halfway across the map, 400 is default //
constant function DE_PortalHeightBase takes nothing returns real
return 400.00
endfunction
//----------------------------------------------------------------//
// Portal Height Per Level: The per level for the height of the //
// portal, generally this'll be set at 0 as the spell changes //
// more on functionality, than on effectiveness depending on //
// height - so changing this value as it levels up will not //
// necessarily make it any stronger or weaker //
constant function DE_PortalHeightPerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// Portal Scale Base: this is the scale of the portal model //
// it's a decimal percentage (1.00 = 100%) as the largest part //
// of the spell you'll normally want this at, at least 100% //
// depending on the model, generally a good idea to try to line //
// it up with your portal radius as to get the best effect out //
// of it //
constant function DE_PortalScaleBase takes nothing returns real
return 2.00
endfunction
//----------------------------------------------------------------//
// Portal Scale Per Level: Used for changing the portal scale //
// as it levels up - good in combination with radius change per //
// level as to stay correct relatively //
constant function DE_PortalScalePerLevel takes nothing returns real
return 1.00
endfunction
//----------------------------------------------------------------//
// Shard Scale Base: Scales the Shards that are created by the //
// portal, normally you'll want them significantly smaller that //
// the portal 10% (0.10) is a good size, but for some models a //
// bit bigger might be good, be sure to play around with this //
// to get the size you want and looks best in your opinion //
constant function DE_ShardScaleBase takes nothing returns real
return 0.10
endfunction
//----------------------------------------------------------------//
// Shard Scale Per Level: Also for use with making the portal //
// seem relatively the same size as it levels up - or simply //
// to make them bigger to show increased AOE, Damage, more or //
// less to show anything about the spell being stronger as it //
// levels up and becomes more powerful //
constant function DE_ShardScalePerLevel takes nothing returns real
return 0.00
endfunction
//----------------------------------------------------------------//
// DAMAGE INFORMATION //
//----------------------------------------------------------------//
// Damage Type: These determine the damagetypes, changing this //
// will modify the damage multiplyers vs certain enemies //
// the standard is DAMAGE_TYPE_MAGIC, note that this spell //
// automatically discludes magic immunes, so changing this //
// damage type will not make them start taking damage //
constant function DE_AttackType takes nothing returns attacktype
return ATTACK_TYPE_MAGIC
endfunction
//----------------------------------------------------------------//
// Attack Type: This is very much so basically the same as //
// Damage Type, generally you'll want this to match with it //
// as such the default is ATTACK_TYPE_MAGIC, though Damagetype //
// is a key factor for determining bonuses rather than this //
// but unlike weapontype, you cannot have null as a setting //
constant function DE_DamageType takes nothing returns damagetype
return DAMAGE_TYPE_MAGIC
endfunction
//----------------------------------------------------------------//
// Weapon Type: This alters what kind of weapon type is used by //
// the spell, those without knowledge of weapontypes don't //
// worry, you're not missing much, this spell doesn't really //
// use it, hence the default of null, but if you want to use //
// them, no reason to not. //
constant function DE_WeaponType takes nothing returns weapontype
return null
endfunction
//----------------------------------------------------------------//
// OTHER ATTRIBUTES //
//----------------------------------------------------------------//
// Gravity: Determines the worldly gravity strength used to //
// pull the shards back to the ground after they have been //
// freed from the portal, having a lower gravity increases the //
// spread range, higher lowers it, the default is 1/8 of the //
// earthly gravity of 9.81, beng 1.22625 //
constant function DE_Gravity takes nothing returns real
return 1.22625
endfunction
//----------------------------------------------------------------//
// Gravitational Constant: This is the constant reprisented by //
// G in Celestial Physics and Mechanics. Normally it's //
// 6.67384 x 10^-11 N (m/kg)^2 but for Warcraft purposes I //
// cranked it up a bit, (x 10^11 to be exact) changing it may //
// yeild interesting results, but I take no responcibility if //
// you do something silly and crash the game by making it //
// really high //
constant function DE_GravitationalConstant takes nothing returns real
return 6.67384
endfunction
//----------------------------------------------------------------//
// Height Let: This is a small let so that projectiles nearly //
// touching the floor, will be treated as actually touching it //
// This is to prevent graphical errors because models cannot //
// sink into the floor by reducing their fly height //
// 5 is default 10 is probably the max you can reasonably give //
// this //
constant function DE_HeightLet takes nothing returns real
return 5.00
endfunction
//----------------------------------------------------------------//
// Death Timer: Determines how long after the death of a dummy //
// will it be removed from the game completely, this is so //
// death effects, if any can finish playing before the unit is //
// removed, 1.8 is default, 2 is probably excessive and in some //
// cases it's possible that 1 could be too little //
constant function DE_DeathTimer takes nothing returns real
return 1.80
endfunction
//----------------------------------------------------------------//
// You have now reached the end of the configuration, below are //
// the functions used to run the spell, beyond this point if //
// you find any constant values (indicated in Blue like the //
// other constants here if you have standard syntax highlighting //
// they're there for a reason and don't fiddle with them, to //
// actually make any modifications I hope you're an experienced //
// programmer, though do not hassle for help because I don't //
// take responcibility for other people's programming skills //
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function used for finding the Z height of a location, since //
// it cannot be done with co-ordinates, a recycled location is //
// used constantly. //
////////////////////////////////////////////////////////////////////
function DE_GetZ takes real x, real y returns real
//Gets the location Z of the selected location
call MoveLocation(udg_DE_ZLoc, x, y)
return GetLocationZ(udg_DE_ZLoc)
endfunction
////////////////////////////////////////////////////////////////////
// Target filter function - passed units and players and checks //
// if the unit is allowed to be targetted by this spell //
////////////////////////////////////////////////////////////////////
function DE_TargetFilter takes unit u, player pl returns boolean
//Checks if the unit can be used as a target
if (IsUnitType(u, UNIT_TYPE_GROUND)) and (not IsUnitType(u, UNIT_TYPE_STRUCTURE)) and (not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)) and (IsUnitEnemy(u, pl)) and (GetUnitTypeId(u) != DE_DummyID()) and (not IsUnitType(u, UNIT_TYPE_DEAD)) then
return true
endif
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function for running the main parts of the spell, creates //
// new shards and destroys old portals, and does all the //
// recycling and damaging of targets, as well as shard movement //
////////////////////////////////////////////////////////////////////
function DE_Loop takes nothing returns nothing
//Sets up all the locals needed for this section
local integer TempInt = 0
local integer TempInt2 = 0
local integer TempNode = 0
local integer Node = 0
local real Angle
local real Angle2
local real Distance
local real x
local real x2
local real dx
local real y
local real y2
local real dy
local real z
local unit u
local player pl
loop
//Moves to the next node
set TempInt = TempInt + 1
exitwhen TempInt > udg_DE_SpellCounter
set Node = udg_DE_NextNode[Node]
if (udg_DE_StageID[Node] == 2) then
//Initialises data required for movement
set x = GetUnitX(udg_DE_Unit[Node])
set y = GetUnitY(udg_DE_Unit[Node])
set udg_DE_CurrentZ[Node] = udg_DE_CurrentZ[Node] + udg_DE_ZVelocity[Node]
set z = DE_GetZ(x, y)
set dy = udg_DE_PortalY[Node] - y
set dx = udg_DE_PortalX[Node] - x
set Angle = Atan2(dy, dx)
set Angle2 = Atan2(udg_DE_PortalZ[Node] - udg_DE_CurrentZ[Node], SquareRoot(dx * dx + dy * dy))
//Checks if the projectile has crashed
if (udg_DE_CurrentZ[Node] - z < DE_HeightLet()) then
//Yes it crashed, deassociating the unit
set udg_DE_StageID[Node] = 3
set pl = GetOwningPlayer(udg_DE_OriginalCaster[Node])
call DestroyEffect(udg_DE_CurrentEffect[Node])
call DestroyEffect(AddSpecialEffect(DE_ImpactModel(), x, y))
//Select Units to damage
call GroupEnumUnitsInRange(udg_DE_TempGroup, x, y, udg_DE_ShardAOE[Node], null)
loop
//Scanning through
set u = FirstOfGroup(udg_DE_TempGroup)
exitwhen u == null
//Select all the units which are to be damaged
if DE_TargetFilter(u, pl) then
//Dealing health and mana damage
call UnitDamageTarget(udg_DE_OriginalCaster[Node], u, udg_DE_HealthDamage[Node], true, false, DE_AttackType(), DE_DamageType(), DE_WeaponType())
call SetUnitState(u, UNIT_STATE_MANA, (GetUnitState(u,UNIT_STATE_MANA) - udg_DE_ManaDamage[Node]))
endif
//Remove the unit from the unit group
call GroupRemoveUnit(udg_DE_TempGroup, u)
endloop
//Removes the projectile
call KillUnit(udg_DE_Unit[Node])
//Nulls variables
set u = null
set pl = null
else
//Setting the new locations X and Y for this instance
set x2 = x + udg_DE_XVelocity[Node]
set y2 = y + udg_DE_YVelocity[Node]
if (IsUnitInGroup(udg_DE_Unit[Node], udg_DE_GravitatedShard)) then
//Calculating the new velocities (will be used next time this runs)
set udg_DE_ZVelocity[Node] = udg_DE_ZVelocity[Node] + udg_DE_BaseVelocity[Node] * Sin(Angle2)
set udg_DE_XVelocity[Node] = udg_DE_XVelocity[Node] + udg_DE_BaseVelocity[Node] * Cos(Angle) * Cos(Angle2)
set udg_DE_YVelocity[Node] = udg_DE_YVelocity[Node] + udg_DE_BaseVelocity[Node] * Sin(Angle) * Cos(Angle2)
else
set udg_DE_ZVelocity[Node] = udg_DE_ZVelocity[Node] - DE_Gravity()
endif
//Makes sure the new location is within the map bounds
if ((udg_DE_MapMinX <= x2) and (x2 <= udg_DE_MapMaxX) and (udg_DE_MapMinY <= y2)and (y2 <= udg_DE_MapMaxY)) then
call SetUnitX(udg_DE_Unit[Node], x2)
call SetUnitY(udg_DE_Unit[Node], y2)
endif
//Sets the correct fly height
call SetUnitFlyHeight(udg_DE_Unit[Node], udg_DE_CurrentZ[Node] - z, 0.00)
endif
elseif (udg_DE_StageID[Node] == 1) then
//Increases the duration of both artificial wait timers
set udg_DE_CurrentShardDelay[Node] = udg_DE_CurrentShardDelay[Node] + DE_TimerSpeed()
set udg_DE_CurrentDuration[Node] = udg_DE_CurrentDuration[Node] + DE_TimerSpeed()
//Checks if the spell has ran out of duration
if(udg_DE_CurrentDuration[Node] >= udg_DE_Duration[Node]) then
set udg_DE_StageID[Node] = 3
call DestroyEffect(udg_DE_CurrentEffect[Node])
//Finds all the affected Shards and releases them
loop
set TempInt2 = TempInt2 + 1
exitwhen TempInt2 > udg_DE_SpellCounter
set TempNode = udg_DE_NextNode[TempNode]
if (udg_DE_Portal[TempNode] == udg_DE_Unit[Node]) then
call GroupRemoveUnit (udg_DE_GravitatedShard, udg_DE_Unit[TempNode])
endif
endloop
//Checks if it's time to make a new shard
elseif (udg_DE_CurrentShardDelay[Node] >= udg_DE_SpawnRate[Node]) then
//Resets the timer
set udg_DE_CurrentShardDelay[Node] = 0.00
//Sets up a random place to put the new Shard
set Angle = GetRandomReal(0, 360)
set Angle2 = GetRandomReal(0, 180)
set Distance = Cos(Angle2) * udg_DE_Radius[Node]
if (Distance < 0) then
set Distance = Distance * -1
endif
set udg_DE_SpellCounter = udg_DE_SpellCounter + 1
set x = udg_DE_PortalX[Node] + Distance * Cos(Angle * bj_DEGTORAD)
set y = udg_DE_PortalY[Node] + Distance * Sin(Angle * bj_DEGTORAD)
set z = Sin(Angle2) * udg_DE_Radius[Node] + udg_DE_PortalZ[Node]
//Checking for recycleable Nodes
if (udg_DE_RecycleableNodes == 0) then
set udg_DE_NodeNumber = udg_DE_NodeNumber + 1
set TempNode = udg_DE_NodeNumber
else
set udg_DE_RecycleableNodes = udg_DE_RecycleableNodes - 1
set TempNode = udg_DE_RecycleNodes[udg_DE_RecycleableNodes]
endif
//Sets up this Node
set udg_DE_NextNode[TempNode] = 0
set udg_DE_NextNode[udg_DE_LastNode] = TempNode
set udg_DE_PrevNode[TempNode] = udg_DE_LastNode
set udg_DE_LastNode = TempNode
//Sets up the data for the Shard
set udg_DE_HealthDamage[TempNode] = udg_DE_HealthDamage[Node]
set udg_DE_ManaDamage[TempNode] = udg_DE_ManaDamage[Node]
set udg_DE_Portal[TempNode] = udg_DE_Unit[Node]
set udg_DE_PortalX[TempNode] = udg_DE_PortalX[Node]
set udg_DE_PortalY[TempNode] = udg_DE_PortalY[Node]
set udg_DE_PortalZ[TempNode] = udg_DE_PortalZ[Node]
set udg_DE_ShardAOE[TempNode] = udg_DE_ShardAOE[Node]
set udg_DE_OriginalCaster[TempNode] = udg_DE_OriginalCaster[Node]
set udg_DE_BaseVelocity[TempNode] = udg_DE_BaseVelocity[Node]
set udg_DE_CurrentZ[TempNode] = z
set udg_DE_StageID[TempNode] = 2
//Sets up initialisation Velocities (this is to give the shards a bit of a kick of instability in their orbit)
set udg_DE_ZVelocity[TempNode] = udg_DE_BaseVelocity[TempNode] * Sin(Angle2)
set udg_DE_XVelocity[TempNode] = udg_DE_BaseVelocity[TempNode] * Cos(Angle) * Cos(Angle2)
set udg_DE_YVelocity[TempNode] = udg_DE_BaseVelocity[TempNode] * Sin(Angle) * Cos(Angle2)
//Creates the unit and applies Aesthetics
set udg_DE_Unit[TempNode] = CreateUnit(Player(14), DE_DummyID(), x, y, 0.00)
if UnitAddAbility(udg_DE_Unit[TempNode], 'Amrf') and UnitRemoveAbility(udg_DE_Unit[TempNode], 'Amrf') then
endif
set udg_DE_CurrentEffect[TempNode] = AddSpecialEffectTarget(DE_ShardModel(), udg_DE_Unit[TempNode], DE_AttachmentPoint())
call SetUnitScale(udg_DE_Unit[TempNode], udg_DE_ShardScale[Node], 0.00, 0.00)
call SetUnitFlyHeight(udg_DE_Unit[TempNode], z, 0.00)
//Adds them to the group of Gravitated Shards
call GroupAddUnit(udg_DE_GravitatedShard, udg_DE_Unit[TempNode])
endif
elseif (udg_DE_CurrentDeathTimer[Node] < DE_DeathTimer()) then
set udg_DE_CurrentDeathTimer[Node] = 0.00
//Removes the projectile
call RemoveUnit(udg_DE_Unit[Node])
if (udg_DE_LastNode == Node) then
set udg_DE_LastNode = udg_DE_PrevNode[Node]
endif
//Recycles the node
set udg_DE_RecycleNodes[udg_DE_RecycleableNodes] = Node
set udg_DE_RecycleableNodes = udg_DE_RecycleableNodes + 1
set udg_DE_NextNode[udg_DE_PrevNode[Node]] = udg_DE_NextNode[Node]
set udg_DE_PrevNode[udg_DE_NextNode[Node]] = udg_DE_PrevNode[Node]
set udg_DE_SpellCounter = udg_DE_SpellCounter - 1
set TempInt = TempInt - 1
//Destroys the timer when not in use
if (udg_DE_SpellCounter == 0) then
call DestroyTimer(GetExpiredTimer())
endif
else
set udg_DE_CurrentDeathTimer[Node] = udg_DE_CurrentDeathTimer[Node] + DE_TimerSpeed()
endif
endloop
endfunction
////////////////////////////////////////////////////////////////////
// Function runs when a new instance is to be created - runs //
// as a condition but always returns false, creates a new //
// portal if the correct spell was cast //
////////////////////////////////////////////////////////////////////
function DE_NewInstance takes nothing returns boolean
//Sets up locals
local unit u
local integer Node
local real rLevel
local real x
local real y
//Checks if the spell cast is the correct spell
if (GetSpellAbilityId() == DE_SpellID()) then
set u = GetTriggerUnit()
set x = GetSpellTargetX()
set y = GetSpellTargetY()
set rLevel = I2R(GetUnitAbilityLevel(u, DE_SpellID()))
//Checking for recycleable Nodes
if (udg_DE_RecycleableNodes == 0) then
set udg_DE_NodeNumber = udg_DE_NodeNumber + 1
set Node = udg_DE_NodeNumber
else
set udg_DE_RecycleableNodes = udg_DE_RecycleableNodes - 1
set Node = udg_DE_RecycleNodes[udg_DE_RecycleableNodes]
endif
//Sets up this Node
set udg_DE_NextNode[Node] = 0
set udg_DE_NextNode[udg_DE_LastNode] = Node
set udg_DE_PrevNode[Node] = udg_DE_LastNode
set udg_DE_LastNode = Node
//Sets up the portal data
set udg_DE_PortalHeight[Node] = DE_PortalHeightBase() + (DE_PortalHeightPerLevel() * rLevel)
set udg_DE_Mass[Node] = DE_MassBase() + (DE_MassPerLevel() * rLevel)
set udg_DE_Radius[Node] = DE_RadiusBase() + (DE_RadiusPerLevel() * rLevel)
set udg_DE_BaseVelocity[Node] = ((DE_GravitationalConstant() * udg_DE_Mass[Node]) / udg_DE_Radius[Node]) * DE_TimerSpeed()
set udg_DE_HealthDamage[Node] = DE_HealthDamageBase() + (DE_HealthDamagePerLevel() * rLevel)
set udg_DE_ManaDamage[Node] = DE_ManaDamageBase() + (DE_ManaDamagePerLevel() * rLevel)
set udg_DE_SpawnRate[Node] = DE_SpawnRateBase() + (DE_SpawnRatePerLevel() * rLevel)
set udg_DE_Duration[Node] = DE_DurationBase() + (DE_DurationPerLevel() * rLevel)
set udg_DE_ShardScale[Node] = DE_ShardScaleBase() + (DE_ShardScalePerLevel() * rLevel)
set udg_DE_ShardAOE[Node] = DE_ShardAOEBase() + (DE_ShardAOEPerLevel() * rLevel)
set udg_DE_PortalX[Node] = x
set udg_DE_PortalY[Node] = y
set udg_DE_PortalZ[Node] = udg_DE_PortalHeight[Node] + DE_GetZ(x, y)
set udg_DE_CurrentShardDelay[Node] = 0.00
set udg_DE_CurrentDuration[Node] = 0.00
set udg_DE_OriginalCaster[Node] = u
set udg_DE_StageID[Node] = 1
set udg_DE_SpellCounter = udg_DE_SpellCounter + 1
//Creates the unit and applies Aesthetics
set udg_DE_Unit[Node] = CreateUnit(Player(14), DE_DummyID(), x, y, 0.00)
if UnitAddAbility(udg_DE_Unit[Node], 'Amrf') and UnitRemoveAbility(udg_DE_Unit[Node], 'Amrf') then
endif
set udg_DE_CurrentEffect[Node] = AddSpecialEffectTarget(DE_PortalModel(), udg_DE_Unit[Node], DE_AttachmentPoint())
call SetUnitScale(udg_DE_Unit[Node], DE_PortalScaleBase() + (DE_PortalScalePerLevel() * rLevel), 0.00, 0.00)
call SetUnitFlyHeight(udg_DE_Unit[Node], udg_DE_PortalHeight[Node], 0.00)
//Checks if it's the only portal on the map
if (udg_DE_SpellCounter == 1) then
call TimerStart(CreateTimer(), DE_TimerSpeed(), true, function DE_Loop)
endif
//Nulls variables
set u = null
endif
return false
endfunction
////////////////////////////////////////////////////////////////////
// Function for setting up the other functions and initialising //
// the map bounds variables and Z finder for locations //
////////////////////////////////////////////////////////////////////
function InitTrig_DE_DevastationEnvoy takes nothing returns nothing
//Sets up locals
local trigger DE = CreateTrigger()
local integer index = 0
//Initialise the event for every player
loop
call TriggerRegisterPlayerUnitEvent(DE, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
set index = index + 1
exitwhen index == bj_MAX_PLAYER_SLOTS
endloop
call TriggerAddCondition(DE, Condition(function DE_NewInstance))
//Sets up the map bounds the spell with use
set udg_DE_MapMaxX = GetRectMaxX(bj_mapInitialPlayableArea)
set udg_DE_MapMinX = GetRectMinX(bj_mapInitialPlayableArea)
set udg_DE_MapMaxY = GetRectMaxY(bj_mapInitialPlayableArea)
set udg_DE_MapMinY = GetRectMinY(bj_mapInitialPlayableArea)
//Sets up the Z location finder
set udg_DE_ZLoc = Location(0,0)
//Nulls variables
set DE = null
endfunction
////////////////////////////////////////////////////////////////////
// End of the spell //
////////////////////////////////////////////////////////////////////