Contains information about the source action part of the CombatActionPack. This part is sent first, before the target actions.
Inheritance: CombatAction
Ejemplo n.º 1
0
		/// <summary>
		/// Calculates and sets splash damage reductions and bonuses against splashTarget.
		/// </summary>
		/// <param name="splashTarget"></param>
		/// <param name="damageSplash"></param>
		/// <param name="skill"></param>
		/// <param name="critSkill"></param>
		/// <param name="aAction"></param>
		/// <param name="tAction"></param>
		/// <param name="tSplashAction"></param>
		public void CalculateSplashDamage(Creature splashTarget, ref float damageSplash, Skill skill, Skill critSkill, AttackerAction aAction, TargetAction tAction, TargetAction tSplashAction, Item weapon = null)
		{
			//Splash Damage Reduction
			if (skill.Info.Id == SkillId.Smash)
				damageSplash *= skill.Info.Rank < SkillRank.R1 ? 0.1f : 0.2f;
			else
				damageSplash *= weapon != null ? weapon.Data.SplashDamage : 0f;

			// Critical Hit
			if (critSkill != null && tAction.Has(TargetOptions.Critical))
			{
				// Add crit bonus
				var bonus = critSkill.RankData.Var1 / 100f;
				damageSplash = damageSplash + (damageSplash * bonus);

				// Set splashTarget option
				tSplashAction.Set(TargetOptions.Critical);
			}

			var maxDamageSplash = damageSplash; //Damage without Defense and Protection
			// Subtract splashTarget def/prot
			SkillHelper.HandleDefenseProtection(splashTarget, ref damageSplash);

			// Defense
			Channel.Skills.Combat.Defense.Handle(aAction, tSplashAction, ref damageSplash);

			// Mana Shield
			ManaShield.Handle(splashTarget, ref damageSplash, tSplashAction, maxDamageSplash);

			if (damageSplash <= 0f)
				damageSplash = 1f;
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Called when the AI hit someone with a skill.
		/// </summary>
		/// <param name="aAction"></param>
		public void OnUsedSkill(AttackerAction aAction)
		{
			if (this.Creature.Skills.ActiveSkill != null)
				this.ExecuteOnce(this.CompleteSkill());
		}