public override void AdditionEnd() { SkillHandler.RemoveAddition(this.AttachedActor, this, true); BonusHandler.Instance.SkillAddAddition(this.AttachedActor, (uint)this.skillID, true); SkillHandler.RemoveStatusIcon(this.AttachedActor, (uint)this.skillID); TimerEnd(); }
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args) { ActorPC pc = (ActorPC)sActor; ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e; if (sActor.type == ActorType.PC) { if (!SkillHandler.CheckSkillSP(pc, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking byte level = (byte)(args.skillID - baseID + 1); SkillHandler.AddSkillEXP(ref pc, (uint)args.skillID, 3); if (!pc.Tasks.ContainsKey("ActDead")) { Tasks.PassiveSkillStatus t = new SagaMap.Tasks.PassiveSkillStatus(level); args.failed = true; pc.Tasks.Add("ActDead", t); SkillHandler.AddStatusIcon(pc, (uint)args.skillID, 0); } else { args.failed = false; pc.Tasks.Remove("ActDead"); SkillHandler.RemoveStatusIcon(pc, (uint)args.skillID); } } }
public static void Callback(Actor client) { try { Tasks.PassiveSkillStatus ss; ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)client.e; ss = (PassiveSkillStatus)client.Tasks["VenomCoat"]; if (ss.dueTime > 0) { if (client.type == ActorType.PC) { eh.C.SendBattleStatus(); } ss.dueTime--; } else { SkillHandler.RemoveStatusIcon(client, (uint)(1457400 + ss.level)); client.BattleStatus.atkskill -= CalcDamage(ss.level); eh.C.SendBattleStatus(); ss.Deactivate(); client.Tasks.Remove("VenomCoat"); ss = null; } } catch (Exception) { } }
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args) { if (sActor.type == ActorType.PC) { ActorPC pc = (ActorPC)sActor; if (pc.SP < SkillFactory.GetSkill((uint)args.skillID).sp) { args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Miss; args.failed = true; return; } else { ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e; pc.SP -= (ushort)SkillFactory.GetSkill((uint)args.skillID).sp; pc.LP += 1; if (pc.LP > 5) { pc.LP = 5; } eh.C.SendCharStatus(0); } } args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage; byte level = (byte)(args.skillID - baseID + 1); ActorPC targetpc = (ActorPC)dActor; Tasks.PassiveSkillStatus ss; if (targetpc.Tasks.ContainsKey("VenomCoat")) { ss = (PassiveSkillStatus)targetpc.Tasks["VenomCoat"]; ss.level = level; SkillHandler.RemoveStatusIcon(dActor, (uint)1457400 + ss.level); targetpc.BattleStatus.atkskill -= CalcDamage(ss.level); ss.Deactivate(); ss.dueTime = 1; ss.period = 600000; targetpc.BattleStatus.atkskill += CalcDamage(level); SkillHandler.AddStatusIcon(dActor, (uint)args.skillID, 600000); ss.Activate(); } else { ss = new PassiveSkillStatus(level); ss.dueTime = 1; ss.period = 600000; ss.client = dActor; ss.Func = new PassiveSkillStatus.CallBackFunc(Callback); targetpc.Tasks.Add("VenomCoat", ss); targetpc.BattleStatus.atkskill += CalcDamage(level); SkillHandler.AddStatusIcon(dActor, (uint)args.skillID, 600000); ss.Activate(); } }
private static void Deactivate(Actor client) { try { Tasks.PassiveSkillStatus ss = (Tasks.PassiveSkillStatus)client.Tasks["Stunned"]; SkillHandler.RemoveStatusIcon(client, (uint)(baseID + ss.level - 1)); } catch (Exception ex) { Logger.ShowError(ex); } }
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args) { if (sActor.type == ActorType.PC) { ActorPC pc = (ActorPC)sActor; byte level = (byte)(args.skillID - baseID + 1); if (!SkillHandler.CheckSkillSP(pc, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } args.damage = 0; args.isCritical = SkillHandler.CalcCrit(sActor, dActor, args, SkillHandler.AttackType.Physical); if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block) { args.damage = CalcDamage(sActor, dActor, args); int perc = 0; perc = 51 + level * 4; if (Global.Random.Next(0, 99) <= perc) { Tasks.PassiveSkillStatus ss; switch (SkillHandler.AddPassiveStatus(dActor, "Stunned", 255, out ss, new SagaMap.Tasks.PassiveSkillStatus.CallBackFunc(Callback), new SagaMap.Tasks.PassiveSkillStatus.DeactivateFunc(Deactivate))) { case PassiveStatusAddResult.Updated: ss.dueTime = 3000; ss.period = 3000; SkillHandler.RemoveStatusIcon(dActor, (uint)(baseID + ss.level - 1)); if (ss.Activated()) { ss.Deactivate(); } ss.Activate(); ss.level = level; SkillHandler.AddStatusIcon(dActor, (uint)args.skillID, 3000); break; case PassiveStatusAddResult.OK: ss.dueTime = 3000; ss.period = 3000; ss.level = level; ss.Activate(); SkillHandler.AddStatusIcon(dActor, (uint)args.skillID, 3000); break; } } } } SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args); }
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args) { if (sActor.type == ActorType.PC) { ActorPC pc = (ActorPC)sActor; ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e; byte level = (byte)(args.skillID - baseID + 1); if (!SkillHandler.CheckSkillSP(pc, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage; Tasks.PassiveSkillStatus ss; switch (SkillHandler.AddPassiveStatus(dActor, "WeaponBlessing", 255, out ss, new SagaMap.Tasks.PassiveSkillStatus.CallBackFunc(Callback), new SagaMap.Tasks.PassiveSkillStatus.DeactivateFunc(Deactivate))) { case PassiveStatusAddResult.Updated: ss.dueTime = 900000; ss.period = 900000; SkillHandler.RemoveStatusIcon(dActor, (uint)(baseID + ss.level - 1)); if (ss.Activated()) { ss.Deactivate(); } ss.Activate(); BonusHandler.Instance.SkillAddAddition(dActor, (uint)args.skillID, false); ss.level = level; SkillHandler.AddStatusIcon(dActor, (uint)args.skillID, 900000); break; case PassiveStatusAddResult.OK: ss.dueTime = 900000; ss.period = 900000; ss.level = level; ss.Activate(); BonusHandler.Instance.SkillAddAddition(dActor, (uint)args.skillID, false); SkillHandler.AddStatusIcon(dActor, (uint)args.skillID, 900000); break; } if (dActor.type == ActorType.PC) { eh = (SagaMap.ActorEventHandlers.PC_EventHandler)dActor.e; eh.C.SendBattleStatus(); } } }
private static void Deactivate(Actor client) { try { Tasks.PassiveSkillStatus ss = (Tasks.PassiveSkillStatus)client.Tasks["WeaponBlessing"]; SkillHandler.RemoveStatusIcon(client, (uint)(baseID + ss.level - 1)); BonusHandler.Instance.SkillAddAddition(client, (uint)(baseID + ss.level - 1), true); if (client.type == ActorType.PC) { ActorPC pc = (ActorPC)client; ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)pc.e; eh.C.SendBattleStatus(); } } catch (Exception ex) { Logger.ShowError(ex); } }
private static void Deactivate(Actor actor) { Tasks.PassiveSkillStatus ss; ss = (Tasks.PassiveSkillStatus)actor.Tasks["Swordstick Stance"]; SkillHandler.RemoveStatusIcon(actor, (uint)(baseID + ss.level - 1)); }