<commit_before>#pragma warning disable
using System.Collections.Generic;
using XPT.Legacy;
using XPT.Legacy.Assets;
using XPT.Legacy.Entities;

namespace XPT.Legacy.Maps {
    class YserMap14 : AMapScripted {
        protected override int MapIndex => 14;
        protected override int RandomEncounterChance => 10;
        protected override int RandomEncounterExtraCount => 1;

        public YserMap14() {
            MapEvent01 = FnTORUNERM_01;
            MapEvent02 = FnTOMAUS_02;
            MapEvent03 = FnSPECDOOR_03;
            MapEvent04 = FnQUESTDOR_04;
            MapEvent05 = FnSTRSTELE_05;
            MapEvent06 = FnQSTCHARA_06;
            MapEvent07 = FnQSTCHARB_07;
            MapEvent08 = FnQSTCHARC_08;
            MapEvent09 = FnTELEPORT_09;
            MapEvent0A = FnTELEPORT_0A;
            MapEvent0B = FnHUTHDOOR_0B;
            MapEvent0C = FnORCLDOOR_0C;
            MapEvent0D = FnELBADOOR_0D;
            MapEvent0E = FnTRRADOOR_0E;
            MapEvent0F = FnDWKNDOOR_0F;
            MapEvent10 = FnGNWIDOOR_10;
            MapEvent11 = FnHAITDOOR_11;
            MapEvent12 = FnGRITDOOR_12;
            MapEvent13 = FnOTGGDOOR_13;
            MapEvent14 = FnHEDHDOOR_14;
            MapEvent15 = FnCHAOSDOR_15;
            MapEvent16 = FnHARMDOOR_16;
            MapEvent17 = FnPAYAENC_17;
            MapEvent18 = FnPAYBENC_18;
            MapEvent19 = FnBLESSMES_19;
            MapEvent1A = FnBLESSMES_1A;
            MapEvent1B = FnBLESSMES_1B;
            MapEvent1C = FnBLESSMES_1C;
            MapEvent1D = FnBLESSMES_1D;
            MapEvent1E = FnBLESSMES_1E;
            MapEvent1F = FnBLESSMES_1F;
            MapEvent20 = FnBLESSMES_20;
            MapEvent21 = FnENDQSTDR_21;
            MapEvent22 = FnQUESTBEN_22;
            MapEvent23 = FnGOLDAENC_23;
            MapEvent24 = FnWEAPAENC_24;
            MapEvent25 = FnMAGICENC_25;
            MapEvent26 = FnQUESTAEN_26;
            MapEvent27 = FnITEMAENC_27;
            MapEvent28 = FnGOLDBENC_28;
            MapEvent29 = FnDRKEYENC_29;
            MapEvent2A = FnSPKEYDOO_2A;
            MapEvent2C = FnITEMBENC_2C;
            MapEvent2D = FnGOLDPILE_2D;
            MapEvent2E = FnSTRMNSTR_2E;
            MapEvent2F = FnTUFMNSTR_2F;
            MapEvent3A = FnGATEMESA_3A;
            MapEvent3B = FnGATEMESB_3B;
            MapEvent3C = FnSTRSMESS_3C;
            MapEvent3D = FnTELEMESA_3D;
            MapEvent3E = FnTELEMESB_3E;
        }
        
        // === Strings ================================================
        private const string String03FC = "The door opens.";
        private const string String040C = "This door is locked.";
        private const string String0421 = "The door magically opens!";
        private const string String043B = "This door will not open.";
        private const string String0454 = "That is indeed the King's Pass. You may continue. If you ever return, I'll need to see another pass.";
        private const string String04B9 = "None may pass. I am pledged to guard King Cleowyn's Apartments for eternity. Of course, if you had the King's Pass, I could let you through.";
        private const string String0546 = "Seek the Pass where Ranger and Troll are blessed.";
        private const string String0578 = "You have passed the Trial of Harmony. A great reward is yours, if you but look for it.";
        private const string String05CF = "You have mastered our Challenge. Congratulations! Behold the door of Harmony. Only those pledged to Harmony should enter.";
        private const string String0649 = "You have passed the Trial of Chaos. A great reward is yours, if you but look for it.";
        private const string String069E = "You have mastered our Challenge. Congratulations! Behold the door of Chaos. Only those pledged to Chaos should enter.";
        private const string String0714 = "The door is opened";
        private const string String0727 = "The door can be opened only by a Human or Thief.";
        private const string String0758 = "The lock of the door opens as you step forward.";
        private const string String0788 = "The door can be opened only by an Orc or Cleric.";
        private const string String07B9 = "The lock opens as you approach.";
        private const string String07D9 = "The door can be opened only by an Elf or Barbarian.";
        private const string String080D = "The door unlocks when you test it.";
        private const string String0830 = "The door can be opened only by a Troll or Ranger.";
        private const string String0862 = "The door opens as you advance.";
        private const string String0881 = "The door can be opened only by a Dwarf or Knight.";
        private const string String08B3 = "The door is opened.";
        private const string String08C7 = "The door can be opened only by a Gnome or Wizard.";
        private const string String08F9 = "The door clicks open.";
        private const string String090F = "The door can be opened only by a Halfling or by Cleowyn's Key.";
        private const string String094E = "The lock opens for you.";
        private const string String0966 = "The door can be opened only by a Gremlin or by Cleowyn's Lockpick.";
        private const string String09A9 = "A warning is on the door -";
        private const string String09C4 = "'Those honoring Harmony may safely enter.'";
        private const string String09EF = "'Woe to you who serve Chaos. If you dare cross this threshold you will be chastised.'";
        private const string String0A2E = "A warning is on the door -";
        private const string String0A49 = "'Those honoring Chaos may safely enter.'";
        private const string String0A72 = "'Woe to you who serve Harmony. If you dare cross this threshold you will be chastised.'";
        private const string String0AB3 = "A sign is on the door -";
        private const string String0ACB = "The way is clear only for members of Chaos.";
        private const string String0AF2 = "Fool! You were warned not to come this way. Chaos overwhelms you, leaving you poorer in gold and experience.";
        private const string String0B25 = "A sign is on the door -";
        private const string String0B3D = "The way is clear only for members of Harmony.";
        private const string String0B66 = "Fool! You were warned not to come this way. Harmony overwhelms you, leaving you poorer in gold and experience.";
        private const string String0B9B = "Rogues bar the way to Chaos.";
        private const string String0BB8 = "Rogues bar the way to Harmony.";
        private const string String0BD7 = "Blessed Human or Thief, you may continue the quest.";
        private const string String0C0B = "The tapestry shows nothing of interest.";
        private const string String0C33 = "Blessed Orc or Cleric, you may continue the quest.";
        private const string String0C66 = "The tapestry shows a jumble of runes.";
        private const string String0C8C = "Blessed Elf or Barbarian, you may continue the quest.";
        private const string String0CC2 = "The tapestry is blank.";
        private const string String0CD9 = "Blessed Troll or Ranger, you may continue the quest.";
        private const string String0D0E = "The tapestry is blank.";
        private const string String0D25 = "Blessed Dwarf or Knight, you may continue the quest.";
        private const string String0D5A = "It is too dark to read the inscription.";
        private const string String0D82 = "Blessed Gnome or Wizard, you may continue the quest.";
        private const string String0DB7 = "An inscription on the tapestry fades away as you draw near.";
        private const string String0DF3 = "Blessed Halfling! Blessed Key of Cleowyn! With either, the quest may continue.";
        private const string String0E42 = "The tapestry is empty.";
        private const string String0E59 = "Blessed Gremlin! Blessed Pick of Cleowyn! With either, the quest may continue.";
        private const string String0EA8 = "The tapestry once held a woven message.";
        private const string String0ED0 = "You found a secret door!";
        private const string String0EE9 = "Reptilian bodies rise from the shadows.";
        private const string String0F11 = "On the floor is a Chess Piece inscribed with the words - 'Property of Arnakkian Slowfoot.'";
        private const string String0F6C = "You are challenged to combat.";
        private const string String0F8A = "Ferocious enemies stop you.";
        private const string String0FA6 = "Elf Rangers await you.";
        private const string String0FBD = "An Elf Ranger holds the King's Pass.";
        private const string String0FE2 = "Proud knights dispute your progress.";
        private const string String1007 = "Strong enemies bar your way.";
        private const string String1024 = "There is nothing of interest here.";
        private const string String1047 = "You see a lockpick on the floor.";
        private const string String1068 = "Gallants challenge you.";
        private const string String1080 = "The key opens the door.";
        private const string String1098 = "The door is locked and requires a special key.";
        private const string String10C7 = "Fierce opponents bar your way.";
        private const string String10E6 = "This area has been looted.";
        private const string String1101 = "You find 12000 Gold Pieces on the floor.";
        private const string String112A = "Your way is blocked.";
        private const string String113F = "The gateway leads to THE RUNE ROOM.";
        private const string String1163 = "The gateway leads to THE MAUSOLEUM.";
        private const string String1187 = "Stairs past the south gateway lead down.";
        private const string String11B0 = "There is a teleport in the east wall.";
        private const string String11D6 = "There is a teleport in the west wall.";
        
        // === Functions ================================================
        private void FnTORUNERM_01(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x03, 0x01, 0x1F, 0x00, isForwardMove);
            L001D: return; // RETURN;
        }

        private void FnTOMAUS_02(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x03, 0x04, 0xF8, 0x03, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnSPECDOOR_03(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ax = HasUsedItem(player, 0xD2, 0xD2);
            L0016: if (JumpNotEqual) goto L0028;
            L0018: ax = HasItem(player, 0xF8);
            L0026: if (JumpEqual) goto L0073;
            L0028: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0046: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0064: ShowMessage(player, String03FC); // The door opens.
            L0071: goto L009D;
            L0073: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0090: ShowMessage(player, String040C); // This door is locked.
            L009D: return; // RETURN;
        }

        private void FnQUESTDOR_04(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorGaveKingsPassToGuard), 0x0001);
            L0017: if (JumpNotEqual) goto L0078;
            L0019: SetFlag(player, FlagTypeDungeon, FlagGreatCorridorGaveKingsPassToGuard, 0x00);
            L002D: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L004B: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0069: ShowMessage(player, String0421); // The door magically opens!
            L0076: goto L00A2;
            L0078: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0095: ShowMessage(player, String043B); // This door will not open.
            L00A2: return; // RETURN;
        }

        private void FnSTRSTELE_05(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x04, 0x01, 0x1F, 0x01, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnQSTCHARA_06(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ax = HasItem(player, 0xF9);
            L0011: if (JumpEqual) goto L008C;
            L0013: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0031: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L004F: SetFlag(player, FlagTypeDungeon, FlagGreatCorridorGaveKingsPassToGuard, 0x01);
            L0064: ShowPortrait(player, 0x001C);
            L0071: RemoveItem(player, 0xF9);
            L007D: ShowMessage(player, String0454); // That is indeed the King's Pass. You may continue. If you ever return, I'll need to see another pass.
            L008A: goto L00D0;
            L008C: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L00A9: ShowPortrait(player, 0x001C);
            L00B6: ShowMessage(player, String04B9); // None may pass. I am pledged to guard King Cleowyn's Apartments for eternity. Of course, if you had the King's Pass, I could let you through.
            L00C3: ShowMessage(player, String0546); // Seek the Pass where Ranger and Troll are blessed.
            L00D0: return; // RETURN;
        }

        private void FnQSTCHARB_07(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorHarmony), 0x0001);
            L0017: if (JumpNotEqual) goto L0035;
            L0019: ShowPortrait(player, 0x002C);
            L0026: ShowMessage(player, String0578); // You have passed the Trial of Harmony. A great reward is yours, if you but look for it.
            L0033: goto L004F;
            L0035: ShowPortrait(player, 0x002C);
            L0042: ShowMessage(player, String05CF); // You have mastered our Challenge. Congratulations! Behold the door of Harmony. Only those pledged to Harmony should enter.
            L004F: return; // RETURN;
        }

        private void FnQSTCHARC_08(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorChaos), 0x0001);
            L0017: if (JumpNotEqual) goto L0035;
            L0019: ShowPortrait(player, 0x002D);
            L0026: ShowMessage(player, String0649); // You have passed the Trial of Chaos. A great reward is yours, if you but look for it.
            L0033: goto L004F;
            L0035: ShowPortrait(player, 0x002D);
            L0042: ShowMessage(player, String069E); // You have mastered our Challenge. Congratulations! Behold the door of Chaos. Only those pledged to Chaos should enter.
            L004F: return; // RETURN;
        }

        private void FnTELEPORT_09(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x02, 0x01, 0xF0, 0x02, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnTELEPORT_0A(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x04, 0x01, 0x87, 0x02, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnHUTHDOOR_0B(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: RefreshCompareFlags(GetRace(player));
            L000C: if (JumpEqual) goto L001A;
            L000E: Compare(GetClass(player), 0x0003);
            L0018: if (JumpNotEqual) goto L0065;
            L001A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0038: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0056: ShowMessage(player, String0714); // The door is opened
            L0063: goto L008F;
            L0065: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0082: ShowMessage(player, String0727); // The door can be opened only by a Human or Thief.
            L008F: return; // RETURN;
        }

        private void FnORCLDOOR_0C(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0001);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0004);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String0758); // The lock of the door opens as you step forward.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String0788); // The door can be opened only by an Orc or Cleric.
            L0090: return; // RETURN;
        }

        private void FnELBADOOR_0D(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0002);
            L000D: if (JumpEqual) goto L001A;
            L000F: RefreshCompareFlags(GetClass(player));
            L0018: if (JumpNotEqual) goto L0065;
            L001A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0038: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0056: ShowMessage(player, String07B9); // The lock opens as you approach.
            L0063: goto L008F;
            L0065: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0082: ShowMessage(player, String07D9); // The door can be opened only by an Elf or Barbarian.
            L008F: return; // RETURN;
        }

        private void FnTRRADOOR_0E(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0003);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0002);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String080D); // The door unlocks when you test it.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String0830); // The door can be opened only by a Troll or Ranger.
            L0090: return; // RETURN;
        }

        private void FnDWKNDOOR_0F(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0004);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0001);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String0862); // The door opens as you advance.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String0881); // The door can be opened only by a Dwarf or Knight.
            L0090: return; // RETURN;
        }

        private void FnGNWIDOOR_10(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0005);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0005);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String08B3); // The door is opened.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String08C7); // The door can be opened only by a Gnome or Wizard.
            L0090: return; // RETURN;
        }

        private void FnHAITDOOR_11(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0006);
            L000D: if (JumpEqual) goto L001F;
            L000F: ax = HasItem(player, 0xD3);
            L001D: if (JumpEqual) goto L006A;
            L001F: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L003D: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L005B: ShowMessage(player, String08F9); // The door clicks open.
            L0068: goto L0094;
            L006A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0087: ShowMessage(player, String090F); // The door can be opened only by a Halfling or by Cleowyn's Key.
            L0094: return; // RETURN;
        }

        private void FnGRITDOOR_12(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0007);
            L000D: if (JumpEqual) goto L001F;
            L000F: ax = HasItem(player, 0xD2);
            L001D: if (JumpEqual) goto L006A;
            L001F: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L003D: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L005B: ShowMessage(player, String094E); // The lock opens for you.
            L0068: goto L0094;
            L006A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0087: ShowMessage(player, String0966); // The door can be opened only by a Gremlin or by Cleowyn's Lockpick.
            L0094: return; // RETURN;
        }

        private void FnOTGGDOOR_13(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String09A9); // A warning is on the door -
            L0010: RefreshCompareFlags(GetAlignment(player));
            L001A: if (JumpNotEqual) goto L002B;
            L001C: ShowMessage(player, String09C4); // 'Those honoring Harmony may safely enter.'
            L0029: goto L0038;
            L002B: ShowMessage(player, String09EF); // 'Woe to you who serve Chaos, if you dare cross the threshold.'
            L0038: return; // RETURN;
        }

        private void FnHEDHDOOR_14(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String0A2E); // A warning is on the door -
            L0010: Compare(GetAlignment(player), 0x0001);
            L001B: if (JumpNotEqual) goto L002C;
            L001D: ShowMessage(player, String0A49); // 'Those honoring Chaos may safely enter.'
            L002A: goto L0039;
            L002C: ShowMessage(player, String0A72); // 'Woe to you who serve Harmony, if you dare cross the threshold.'
            L0039: return; // RETURN;
        }

        private void FnCHAOSDOR_15(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String0AB3); // A sign is on the door -
            L0010: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L002E: Compare(GetAlignment(player), 0x0001);
            L0039: if (JumpNotEqual) goto L0068;
            L003B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0059: ShowMessage(player, String0ACB); // The way is clear for members of Chaos.
            L0066: goto L00C8;
            L0068:
            player.Gold = (int)(player.Gold * 0.95f);
            player.Experience = CanoResourceProvider.GetProgressionLevel((int)player.Class, player.Level - 1).ExpNext;
            // L0067: ModifyGold(player, 0xFFFF78BA);
            // L007A: ModifyAttribute(player, 0x00, 0xFFFE);
            // L008B: ModifyAttribute(player, 0x01, 0xFFFE);
            L009D: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L00BB: ShowMessage(player, String0AF2); // Those not sworn to Chaos have been duly chastised.
            L00C8: return; // RETURN;
        }

        private void FnHARMDOOR_16(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String0B25); // A sign is on the door -
            L0010: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L002E: RefreshCompareFlags(GetAlignment(player));
            L0038: if (JumpNotEqual) goto L0067;
            L003A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0058: ShowMessage(player, String0B3D); // The way is clear for members of Harmony.
            L0065: goto L00C7;
            L0067:
            player.Gold = (int)(player.Gold * 0.95f);
            player.Experience = CanoResourceProvider.GetProgressionLevel((int)player.Class, player.Level - 1).ExpNext;
            // L0067: ModifyGold(player, 0xFFFF78BA);
            // L0079: ModifyAttribute(player, 0x00, 0xFFFE);
            // L008A: ModifyAttribute(player, 0x01, 0xFFFE);
            L009C: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L00BA: ShowMessage(player, String0B66); // Those not sworn to Harmony have been duly chastised.
            L00C7: return; // RETURN;
        }

        private void FnPAYAENC_17(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorChaos), 0x0001);
            L0017: if (JumpEqual) goto L0025;
            L0019: RefreshCompareFlags(GetAlignment(player));
            L0023: if (JumpNotEqual) goto L0048;
            L0025: AddTreasure(player, 0x0064, 0x00, 0x00, 0x00, 0xCE, 0xB7);
            L0045: goto L00E1;
            L0048: SetFlag(player, FlagTypeDungeon, FlagGreatCorridorChaos, 0x01);
            L005D: Compare(GetClass(player), 0x0005);
            L0067: if (JumpEqual) goto L0075;
            L0069: Compare(GetClass(player), 0x0004);
            L0073: if (JumpNotEqual) goto L0096;<commit_msg>Replace CanoResource provider with new LegacyAssets provider<commit_after>#pragma warning disable
using System.Collections.Generic;
using XPT.Legacy;
using XPT.Legacy.Assets;
using XPT.Legacy.Entities;

namespace XPT.Legacy.Maps {
    class YserMap14 : AMapScripted {
        protected override int MapIndex => 14;
        protected override int RandomEncounterChance => 10;
        protected override int RandomEncounterExtraCount => 1;

        public YserMap14() {
            MapEvent01 = FnTORUNERM_01;
            MapEvent02 = FnTOMAUS_02;
            MapEvent03 = FnSPECDOOR_03;
            MapEvent04 = FnQUESTDOR_04;
            MapEvent05 = FnSTRSTELE_05;
            MapEvent06 = FnQSTCHARA_06;
            MapEvent07 = FnQSTCHARB_07;
            MapEvent08 = FnQSTCHARC_08;
            MapEvent09 = FnTELEPORT_09;
            MapEvent0A = FnTELEPORT_0A;
            MapEvent0B = FnHUTHDOOR_0B;
            MapEvent0C = FnORCLDOOR_0C;
            MapEvent0D = FnELBADOOR_0D;
            MapEvent0E = FnTRRADOOR_0E;
            MapEvent0F = FnDWKNDOOR_0F;
            MapEvent10 = FnGNWIDOOR_10;
            MapEvent11 = FnHAITDOOR_11;
            MapEvent12 = FnGRITDOOR_12;
            MapEvent13 = FnOTGGDOOR_13;
            MapEvent14 = FnHEDHDOOR_14;
            MapEvent15 = FnCHAOSDOR_15;
            MapEvent16 = FnHARMDOOR_16;
            MapEvent17 = FnPAYAENC_17;
            MapEvent18 = FnPAYBENC_18;
            MapEvent19 = FnBLESSMES_19;
            MapEvent1A = FnBLESSMES_1A;
            MapEvent1B = FnBLESSMES_1B;
            MapEvent1C = FnBLESSMES_1C;
            MapEvent1D = FnBLESSMES_1D;
            MapEvent1E = FnBLESSMES_1E;
            MapEvent1F = FnBLESSMES_1F;
            MapEvent20 = FnBLESSMES_20;
            MapEvent21 = FnENDQSTDR_21;
            MapEvent22 = FnQUESTBEN_22;
            MapEvent23 = FnGOLDAENC_23;
            MapEvent24 = FnWEAPAENC_24;
            MapEvent25 = FnMAGICENC_25;
            MapEvent26 = FnQUESTAEN_26;
            MapEvent27 = FnITEMAENC_27;
            MapEvent28 = FnGOLDBENC_28;
            MapEvent29 = FnDRKEYENC_29;
            MapEvent2A = FnSPKEYDOO_2A;
            MapEvent2C = FnITEMBENC_2C;
            MapEvent2D = FnGOLDPILE_2D;
            MapEvent2E = FnSTRMNSTR_2E;
            MapEvent2F = FnTUFMNSTR_2F;
            MapEvent3A = FnGATEMESA_3A;
            MapEvent3B = FnGATEMESB_3B;
            MapEvent3C = FnSTRSMESS_3C;
            MapEvent3D = FnTELEMESA_3D;
            MapEvent3E = FnTELEMESB_3E;
        }
        
        // === Strings ================================================
        private const string String03FC = "The door opens.";
        private const string String040C = "This door is locked.";
        private const string String0421 = "The door magically opens!";
        private const string String043B = "This door will not open.";
        private const string String0454 = "That is indeed the King's Pass. You may continue. If you ever return, I'll need to see another pass.";
        private const string String04B9 = "None may pass. I am pledged to guard King Cleowyn's Apartments for eternity. Of course, if you had the King's Pass, I could let you through.";
        private const string String0546 = "Seek the Pass where Ranger and Troll are blessed.";
        private const string String0578 = "You have passed the Trial of Harmony. A great reward is yours, if you but look for it.";
        private const string String05CF = "You have mastered our Challenge. Congratulations! Behold the door of Harmony. Only those pledged to Harmony should enter.";
        private const string String0649 = "You have passed the Trial of Chaos. A great reward is yours, if you but look for it.";
        private const string String069E = "You have mastered our Challenge. Congratulations! Behold the door of Chaos. Only those pledged to Chaos should enter.";
        private const string String0714 = "The door is opened";
        private const string String0727 = "The door can be opened only by a Human or Thief.";
        private const string String0758 = "The lock of the door opens as you step forward.";
        private const string String0788 = "The door can be opened only by an Orc or Cleric.";
        private const string String07B9 = "The lock opens as you approach.";
        private const string String07D9 = "The door can be opened only by an Elf or Barbarian.";
        private const string String080D = "The door unlocks when you test it.";
        private const string String0830 = "The door can be opened only by a Troll or Ranger.";
        private const string String0862 = "The door opens as you advance.";
        private const string String0881 = "The door can be opened only by a Dwarf or Knight.";
        private const string String08B3 = "The door is opened.";
        private const string String08C7 = "The door can be opened only by a Gnome or Wizard.";
        private const string String08F9 = "The door clicks open.";
        private const string String090F = "The door can be opened only by a Halfling or by Cleowyn's Key.";
        private const string String094E = "The lock opens for you.";
        private const string String0966 = "The door can be opened only by a Gremlin or by Cleowyn's Lockpick.";
        private const string String09A9 = "A warning is on the door -";
        private const string String09C4 = "'Those honoring Harmony may safely enter.'";
        private const string String09EF = "'Woe to you who serve Chaos. If you dare cross this threshold you will be chastised.'";
        private const string String0A2E = "A warning is on the door -";
        private const string String0A49 = "'Those honoring Chaos may safely enter.'";
        private const string String0A72 = "'Woe to you who serve Harmony. If you dare cross this threshold you will be chastised.'";
        private const string String0AB3 = "A sign is on the door -";
        private const string String0ACB = "The way is clear only for members of Chaos.";
        private const string String0AF2 = "Fool! You were warned not to come this way. Chaos overwhelms you, leaving you poorer in gold and experience.";
        private const string String0B25 = "A sign is on the door -";
        private const string String0B3D = "The way is clear only for members of Harmony.";
        private const string String0B66 = "Fool! You were warned not to come this way. Harmony overwhelms you, leaving you poorer in gold and experience.";
        private const string String0B9B = "Rogues bar the way to Chaos.";
        private const string String0BB8 = "Rogues bar the way to Harmony.";
        private const string String0BD7 = "Blessed Human or Thief, you may continue the quest.";
        private const string String0C0B = "The tapestry shows nothing of interest.";
        private const string String0C33 = "Blessed Orc or Cleric, you may continue the quest.";
        private const string String0C66 = "The tapestry shows a jumble of runes.";
        private const string String0C8C = "Blessed Elf or Barbarian, you may continue the quest.";
        private const string String0CC2 = "The tapestry is blank.";
        private const string String0CD9 = "Blessed Troll or Ranger, you may continue the quest.";
        private const string String0D0E = "The tapestry is blank.";
        private const string String0D25 = "Blessed Dwarf or Knight, you may continue the quest.";
        private const string String0D5A = "It is too dark to read the inscription.";
        private const string String0D82 = "Blessed Gnome or Wizard, you may continue the quest.";
        private const string String0DB7 = "An inscription on the tapestry fades away as you draw near.";
        private const string String0DF3 = "Blessed Halfling! Blessed Key of Cleowyn! With either, the quest may continue.";
        private const string String0E42 = "The tapestry is empty.";
        private const string String0E59 = "Blessed Gremlin! Blessed Pick of Cleowyn! With either, the quest may continue.";
        private const string String0EA8 = "The tapestry once held a woven message.";
        private const string String0ED0 = "You found a secret door!";
        private const string String0EE9 = "Reptilian bodies rise from the shadows.";
        private const string String0F11 = "On the floor is a Chess Piece inscribed with the words - 'Property of Arnakkian Slowfoot.'";
        private const string String0F6C = "You are challenged to combat.";
        private const string String0F8A = "Ferocious enemies stop you.";
        private const string String0FA6 = "Elf Rangers await you.";
        private const string String0FBD = "An Elf Ranger holds the King's Pass.";
        private const string String0FE2 = "Proud knights dispute your progress.";
        private const string String1007 = "Strong enemies bar your way.";
        private const string String1024 = "There is nothing of interest here.";
        private const string String1047 = "You see a lockpick on the floor.";
        private const string String1068 = "Gallants challenge you.";
        private const string String1080 = "The key opens the door.";
        private const string String1098 = "The door is locked and requires a special key.";
        private const string String10C7 = "Fierce opponents bar your way.";
        private const string String10E6 = "This area has been looted.";
        private const string String1101 = "You find 12000 Gold Pieces on the floor.";
        private const string String112A = "Your way is blocked.";
        private const string String113F = "The gateway leads to THE RUNE ROOM.";
        private const string String1163 = "The gateway leads to THE MAUSOLEUM.";
        private const string String1187 = "Stairs past the south gateway lead down.";
        private const string String11B0 = "There is a teleport in the east wall.";
        private const string String11D6 = "There is a teleport in the west wall.";
        
        // === Functions ================================================
        private void FnTORUNERM_01(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x03, 0x01, 0x1F, 0x00, isForwardMove);
            L001D: return; // RETURN;
        }

        private void FnTOMAUS_02(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x03, 0x04, 0xF8, 0x03, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnSPECDOOR_03(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ax = HasUsedItem(player, 0xD2, 0xD2);
            L0016: if (JumpNotEqual) goto L0028;
            L0018: ax = HasItem(player, 0xF8);
            L0026: if (JumpEqual) goto L0073;
            L0028: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0046: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0064: ShowMessage(player, String03FC); // The door opens.
            L0071: goto L009D;
            L0073: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0090: ShowMessage(player, String040C); // This door is locked.
            L009D: return; // RETURN;
        }

        private void FnQUESTDOR_04(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorGaveKingsPassToGuard), 0x0001);
            L0017: if (JumpNotEqual) goto L0078;
            L0019: SetFlag(player, FlagTypeDungeon, FlagGreatCorridorGaveKingsPassToGuard, 0x00);
            L002D: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L004B: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0069: ShowMessage(player, String0421); // The door magically opens!
            L0076: goto L00A2;
            L0078: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0095: ShowMessage(player, String043B); // This door will not open.
            L00A2: return; // RETURN;
        }

        private void FnSTRSTELE_05(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x04, 0x01, 0x1F, 0x01, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnQSTCHARA_06(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ax = HasItem(player, 0xF9);
            L0011: if (JumpEqual) goto L008C;
            L0013: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0031: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L004F: SetFlag(player, FlagTypeDungeon, FlagGreatCorridorGaveKingsPassToGuard, 0x01);
            L0064: ShowPortrait(player, 0x001C);
            L0071: RemoveItem(player, 0xF9);
            L007D: ShowMessage(player, String0454); // That is indeed the King's Pass. You may continue. If you ever return, I'll need to see another pass.
            L008A: goto L00D0;
            L008C: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L00A9: ShowPortrait(player, 0x001C);
            L00B6: ShowMessage(player, String04B9); // None may pass. I am pledged to guard King Cleowyn's Apartments for eternity. Of course, if you had the King's Pass, I could let you through.
            L00C3: ShowMessage(player, String0546); // Seek the Pass where Ranger and Troll are blessed.
            L00D0: return; // RETURN;
        }

        private void FnQSTCHARB_07(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorHarmony), 0x0001);
            L0017: if (JumpNotEqual) goto L0035;
            L0019: ShowPortrait(player, 0x002C);
            L0026: ShowMessage(player, String0578); // You have passed the Trial of Harmony. A great reward is yours, if you but look for it.
            L0033: goto L004F;
            L0035: ShowPortrait(player, 0x002C);
            L0042: ShowMessage(player, String05CF); // You have mastered our Challenge. Congratulations! Behold the door of Harmony. Only those pledged to Harmony should enter.
            L004F: return; // RETURN;
        }

        private void FnQSTCHARC_08(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorChaos), 0x0001);
            L0017: if (JumpNotEqual) goto L0035;
            L0019: ShowPortrait(player, 0x002D);
            L0026: ShowMessage(player, String0649); // You have passed the Trial of Chaos. A great reward is yours, if you but look for it.
            L0033: goto L004F;
            L0035: ShowPortrait(player, 0x002D);
            L0042: ShowMessage(player, String069E); // You have mastered our Challenge. Congratulations! Behold the door of Chaos. Only those pledged to Chaos should enter.
            L004F: return; // RETURN;
        }

        private void FnTELEPORT_09(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x02, 0x01, 0xF0, 0x02, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnTELEPORT_0A(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: TeleportParty(player, 0x04, 0x01, 0x87, 0x02, isForwardMove);
            L001E: return; // RETURN;
        }

        private void FnHUTHDOOR_0B(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: RefreshCompareFlags(GetRace(player));
            L000C: if (JumpEqual) goto L001A;
            L000E: Compare(GetClass(player), 0x0003);
            L0018: if (JumpNotEqual) goto L0065;
            L001A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0038: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0056: ShowMessage(player, String0714); // The door is opened
            L0063: goto L008F;
            L0065: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0082: ShowMessage(player, String0727); // The door can be opened only by a Human or Thief.
            L008F: return; // RETURN;
        }

        private void FnORCLDOOR_0C(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0001);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0004);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String0758); // The lock of the door opens as you step forward.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String0788); // The door can be opened only by an Orc or Cleric.
            L0090: return; // RETURN;
        }

        private void FnELBADOOR_0D(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0002);
            L000D: if (JumpEqual) goto L001A;
            L000F: RefreshCompareFlags(GetClass(player));
            L0018: if (JumpNotEqual) goto L0065;
            L001A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0038: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0056: ShowMessage(player, String07B9); // The lock opens as you approach.
            L0063: goto L008F;
            L0065: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0082: ShowMessage(player, String07D9); // The door can be opened only by an Elf or Barbarian.
            L008F: return; // RETURN;
        }

        private void FnTRRADOOR_0E(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0003);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0002);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String080D); // The door unlocks when you test it.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String0830); // The door can be opened only by a Troll or Ranger.
            L0090: return; // RETURN;
        }

        private void FnDWKNDOOR_0F(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0004);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0001);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String0862); // The door opens as you advance.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String0881); // The door can be opened only by a Dwarf or Knight.
            L0090: return; // RETURN;
        }

        private void FnGNWIDOOR_10(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0005);
            L000D: if (JumpEqual) goto L001B;
            L000F: Compare(GetClass(player), 0x0005);
            L0019: if (JumpNotEqual) goto L0066;
            L001B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0039: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L0057: ShowMessage(player, String08B3); // The door is opened.
            L0064: goto L0090;
            L0066: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0083: ShowMessage(player, String08C7); // The door can be opened only by a Gnome or Wizard.
            L0090: return; // RETURN;
        }

        private void FnHAITDOOR_11(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0006);
            L000D: if (JumpEqual) goto L001F;
            L000F: ax = HasItem(player, 0xD3);
            L001D: if (JumpEqual) goto L006A;
            L001F: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L003D: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L005B: ShowMessage(player, String08F9); // The door clicks open.
            L0068: goto L0094;
            L006A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0087: ShowMessage(player, String090F); // The door can be opened only by a Halfling or by Cleowyn's Key.
            L0094: return; // RETURN;
        }

        private void FnGRITDOOR_12(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetRace(player), 0x0007);
            L000D: if (JumpEqual) goto L001F;
            L000F: ax = HasItem(player, 0xD2);
            L001D: if (JumpEqual) goto L006A;
            L001F: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L003D: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L005B: ShowMessage(player, String094E); // The lock opens for you.
            L0068: goto L0094;
            L006A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x00);
            L0087: ShowMessage(player, String0966); // The door can be opened only by a Gremlin or by Cleowyn's Lockpick.
            L0094: return; // RETURN;
        }

        private void FnOTGGDOOR_13(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String09A9); // A warning is on the door -
            L0010: RefreshCompareFlags(GetAlignment(player));
            L001A: if (JumpNotEqual) goto L002B;
            L001C: ShowMessage(player, String09C4); // 'Those honoring Harmony may safely enter.'
            L0029: goto L0038;
            L002B: ShowMessage(player, String09EF); // 'Woe to you who serve Chaos, if you dare cross the threshold.'
            L0038: return; // RETURN;
        }

        private void FnHEDHDOOR_14(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String0A2E); // A warning is on the door -
            L0010: Compare(GetAlignment(player), 0x0001);
            L001B: if (JumpNotEqual) goto L002C;
            L001D: ShowMessage(player, String0A49); // 'Those honoring Chaos may safely enter.'
            L002A: goto L0039;
            L002C: ShowMessage(player, String0A72); // 'Woe to you who serve Harmony, if you dare cross the threshold.'
            L0039: return; // RETURN;
        }

        private void FnCHAOSDOR_15(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String0AB3); // A sign is on the door -
            L0010: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L002E: Compare(GetAlignment(player), 0x0001);
            L0039: if (JumpNotEqual) goto L0068;
            L003B: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0059: ShowMessage(player, String0ACB); // The way is clear for members of Chaos.
            L0066: goto L00C8;
            L0068:
            player.Gold = (int)(player.Gold * 0.95f);
            player.Experience = LegacyAssets.GetProgressionLevel((int)player.Class, player.Level - 1).ExpNext;
            // L0067: ModifyGold(player, 0xFFFF78BA);
            // L007A: ModifyAttribute(player, 0x00, 0xFFFE);
            // L008B: ModifyAttribute(player, 0x01, 0xFFFE);
            L009D: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L00BB: ShowMessage(player, String0AF2); // Those not sworn to Chaos have been duly chastised.
            L00C8: return; // RETURN;
        }

        private void FnHARMDOOR_16(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: ShowMessage(player, String0B25); // A sign is on the door -
            L0010: SetWallItem(player, 0x01, GetCurrentTile(player), GetFacing(player));
            L002E: RefreshCompareFlags(GetAlignment(player));
            L0038: if (JumpNotEqual) goto L0067;
            L003A: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L0058: ShowMessage(player, String0B3D); // The way is clear for members of Harmony.
            L0065: goto L00C7;
            L0067:
            player.Gold = (int)(player.Gold * 0.95f);
            player.Experience = LegacyAssets.GetProgressionLevel((int)player.Class, player.Level - 1).ExpNext;
            // L0067: ModifyGold(player, 0xFFFF78BA);
            // L0079: ModifyAttribute(player, 0x00, 0xFFFE);
            // L008A: ModifyAttribute(player, 0x01, 0xFFFE);
            L009C: SetWallPassable(player, GetCurrentTile(player), GetFacing(player), 0x01);
            L00BA: ShowMessage(player, String0B66); // Those not sworn to Harmony have been duly chastised.
            L00C7: return; // RETURN;
        }

        private void FnPAYAENC_17(ServerPlayer player, bool isForwardMove) {
            int ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0, tmp = 0;
            L0000: // BEGIN;
            L0003: Compare(GetFlag(player, FlagTypeDungeon, FlagGreatCorridorChaos), 0x0001);
            L0017: if (JumpEqual) goto L0025;
            L0019: RefreshCompareFlags(GetAlignment(player));
            L0023: if (JumpNotEqual) goto L0048;
            L0025: AddTreasure(player, 0x0064, 0x00, 0x00, 0x00, 0xCE, 0xB7);
            L0045: goto L00E1;
            L0048: SetFlag(player, FlagTypeDungeon, FlagGreatCorridorChaos, 0x01);
            L005D: Compare(GetClass(player), 0x0005);
            L0067: if (JumpEqual) goto L0075;
            L0069: Compare(GetClass(player), 0x0004);
            L0073: if (JumpNotEqual) goto L0096;
{'fraction_non_alphanumeric': 0.0938469901278297, 'fraction_numerical': 0.07326097248768171, 'mean_word_length': 2.3944408070948158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3986072', 'n_tokens_mistral': 20312, 'n_tokens_neox': 17345, 'n_words': 5699}