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 = (ActorEventHandlers.PC_EventHandler)pc.e; if (!SkillHandler.CheckSkillSP(pc, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } Mob mob = (Mob)dActor.e; args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking if (!mob.Hate.ContainsKey(pc.id)) { SkillHandler.SetSkillFailed(ref args); return; } SkillHandler.AddSkillEXP(ref pc, (uint)args.skillID, 3); ushort value = GetHateReduction(args); if (mob.Hate[pc.id] > value) mob.Hate[pc.id] -= (byte)value; else mob.Hate[pc.id] = 0; } //TODO: //20% Sadness status on enemy }
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 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; } } else//currently cannot be cast on player { SkillHandler.SetSkillFailed(ref args); return; } args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking if (!pc.BattleStatus.Additions.ContainsKey("BayonetStance")) { SkillHandler.ApplyAddition(pc, new Additions.Global.DefaultStance(args.skillID, pc, "BayonetStance")); args.failed = true; } else { args.failed = false; SkillHandler.RemoveAddition(pc, pc.BattleStatus.Additions["BayonetStance"]); } }
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); switch (SkillHandler.AddPassiveStatus(pc, "MentalPower", 3, out ss, new PassiveSkillStatus.DeactivateFunc(Deactivate))) { case PassiveStatusAddResult.WeaponMissMatch: if (ss != null) { BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true); } break; case PassiveStatusAddResult.Updated: BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true); BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false); ss.level = level; break; case PassiveStatusAddResult.OK: ss.level = level; BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false); break; } }
public MobAttack(Mob mob, int aDelay, Actor dActor) { this.dueTime = 0; this.period = aDelay; this.mob = mob; this.dActor = dActor; }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { args.damage = 0; args.isCritical = 0; bool ifActivate = (SagaDB.Items.WeaponFactory.GetActiveWeapon((ActorPC)sActor).type == 2); SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultPassiveSkill(args.skillID, dActor, "LongSwordMastery", ifActivate)); }
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 = SkillHandler.CalcCrit(sActor,dActor, args, SkillHandler.AttackType.Physical); if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block) { ActorPC targetPC = (ActorPC)sActor; args.damage = CalcDamage(sActor, dActor, args); } if (args.damage <= 0) args.damage = 1; SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.HOLY, ref args); }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { ActorPC pc = (ActorPC)sActor; ActorEventHandlers.PC_EventHandler eh = (SagaMap.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.Heal; ActorPC targetPC; args.damage = CalcDamage(sActor, dActor, args); if (dActor.type == ActorType.PC) { targetPC = (ActorPC)dActor; eh = (SagaMap.ActorEventHandlers.PC_EventHandler)targetPC.e; targetPC.HP += (ushort)args.damage; eh.C.SendSkillEffect(SkillFactory.GetSkill((uint)args.skillID).addition, SkillEffects.HP, args.damage); if (targetPC.HP > targetPC.maxHP) targetPC.HP = targetPC.maxHP; eh.C.SendCharStatus(0); } } }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { ActorPC pc=(ActorPC)sActor; args.damage = 0; args.isCritical = 0; SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultPassiveSkill(args.skillID, dActor, "StrongMind", true)); }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { if (sActor.type == ActorType.PC) { ActorPC pc = (ActorPC)sActor; if (!SkillHandler.CheckSkillSP(pc, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } SkillHandler.GainLP(pc, args.skillID); args.damage = 0; args.isCritical = SkillHandler.CalcCrit(sActor, dActor, args, SkillHandler.AttackType.Magical); if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block) { uint MDamage; uint FireDamage; args.damage = CalcDamage(sActor, dActor, args); MDamage = SkillHandler.MagicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args); args.damage = CalcFireDamage(sActor, dActor, args); FireDamage = SkillHandler.MagicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.FIRE, ref args); args.damage = MDamage + FireDamage; } } }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { byte level; ActorPC pc=(ActorPC)sActor; Tasks.PassiveSkillStatus ss; args.damage = 0; args.isCritical = 0; level = (byte)(args.skillID - baseID + 1); switch (SkillHandler.AddPassiveStatus(pc, "WhiteShortSwordMastery", 1, out ss, new PassiveSkillStatus.DeactivateFunc(Deactivate))) { case PassiveStatusAddResult.WeaponMissMatch: if (ss != null) { BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true); } break; case PassiveStatusAddResult.Updated: BonusHandler.Instance.SkillAddAddition(pc, (uint)(baseID + ss.level - 1), true); BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false); ss.level = level; break; case PassiveStatusAddResult.OK: ss.level = level; BonusHandler.Instance.SkillAddAddition(pc, (uint)args.skillID, false); break; } }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { if (sActor.type == ActorType.PC) { ActorPC pc = (ActorPC)sActor; 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) { if (dActor.type == ActorType.NPC) { ActorNPC npc = (ActorNPC)dActor; if (npc.npcType >= 10000 && npc.npcType < 50000) { Mob mob = (Mob)npc.e; if (mob.Hate.ContainsKey(sActor.id)) mob.Hate[sActor.id] = 65535; else mob.Hate.Add(sActor.id, 65535); } } } } }
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) { } }
/// <summary> /// Constructor for Addition: Short Sword Mastery /// </summary> /// <param name="id">Skill ID</param> /// <param name="actor">Actor, which this addition get attached to</param> public DefaultPassiveSkill(SkillIDs id, Actor actor,string name, bool ifActivate) { this.Name = name; this.skillID = id; this.AttachedActor = actor; this.activate = ifActivate; }
private static uint CalcDamage(Actor sActor,Actor dActor,Map.SkillArgs args) { byte level = (byte)(args.skillID - baseID + 1); ActorPC pc = (ActorPC)sActor; int dmg = 0; switch (pc.LP) { case 1: dmg = 7 + level; break; case 2: dmg = 13 + level * 2; break; case 3: dmg = 21 + level * 3; break; case 4: dmg = 29 + level * 4; break; case 5: dmg = 37 + level * 5; break; } return (uint)(sActor.BattleStatus.atk + dmg); }
private static uint CalcDamage(Actor sActor,Actor dActor,Map.SkillArgs args) { ActorPC pc = (ActorPC)sActor; byte level = (byte)(args.skillID - baseID + 1); return (uint)(150 * level); }
public DefaultBuff(int additionID, Actor actor, string name, int lifetime, Addition.AdditionType type) { this.Name = name; this.additionID = (uint)additionID; this.AttachedActor = actor; this.lifeTime = lifetime; this.MyType = type; }
public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args) { ActorPC pc = (ActorPC)sActor; args.damage = 0; args.isCritical = 0; bool ifActivate = (SagaDB.Items.WeaponFactory.GetActiveWeapon(pc).type == 4); SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultPassiveSkill(args.skillID, dActor, "FirePractice", ifActivate)); }
public void AddAddition(Actor pc, uint id, bool deactivate) { List<SagaDB.Items.Bonus> bonus = AdditionFactory.GetBonus(id); foreach (SagaDB.Items.Bonus i in bonus) { AddBonus(pc, i, BonusType.Skill, deactivate, id); } }
public DefaultBuff(SkillIDs id, Actor actor, string name,int lifetime, Addition.AdditionType type) { this.Name = name; this.skillID = id; this.AttachedActor = actor; this.lifeTime = lifetime; this.MyType = type; }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { ActorItem item = (ActorItem)dActor; ActorPC pc= (ActorPC)sActor; MapItem eh = (MapItem)item.e; args.isCritical = Map.SkillArgs.AttackResult.Nodamage; args.damage = 0; eh.OnOpen(pc); }
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)sActor.e; if (!SkillHandler.CheckSkillSP(pc, args.skillID) || pc.LP < 1) { SkillHandler.SetSkillFailed(ref args); return; } pc.LP -= 1; eh.C.SendCharStatus(0); Map map; if (dActor.mapID == 0) { if (dActor.type == ActorType.PC) { eh = (SagaMap.ActorEventHandlers.PC_EventHandler)dActor.e; dActor.mapID = (byte)eh.C.map.ID; } } if (MapManager.Instance.GetMap(dActor.mapID, out map)) { foreach (Actor actor in map.GetActorsArea(dActor, 500, true)) { Actor tmp = actor; if (actor == sActor || actor.stance == Global.STANCE.DIE || actor.type != ActorType.NPC) continue; args.damage = 0; args.isCritical = SkillHandler.CalcCrit(sActor, actor, args, SkillHandler.AttackType.Physical); ActorNPC npc = (ActorNPC)actor; if (npc.npcType < 10000) continue; if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block) { ActorPC targetPC = (ActorPC)sActor; args.damage = CalcDamage(sActor, actor, args); } SkillHandler.PhysicalAttack(ref sActor, ref tmp, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args); if (actor != dActor) { args.targetActorID = actor.id; map.SendEventToAllActorsWhoCanSeeActor(Map.EVENT_TYPE.SKILL, args, sActor, true); } } args.targetActorID = dActor.id; } else { SkillHandler.SetSkillFailed(ref args); return; } } }
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 uint CalcDamage(Actor sActor,Actor dActor,Map.SkillArgs args) { ActorNPC npc = (ActorNPC)dActor; ActorPC pc = (ActorPC)sActor; byte level = (byte)(args.skillID - baseID + 1); int delta = Math.Abs((int)((npc.level - pc.cLevel))); if (delta <= 20) return (uint)(sActor.BattleStatus.atk + (14 + level * 6) * delta); else return (uint)(sActor.BattleStatus.atk + (14 + level * 6) * 20); }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { if (sActor.type != ActorType.PC) { SkillHandler.SetSkillFailed(ref args); return; } ActorEventHandlers.PC_EventHandler eh = (SagaMap.ActorEventHandlers.PC_EventHandler)sActor.e; args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage;//not for damage eh.C.OnUsePromiseStone(sActor.mapID, sActor.x, sActor.y, sActor.z); }
public static uint MagicalAttack(ref Actor sActor, ref Actor dActor, uint damage, AttackElements element, ref Map.SkillArgs args) { //TODO: //Damage calculation and magical resists. if (args.isCritical == Map.SkillArgs.AttackResult.Critical) { damage = damage * 2; args.damage = damage; } SkillAttack(ref sActor, ref dActor, damage, ref args); return damage; }
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(); } } } }
private static void Callback(Actor client) { try { Tasks.PassiveSkillStatus ss = (Tasks.PassiveSkillStatus)client.Tasks["Stunned"]; ss.Deactivate(); client.Tasks.Remove("Stunned"); } 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) { if (!SkillHandler.CheckSkillSP((ActorPC)dActor, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage; SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultBuff(args.skillID, dActor, "FatalContract", 240000, Addition.AdditionType.Buff)); } }
public static void Proc(ref Actor sActor, ref Actor dActor,ref Map.SkillArgs args) { if (sActor.type == ActorType.PC) { if (!SkillHandler.CheckSkillSP((ActorPC)dActor, args.skillID)) { SkillHandler.SetSkillFailed(ref args); return; } args.damage = 0; args.isCritical = Map.SkillArgs.AttackResult.Nodamage; SkillHandler.ApplyAddition(dActor, new Additions.Thief.RapidRun(args.skillID, dActor)); } }