本文整理汇总了C#中Aura.Channel.World.Entities.Creature.StopMove方法的典型用法代码示例。如果您正苦于以下问题:C# Creature.StopMove方法的具体用法?C# Creature.StopMove怎么用?C# Creature.StopMove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Channel.World.Entities.Creature
的用法示例。
在下文中一共展示了Creature.StopMove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Prepare
/// <summary>
/// Prepares skill, skips right to used.
/// </summary>
/// <remarks>
/// Doesn't check anything, like what you can gather with what,
/// because at this point there's no chance for abuse.
/// </remarks>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
/// <returns></returns>
public bool Prepare(Creature creature, Skill skill, Packet packet)
{
var entityId = packet.GetLong();
var collectId = packet.GetInt();
// You shall stop
creature.StopMove();
var creaturePosition = creature.GetPosition();
// Get target (either prop or creature)
var targetEntity = this.GetTargetEntity(creature.Region, entityId);
if (targetEntity != null)
creature.Temp.GatheringTargetPosition = targetEntity.GetPosition();
// Check distance
if (!creaturePosition.InRange(creature.Temp.GatheringTargetPosition, MaxDistance))
{
Send.Notice(creature, Localization.Get("Your arms are too short to reach that from here."));
return false;
}
// ? (sets creatures position on the client side)
Send.CollectAnimation(creature, entityId, collectId, creaturePosition);
// Use
Send.SkillUse(creature, skill.Info.Id, entityId, collectId);
skill.State = SkillState.Used;
return true;
}
示例2: Prepare
/// <summary>
/// Prepares skill, showing a casting motion.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
/// <returns></returns>
public virtual bool Prepare(Creature creature, Skill skill, Packet packet)
{
creature.StopMove();
Send.Effect(creature, Effect.Casting, (short)skill.Info.Id, (byte)0, (byte)1, (short)0);
Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());
return true;
}
示例3: Prepare
/// <summary>
/// Preapres the skill.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
/// <returns></returns>
public override bool Prepare(Creature creature, Skill skill, Packet packet)
{
creature.StopMove();
Send.SkillInitEffect(creature, "");
Send.UseMotion(creature, 10, 2);
Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());
return true;
}
示例4: Prepare
/// <summary>
/// Prepares WM, empty skill init for only the loading sound.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
/// <returns></returns>
public bool Prepare(Creature creature, Skill skill, Packet packet)
{
creature.StopMove();
creature.Lock(Locks.Move);
Send.SkillInitEffect(creature, null);
Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());
return true;
}
示例5: UseSkillOnTarget
/// <summary>
/// Bolt specific use code.
/// </summary>
/// <param name="attacker"></param>
/// <param name="skill"></param>
/// <param name="target"></param>
protected override void UseSkillOnTarget(Creature attacker, Skill skill, Creature target)
{
attacker.StopMove();
target.StopMove();
// Create actions
var aAction = new AttackerAction(CombatActionType.RangeHit, attacker, target.EntityId);
aAction.Set(AttackerOptions.Result);
var tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, skill.Info.Id);
tAction.Set(TargetOptions.Result);
tAction.Stun = TargetStun;
var cap = new CombatActionPack(attacker, skill.Info.Id, aAction, tAction);
// Damage
var damage = this.GetDamage(attacker, skill);
// Elements
damage *= this.GetElementalDamageMultiplier(attacker, target);
// Reduce damage
SkillHelper.HandleMagicDefenseProtection(target, ref damage);
ManaShield.Handle(target, ref damage, tAction);
ManaDeflector.Handle(attacker, target, ref damage, tAction);
// Deal damage
if (damage > 0)
target.TakeDamage(tAction.Damage = damage, attacker);
target.Aggro(attacker);
// Knock down on deadly
if (target.Conditions.Has(ConditionsA.Deadly))
{
tAction.Set(TargetOptions.KnockDown);
tAction.Stun = TargetStun;
}
// Death/Knockback
attacker.Shove(target, KnockbackDistance);
if (target.IsDead)
tAction.Set(TargetOptions.FinishingKnockDown);
else
tAction.Set(TargetOptions.KnockDown);
// Override stun set by defense
aAction.Stun = AttackerStun;
Send.Effect(attacker, Effect.UseMagic, EffectSkillName);
Send.SkillUseStun(attacker, skill.Info.Id, aAction.Stun, 1);
skill.Stacks = 0;
cap.Handle();
}
示例6: Prepare
/// <summary>
/// Handles skill preparation.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public override bool Prepare(Creature creature, Skill skill, Packet packet)
{
Send.SkillFlashEffect(creature);
Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());
// Default lock is Walk|Run, since renovation you are stopped when
// loading counter, previously you kept running till you were at your
// destination.
if (AuraData.FeaturesDb.IsEnabled("TalentRenovationCloseCombat"))
creature.StopMove();
return true;
}
示例7: Prepare
/// <summary>
/// Prepares skill, fails if no Dice is found.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
/// <returns></returns>
public bool Prepare(Creature creature, Skill skill, Packet packet)
{
// Check if dice are equipped (checked on client as well)
if (creature.RightHand == null || !creature.RightHand.HasTag("/dice/"))
{
Send.Notice(creature, Localization.Get("You must equip one Six Sided Dice to use this Action."));
return false;
}
creature.StopMove();
Send.UseMotion(creature, 27, 0, false, false);
Send.Effect(creature, Effect.Dice, 0, "prepare"); // [200200, NA233 (2016-08-12)] New 0 int after effect id
Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());
return true;
}
示例8: Start
public override StartStopResult Start(Creature creature, Skill skill, MabiDictionary dict)
{
creature.StopMove();
var chairItemEntityId = dict.GetLong("ITEMID");
if (chairItemEntityId != 0)
this.SetUpChair(creature, chairItemEntityId);
creature.Activate(CreatureStates.SitDown);
Send.SitDown(creature);
creature.Regens.Add("Rest", Stat.Life, (0.12f * ((skill.RankData.Var1 - 100) / 100)), creature.LifeMax);
creature.Regens.Add("Rest", Stat.Stamina, (0.4f * ((skill.RankData.Var2 - 100) / 100)), creature.StaminaMax);
creature.Regens.Add("Rest", Stat.LifeInjured, skill.RankData.Var3, creature.LifeMax);
if (skill.Info.Rank == SkillRank.Novice) skill.Train(1); // Use Rest.
return StartStopResult.Okay;
}
示例9: Start
/// <summary>
/// Starts rest skill.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="dict"></param>
/// <returns></returns>
public override StartStopResult Start(Creature creature, Skill skill, MabiDictionary dict)
{
creature.StopMove();
creature.IsInBattleStance = false;
creature.AttemptingAttack = false;
var chairItemEntityId = dict.GetLong("ITEMID");
if (chairItemEntityId != 0)
this.SetUpChair(creature, chairItemEntityId);
creature.Activate(CreatureStates.SitDown);
if (skill.Info.Rank >= SkillRank.R9)
creature.Activate(CreatureStatesEx.RestR9);
Send.SitDown(creature);
// Get bonuses if meditation isn't active.
if (!creature.Conditions.Has(ConditionsE.Meditation))
{
ApplyRestBonus(creature, skill, chairItemEntityId);
}
else
{
RestCampfireBonus(creature, skill, chairItemEntityId);
}
// Add bonus from campfire
// TODO: Check for disappearing of campfire? (OnDisappears+Recheck)
var campfires = creature.Region.GetProps(a => a.Info.Id == 203 && a.GetPosition().InRange(creature.GetPosition(), 500));
if (campfires.Count > 0)
{
Send.Notice(creature, Localization.Get("The fire feels very warm."));
}
if (skill.Info.Rank == SkillRank.Novice) skill.Train(1); // Use Rest.
return StartStopResult.Okay;
}
示例10: Prepare
/// <summary>
/// Prepares the skill, called to start casting.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public override bool Prepare(Creature creature, Skill skill, Packet packet)
{
Send.SkillFlashEffect(creature);
Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());
// Default lock is Walk|Run, since renovation you're not able to
// move while loading anymore.
if (AuraData.FeaturesDb.IsEnabled("TalentRenovationCloseCombat"))
{
creature.StopMove();
}
// Since the client locks Walk|Run by default we have to tell it
// to enable walk but disable run (under any circumstances) if
// renovation is disabled.
else
{
creature.Lock(Locks.Run, true);
creature.Unlock(Locks.Walk, true);
}
return true;
}
示例11: Use
public void Use(Creature creature, Skill skill, Packet packet)
{
var targetPos = new Position(packet.GetLong());
// Check distance to target position
if (!creature.GetPosition().InRange(targetPos, (int)skill.RankData.Var2 + DistanceBuffer))
{
Send.Notice(creature, Localization.Get("Out of range."));
Send.SkillUse(creature, skill.Info.Id, 0);
return;
}
// Stop creature's movement.
creature.StopMove();
// Teleport effect (does not actually teleport)
Send.Effect(creature, Effect.SilentMoveTeleport, (byte)2, targetPos.X, targetPos.Y);
// Teleport player to target position
creature.SetPosition(targetPos.X, targetPos.Y);
Send.SkillTeleport(creature, targetPos.X, targetPos.Y);
Send.SkillUse(creature, skill.Info.Id, 1);
}
示例12: Start
/// <summary>
/// Starts rest skill.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="dict"></param>
/// <returns></returns>
public override StartStopResult Start(Creature creature, Skill skill, MabiDictionary dict)
{
creature.StopMove();
var chairItemEntityId = dict.GetLong("ITEMID");
if (chairItemEntityId != 0)
this.SetUpChair(creature, chairItemEntityId);
creature.Activate(CreatureStates.SitDown);
if (skill.Info.Rank >= SkillRank.R9)
creature.Activate(CreatureStatesEx.RestR9);
Send.SitDown(creature);
// Get base bonuses
var bonusLife = ((skill.RankData.Var1 - 100) / 100);
var bonusStamina = ((skill.RankData.Var2 - 100) / 100);
var bonusInjury = skill.RankData.Var3;
// Add bonus from campfire
// TODO: Check for disappearing of campfire? (OnDisappears+Recheck)
var campfires = creature.Region.GetProps(a => a.Info.Id == 203 && a.GetPosition().InRange(creature.GetPosition(), 500));
if (campfires.Count > 0)
{
// Add bonus if no chair?
if (chairItemEntityId == 0)
{
// TODO: Select nearest? Random?
var campfire = campfires[0];
var multi = (campfire.Temp.CampfireSkillRank != null ? campfire.Temp.CampfireSkillRank.Var1 / 100f : 1);
// Add bonus for better wood.
// Amounts unofficial.
if (campfire.Temp.CampfireFirewood != null)
{
if (campfire.Temp.CampfireFirewood.HasTag("/firewood01/"))
multi += 0.1f;
else if (campfire.Temp.CampfireFirewood.HasTag("/firewood02/"))
multi += 0.2f;
else if (campfire.Temp.CampfireFirewood.HasTag("/firewood03/"))
multi += 0.3f;
}
// Apply multiplicator
bonusLife *= multi;
bonusStamina *= multi;
bonusInjury *= multi;
}
Send.Notice(creature, Localization.Get("The fire feels very warm"));
}
creature.Regens.Add("Rest", Stat.Life, (0.12f * bonusLife), creature.LifeMax);
creature.Regens.Add("Rest", Stat.Stamina, (0.4f * bonusStamina), creature.StaminaMax);
creature.Regens.Add("Rest", Stat.LifeInjured, bonusInjury, creature.LifeMax); // TODO: Test if LifeInjured = Injuries
if (skill.Info.Rank == SkillRank.Novice) skill.Train(1); // Use Rest.
return StartStopResult.Okay;
}
示例13: UseSkillOnTarget
/// <summary>
/// Bolt specific use code.
/// </summary>
/// <param name="attacker"></param>
/// <param name="skill"></param>
/// <param name="target"></param>
protected override void UseSkillOnTarget(Creature attacker, Skill skill, Creature target)
{
attacker.StopMove();
target.StopMove();
// Create actions
var aAction = new AttackerAction(CombatActionType.RangeHit, attacker, target.EntityId);
aAction.Set(AttackerOptions.Result);
var tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, skill.Info.Id);
tAction.Set(TargetOptions.Result);
tAction.Stun = TargetStun;
var cap = new CombatActionPack(attacker, skill.Info.Id, aAction, tAction);
// Damage
var damage = this.GetDamage(attacker, skill);
// Elements
damage *= this.GetElementalDamageMultiplier(attacker, target);
// Critical Hit
var critChance = attacker.GetTotalCritChance(target.Protection, true);
CriticalHit.Handle(attacker, critChance, ref damage, tAction);
// Reduce damage
Defense.Handle(aAction, tAction, ref damage);
SkillHelper.HandleMagicDefenseProtection(target, ref damage);
ManaShield.Handle(target, ref damage, tAction);
// Mana Deflector
var delayReduction = ManaDeflector.Handle(attacker, target, ref damage, tAction);
// Deal damage
if (damage > 0)
target.TakeDamage(tAction.Damage = damage, attacker);
target.Aggro(attacker);
// Knock down on deadly
if (target.Conditions.Has(ConditionsA.Deadly))
{
tAction.Set(TargetOptions.KnockDown);
tAction.Stun = TargetStun;
}
// Reduce stun, based on ping
if (delayReduction > 0)
tAction.Stun = (short)Math.Max(0, tAction.Stun - (tAction.Stun / 100 * delayReduction));
// Death/Knockback
if (target.IsDead)
{
tAction.Set(TargetOptions.FinishingKnockDown);
}
else
{
// If knocked down, instant recovery,
// if repeat hit, knock down,
// otherwise potential knock back.
if (target.IsKnockedDown)
{
tAction.Stun = 0;
}
else if (target.Stability < MinStability)
{
tAction.Set(TargetOptions.KnockDown);
}
else
{
var stabilityReduction = StabilityReduction;
// Reduce reduction, based on ping
// While the Wiki says that "the Knockdown Gauge [does not]
// build up", tests show that it does. However, it's
// reduced, assumedly based on the MD rank.
if (delayReduction > 0)
stabilityReduction = (short)Math.Max(0, stabilityReduction - (stabilityReduction / 100 * delayReduction));
target.Stability -= stabilityReduction;
if (target.IsUnstable)
{
tAction.Set(TargetOptions.KnockBack);
}
}
}
if (tAction.IsKnockBack)
attacker.Shove(target, KnockbackDistance);
// Override stun set by defense
aAction.Stun = AttackerStun;
Send.Effect(attacker, Effect.UseMagic, EffectSkillName);
//.........这里部分代码省略.........
示例14: Use
/// <summary>
/// Uses skill, the actual usage is in Complete.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
public void Use(Creature creature, Skill skill, Packet packet)
{
var entityId = packet.GetLong();
var unkInt1 = packet.GetInt();
var unkInt2 = packet.GetInt();
creature.StopMove();
// Do checks in Complete.
Send.SkillUse(creature, skill.Info.Id, entityId, unkInt1, unkInt2);
}
示例15: UseSkillOnTarget
/// <summary>
/// Bolt specific use code.
/// </summary>
/// <param name="attacker"></param>
/// <param name="skill"></param>
/// <param name="target"></param>
protected virtual void UseSkillOnTarget(Creature attacker, Skill skill, Creature target)
{
target.StopMove();
// Create actions
var aAction = new AttackerAction(CombatActionType.RangeHit, attacker, skill.Info.Id, target.EntityId);
aAction.Set(AttackerOptions.Result);
var tAction = new TargetAction(CombatActionType.TakeHit, target, attacker, skill.Info.Id);
tAction.Set(TargetOptions.Result);
tAction.Stun = TargetStun;
var cap = new CombatActionPack(attacker, skill.Info.Id, aAction, tAction);
// Damage
var damage = this.GetDamage(attacker, skill);
// Reduce damage
if (this.Defendable)
Defense.Handle(aAction, tAction, ref damage);
SkillHelper.HandleMagicDefenseProtection(target, ref damage);
ManaShield.Handle(target, ref damage, tAction);
// Deal damage
if (damage > 0)
target.TakeDamage(tAction.Damage = damage, attacker);
target.Aggro(attacker);
// Death/Knockback
this.HandleKnockBack(attacker, target, tAction);
// Override stun set by defense
aAction.Stun = AttackerStun;
Send.Effect(attacker, Effect.UseMagic, EffectSkillName);
Send.SkillUseStun(attacker, skill.Info.Id, aAction.Stun, 1);
this.BeforeHandlingPack(attacker, skill);
cap.Handle();
}