Пример #1
0
            /// <summary>
            /// Called on every timer tick
            /// </summary>
            protected override void OnTick()
            {
                var          player   = (GamePlayer)m_actionSource;
                List <IDoor> doorList = DoorMgr.getDoorByID(m_doorId);

                if (doorList.Count > 0)
                {
                    bool success = false;
                    foreach (IDoor mydoor in doorList)
                    {
                        if (success)
                        {
                            break;
                        }
                        if (mydoor is GameKeepDoor)
                        {
                            var door = mydoor as GameKeepDoor;
                            //portal keeps left click = right click
                            if (door.Component.Keep is GameKeepTower && door.Component.Keep.KeepComponents.Count > 1)
                            {
                                door.Interact(player);
                            }
                            success = true;
                        }
                        else
                        {
                            if (player.IsWithinRadius(mydoor.Position, m_radius))
                            {
                                if (m_doorState == 0x01)
                                {
                                    mydoor.Open(player);
                                }
                                else
                                {
                                    mydoor.Close(player);
                                }
                                success = true;
                            }
                        }
                    }

                    if (!success)
                    {
                        player.Out.SendMessage(
                            LanguageMgr.GetTranslation(player.Client.Account.Language, "DoorRequestHandler.OnTick.TooFarAway", doorList[0].Name),
                            eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    }
                }
                else
                {
                    //new frontiers we don't want this, i.e. relic gates etc
                    if (player.CurrentRegionID == 163 && player.Client.Account.PrivLevel == 1)
                    {
                        return;
                    }

                    /*
                     * //create a bug report
                     * BugReport report = new BugReport();
                     * report.DateSubmitted = DateTime.Now;
                     * report.ID = GameServer.Database.GetObjectCount<BugReport>() + 1;
                     * report.Message = "There is a missing door at location Region: " + player.CurrentRegionID + " X:" + player.X + " Y: " + player.Y + " Z: " + player.Z;
                     * report.Submitter = player.Name;
                     * GameServer.Database.AddObject(report);
                     */

                    player.Out.SendDebugMessage("Door {0} not found in door list, opening via GM door hack.", m_doorId);

                    //else basic quick hack
                    var door = new GameDoor();
                    door.DoorID        = m_doorId;
                    door.Position      = player.Position;
                    door.Realm         = eRealm.Door;
                    door.CurrentRegion = player.CurrentRegion;
                    door.Open(player);
                }
            }
Пример #2
0
            /// <summary>
            /// Called on every timer tick
            /// </summary>
            protected override void OnTick()
            {
                var          player   = (GamePlayer)m_actionSource;
                List <IDoor> doorList = DoorMgr.getDoorByID(_doorId);

                if (doorList.Count > 0)
                {
                    bool success = false;
                    foreach (IDoor mydoor in doorList)
                    {
                        if (success)
                        {
                            break;
                        }

                        if (mydoor is GameKeepDoor)
                        {
                            var door = mydoor as GameKeepDoor;

                            // portal keeps left click = right click
                            if (door.Component.AbstractKeep is GameKeepTower && door.Component.AbstractKeep.KeepComponents.Count > 1)
                            {
                                door.Interact(player);
                            }

                            success = true;
                        }
                        else
                        {
                            if (player.IsWithinRadius(mydoor, _radius))
                            {
                                if (_doorState == 0x01)
                                {
                                    mydoor.Open(player);
                                }
                                else
                                {
                                    mydoor.Close(player);
                                }

                                success = true;
                            }
                        }
                    }

                    if (!success)
                    {
                        player.Out.SendMessage(LanguageMgr.GetTranslation(player.Client.Account.Language, "DoorRequestHandler.OnTick.TooFarAway", doorList[0].Name), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                    }
                }
                else
                {
                    // new frontiers we don't want this, i.e. relic gates etc
                    if (player.CurrentRegionID == 163 && player.Client.Account.PrivLevel == 1)
                    {
                        return;
                    }

                    player.Out.SendDebugMessage($"Door {_doorId} not found in door list, opening via GM door hack.");

                    // else basic quick hack
                    var door = new GameDoor
                    {
                        DoorID        = _doorId,
                        X             = player.X,
                        Y             = player.Y,
                        Z             = player.Z,
                        Realm         = eRealm.Door,
                        CurrentRegion = player.CurrentRegion
                    };

                    door.Open(player);
                }
            }