本文整理汇总了C#中Aura.World.World.MabiCreature.CancelSkill方法的典型用法代码示例。如果您正苦于以下问题:C# MabiCreature.CancelSkill方法的具体用法?C# MabiCreature.CancelSkill怎么用?C# MabiCreature.CancelSkill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.World.World.MabiCreature
的用法示例。
在下文中一共展示了MabiCreature.CancelSkill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleCreatureKill
public void HandleCreatureKill(MabiCreature creature, MabiCreature killer, MabiVertex position, SkillConst skillId)
{
if (killer != null)
{
// Shadow Bunshin soul counter
if (skillId != SkillConst.ShadowBunshin)
killer.SoulCount++;
// Exp
if (killer.LevelingEnabled)
{
// Give exp
var exp = creature.BattleExp * WorldConf.ExpRate;
killer.GiveExp((ulong)exp);
Send.CombatMessage(killer.Client, killer, "+{0} EXP", exp);
EventManager.CreatureEvents.OnCreatureKilled(creature, killer);
if (killer is MabiPC)
EventManager.PlayerEvents.OnKilledByPlayer(creature, killer);
}
}
var npc = creature as MabiNPC;
if (npc != null)
{
var rnd = RandomProvider.Get();
// Gold
if (rnd.NextDouble() < WorldConf.GoldDropRate)
{
var amount = rnd.Next(npc.GoldMin, npc.GoldMax + 1);
if (amount > 0)
{
var gold = new MabiItem(2000);
gold.Info.Amount = (ushort)amount;
gold.Info.Region = npc.Region;
gold.Info.X = (uint)(position.X + rnd.Next(-50, 51));
gold.Info.Y = (uint)(position.Y + rnd.Next(-50, 51));
gold.DisappearTime = DateTime.Now.AddSeconds(60);
this.AddItem(gold);
}
}
// Drops
foreach (var drop in npc.Drops)
{
if (rnd.NextDouble() < drop.Chance * WorldConf.DropRate)
{
var item = new MabiItem(drop.ItemId);
item.Info.Amount = 1;
item.Info.Region = npc.Region;
item.Info.X = (uint)(position.X + rnd.Next(-50, 51));
item.Info.Y = (uint)(position.Y + rnd.Next(-50, 51));
item.DisappearTime = DateTime.Now.AddSeconds(60);
this.AddItem(item);
}
}
}
// Set finisher?
WorldManager.Instance.Broadcast(new MabiPacket(Op.CombatSetFinisher, creature.Id).PutLong(killer.Id), SendTargets.Range, creature);
// Clear target
Send.CombatTargetSet(killer, null);
// Finish this finisher part?
WorldManager.Instance.Broadcast(new MabiPacket(Op.CombatSetFinisher2, creature.Id), SendTargets.Range, creature);
// TODO: There appears to be something missing to let it lay there for finish, if we don't kill it with the following packets.
// TODO: Check for finishing.
// Make it dead
WorldManager.Instance.Broadcast(new MabiPacket(Op.IsNowDead, creature.Id), SendTargets.Range, creature);
// Remove finisher?
WorldManager.Instance.Broadcast(new MabiPacket(Op.CombatSetFinisher, creature.Id).PutLong(0), SendTargets.Range, creature);
if (creature.ActiveSkillId != SkillConst.None)
creature.CancelSkill();
if (creature.Owner != null)
{
Send.DeadFeather(creature, DeadMenuOptions.Here | DeadMenuOptions.FeatherUp);
// TODO: Unmount.
}
creature.CauseOfDeath = DeathCauses.None;
if (creature.ArenaPvPManager != null && creature.ArenaPvPManager == killer.ArenaPvPManager && creature.ArenaPvPManager.IsAttackableBy(creature, killer))
{
creature.ArenaPvPManager.CreatureKilled(creature, killer);
creature.CauseOfDeath = DeathCauses.Arena;
}
// TODO: Trans PvP
if (creature.CauseOfDeath == DeathCauses.None && creature.EvGEnabled && killer.EvGEnabled)
//.........这里部分代码省略.........