コード例 #1
0
        private static void smethod_22(Session session_0, ClientMessage clientMessage_0)
        {
            uint          actorId           = clientMessage_0.ReadUnsignedInteger();
            uint          num2              = clientMessage_0.ReadUnsignedInteger();
            SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId);

            if (instanceBySpaceId != null)
            {
                SpaceActor actor  = instanceBySpaceId.GetActor(actorId);
                SpaceActor actor2 = instanceBySpaceId.GetActor(num2);
                if ((actor != null) && (actor2 != null) && ChatCommands.block_coco == false)
                {
                    CharacterInfo referenceObject = (CharacterInfo)actor.ReferenceObject;
                    CharacterInfo info2           = (CharacterInfo)actor2.ReferenceObject;
                    if (!actor2.IsLocked)
                    {
                        using (SqlDatabaseClient client = SqlDatabaseManager.GetClient())
                        {
                            referenceObject.UpdateGoldCreditsBalance(client, -200);//Coconut cost 10
                            referenceObject.UpdateCoconuts(client, true);
                            info2.UpdateCoconuts(client, false);
                            session_0.SendData(CharacterCoinsComposer.RemoveGoldCompose(200), false);//Coconut cost 10
                            instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor, 5), 0, false);
                            instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor2, 5), 0, false);
                            actor2.Lock(6, false, true);
                            instanceBySpaceId.BroadcastMessage(SpaceUserSendCoconut.SendAndBlock(actor2.ReferenceId), 0, false);
                        }
                    }
                }
            }
        }
コード例 #2
0
        private static void smethod_21(Session session_0, ClientMessage clientMessage_0)
        {
            uint num2 = clientMessage_0.ReadUnsignedInteger();

            SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId);

            if (instanceBySpaceId != null)
            {
                SpaceActor actor  = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter);
                SpaceActor actor2 = instanceBySpaceId.GetActor(num2);
                if ((actor != null) && (actor2 != null))
                {
                    CharacterInfo referenceObject = (CharacterInfo)actor.ReferenceObject;
                    CharacterInfo info2           = (CharacterInfo)actor2.ReferenceObject;
                    if (!actor.IsLocked && !actor2.IsLocked)
                    {
                        actor.StopMoving();
                        using (SqlDatabaseClient client = SqlDatabaseManager.GetClient())
                        {
                            referenceObject.UpdateGoldCreditsBalance(client, -250);
                            referenceObject.UpdateUppercuts(client, true);
                            info2.UpdateUppercuts(client, false);
                            session_0.SendData(CharacterCoinsComposer.RemoveGoldCompose(250));
                            instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor, 4), 0, false);
                            instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor2, 4), 0, false);
                            actor.Lock(20, true, false);
                            actor2.Lock(20, true, false);
                            instanceBySpaceId.BroadcastMessage(SpaceUserSendUppercut.Compose(actor, actor2), 0, false);
                        }
                    }
                }
            }
        }
コード例 #3
0
        private static void smethod_21(Session session_0, ClientMessage clientMessage_0)
        {
            clientMessage_0.ReadInteger();
            uint actorId = clientMessage_0.ReadUnsignedInteger();

            clientMessage_0.ReadInteger();
            clientMessage_0.ReadInteger();
            uint num2 = clientMessage_0.ReadUnsignedInteger();

            clientMessage_0.ReadInteger();
            clientMessage_0.ReadInteger();
            SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId);

            if (instanceBySpaceId != null)
            {
                SpaceActor actor  = instanceBySpaceId.GetActor(actorId);
                SpaceActor actor2 = instanceBySpaceId.GetActor(num2);
                uint       ID1    = CharacterResolverCache.GetUidFromName(actor.Name);
                uint       ID2    = CharacterResolverCache.GetUidFromName(actor2.Name);
                if ((actor != null) && (actor2 != null))
                {
                    CharacterInfo referenceObject = (CharacterInfo)actor.ReferenceObject;
                    CharacterInfo info2           = (CharacterInfo)actor2.ReferenceObject;
                    if (!actor.IsLocked && !actor2.IsLocked && ChatCommands.block_upper == false && !ChatCommands.UpperBlock.Contains(actor2.Name) && !ChatCommands.UpperBlockUser.Contains(ID1) && !ChatCommands.UpperBlockUser.Contains(ID2))
                    {
                        actor.StopMoving();
                        using (SqlDatabaseClient client = SqlDatabaseManager.GetClient())
                        {
                            if (referenceObject.Staff == 1)
                            {
                                referenceObject.UpdateGoldCreditsBalance(client, -250);//Punch cost 500
                                referenceObject.UpdateUppercuts(client, true);
                                info2.UpdateUppercuts(client, false);
                                session_0.SendData(CharacterCoinsComposer.RemoveGoldCompose(250), false);//Punch cost 500
                                instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor, 4), 0, false);
                                instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor2, 4), 0, false);
                                actor.Lock(13, false, false);
                                actor2.Lock(10, true, false);
                                instanceBySpaceId.BroadcastMessage(SpaceUserSendUppercut.Compose(actor, actor2), 0, false);
                            }
                            else
                            {
                                referenceObject.UpdateGoldCreditsBalance(client, -250);//Punch cost 200
                                referenceObject.UpdateUppercuts(client, true);
                                info2.UpdateUppercuts(client, false);
                                session_0.SendData(CharacterCoinsComposer.RemoveGoldCompose(250), false);//Punch cost 200
                                instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor, 4), 0, false);
                                instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor2, 4), 0, false);
                                actor.Lock(13, false, false);
                                actor2.Lock(10, true, false);
                                instanceBySpaceId.BroadcastMessage(SpaceUserSendUppercut.Compose(actor, actor2), 0, false);
                            }
                        }
                    }
                }
            }
        }
コード例 #4
0
        private static void smethod_12(Session session_0, ClientMessage clientMessage_0)
        {
            uint          actionId          = clientMessage_0.ReadUnsignedInteger();
            uint          actorId           = clientMessage_0.ReadUnsignedInteger();
            SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId);

            if (instanceBySpaceId == null)
            {
                return;
            }
            SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter);
            SpaceActor actor = instanceBySpaceId.GetActor(actorId);

            if ((actor == null) || (actorByReferenceId == null))
            {
                return;
            }
            CharacterInfo referenceObject = (CharacterInfo)actorByReferenceId.ReferenceObject;
            CharacterInfo info2           = (CharacterInfo)actor.ReferenceObject;

            if (actorByReferenceId.IsLocked || actor.IsLocked)
            {
                return;
            }
            actorByReferenceId.StopMoving();
            actor.StopMoving();
            if (SessionManager.GetSessionByCharacterId(actor.ReferenceId) == null)
            {
                return;
            }
            using (SqlDatabaseClient client = SqlDatabaseManager.GetClient())
            {
                switch (actionId)
                {
                case 1:
                    referenceObject.UpdateKisses(client, false);
                    info2.UpdateKisses(client, true);
                    actor.Lock(3, false, false);
                    actorByReferenceId.Lock(3, false, false);
                    goto Label_0165;

                case 2:
                    referenceObject.UpdateCocktails(client, false);
                    info2.UpdateCocktails(client, true);
                    actor.Lock(9, false, false);
                    actorByReferenceId.Lock(9, false, false);
                    goto Label_0165;

                case 3:
                    referenceObject.UpdateRoses(client, false);
                    info2.UpdateRoses(client, true);
                    actor.Lock(4, false, false);
                    actorByReferenceId.Lock(4, false, false);
                    goto Label_0165;
                }
                referenceObject.UpdateKisses(client, false);
                info2.UpdateKisses(client, true);
                actor.Lock(3, false, false);
                actorByReferenceId.Lock(3, false, false);
            }
Label_0165:
            instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actorByReferenceId, actionId), 0, false);
            instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor, actionId), 0, false);
            instanceBySpaceId.BroadcastMessage(SpaceUserAcceptInteract.Compose(actor, actorByReferenceId, actionId), 0, false);
        }