public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args) { byte level; ActorPC pc = (ActorPC)sActor; Tasks.PassiveSkillStatus ss; Tasks.Regeneration rege = (Tasks.Regeneration)pc.Tasks["RegenerationSP"]; args.damage = 0; args.isCritical = 0; level = (byte)(args.skillID - baseID + 1); if (!pc.BattleSkills.ContainsKey((uint)args.skillID)) { if (pc.Tasks.ContainsKey("ChakraaBreath")) { ss = (PassiveSkillStatus)pc.Tasks["ChakraaBreath"]; rege.sp -= (ushort)GetLevelValue(level); pc.Tasks.Remove("ChakraaBreath"); } return; //if current weapon is not Short Sword } if (pc.Tasks.ContainsKey("ChakraaBreath")) { ss = (PassiveSkillStatus)pc.Tasks["ChakraaBreath"]; rege.sp -= (ushort)GetLevelValue(ss.level); ss.level = level; rege.sp += (ushort)GetLevelValue(level); } else { ss = new PassiveSkillStatus(level); rege.sp += (ushort)GetLevelValue(level); pc.Tasks.Add("ChakraaBreath", ss); } }
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) { byte level; ActorPC pc = (ActorPC)sActor; ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e; Tasks.PassiveSkillStatus ss; level = (byte)(args.skillID - baseID + 1); args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage; if (dActor.type == ActorType.PC) { ActorPC targetpc = (ActorPC)dActor; if (targetpc.Tasks.ContainsKey("Meditation")) { ss = (PassiveSkillStatus)targetpc.Tasks["Meditation"]; targetpc.BattleStatus.fireresist -= CalcValue(ss.level); targetpc.BattleStatus.iceresist -= CalcValue(ss.level); targetpc.BattleStatus.windresist -= CalcValue(ss.level); targetpc.BattleStatus.holyresist -= CalcValue(ss.level); targetpc.BattleStatus.darkresist -= CalcValue(ss.level); ss.level = level; targetpc.BattleStatus.fireresist += CalcValue(level); targetpc.BattleStatus.iceresist += CalcValue(level); targetpc.BattleStatus.windresist += CalcValue(level); targetpc.BattleStatus.holyresist += CalcValue(level); targetpc.BattleStatus.darkresist += CalcValue(level); if (dActor.type == ActorType.PC) { eh = (ActorEventHandlers.PC_EventHandler)dActor.e; eh.C.SendBattleStatus(); } } else { ss = new PassiveSkillStatus(level); ss.DeactFunc += Deactivate; ss.client = dActor; targetpc.Tasks.Add("Meditation", ss); targetpc.BattleStatus.fireresist += CalcValue(level); targetpc.BattleStatus.iceresist += CalcValue(level); targetpc.BattleStatus.windresist += CalcValue(level); targetpc.BattleStatus.holyresist += CalcValue(level); targetpc.BattleStatus.darkresist += CalcValue(level); if (dActor.type == ActorType.PC) { eh = (ActorEventHandlers.PC_EventHandler)dActor.e; eh.C.SendBattleStatus(); } } } }
/// <summary> /// Add a passive status to a Actor /// </summary> /// <param name="pc">Actor</param> /// <param name="StatusName">Name of the Status</param> /// <param name="WeaponType">Weapon type</param> /// <param name="Status">Status instance</param> /// <param name="callback">Delegate to a callback function</param> /// <param name="DeactFunc">Delegate to a deactivation function</param> /// <returns>Result</returns> public static PassiveStatusAddResult AddPassiveStatus(Actor pc, string StatusName, byte WeaponType, out PassiveSkillStatus Status, PassiveSkillStatus.CallBackFunc callback, PassiveSkillStatus.DeactivateFunc DeactFunc) { Status = null; if (pc.type == ActorType.PC) { if (SagaDB.Items.WeaponFactory.GetActiveWeapon((ActorPC)pc).type != WeaponType && WeaponType != 255) { if (pc.Tasks.ContainsKey(StatusName)) { Status = (PassiveSkillStatus)pc.Tasks[StatusName]; pc.Tasks.Remove(StatusName); } return(PassiveStatusAddResult.WeaponMissMatch); } } if (pc.Tasks.ContainsKey(StatusName)) { Status = (PassiveSkillStatus)pc.Tasks[StatusName]; return(PassiveStatusAddResult.Updated); } else { Status = new PassiveSkillStatus(1); if (DeactFunc != null) { Status.DeactFunc += DeactFunc; } if (callback != null) { Status.Func += callback; } Status.client = pc; pc.Tasks.Add(StatusName, Status); return(PassiveStatusAddResult.OK); } }
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(); } }
/// <summary> /// Add a passive status to a Actor /// </summary> /// <param name="pc">Actor</param> /// <param name="StatusName">Name of the Status</param> /// <param name="WeaponType">Weapon type</param> /// <param name="Status">Status instance</param> /// <param name="callback">Delegate to a callback function</param> /// <param name="DeactFunc">Delegate to a deactivation function</param> /// <returns>Result</returns> public static PassiveStatusAddResult AddPassiveStatus(Actor pc, string StatusName, byte WeaponType, out PassiveSkillStatus Status, PassiveSkillStatus.CallBackFunc callback, PassiveSkillStatus.DeactivateFunc DeactFunc) { Status = null; if (pc.type == ActorType.PC) { if (SagaDB.Items.WeaponFactory.GetActiveWeapon((ActorPC)pc).type != WeaponType && WeaponType != 255) { if (pc.Tasks.ContainsKey(StatusName)) { Status = (PassiveSkillStatus)pc.Tasks[StatusName]; pc.Tasks.Remove(StatusName); } return PassiveStatusAddResult.WeaponMissMatch; } } if (pc.Tasks.ContainsKey(StatusName)) { Status = (PassiveSkillStatus)pc.Tasks[StatusName]; return PassiveStatusAddResult.Updated; } else { Status = new PassiveSkillStatus(1); if (DeactFunc != null) Status.DeactFunc += DeactFunc; if (callback != null) Status.Func += callback; Status.client = pc; pc.Tasks.Add(StatusName, Status); return PassiveStatusAddResult.OK; } }