SHARE
TWEET

Untitled

a guest Apr 25th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static function X2DataTemplate CreateShadowbind(name AbilityTemplateName, name UnitToSpawnName)
  2. {
  3.     local X2AbilityTemplate Template;
  4.     local X2AbilityCost_ActionPoints ActionPointCost;
  5.     local X2Condition_UnitProperty UnitPropertyCondition;
  6.     local X2Condition_UnitImmunities UnitImmunityCondition;
  7.     local X2Effect_RemoveEffects RemoveEffects;
  8.     local X2Effect_SpawnShadowbindUnit SpawnShadowbindUnit;
  9.     local X2AbilityCooldown_LocalAndGlobal Cooldown;
  10.     local X2Effect_OverrideDeathAction DeathActionEffect;
  11.     local X2Effect_Persistent UnconsciousEffect;
  12.     local X2Condition_UnitType UnitTypeCondition;
  13.     local array<name> SkipExclusions;
  14.  
  15.     `CREATE_X2ABILITY_TEMPLATE(Template, AbilityTemplateName);
  16.     Template.IconImage = "img:///UILibrary_XPACK_Common.PerkIcons.UIPerk_shadowbind";
  17.     Template.Hostility = eHostility_Neutral;
  18.     Template.AbilitySourceName = 'eAbilitySource_Standard';
  19.     Template.eAbilityIconBehaviorHUD = eAbilityIconBehavior_AlwaysShow;
  20.  
  21.     ActionPointCost = new class'X2AbilityCost_ActionPoints';
  22.     ActionPointCost.iNumPoints = 1;
  23.     ActionPointCost.bConsumeAllPoints = false;
  24.     Template.AbilityCosts.AddItem(ActionPointCost);
  25.  
  26.     Cooldown = new class'X2AbilityCooldown_LocalAndGlobal';
  27.     Cooldown.iNumTurns = default.SHADOWBIND_COOLDOWN_LOCAL;
  28.     Cooldown.NumGlobalTurns = default.SHADOWBIND_COOLDOWN_GLOBAL;
  29.     Template.AbilityCooldown = Cooldown;
  30.  
  31.     Template.AbilityToHitCalc = default.DeadEye;
  32.     Template.AbilityTargetStyle = new class'X2AbilityTarget_MovingMelee';
  33.     Template.TargetingMethod = class'X2TargetingMethod_MeleePath';
  34.  
  35.     Template.AbilityTriggers.AddItem(default.PlayerInputTrigger);
  36.     Template.AbilityTriggers.AddItem(new class'X2AbilityTrigger_EndOfMove');
  37.  
  38.     Template.AbilityShooterConditions.AddItem(default.LivingShooterProperty);
  39.     Template.AbilityShooterConditions.AddItem(new class'X2Condition_UnblockedNeighborTile');
  40.     SkipExclusions.AddItem(class'X2StatusEffects'.default.BurningName);
  41.     Template.AddShooterEffectExclusions(SkipExclusions);
  42.  
  43.     Template.AbilityTargetConditions.AddItem(default.MeleeVisibilityCondition);
  44.     UnitTypeCondition = new class'X2Condition_UnitType';
  45.     UnitTypeCondition.ExcludeTypes.AddItem('TheLost');
  46.     Template.AbilityTargetConditions.AddItem(UnitTypeCondition);
  47.  
  48.     // The Target must be alive and a humanoid
  49.     UnitPropertyCondition = new class'X2Condition_UnitProperty';
  50.     UnitPropertyCondition.ExcludeDead = true;
  51.     UnitPropertyCondition.ExcludeRobotic = true;
  52.     UnitPropertyCondition.ExcludeAlien = true;
  53.     UnitPropertyCondition.ExcludeFriendlyToSource = true;
  54.     UnitPropertyCondition.FailOnNonUnits = true;
  55.     UnitPropertyCondition.ExcludeImpaired = true;
  56.     Template.AbilityTargetConditions.AddItem(UnitPropertyCondition);
  57.  
  58.     UnitImmunityCondition = new class'X2Condition_UnitImmunities';
  59.     UnitImmunityCondition.AddExcludeDamageType('Unconscious');
  60.     Template.AbilityTargetConditions.AddItem(UnitImmunityCondition);
  61.  
  62.     RemoveEffects = new class'X2Effect_RemoveEffects';
  63.     RemoveEffects.EffectNamesToRemove.AddItem(class'X2Effect_ParthenogenicPoison'.default.EffectName);
  64.     Template.AddTargetEffect(RemoveEffects);
  65.  
  66.     DeathActionEffect = new class'X2Effect_OverrideDeathAction';
  67.     DeathActionEffect.DeathActionClass = class'X2Action_ShadowbindTarget';
  68.     DeathActionEffect.EffectName = 'ShadowbindUnconcious';
  69.     Template.AddTargetEffect(DeathActionEffect);
  70.  
  71.     UnconsciousEffect = class'X2StatusEffects'.static.CreateUnconsciousStatusEffect();
  72.     UnconsciousEffect.bRemoveWhenSourceDies = false;
  73.     UnconsciousEffect.VisualizationFn = ShadowbindUnconsciousVisualization;
  74.     Template.AddTargetEffect(UnconsciousEffect);
  75.  
  76.     SpawnShadowbindUnit = new class'X2Effect_SpawnShadowbindUnit';
  77.     SpawnShadowbindUnit.BuildPersistentEffect(1, true, false, true);
  78.     SpawnShadowbindUnit.bRemoveWhenTargetDies = false;
  79.     SpawnShadowbindUnit.UnitToSpawnName = UnitToSpawnName;
  80.     Template.AddTargetEffect(SpawnShadowbindUnit);
  81.  
  82.     Template.BuildNewGameStateFn = TypicalMoveEndAbility_BuildGameState;
  83.     Template.BuildVisualizationFn = Shadowbind_BuildVisualization;
  84.     Template.BuildInterruptGameStateFn = TypicalMoveEndAbility_BuildInterruptGameState;
  85.  
  86.     Template.CinescriptCameraType = "Spectre_Shadowbind";
  87.    
  88. //BEGIN AUTOGENERATED CODE: Template Overrides 'Shadowbind'
  89. //BEGIN AUTOGENERATED CODE: Template Overrides 'ShadowbindM2'  
  90.     Template.CustomFireAnim = 'HL_Shadowbind';
  91. //END AUTOGENERATED CODE: Template Overrides 'ShadowbindM2'
  92. //END AUTOGENERATED CODE: Template Overrides 'Shadowbind'
  93.  
  94.     return Template;
  95. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top