本文整理汇总了C#中Aura.World.World.MabiCreature.GetRndRangeDamage方法的典型用法代码示例。如果您正苦于以下问题:C# MabiCreature.GetRndRangeDamage方法的具体用法?C# MabiCreature.GetRndRangeDamage怎么用?C# MabiCreature.GetRndRangeDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.World.World.MabiCreature
的用法示例。
在下文中一共展示了MabiCreature.GetRndRangeDamage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseCombat
public override SkillResults UseCombat(MabiCreature attacker, ulong targetId, MabiSkill skill)
{
var target = WorldManager.Instance.GetCreatureById(targetId);
if (target == null)
return SkillResults.InvalidTarget;
if (attacker.Inventory.Magazine == null || attacker.Inventory.Magazine.Count < 1)
return SkillResults.Failure;
var rnd = RandomProvider.Get();
attacker.StopMove();
var factory = new CombatFactory();
factory.SetAttackerAction(attacker, CombatActionType.RangeHit, skill.Id, targetId);
factory.SetAttackerOptions(AttackerOptions.Result);
factory.SetAttackerStun(AfterUseStun);
bool hit = false;
if (attacker.GetAimPercent(attacker.Skills.Get(SkillConst.RangedCombatMastery).RankInfo.Var3, attacker.ActiveSkillStacks == 5 ? skill.RankInfo.Var3 : 0) > rnd.NextDouble())
{
target.StopMove();
factory.AddTargetAction(target, CombatActionType.TakeHit);
factory.SetTargetOptions(TargetOptions.Result);
factory.SetTargetStun(StunTime);
hit = true;
}
else
{
factory.AddTargetAction(target, CombatActionType.None);
}
Send.SkillUse(attacker.Client, attacker, skill.Id, AfterUseStun, 1);
SkillHelper.DecStack(attacker, skill);
attacker.Client.Send(new MabiPacket(Op.CombatTargetSet, attacker.Id).PutLong(0));
factory.ExecuteDamage(new System.Func<MabiCreature, MabiCreature, float>((a, t) =>
{
var dmg = attacker.GetRndRangeDamage();
switch (5 - a.ActiveSkillStacks)
{
case 1:
dmg *= (95 + skill.RankInfo.Var1) / 100f;
break;
case 2:
dmg *= (105 + skill.RankInfo.Var1) / 100f;
break;
case 3:
dmg *= (110 + skill.RankInfo.Var1) / 100f;
break;
case 4:
dmg *= (130 + skill.RankInfo.Var1) / 100f;
break;
default:
dmg *= (160 + skill.RankInfo.Var2) / 100f;
break;
}
return dmg;
}));
factory.ExecuteStun();
factory.ExecuteKnockback(40f);
WorldManager.Instance.HandleCombatActionPack(factory.GetCap());
if (hit)
CombatHelper.SetAggro(attacker, target);
SkillHelper.GiveSkillExp(attacker, skill, 20);
return SkillResults.Okay;
}
示例2: UseCombat
public override SkillResults UseCombat(MabiCreature attacker, ulong targetId, MabiSkill skill)
{
var target = WorldManager.Instance.GetCreatureById(targetId);
if (target == null)
return SkillResults.InvalidTarget;
if (attacker.Magazine == null || attacker.Magazine.Count < 1)
return SkillResults.Failure;
var rnd = RandomProvider.Get();
attacker.StopMove();
var factory = new CombatFactory();
factory.SetAttackerAction(attacker, CombatActionType.RangeHit, skill.Id, targetId);
factory.SetAttackerOptions(AttackerOptions.Result);
factory.SetAttackerStun(AfterUseStun);
bool hit = false;
if (attacker.GetAimPercent(1) > rnd.NextDouble())
{
target.StopMove();
factory.AddTargetAction(target, CombatActionType.TakeHit);
factory.SetTargetOptions(TargetOptions.Result);
factory.SetTargetStun(StunTime);
hit = true;
}
else
{
factory.AddTargetAction(target, CombatActionType.None);
}
Send.SkillUse(attacker.Client, attacker, skill.Id, AfterUseStun, 1);
SkillHelper.ClearStack(attacker, skill);
attacker.Client.Send(new MabiPacket(Op.CombatTargetSet, attacker.Id).PutLong(0));
factory.ExecuteDamage(new System.Func<MabiCreature, MabiCreature, float>((a, t) =>
{
var damage = attacker.GetRndRangeDamage();
damage *= skill.RankInfo.Var1 / 100f;
return damage;
}));
factory.ExecuteStun();
factory.ExecuteKnockback(CombatHelper.MaxKnockBack);
WorldManager.Instance.HandleCombatActionPack(factory.GetCap());
if (hit)
CombatHelper.SetAggro(attacker, target);
SkillHelper.GiveSkillExp(attacker, skill, 20);
return SkillResults.Okay;
}
示例3: UseCombat
public override SkillResults UseCombat(MabiCreature attacker, ulong targetId, MabiSkill skill)
{
var target = WorldManager.Instance.GetCreatureById(targetId);
if (target == null)
return SkillResults.InvalidTarget;
if (attacker.Magazine == null || attacker.Magazine.Count < 1)
return SkillResults.Failure;
var rnd = RandomProvider.Get();
attacker.StopMove();
var factory = new CombatFactory();
factory.SetAttackerAction(attacker, CombatActionType.RangeHit, skill.Id, targetId);
factory.SetAttackerOptions(AttackerOptions.Result);
factory.SetAttackerStun(AfterUseStun);
bool hit = false;
if (attacker.GetAimPercent(attacker.Skills.Get(SkillConst.RangedCombatMastery).RankInfo.Var3) > rnd.NextDouble())
{
target.StopMove();
factory.AddTargetAction(target, CombatActionType.TakeHit);
factory.SetTargetOptions(TargetOptions.Result);
factory.SetTargetStun(StunTime);
hit = true;
}
else
{
factory.AddTargetAction(target, CombatActionType.None);
}
Send.SkillUse(attacker.Client, attacker, skill.Id, AfterUseStun, 1);
SkillHelper.ClearStack(attacker, skill);
attacker.Client.Send(new MabiPacket(Op.CombatTargetSet, attacker.Id).PutLong(0));
factory.ExecuteDamage(new System.Func<MabiCreature, MabiCreature, float>((a, t) =>
{
var damage = attacker.GetRndRangeDamage();
return damage * .8f;
}));
factory.ExecuteStun();
factory.ExecuteKnockback(0f);
WorldManager.Instance.HandleCombatActionPack(factory.GetCap());
if (!target.IsDead && hit)
{
// TODO: debuff
WorldManager.Instance.Broadcast(new MabiPacket(Op.Effect, target.Id).PutInt(Effect.SupportShot).PutByte(1), SendTargets.Range, target);
System.Threading.Thread t = new System.Threading.Thread(() =>
{
System.Threading.Thread.Sleep(3000);
WorldManager.Instance.Broadcast(new MabiPacket(Op.Effect, target.Id).PutInt(Effect.SupportShot).PutByte(0), SendTargets.Range, target);
});
t.Start();
CombatHelper.SetAggro(attacker, target);
}
SkillHelper.GiveSkillExp(attacker, skill, 20);
return SkillResults.Okay;
}