Ejemplo n.º 1
0
        public void HandleOnSkillCastFinish(SkillArg arg)
        {
            Map.Map map = MapManager.Instance.GetMap(arg.Caster.MapInstanceID);
            arg.Caster.Status.StanceFlag1.SetValue(StanceU1.Dash, false);
            UpdateEvent evt = new UpdateEvent()
            {
                Actor             = arg.Caster,
                AdditionID        = 15000030,
                AdditionSession   = 1,
                Target            = arg.Caster,
                Skill             = arg.Skill,
                SkillSession      = arg.SkillSession,
                ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Cancel,
                UpdateType        = UpdateTypes.Actor
            };

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, arg.Caster.Status.StanceFlag1.Value);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF4, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF1, 0);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);

            evt = new UpdateEvent()
            {
                Actor             = arg.Caster,
                Target            = arg.Caster,
                AdditionSession   = 1,
                AdditionID        = 15000030,
                RestTime          = arg.ApproachTime,
                ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Cancel,
                UpdateType        = UpdateTypes.ActorExtension
            };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);
        }
Ejemplo n.º 2
0
        private void Mine_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map     map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            UpdateEvent evt = new UpdateEvent()
            {
                Actor             = actor,
                Target            = actor,
                SkillSession      = 128,
                AdditionID        = 15208019,
                AdditionSession   = 1,
                ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Activate,
                UpdateType        = UpdateTypes.Actor
            };

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = new UpdateEvent()
            {
                Actor           = actor,
                Target          = actor,
                AdditionSession = 1,
                AdditionID      = 15208019,
                RestTime        = arg.Skill.BaseData.Duration,
                SkillSession    = 128,
                UpdateType      = UpdateTypes.ActorExtension
            };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 3
0
        private void Fire_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);

            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, arg.Caster, arg.SkillSession, 0, 12000003, UpdateEvent.ExtraUpdateModes.None);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);
            evt = UpdateEvent.NewActorAdditionExtEvent(arg.Caster, arg.SkillSession, 2, 12000030, 10000, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 4
0
        private void Poisening_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map     map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 3, 15000017, UpdateEvent.ExtraUpdateModes.Cancel);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 3, 15000017, 3000, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 5
0
        private void Poisening_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map     map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, arg.Caster, arg.SkillSession, 3, 15000016, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF9, 1);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(arg.Caster, arg.SkillSession, 3, 15000016, 3000, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 6
0
        public void HandleOnSkillCasting(SkillArg arg)
        {
            Map.Map map = MapManager.Instance.GetMap(arg.Caster.MapInstanceID);
            arg.Caster.Status.StanceFlag1.SetValue(StanceU1.Dash, true);
            UpdateEvent evt = new UpdateEvent()
            {
                Actor             = arg.Caster,
                AdditionID        = 15000030,
                AdditionSession   = 1,
                Target            = arg.Caster,
                Skill             = arg.Skill,
                SkillSession      = arg.SkillSession,
                ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Activate,
                UpdateType        = UpdateTypes.Actor
            };

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, arg.Caster.Status.StanceFlag1.Value);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF4, 1);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF1, 1);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);

            evt = new UpdateEvent()
            {
                Actor           = arg.Caster,
                Target          = arg.Caster,
                AdditionSession = 1,
                AdditionID      = 15000030,
                RestTime        = arg.ApproachTime,
                UpdateType      = UpdateTypes.ActorExtension
            };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);

            if (isBack)
            {
                arg.Caster.Status.Stealth = true;
            }

            Map.MoveArgument argu = new Map.MoveArgument()
            {
                BNSMoveType = MoveType.StepForward
            };
            int distance = arg.Caster.DistanceToActor(arg.Target);
            int forward  = distance < 40 ? 0 : distance - 20;

            argu.SkillSession = arg.SkillSession;
            float deltaX = (float)(arg.Target.X - arg.Caster.X) / distance;
            float deltaY = (float)(arg.Target.Y - arg.Caster.Y) / distance;

            argu.X   = arg.Caster.X + (int)(deltaX * forward);
            argu.Y   = arg.Caster.Y + (int)(deltaY * forward);
            argu.Z   = (short)arg.Target.Z;
            argu.Dir = arg.Caster.Dir;
            map.MoveActor(arg.Caster, argu, true);
        }
Ejemplo n.º 7
0
        private void CounterEnemy_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Status.Counter = true;
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent((ActorExt)actor, (ActorExt)actor, arg.SkillSession, 1, 11103010, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.BlockingStance, 1);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 1, 11103010, arg.Skill.BaseData.Duration, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 8
0
        private void CounterEnemy_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Status.Counter = true;
            arg.Caster.Status.StanceFlag1.SetValue(StanceU1.Unknown40000, true);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, arg.Caster, arg.SkillSession, 4098, 11000018, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, arg.Caster.Status.StanceFlag1.Value);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(arg.Caster, arg.SkillSession, 4098, 11000018, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);
        }
Ejemplo n.º 9
0
        private void Mine_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Tasks.TryRemove("Mine", out Task removed);
            UpdateEvent evt = new UpdateEvent()
            {
                Actor             = actor,
                Target            = actor,
                SkillSession      = 128,
                AdditionID        = 15208019,
                AdditionSession   = 1,
                ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Cancel
            };

            evt.SkillSession = arg.SkillSession;
            evt.UpdateType   = UpdateTypes.Actor;
            evt.UserData     = new byte[] { 9, 3, 0 };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = new UpdateEvent()
            {
                Actor             = actor,
                Target            = actor,
                AdditionSession   = 1,
                AdditionID        = 15208019,
                ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Cancel,
                SkillSession      = 128,
                UpdateType        = UpdateTypes.ActorExtension
            };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
            SkillManager.Instance.BroadcastSkillCast(arg, SkillMode.Abort);
            SkillManager.Instance.DoAttack(arg);
            foreach (SkillAffectedActor i in arg.AffectedActors)
            {
                SkillAttackResult res = i.Result;
                if (res != SkillAttackResult.Avoid && res != SkillAttackResult.Miss && res != SkillAttackResult.Parry && res != SkillAttackResult.TotalParry)
                {
                    if (i.Target.Tasks.ContainsKey("ActorDown"))
                    {
                        Buff buff = i.Target.Tasks["ActorDown"] as Buff;
                        buff.Deactivate();
                    }
                    i.NoDamageBroadcast = true;
                    Common.Additions.ActorDown add = new Common.Additions.ActorDown(arg, i.Target, 15208018, i.Damage);

                    i.Target.Tasks["ActorDown"] = add;
                    add.Activate();
                }
            }
            SkillManager.Instance.BroadcastSkillCast(arg, SkillMode.End);
        }
Ejemplo n.º 10
0
        private void ActorItemPickDropTask_OnAdditionEnd(SmartEngine.Network.Map.Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = MapManager.Instance.GetMap(pc.MapInstanceID);

            pc.Tasks.TryRemove("ActorItemPickDropTask", out Task removed);
            switch (action)
            {
            case ActionTypes.Pick:
            {
                UpdateEvent evt = new UpdateEvent()
                {
                    UpdateType = UpdateTypes.ItemPick,
                    Actor      = pc,
                    Target     = item,
                    UserData   = (byte)1
                };
                map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, pc, true);
            }
            break;

            case ActionTypes.PickCorpse:
            {
                UpdateEvent evt = new UpdateEvent()
                {
                    UpdateType = UpdateTypes.ItemPickCorpse,
                    Actor      = pc,
                    Target     = item,
                    UserData   = (byte)1
                };
                map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, pc, true);
            }
            break;

            case ActionTypes.Drop:
            {
                UpdateEvent evt = new UpdateEvent()
                {
                    UpdateType = UpdateTypes.ItemDrop,
                    Actor      = pc,
                    Target     = item,
                    X          = (short)item.X,
                    Y          = (short)item.Y,
                    Z          = (short)item.Z,
                    UserData   = (byte)1
                };
                map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, pc, true);
            }
            break;
            }
        }
Ejemplo n.º 11
0
        private void Fire_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Tasks.TryRemove("Fire", out Task removed);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 4105, 12000035, UpdateEvent.ExtraUpdateModes.Cancel);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF7, 0);
            evt.UserData = new byte[] { 9, 4, 0 };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 4105, 12000035, 10000, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 12
0
        private void Fire_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);

            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 4105, 12000035, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, 4);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkF7, 1);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 4105, 12000035, 10000, UpdateEvent.ExtraUpdateModes.Activate);
            evt.AdditionCount = AccumulateCount;
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 13
0
        private void ActorCatch_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            target.Status.Catch = false;
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown400000000000, false);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown200000000000, false);
            target.Status.StanceFlag1.SetValue(StanceU1.NoMove, false);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown4, false);
            target.Status.InteractWith     = 0;
            arg.Caster.Status.InteractWith = 0;

            target.Tasks.TryRemove("ActorCatch", out Task removed);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4098, additionID, UpdateEvent.ExtraUpdateModes.Cancel);

            evt.UpdateType = UpdateTypes.Actor;
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, arg.Caster, 0, 0, 65000, UpdateEvent.ExtraUpdateModes.Cancel);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.InteractWith, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.InteractionType, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.InteractionRelation, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk74, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkD7, 0);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            target.Status.StanceFlag1.SetValue(StanceU1.Unknown4, true);
            target.X = arg.Caster.X + diffX;
            target.Y = arg.Caster.Y + diffY;
            target.Z = arg.Caster.Z;

            evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4099, 12300011, UpdateEvent.ExtraUpdateModes.Cancel);
            evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.X, arg.Caster.X);
            evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Y, arg.Caster.Y);
            evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Z, arg.Caster.Z);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.InteractWith, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.InteractionType, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.InteractionRelation, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk74, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkD7, 0);
            evt.UserData = new byte[] { 9, 1, 0 };
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(arg.Caster, arg.SkillSession, 4099, 12300011, 5000, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, arg.Caster, true);

            SkillManager.Instance.BroadcastSkillCast(arg, SkillMode.End);
        }
Ejemplo n.º 14
0
        private void CounterEnemy_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            ((ActorExt)actor).Status.Counter = false;
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Tasks.TryRemove("CounterEnemy", out Task removed);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent((ActorExt)actor, (ActorExt)actor, arg.SkillSession, 1, 11103010, UpdateEvent.ExtraUpdateModes.Cancel);

            evt.UserData = new byte[] { 9, 1, 0 };
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.BlockingStance, 0);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 1, 11103010, 0, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
            SkillManager.Instance.BroadcastSkillCast(arg, SkillMode.End);
        }
Ejemplo n.º 15
0
        private unsafe void Poisen_OnUpdate(Actor actor, Buff skill)
        {
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            if (map != null)
            {
                Interlocked.Add(ref target.HP, -damage);
                if (target.HP < 0)
                {
                    Interlocked.Exchange(ref target.HP, 0);
                    Deactivate();
                }
                UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4098, additionID, UpdateEvent.ExtraUpdateModes.Update);
                evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.HP, target.HP);
                if (target.HP <= 0 && !(target.Status.Dead && !target.Status.Dying))
                {
                    target.Status.Dead = true;
                    //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Dead, target.ActorType == ActorType.PC ? (target.Status.Dying ? 1 : 2) : 1);
                    ((BNSActorEventHandler)target.EventHandler).OnDie(arg.Caster);
                }
                byte[] buf = new byte[6];
                fixed(byte *res = buf)
                {
                    res[0]          = 7;
                    *(int *)&res[2] = -damage;
                }

                evt.UserData = buf;

                map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
            }
            else
            {
                Deactivate();
            }
        }
Ejemplo n.º 16
0
        private void FrosenSelf_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Tasks.TryRemove("FrosenSelf", out Task removed);
            UpdateEvent evt = UpdateEvent.NewActorAdditionExtEvent(arg.Caster, arg.SkillSession, 10, 12000040, 10000, UpdateEvent.ExtraUpdateModes.Cancel);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 17
0
        private void Frosen_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown10000000, false);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown400000, false);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown4, false);

            ((ActorExt)actor).Tasks.TryRemove("Frosen", out Task removed);
            target.Speed = 500;
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 4101, 12000057, UpdateEvent.ExtraUpdateModes.Cancel);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Speed, target.Speed / 10);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, 0);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 12, 12000057, 6000, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 18
0
        private unsafe void ActorFrosen_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            target.Status.StanceFlag1.SetValue(StanceU1.Poisen, true);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4098, additionID, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            byte[] buf = new byte[6];
            fixed(byte *res = buf)
            {
                res[0]          = 7;
                *(int *)&res[2] = -damage;
            }

            evt.UserData = buf;
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(target, arg.SkillSession, 4098, additionID, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
        }
Ejemplo n.º 19
0
        private void Teleport_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map     map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            UpdateEvent evt = new UpdateEvent()
            {
                Actor         = actor,
                UpdateType    = UpdateTypes.Teleport,
                AdditionCount = 0
            };

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 20
0
 private void ActorFrosen_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
 {
     try
     {
         Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
         target.Tasks.TryRemove("Poisen", out Task removed);
         target.Status.StanceFlag1.SetValue(StanceU1.Poisen, false);
         if (map != null)
         {
             UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4098, additionID, UpdateEvent.ExtraUpdateModes.Cancel);
             //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
             map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
             evt = UpdateEvent.NewActorAdditionExtEvent(target, arg.SkillSession, 4098, additionID, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Cancel);
             map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
         }
     }
     catch (Exception ex)
     {
         Logger.Log.Error(ex);
     }
 }
Ejemplo n.º 21
0
        private void ActorFrosen_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            target.Tasks.TryRemove("Suicide", out Task removed);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 0, additionID, UpdateEvent.ExtraUpdateModes.None);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Dead, 1);
            target.Status.Dead = true;
            target.HP          = 0;
            ((BNSActorEventHandler)target.EventHandler).OnDie(target);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
        }
Ejemplo n.º 22
0
        private unsafe void ActorDown_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            target.Status.Stun = true;
            target.Status.StanceFlag1.SetValue(StanceU1.Stun, true);
            target.Status.StanceFlag1.SetValue(StanceU1.NoMove, true);
            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4098, 11104011, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(target, arg.SkillSession, 4098, 11104011, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4099, 11104012, UpdateEvent.ExtraUpdateModes.Activate);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkD3, 1);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(target, arg.SkillSession, 4099, 11104012, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Activate);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
        }
Ejemplo n.º 23
0
        public override void CallBack()
        {
            if (map == null)
            {
                map = Map.MapManager.Instance.GetMap(npc.MapInstanceID);
            }

            if (Pause)
            {
                if (currentCommand?.Type == CommandTypes.Attack)
                {
                    ((Attack)currentCommand).Target = null;
                }
                return;
            }
            try
            {
                if (npc.Status.Dead)
                {
                    Deactivate();
                    return;
                }
                if (npc.Status.Blocking || npc.Status.Down || npc.Status.Frosen || npc.Status.Catch || npc.Status.Invincible || npc.Status.Stun || npc.Status.TakenDown)
                {
                    return;
                }

                if (hateTable.Count == 0 && !npc.Status.Dead && npc.HP < npc.MaxHP)
                {
                    System.Threading.Interlocked.Exchange(ref npc.HP, npc.MaxHP);
                    UpdateEvent evt = new UpdateEvent()
                    {
                        Actor      = npc,
                        Target     = npc,
                        UpdateType = UpdateTypes.Actor
                    };
                    evt.AddActorPara(Common.Packets.GameServer.PacketParameter.HP, npc.HP);
                    map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, npc, false);
                }

                switch (Status)
                {
                case AIStatus.Normal:
                    DoNormal();
                    break;
                }
            }
            catch (Exception ex)
            {
                Logger.Log.Error(ex);
            }
        }
Ejemplo n.º 24
0
        private void Init()
        {
            UpdateEvent evt = new UpdateEvent()
            {
                Actor      = self,
                Target     = self,
                UpdateType = UpdateTypes.Actor
            };

            //evt.AddActorPara(PacketParameter.CombatStatus, 1);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, self, false);
            self.Status.IsInCombat = true;

            evt = new UpdateEvent()
            {
                Actor      = self,
                Target     = self,
                UpdateType = UpdateTypes.Actor
            };
            //evt.AddActorPara(PacketParameter.FaceTo, (long)target.ActorID);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, self, false);
        }
Ejemplo n.º 25
0
        private void Frosen_OnAdditionStart(Actor actor, Buff skill)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);

            target.Status.StanceFlag1.SetValue(StanceU1.Unknown10000000, true);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown400000, true);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown4, true);

            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 0, 12256011, UpdateEvent.ExtraUpdateModes.Activate);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            target.Speed = (ushort)(500 * (1 - (0.15 * AccumulateCount)));
            evt          = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 4101, 12000057, UpdateEvent.ExtraUpdateModes.Activate);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Speed, target.Speed / 10);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);

            evt = UpdateEvent.NewActorAdditionExtEvent((ActorExt)actor, arg.SkillSession, 12, 12000057, 6000, UpdateEvent.ExtraUpdateModes.Activate);

            evt.AdditionCount = AccumulateCount;
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 26
0
        private void ActorDown_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            target.Status.Stun = false;
            Map.Map map = MapManager.Instance.GetMap(actor.MapInstanceID);
            target.Tasks.TryRemove("Stun", out Task removed);
            target.Status.StanceFlag1.SetValue(StanceU1.Stun, false);
            target.Status.StanceFlag1.SetValue(StanceU1.NoMove, false);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown2000, false);

            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4098, 11104011, UpdateEvent.ExtraUpdateModes.Cancel);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(target, arg.SkillSession, 4098, 11104011, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, target, arg.SkillSession, 4099, 11104012, UpdateEvent.ExtraUpdateModes.Cancel);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkD3, 0);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);

            evt = UpdateEvent.NewActorAdditionExtEvent(target, arg.SkillSession, 4099, 11104012, TotalLifeTime, UpdateEvent.ExtraUpdateModes.Cancel);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, target, true);
        }
Ejemplo n.º 27
0
        private void Frost_OnAdditionStart(Actor actor, Buff skill)
        {
            target.Status.Invincible = true;

            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);

            target.Status.StanceFlag1.SetValue(StanceU1.Unknown10000000, true);
            target.Status.StanceFlag1.SetValue(StanceU1.NoMove, true);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown200, true);

            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 4104, 12237012, UpdateEvent.ExtraUpdateModes.Activate);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, target.Status.StanceFlag1.Value);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkE9, 1);
            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 28
0
        private void Frost_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            target.Status.Invincible = false;

            target.Status.StanceFlag1.SetValue(StanceU1.Unknown10000000, false);
            target.Status.StanceFlag1.SetValue(StanceU1.NoMove, false);
            target.Status.StanceFlag1.SetValue(StanceU1.Unknown200, false);
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            ((ActorExt)actor).Tasks.TryRemove("Frost", out Task removed);

            UpdateEvent evt = UpdateEvent.NewActorAdditionEvent(arg.Caster, (ActorExt)actor, arg.SkillSession, 4104, 12237012, UpdateEvent.ExtraUpdateModes.Cancel);

            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.Unk7A, 0);
            //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.UnkE9, 0);

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }
Ejemplo n.º 29
0
        private void Teleport_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            SagaBNS.GameServer.Network.Client.GameSession session = SagaBNS.GameServer.Manager.GameClientManager.Instance.FindClient(actor.Name);
            RespawnPoint sendto = TeleportPoint(arg.Dir);
            bool         passed = true;

            ((ActorExt)actor).Tasks.TryRemove("Teleport", out Task removed);
            List <UpdateEvent> update = new List <UpdateEvent>();
            UpdateEvent        evt    = new UpdateEvent()
            {
                Actor      = actor,
                UpdateType = UpdateTypes.Teleport
            };

            if (cancel)
            {
                evt.AdditionCount = 2;
                passed            = false;
            }
            else
            {
                evt.AdditionCount = 1;
            }

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, false);
            update.Add(evt);
            session.Character.Client().SendActorUpdates(update);

            if (passed && session != null && sendto.teleportId != 0)
            {
                foreach (KeyValuePair <SagaBNS.Common.Item.Item, ushort> i in items)
                {
                    session.RemoveItemSlot(i.Key.SlotID, i.Value);
                }

                session.Character.Status.DisappearEffect = 539;
                session.Character.Status.ShouldLoadMap   = true;
                Map.Map map2 = MapManager.Instance.GetMap(sendto.MapID, session.Character.CharID, session.Character.PartyID);
                session.Map.SendActorToMap(session.Character, map2, sendto.X, sendto.Y, sendto.Z);
            }
        }
Ejemplo n.º 30
0
        private void Repair_OnAdditionEnd(Actor actor, Buff skill, bool cancel)
        {
            Map.Map map = Map.MapManager.Instance.GetMap(actor.MapInstanceID);
            SagaBNS.GameServer.Network.Client.GameSession session = SagaBNS.GameServer.Manager.GameClientManager.Instance.FindClient(actor.Name);
            ((ActorExt)actor).Tasks.TryRemove("Repair", out Task removed);

            foreach (KeyValuePair <SagaBNS.Common.Item.Item, ushort> i in items)
            {
                session.RemoveItemSlot(i.Key.SlotID, i.Value);
            }

            //TODO: Set Durability to Max for equipted weapon

            UpdateEvent evt = new UpdateEvent()
            {
                UpdateType    = UpdateTypes.Repair,
                Actor         = actor,
                Target        = arg.Target,
                AdditionCount = 1
            };

            map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true);
        }