Ejemplo n.º 1
0
        public override void RunImpl()
        {
            L2Player player = _client.CurrentPlayer;

            L2Object obj = null;

            if (_serverId == player.ObjId)
            {
                obj = player;
            }
            else
            {
                if (player.KnownObjects.ContainsKey(_serverId))
                {
                    obj = player.KnownObjects[_serverId];
                }
            }

            if (obj == null)
            {
                player.SendActionFailed();
                return;
            }

            switch (_actionId)
            {
            case 0:
                obj.OnAction(player);
                break;

            case 1:
                obj.OnActionShift(player);
                break;
            }
        }
Ejemplo n.º 2
0
        public override void RunImpl()
        {
            L2Player player = _client.CurrentPlayer;

            L2Object obj = null;

            if (_objectId == player.ObjId)
            {
                obj = player;
            }
            else
            {
                if (L2World.Instance.GetObject(_objectId) != null)
                {
                    obj = L2World.Instance.GetObject(_objectId);
                }
            }

            if (obj == null)
            {
                player.SendActionFailed();
                return;
            }

            switch (_actionId)
            {
            case 0:
                obj.OnAction(player);
                break;

            case 1:
                obj.OnActionShift(player);
                break;
            }
        }
Ejemplo n.º 3
0
        public override void RunImpl()
        {
            L2Player player = _client.CurrentPlayer;
            L2Object obj    = null;

            if (_objectId == player.ObjId)
            {
                obj = player;
            }
            else
            {
                if (L2World.Instance.GetObject(_objectId) != null)
                {
                    obj = L2World.Instance.GetObject(_objectId);
                }
            }
            //fixed nullreference exception when obj is null
            Log.Debug($"Action Requested with { Utilz.GetTypeLower(obj).ToString() }  of ID : { _objectId.ToString()}");

            if (obj == null)
            {
                Log.Debug("Action Requested Failed");
                player.SendActionFailed();
                return;
            }

            switch (_actionId)
            {
            case 0:
                obj.OnAction(player);
                break;

            case 1:
                obj.OnActionShift(player);
                break;

            default:
                player.SendActionFailed();
                break;
            }
        }