예제 #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);
 }
예제 #2
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;
         }
     }
 }
예제 #3
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);
                     }
                 }
             }
         }
     }
 }
예제 #4
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;
         }
     }
 }
예제 #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;
                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);
        }
예제 #6
0
        public static void Proc(ref Actor sActor, ref Actor dActor, ref Map.SkillArgs args)
        {
            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 (sActor.type == ActorType.PC)
                {
                    ActorPC targetPC = (ActorPC)sActor;
                    ActorEventHandlers.PC_EventHandler eh = (ActorEventHandlers.PC_EventHandler)targetPC.e;
                    try
                    {
                        switch (args.skillID)
                        {
                        case SkillIDs.NormanShortSwordAttack:
                            SkillHandler.AddPassiveSkillEXP(targetPC, "ShortSwordMastery", 1406900, 3);
                            break;

                        case SkillIDs.NormanLongSwordAttack:
                            SkillHandler.AddPassiveSkillEXP(targetPC, "LongSwordMastery", 1416900, 3);
                            SkillHandler.AddPassiveSkillEXP(targetPC, "ArtOfWarrior", 1419100, 3);
                            break;

                        case SkillIDs.NormanDampflintAttack:
                            SkillHandler.AddPassiveSkillEXP(targetPC, "DampRifleMastery", 1426900, 3);
                            SkillHandler.AddPassiveSkillEXP(targetPC, "FirePractice", 1429100, 3);
                            break;

                        case SkillIDs.NormanDampflintAttack2:
                            SkillHandler.AddPassiveSkillEXP(targetPC, "DampRifleMastery", 1426900, 3);
                            SkillHandler.AddPassiveSkillEXP(targetPC, "CloseOrderDrill", 1427100, 3);
                            break;

                        case SkillIDs.NormanSwordStickAttack:
                        case SkillIDs.NormanSwordStickAttack2:
                            SkillHandler.AddPassiveSkillEXP(targetPC, "ShortSwordMastery", 1406900, 3);
                            break;
                        }
                    }
                    catch (Exception) { }
                    SkillHandler.WeaponLoseDura(targetPC, 1);
                }
            }
            SkillHandler.PhysicalAttack(ref sActor, ref dActor, args.damage, SkillHandler.AttackElements.NEUTRAL, ref args);
        }
예제 #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) || 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);
 }
예제 #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 = (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);
 }
예제 #9
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 (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);
 }
예제 #10
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);
        }
예제 #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;
         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);
 }