Esempio n. 1
0
        private void HandleDisablePVPProtection()
        {
            Model dto = GetDialogCustomData <Model>();

            if (!PVPSanctuaryService.PlayerHasPVPSanctuary(GetPC()))
            {
                return;
            }

            if (dto.IsConfirmingDisableSanctuary)
            {
                PVPSanctuaryService.SetPlayerPVPSanctuaryOverride(GetPC(), true);
                dto.IsConfirmingDisableSanctuary = false;
                _.FloatingTextStringOnCreature(ColorTokenService.Red("PVP protection has been disabled. You may now attack and be attacked by other players."), GetPC().Object, _.FALSE);
                SetResponseText("MainPage", 1, "Disable PVP Protection");
            }
            else
            {
                dto.IsConfirmingDisableSanctuary = true;
                _.FloatingTextStringOnCreature(ColorTokenService.Red("WARNING: PVP protection prevents other players from attacking you. If you disable this, players will immediately be able to attack you anywhere. Click again to confirm."), GetPC().Object, _.FALSE);
                SetResponseText("MainPage", 1, "CONFIRM DISABLE PVP PROTECTION");
            }

            SetDialogCustomData(dto);

            ToggleDisablePVPProtectionOption();
        }
Esempio n. 2
0
 private void ToggleDisablePVPProtectionOption()
 {
     SetResponseVisible("MainPage", 1, PVPSanctuaryService.PlayerHasPVPSanctuary(GetPC()));
 }