示例#1
0
        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, "SwordStickMastery", 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;
            }
        }
示例#2
0
        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, "MentalTraining", 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;
            }
        }
示例#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;
                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);
        }
示例#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)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();
                }
            }
        }