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 override void AdditionStart() { this.endTime = DateTime.Now + new TimeSpan(0, 0, 15); InitTimer(15000, 0); SkillHandler.AddStatusIcon(this.AttachedActor, (uint)this.skillID, 15000); BonusHandler.Instance.SkillAddAddition(this.AttachedActor, (uint)this.skillID, false); TimerStart(); }
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(); } }
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 override void AdditionStart() { this.endTime = DateTime.Now + new TimeSpan(0, lifeTime / 60000, (lifeTime / 1000) % 60); InitTimer(lifeTime, 0); if (this.skillID != 0) { SkillHandler.AddStatusIcon(this.AttachedActor, (uint)this.skillID, (uint)lifeTime); BonusHandler.Instance.SkillAddAddition(this.AttachedActor, (uint)this.skillID, false); } if (this.additionID != 0) { SkillHandler.AddStatusIcon(this.AttachedActor, this.additionID, (uint)lifeTime); BonusHandler.Instance.AddAddition(this.AttachedActor, this.additionID, false); } TimerStart(); }
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(); } } }
public override void AdditionStart() { SkillHandler.AddStatusIcon(this.AttachedActor, (uint)this.skillID, 0); BonusHandler.Instance.SkillAddAddition(this.AttachedActor, (uint)this.skillID, false); }