Exemplo n.º 1
0
 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.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.NEUTRAL, ref args);
 }
Exemplo n.º 2
0
        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"]);
            }
        }
Exemplo n.º 3
0
        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);
                }
            }
        }
Exemplo n.º 4
0
        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);
                }
            }
        }
Exemplo n.º 5
0
        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
        }
Exemplo n.º 6
0
 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);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 7
0
 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 WindDamage;
             args.damage = CalcDamage(sActor, dActor, args);
             MDamage     = SkillHandler.MagicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
             args.damage = CalcWindDamage(sActor, dActor, args);
             WindDamage  = SkillHandler.MagicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.WIND, ref args);
             args.damage = MDamage + WindDamage;
         }
     }
 }
Exemplo n.º 8
0
 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;
         }
     }
 }
Exemplo n.º 9
0
 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));
     }
 }
Exemplo n.º 10
0
 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));
     }
 }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args)
        {
            byte    level;
            ActorPC pc = (ActorPC)sActor;

            level = (byte)(args.skillID - baseID + 1);
            ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)pc.e;
            if (!SkillHandler.CheckSkillSP(pc, args.skillID))
            {
                SkillHandler.SetSkillFailed(ref args);
                return;
            }
            SkillHandler.GainLP(pc, args.skillID, (byte)((level + 1) / 2));
            args.damage     = 0;
            args.isCritical = Map.SkillArgs.AttackResult.Nodamage;
        }
Exemplo n.º 13
0
        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();
                }
            }
        }
Exemplo n.º 14
0
 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;
         SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultBuff(args.skillID, dActor, "Tracking", 900000, Addition.AdditionType.Buff));
     }
 }
Exemplo n.º 15
0
        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) || pc.LP < 3)
                {
                    SkillHandler.SetSkillFailed(ref args);
                    return;
                }
                pc.LP          -= 3;
                args.damage     = 0;
                args.isCritical = Map.SkillArgs.AttackResult.Nodamage;// This skill is not for attacking
                SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultBuff(args.skillID, dActor, "ShieldBlock", 300000, Addition.AdditionType.Buff));
            }
        }
Exemplo n.º 16
0
 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;
         }
         SkillHandler.GainLP(pc, args.skillID);
         args.damage     = 0;
         args.isCritical = Map.SkillArgs.AttackResult.Nodamage;
         SkillHandler.ApplyAddition(dActor, new Additions.Recruit.Designation(args.skillID, dActor));
     }
 }
Exemplo n.º 17
0
 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) || pc.LP == 0)
         {
             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)
         {
             byte level = (byte)(args.skillID - baseID + 1);
             args.damage = CalcDamage(sActor, level, pc.LP);
         }
         pc.LP = 0;
     }
     SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
 }
Exemplo n.º 18
0
 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) || pc.LP == 0)
         {
             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);
         }
         pc.LP = 0;
         eh.C.SendCharStatus(0);
     }
     SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
 }
Exemplo n.º 19
0
        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.Ranged);
            byte level = (byte)(args.skillID - baseID + 1);

            if (args.isCritical != Map.SkillArgs.AttackResult.Miss && args.isCritical != Map.SkillArgs.AttackResult.Block)
            {
                ActorPC targetPC = (ActorPC)sActor;
                args.damage = CalcDamage(sActor, dActor, args);
                if (dActor.type == ActorType.NPC)//currently only can be casted on NPCs(Mob)
                {
                    ActorNPC npc = (ActorNPC)dActor;
                    Mob      mob = (Mob)dActor.e;
                    if (Global.Random.Next(0, 99) < 50)
                    {
                        SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultBuff(1004801, dActor, "LowerBodyParalysis", 5000, Addition.AdditionType.Debuff));
                    }
                }
            }
            if (args.damage <= 0)
            {
                args.damage = 1;
            }
            SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
        }
Exemplo n.º 20
0
 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) || pc.LP < 1)
         {
             SkillHandler.SetSkillFailed(ref args);
             return;
         }
         pc.LP          -= 1;
         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);
             if (Global.Random.Next(0, 99) > 65)
             {
                 SkillHandler.ApplyAddition(dActor, new Additions.Global.DefaultBuff(1004901, dActor, "Frozen", 5000, Addition.AdditionType.Debuff));
             }
         }
     }
     SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
 }