public MapInfo(WzImage image, string strMapName, string strStreetName, string strCategoryName) { this.image = image; int?startHour; int?endHour; this.strMapName = strMapName; this.strStreetName = strStreetName; this.strCategoryName = strCategoryName; WzFile file = (WzFile)image.WzFileParent; string loggerSuffix = ", map " + image.Name + ((file != null) ? (" of version " + Enum.GetName(typeof(WzMapleVersion), file.MapleVersion) + ", v" + file.Version.ToString()) : ""); foreach (WzImageProperty prop in image["info"].WzProperties) { switch (prop.Name) { case "bgm": bgm = InfoTool.GetString(prop); break; case "cloud": cloud = InfoTool.GetBool(prop); break; case "swim": swim = InfoTool.GetBool(prop); break; case "forcedReturn": forcedReturn = InfoTool.GetInt(prop); break; case "hideMinimap": hideMinimap = InfoTool.GetBool(prop); break; case "mapDesc": mapDesc = InfoTool.GetString(prop); break; case "mapName": mapName = InfoTool.GetString(prop); break; case "mapMark": mapMark = InfoTool.GetString(prop); break; case "mobRate": mobRate = InfoTool.GetFloat(prop); break; case "moveLimit": moveLimit = InfoTool.GetInt(prop); break; case "returnMap": returnMap = InfoTool.GetInt(prop); break; case "town": town = InfoTool.GetBool(prop); break; case "version": version = InfoTool.GetInt(prop); break; case "fieldLimit": int fl = InfoTool.GetInt(prop); if (fl >= (int)Math.Pow(2, 23)) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "Invalid fieldlimit " + fl.ToString() + loggerSuffix); fl = fl & ((int)Math.Pow(2, 23) - 1); } fieldLimit = (FieldLimit)fl; break; case "VRTop": case "VRBottom": case "VRLeft": case "VRRight": break; case "link": //link = InfoTool.GetInt(prop); break; case "timeLimit": timeLimit = InfoTool.GetInt(prop); break; case "lvLimit": lvLimit = InfoTool.GetInt(prop); break; case "onFirstUserEnter": onFirstUserEnter = InfoTool.GetString(prop); break; case "onUserEnter": onUserEnter = InfoTool.GetString(prop); break; case "fly": fly = InfoTool.GetBool(prop); break; case "noMapCmd": noMapCmd = InfoTool.GetBool(prop); break; case "partyOnly": partyOnly = InfoTool.GetBool(prop); break; case "fieldType": int ft = InfoTool.GetInt(prop); if (!Enum.IsDefined(typeof(FieldType), ft)) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "Invalid fieldType " + ft.ToString() + loggerSuffix); ft = 0; } fieldType = (FieldType)ft; break; case "miniMapOnOff": miniMapOnOff = InfoTool.GetBool(prop); break; case "reactorShuffle": reactorShuffle = InfoTool.GetBool(prop); break; case "reactorShuffleName": reactorShuffleName = InfoTool.GetString(prop); break; case "personalShop": personalShop = InfoTool.GetBool(prop); break; case "entrustedShop": entrustedShop = InfoTool.GetBool(prop); break; case "effect": effect = InfoTool.GetString(prop); break; case "lvForceMove": lvForceMove = InfoTool.GetInt(prop); break; case "timeMob": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int? id = InfoTool.GetOptionalInt(prop["id"]); string message = InfoTool.GetOptionalString(prop["message"]); if (id == null || message == null || (startHour == null ^ endHour == null)) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "timeMob" + loggerSuffix); } else { timeMob = new TimeMob((int?)startHour, (int?)endHour, (int)id, message); } break; case "help": help = InfoTool.GetString(prop); break; case "snow": snow = InfoTool.GetBool(prop); break; case "rain": rain = InfoTool.GetBool(prop); break; case "dropExpire": dropExpire = InfoTool.GetInt(prop); break; case "decHP": decHP = InfoTool.GetInt(prop); break; case "decInterval": decInterval = InfoTool.GetInt(prop); break; case "autoLieDetector": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int?interval = InfoTool.GetOptionalInt(prop["interval"]); int?propInt = InfoTool.GetOptionalInt(prop["prop"]); if (startHour == null || endHour == null || interval == null || propInt == null) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "autoLieDetector" + loggerSuffix); } else { autoLieDetector = new AutoLieDetector((int)startHour, (int)endHour, (int)interval, (int)propInt); } break; case "expeditionOnly": expeditionOnly = InfoTool.GetBool(prop); break; case "fs": fs = InfoTool.GetFloat(prop); break; case "protectItem": protectItem = InfoTool.GetInt(prop); break; case "createMobInterval": createMobInterval = InfoTool.GetInt(prop); break; case "fixedMobCapacity": fixedMobCapacity = InfoTool.GetInt(prop); break; case "streetName": streetName = InfoTool.GetString(prop); break; case "noRegenMap": noRegenMap = InfoTool.GetBool(prop); break; case "allowedItem": allowedItem = new List <int>(); if (prop.WzProperties != null && prop.WzProperties.Count > 0) { foreach (WzImageProperty item in prop.WzProperties) { allowedItem.Add(item.GetInt()); } } break; case "recovery": recovery = InfoTool.GetFloat(prop); break; case "blockPBossChange": blockPBossChange = InfoTool.GetBool(prop); break; case "everlast": everlast = InfoTool.GetBool(prop); break; case "damageCheckFree": damageCheckFree = InfoTool.GetBool(prop); break; case "dropRate": dropRate = InfoTool.GetFloat(prop); break; case "scrollDisable": scrollDisable = InfoTool.GetBool(prop); break; case "needSkillForFly": needSkillForFly = InfoTool.GetBool(prop); break; case "zakum2Hack": zakum2Hack = InfoTool.GetBool(prop); break; case "allMoveCheck": allMoveCheck = InfoTool.GetBool(prop); break; case "VRLimit": VRLimit = InfoTool.GetBool(prop); break; case "consumeItemCoolTime": consumeItemCoolTime = InfoTool.GetBool(prop); break; default: ErrorLogger.Log(ErrorLevel.MissingFeature, "Unknown Prop: " + prop.Name + loggerSuffix); additionalProps.Add(prop.DeepClone()); break; } } }
/// <summary> /// Constructor /// </summary> /// <param name="image"></param> /// <param name="strMapName"></param> /// <param name="strStreetName"></param> /// <param name="strCategoryName"></param> public MapInfo(WzImage image, string strMapName, string strStreetName, string strCategoryName) { this.image = image; int?startHour; int?endHour; this.strMapName = strMapName; this.strStreetName = strStreetName; this.strCategoryName = strCategoryName; WzFile file = (WzFile)image.WzFileParent; string loggerSuffix = ", map " + image.Name + ((file != null) ? (" of version " + Enum.GetName(typeof(WzMapleVersion), file.MapleVersion) + ", v" + file.Version.ToString()) : ""); foreach (WzImageProperty prop in image["info"].WzProperties) { switch (prop.Name) { case "bgm": bgm = InfoTool.GetString(prop); break; case "cloud": cloud = InfoTool.GetBool(prop); break; case "swim": swim = InfoTool.GetBool(prop); break; case "forcedReturn": forcedReturn = InfoTool.GetInt(prop); break; case "hideMinimap": hideMinimap = InfoTool.GetBool(prop); break; case "mapDesc": mapDesc = InfoTool.GetString(prop); break; case "mapName": mapName = InfoTool.GetString(prop); break; case "mapMark": mapMark = InfoTool.GetString(prop); break; case "mobRate": mobRate = InfoTool.GetFloat(prop); break; case "moveLimit": moveLimit = InfoTool.GetInt(prop); break; case "returnMap": returnMap = InfoTool.GetInt(prop); break; case "town": town = InfoTool.GetBool(prop); break; case "version": version = InfoTool.GetInt(prop); break; case "fieldLimit": long fl = InfoTool.GetLong(prop); fieldLimit = fl; break; case "VRTop": VRTop = InfoTool.GetOptionalInt(prop, 0); break; case "VRBottom": VRBottom = InfoTool.GetOptionalInt(prop, 0); break; case "VRLeft": VRLeft = InfoTool.GetOptionalInt(prop, 0); break; case "VRRight": VRRight = InfoTool.GetOptionalInt(prop, 0); break; case "link": //link = InfoTool.GetInt(prop); break; case "timeLimit": timeLimit = InfoTool.GetInt(prop); break; case "lvLimit": lvLimit = InfoTool.GetInt(prop); break; case "onFirstUserEnter": onFirstUserEnter = InfoTool.GetString(prop); break; case "onUserEnter": onUserEnter = InfoTool.GetString(prop); break; case "fly": fly = InfoTool.GetBool(prop); break; case "noMapCmd": noMapCmd = InfoTool.GetBool(prop); break; case "partyOnly": partyOnly = InfoTool.GetBool(prop); break; case "fieldType": int ft = InfoTool.GetInt(prop); if (!Enum.IsDefined(typeof(FieldType), ft)) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "Invalid fieldType " + ft.ToString() + loggerSuffix); ft = 0; } fieldType = (FieldType)ft; break; case "miniMapOnOff": miniMapOnOff = InfoTool.GetBool(prop); break; case "reactorShuffle": reactorShuffle = InfoTool.GetBool(prop); break; case "reactorShuffleName": reactorShuffleName = InfoTool.GetString(prop); break; case "personalShop": personalShop = InfoTool.GetBool(prop); break; case "entrustedShop": entrustedShop = InfoTool.GetBool(prop); break; case "effect": effect = InfoTool.GetString(prop); break; case "lvForceMove": lvForceMove = InfoTool.GetInt(prop); break; case "timeMob": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int? id = InfoTool.GetOptionalInt(prop["id"]); string message = InfoTool.GetOptionalString(prop["message"]); if (id == null || message == null || (startHour == null ^ endHour == null)) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "timeMob" + loggerSuffix); } else { timeMob = new TimeMob((int?)startHour, (int?)endHour, (int)id, message); } break; case "help": help = InfoTool.GetString(prop); break; case "snow": snow = InfoTool.GetBool(prop); break; case "rain": rain = InfoTool.GetBool(prop); break; case "dropExpire": dropExpire = InfoTool.GetInt(prop); break; case "decHP": decHP = InfoTool.GetInt(prop); break; case "decInterval": decInterval = InfoTool.GetInt(prop); break; case "autoLieDetector": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int?interval = InfoTool.GetOptionalInt(prop["interval"]); int?propInt = InfoTool.GetOptionalInt(prop["prop"]); if (startHour == null || endHour == null || interval == null || propInt == null) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "autoLieDetector" + loggerSuffix); } else { autoLieDetector = new AutoLieDetector((int)startHour, (int)endHour, (int)interval, (int)propInt); } break; case "expeditionOnly": expeditionOnly = InfoTool.GetBool(prop); break; case "fs": fs = InfoTool.GetFloat(prop); break; case "protectItem": protectItem = InfoTool.GetInt(prop); break; case "createMobInterval": createMobInterval = InfoTool.GetInt(prop); break; case "fixedMobCapacity": fixedMobCapacity = InfoTool.GetInt(prop); break; case "streetName": streetName = InfoTool.GetString(prop); break; case "noRegenMap": noRegenMap = InfoTool.GetBool(prop); break; case "allowedItem": allowedItem = new List <int>(); if (prop.WzProperties != null && prop.WzProperties.Count > 0) { foreach (WzImageProperty item in prop.WzProperties) { allowedItem.Add(item.GetInt()); } } break; case "recovery": recovery = InfoTool.GetFloat(prop); break; case "blockPBossChange": blockPBossChange = InfoTool.GetBool(prop); break; case "everlast": everlast = InfoTool.GetBool(prop); break; case "damageCheckFree": damageCheckFree = InfoTool.GetBool(prop); break; case "dropRate": dropRate = InfoTool.GetFloat(prop); break; case "scrollDisable": scrollDisable = InfoTool.GetBool(prop); break; case "needSkillForFly": needSkillForFly = InfoTool.GetBool(prop); break; case "zakum2Hack": zakum2Hack = InfoTool.GetBool(prop); break; case "allMoveCheck": allMoveCheck = InfoTool.GetBool(prop); break; case "VRLimit": VRLimit = InfoTool.GetBool(prop); break; case "consumeItemCoolTime": consumeItemCoolTime = InfoTool.GetBool(prop); break; case "zeroSideOnly": zeroSideOnly = InfoTool.GetBool(prop); break; case "mirror_Bottom": mirror_Bottom = InfoTool.GetBool(prop); break; case "AmbientBGM": case "AmbientBGMv": case "areaCtrl": case "onlyUseSkill": case "limitUseShop": case "limitUseTrunk": case "freeFallingVX": case "midAirAccelVX": case "midAirDecelVX": case "jumpSpeedR": case "jumpAccUpKey": case "jumpAccDownKey": case "jumpApplyVX": case "dashSkill": case "speedMaxOver": case "speedMaxOver ": // with a space, stupid nexon case "isSpecialMoveCheck": case "forceSpeed": case "forceJump": case "forceUseIndie": case "vanishPet": case "vanishAndroid": case "vanishDragon": case "limitUI": case "largeSplit": case "qrLimit": case "noChair": case "fieldScript": case "standAlone": case "partyStandAlone": case "HobbangKing": case "quarterView": case "MRLeft": case "MRTop": case "MRRight": case "MRBottom": case "limitSpeedAndJump": case "directionInfo": case "LBSide": case "LBTop": case "LBBottom": case "bgmSub": case "fieldLimit2": case "fieldLimit_tw": case "particle": case "qrLimitJob": case "individualMobPool": case "barrier": case "remoteEffect": case "isFixDec": case "decHPr": case "isDecView": case "forceFadeInTime": case "forceFadeOutTime": case "qrLimitState": case "qrLimitState2": case "difficulty": case "alarm": case "bossMobID": case "reviveCurField": case "ReviveCurFieldOfNoTransfer": case "ReviveCurFieldOfNoTransferPoint": case "limitUserEffectField": case "nofollowCharacter": case "functionObjInfo": case "quest": case "ridingMove": case "ridingField": case "noLanding": case "noCancelSkill": case "defaultAvatarDir": case "footStepSound": case "taggedObjRegenInfo": case "offSoulAbsorption": case "canPartyStatChangeIgnoreParty": case "canPartyStatChangeIgnoreParty ": // with a space case "forceReturnOnDead": case "zoomOutField": case "EscortMinTime": case "deathCount": case "onEnterResetFifthSkill": case "potionLimit": case "lifeCount": case "respawnCooltimeField": case "scale": case "skills": case "noResurection": case "incInterval": case "incMPr": case "bonusExpPerUserHPRate": case "barrierArc": case "noBackOverlapped": case "partyBonusR": case "specialSound": case "inFieldsetForcedReturn": case "chaser": case "chaserEndTime": case "chaserEffect": case "cagePotal": case "cageLT": case "cageRB": case "chaserHoldTime": case "phase": case "boss": case "actionBarIdx": case "shadowzone": case "towerChairEnable": case "DiceMasterUpIndex": case "DiceMasterDownIndex": case "ChangeName": case "entrustedFishing": case "forcedScreenMode": case "isHideUI": case "resetRidingField": case "PL_Gunman": case "noHekatonEffect": case "mode": case "skill": case "MR": case "ratemob": case "bonusStageNoChangeBack": case "questAmbience": case "blockScriptItem": case "remoteTranslucenceView": case "rewardContentName": case "specialDeadAction": case "FriendsStoryBossDelay": case "soulFieldType": case "cameraMoveY": case "subType": case "playTime": case "noEvent": case "forParty": case "whiteOut": case "UserInvisible": case "OnFirstUserEnter": // the same as onFirstUserEnter case "teamPortal": case "typingGame": case "lt": case "rb": case "fieldAttackObj": case "timeLeft": case "timeLeft_d": case "eventSummon": case "rankCheckMob": case "questCheckMob": case "bindSkillLimit": case "NoMobCapacityLimit": case "userTimer": case "eventChairIndex": case "onlyEventChair": case "waitReviveTime": case "RidingTop": case "temporarySkill": case "largeSplt": case "blockTakeOffItem": case "PartyOnly": case "climb": case "bulletConsume": case "gaugeDelay": case "individualPet": case "level": case "hungryMuto": case "property": // map 921172300.img case "spiritSavior": case "standAlonePermitUpgrade": // 993059600.img case "limitHeadAlarmField": // 993180000.img { WzImageProperty cloneProperty = prop.DeepClone(); //cloneProperty.Parent = prop.Parent; unsupportedInfoProperties.Add(cloneProperty); break; } default: ErrorLogger.Log(ErrorLevel.MissingFeature, string.Format("[MapInfo] Unknown field info/ property: '{0}'. {1}. Please fix it at MapInfo.cs", prop.Name, loggerSuffix)); additionalProps.Add(prop.DeepClone()); break; } } }
public MapInfo(WzImage image, string strMapName, string strStreetName) { int?startHour; int?endHour; this.strMapName = strMapName; this.strStreetName = strStreetName; foreach (IWzImageProperty prop in image["info"].WzProperties) { switch (prop.Name) { case "bgm": bgm = InfoTool.GetString(prop); break; case "cloud": cloud = InfoTool.GetBool(prop); break; case "swim": swim = InfoTool.GetBool(prop); break; case "forcedReturn": forcedReturn = InfoTool.GetInt(prop); break; case "hideMinimap": hideMinimap = InfoTool.GetBool(prop); break; case "mapDesc": mapDesc = InfoTool.GetString(prop); break; case "mapMark": MapMark = InfoTool.GetString(prop); break; case "mobRate": mobRate = InfoTool.GetFloat(prop); break; case "moveLimit": moveLimit = InfoTool.GetInt(prop); break; case "returnMap": returnMap = InfoTool.GetInt(prop); break; case "town": town = InfoTool.GetBool(prop); break; case "version": version = InfoTool.GetInt(prop); break; case "fieldLimit": int fl = InfoTool.GetInt(prop); if (fl >= (int)Math.Pow(2, 23)) { fl = fl & ((int)Math.Pow(2, 23) - 1); } fieldLimit = (FieldLimit)fl; break; case "VRTop": case "VRBottom": case "VRLeft": case "VRRight": break; case "link": //link = InfoTool.GetInt(prop); break; case "timeLimit": timeLimit = InfoTool.GetInt(prop); break; case "lvLimit": lvLimit = InfoTool.GetInt(prop); break; case "onFirstUserEnter": onFirstUserEnter = InfoTool.GetString(prop); break; case "onUserEnter": onUserEnter = InfoTool.GetString(prop); break; case "fly": fly = InfoTool.GetBool(prop); break; case "noMapCmd": noMapCmd = InfoTool.GetBool(prop); break; case "partyOnly": partyOnly = InfoTool.GetBool(prop); break; case "fieldType": int ft = InfoTool.GetInt(prop); if (!Enum.IsDefined(typeof(FieldType), ft)) { ft = 0; } fieldType = (FieldType)ft; break; case "miniMapOnOff": miniMapOnOff = InfoTool.GetBool(prop); break; case "reactorShuffle": reactorShuffle = InfoTool.GetBool(prop); break; case "reactorShuffleName": reactorShuffleName = InfoTool.GetString(prop); break; case "personalShop": personalShop = InfoTool.GetBool(prop); break; case "entrustedShop": entrustedShop = InfoTool.GetBool(prop); break; case "effect": effect = InfoTool.GetString(prop); break; case "lvForceMove": lvForceMove = InfoTool.GetInt(prop); break; case "timeMob": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int? id = InfoTool.GetOptionalInt(prop["id"]); string message = InfoTool.GetOptionalString(prop["message"]); if (id == null || message == null || (startHour == null ^ endHour == null)) { //System.Windows.Forms.MessageBox.Show("Warning", "Warning - incorrect timeMob structure in map data. Skipped and error log was saved."); WzFile file = (WzFile)image.WzFileParent; if (file != null) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "timeMob, map " + image.Name + " of version " + Enum.GetName(typeof(WzMapleVersion), file.MapleVersion) + ", v" + file.Version.ToString()); } } else { timeMob = new TimeMob((int?)startHour, (int?)endHour, (int)id, message); } break; case "help": help = InfoTool.GetString(prop); break; case "snow": snow = InfoTool.GetBool(prop); break; case "rain": rain = InfoTool.GetBool(prop); break; case "dropExpire": dropExpire = InfoTool.GetInt(prop); break; case "decHP": decHP = InfoTool.GetInt(prop); break; case "decInterval": decInterval = InfoTool.GetInt(prop); break; case "autoLieDetector": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int?interval = InfoTool.GetOptionalInt(prop["interval"]); int?propInt = InfoTool.GetOptionalInt(prop["prop"]); if (startHour == null || endHour == null || interval == null || propInt == null) { //System.Windows.Forms.MessageBox.Show("Warning", "Warning - incorrect autoLieDetector structure in map data. Skipped and error log was saved."); WzFile file = (WzFile)image.WzFileParent; if (file != null) { ErrorLogger.Log(ErrorLevel.IncorrectStructure, "autoLieDetector, map " + image.Name + " of version " + Enum.GetName(typeof(WzMapleVersion), file.MapleVersion) + ", v" + file.Version.ToString()); } } else { autoLieDetector = new AutoLieDetector((int)startHour, (int)endHour, (int)interval, (int)propInt); } break; case "expeditionOnly": expeditionOnly = InfoTool.GetBool(prop); break; case "fs": fs = InfoTool.GetFloat(prop); break; case "protectItem": protectItem = InfoTool.GetInt(prop); break; case "createMobInterval": createMobInterval = InfoTool.GetInt(prop); break; case "fixedMobCapacity": fixedMobCapacity = InfoTool.GetInt(prop); break; case "streetName": streetName = InfoTool.GetString(prop); break; case "noRegenMap": noRegenMap = InfoTool.GetBool(prop); break; case "allowedItems": allowedItems = new List <int>(); if (prop.WzProperties != null && prop.WzProperties.Count > 0) { foreach (IWzImageProperty item in prop.WzProperties) { allowedItems.Add((int)item); } } break; case "recovery": recovery = InfoTool.GetFloat(prop); break; case "blockPBossChange": blockPBossChange = InfoTool.GetBool(prop); break; case "everlast": everlast = InfoTool.GetBool(prop); break; case "damageCheckFree": damageCheckFree = InfoTool.GetBool(prop); break; case "dropRate": dropRate = InfoTool.GetFloat(prop); break; case "scrollDisable": scrollDisable = InfoTool.GetBool(prop); break; case "needSkillForFly": needSkillForFly = InfoTool.GetBool(prop); break; case "zakum2Hack": zakum2Hack = InfoTool.GetBool(prop); break; case "allMoveCheck": allMoveCheck = InfoTool.GetBool(prop); break; case "VRLimit": VRLimit = InfoTool.GetBool(prop); break; case "consumeItemCoolTime": consumeItemCoolTime = InfoTool.GetBool(prop); break; default: additionalProps.Add(prop); break; } } if (image["info"]["VRLeft"] != null) { IWzImageProperty info = image["info"]; int left = InfoTool.GetInt(info["VRLeft"]); int right = InfoTool.GetInt(info["VRRight"]); int top = InfoTool.GetInt(info["VRTop"]); int bottom = InfoTool.GetInt(info["VRBottom"]); VR = new Rectangle(left, top, right - left, bottom - top); } }
public InfoEditor(Board board, MapInfo info, MultiBoard multiBoard, System.Windows.Controls.TabItem tabItem) { InitializeComponent(); this.board = board; this.info = info; this.multiBoard = multiBoard; this.tabItem = tabItem; timeLimitEnable.Tag = timeLimit; lvLimitEnable.Tag = lvLimit; lvForceMoveUse.Tag = lvForceMove; firstUserEnable.Tag = firstUserEnter; userEnterEnable.Tag = userEnter; fieldTypeEnable.Tag = fieldType; moveLimitEnable.Tag = moveLimit; mapNameEnable.Tag = mapName; mapDescEnable.Tag = mapDesc; streetNameEnable.Tag = streetNameBox; effectEnable.Tag = effectBox; dropExpireEnable.Tag = dropExpire; dropRateEnable.Tag = dropRate; recoveryEnable.Tag = recovery; reactorShuffle.Tag = new Control[] { reactorNameShuffle, reactorNameBox }; reactorNameShuffle.Tag = reactorNameBox; fsEnable.Tag = fsBox; massEnable.Tag = new Control[] { createMobInterval, fixedMobCapacity }; hpDecEnable.Tag = new Control[] { decHP, protectItem, decIntervalEnable, decInterval, protectEnable }; protectEnable.Tag = new Control[] { protectItem }; decIntervalEnable.Tag = decInterval; helpEnable.Tag = helpBox; timedMobEnable.Tag = new Control[] { timedMobEnd, timedMobStart }; summonMobEnable.Tag = new Control[] { timedMobId, timedMobEnable, timedMobMessage }; autoLieDetectorEnable.Tag = new Control[] { autoLieEnd, autoLieInterval, autoLieProp, autoLieStart }; allowedItemsEnable.Tag = new Control[] { allowedItems, allowedItemsAdd, allowedItemsRemove }; this.fieldType.SelectedIndex = 0; xBox.Value = board.MapSize.X; yBox.Value = board.MapSize.Y; List <string> sortedBGMs = new List <string>(); foreach (KeyValuePair <string, WzBinaryProperty> bgm in Program.InfoManager.BGMs) { sortedBGMs.Add(bgm.Key); } sortedBGMs.Sort(); foreach (string bgm in sortedBGMs) { bgmBox.Items.Add(bgm); } bgmBox.SelectedItem = info.bgm; List <string> sortedMarks = new List <string>(); foreach (KeyValuePair <string, Bitmap> mark in Program.InfoManager.MapMarks) { sortedMarks.Add(mark.Key); } sortedMarks.Sort(); foreach (string mark in sortedMarks) { markBox.Items.Add(mark); } markBox.SelectedIndex = 0; switch (info.mapType) { case MapType.CashShopPreview: IDLabel.Text = "CashShopPreview"; break; case MapType.MapLogin: IDLabel.Text = "MapLogin"; break; case MapType.RegularMap: if (info.id == -1) { IDLabel.Text = ""; } else { IDLabel.Text = info.id.ToString(); } break; } nameBox.Text = info.strMapName; streetBox.Text = info.strStreetName; categoryBox.Text = info.strCategoryName; markBox.SelectedItem = info.mapMark; if (info.returnMap == info.id) { cannotReturnCBX.Checked = true; } else { returnBox.Text = info.returnMap.ToString(); } if (info.forcedReturn == 999999999) { returnHereCBX.Checked = true; } else { forcedRet.Text = info.forcedReturn.ToString(); } mobRate.Value = (decimal)info.mobRate; //LoadOptionalInt(info.link, linkBox); LoadOptionalInt(info.timeLimit, timeLimit, timeLimitEnable); LoadOptionalInt(info.lvLimit, lvLimit, lvLimitEnable); LoadOptionalInt(info.lvForceMove, lvForceMove, lvForceMoveUse); LoadOptionalString(info.onFirstUserEnter, firstUserEnter, firstUserEnable); LoadOptionalString(info.onUserEnter, userEnter, userEnterEnable); LoadOptionalString(info.mapName, mapName, mapNameEnable); LoadOptionalString(info.mapDesc, mapDesc, mapDescEnable); LoadOptionalString(info.streetName, streetNameBox, streetNameEnable); LoadOptionalString(info.effect, effectBox, effectEnable); LoadOptionalInt(info.moveLimit, moveLimit, moveLimitEnable); LoadOptionalInt(info.dropExpire, dropExpire, dropExpireEnable); LoadOptionalFloat(info.dropRate, dropRate, dropRateEnable); LoadOptionalFloat(info.recovery, recovery, recoveryEnable); reactorShuffle.Checked = info.reactorShuffle; LoadOptionalString(info.reactorShuffleName, reactorNameBox, reactorNameShuffle); LoadOptionalFloat(info.fs, fsBox, fsEnable); LoadOptionalInt(info.createMobInterval, createMobInterval, massEnable); LoadOptionalInt(info.fixedMobCapacity, fixedMobCapacity, massEnable); LoadOptionalInt(info.decHP, decHP, hpDecEnable); LoadOptionalInt(info.decInterval, decInterval, decIntervalEnable); LoadOptionalInt(info.protectItem, protectItem, protectEnable); helpEnable.Checked = info.help != null; if (info.help != null) { helpBox.Text = info.help.Replace(@"\n", "\r\n"); } if (info.timeMob != null) { TimeMob tMob = (TimeMob)info.timeMob; summonMobEnable.Checked = true; LoadOptionalInt(tMob.startHour, timedMobStart, timedMobEnable); LoadOptionalInt(tMob.endHour, timedMobEnd, timedMobEnable); timedMobId.Value = tMob.id; timedMobMessage.Text = tMob.message.Replace(@"\n", "\r\n"); } if (info.autoLieDetector != null) { AutoLieDetector ald = (AutoLieDetector)info.autoLieDetector; autoLieDetectorEnable.Checked = true; autoLieStart.Value = ald.startHour; autoLieEnd.Value = ald.endHour; autoLieInterval.Value = ald.interval; autoLieProp.Value = ald.prop; } if (info.allowedItem != null) { allowedItemsEnable.Checked = true; foreach (int id in info.allowedItem) { allowedItems.Items.Add(id.ToString()); } } optionsList.SetChecked(0, info.cloud); optionsList.SetChecked(1, info.snow); optionsList.SetChecked(2, info.rain); optionsList.SetChecked(3, info.swim); optionsList.SetChecked(4, info.fly); optionsList.SetChecked(5, info.town); optionsList.SetChecked(6, info.partyOnly); optionsList.SetChecked(7, info.expeditionOnly); optionsList.SetChecked(8, info.noMapCmd); optionsList.SetChecked(9, info.hideMinimap); optionsList.SetChecked(10, info.miniMapOnOff); optionsList.SetChecked(11, info.personalShop); optionsList.SetChecked(12, info.entrustedShop); optionsList.SetChecked(13, info.noRegenMap); optionsList.SetChecked(14, info.blockPBossChange); optionsList.SetChecked(15, info.everlast); optionsList.SetChecked(16, info.damageCheckFree); optionsList.SetChecked(17, info.scrollDisable); optionsList.SetChecked(18, info.needSkillForFly); optionsList.SetChecked(19, info.zakum2Hack); optionsList.SetChecked(20, info.allMoveCheck); optionsList.SetChecked(21, info.VRLimit); // Populate field limit items // automatically populated via fieldLimitPanel1.Loaed fieldLimitPanel1.PopulateDefaultListView(); fieldLimitPanel1.UpdateFieldLimitCheckboxes((ulong)info.fieldLimit); if (info.fieldType != null)/* fieldType.SelectedIndex = -1; * else*/ { fieldType.SelectedIndex = 0; if ((int)info.fieldType <= 0x22) { fieldType.SelectedIndex = (int)info.fieldType; } else { switch (info.fieldType) { case FieldType.FIELDTYPE_WEDDING: fieldType.SelectedIndex = 0x23; break; case FieldType.FIELDTYPE_WEDDINGPHOTO: fieldType.SelectedIndex = 0x24; break; case FieldType.FIELDTYPE_FISHINGKING: fieldType.SelectedIndex = 0x25; break; case FieldType.FIELDTYPE_SHOWABATH: fieldType.SelectedIndex = 0x26; break; case FieldType.FIELDTYPE_BEGINNERCAMP: fieldType.SelectedIndex = 0x27; break; case FieldType.FIELDTYPE_SNOWMAN: fieldType.SelectedIndex = 0x28; break; case FieldType.FIELDTYPE_SHOWASPA: fieldType.SelectedIndex = 0x29; break; case FieldType.FIELDTYPE_HORNTAILPQ: fieldType.SelectedIndex = 0x2A; break; case FieldType.FIELDTYPE_CRIMSONWOODPQ: fieldType.SelectedIndex = 0x2B; break; } } } foreach (WzImageProperty prop in info.additionalProps) { TreeNode node = unknownProps.Nodes.Add(prop.Name); node.Tag = prop; if (prop.WzProperties != null && prop.WzProperties.Count > 0) { ExtractPropList(prop.WzProperties, node); } } }
public MapInfo(WzImage image, string strMapName, string strStreetName) { int? startHour; int? endHour; this.strMapName = strMapName; this.strStreetName = strStreetName; foreach (IWzImageProperty prop in image["info"].WzProperties) switch (prop.Name) { case "bgm": bgm = InfoTool.GetString(prop); break; case "cloud": cloud = InfoTool.GetBool(prop); break; case "swim": swim = InfoTool.GetBool(prop); break; case "forcedReturn": forcedReturn = InfoTool.GetInt(prop); break; case "hideMinimap": hideMinimap = InfoTool.GetBool(prop); break; case "mapDesc": mapDesc = InfoTool.GetString(prop); break; case "mapMark": MapMark = InfoTool.GetString(prop); break; case "mobRate": mobRate = InfoTool.GetFloat(prop); break; case "moveLimit": moveLimit = InfoTool.GetInt(prop); break; case "returnMap": returnMap = InfoTool.GetInt(prop); break; case "town": town = InfoTool.GetBool(prop); break; case "version": version = InfoTool.GetInt(prop); break; case "fieldLimit": int fl = InfoTool.GetInt(prop); if (fl >= (int)Math.Pow(2, 23)) fl = fl & ((int)Math.Pow(2, 23) - 1); fieldLimit = (FieldLimit)fl; break; case "VRTop": case "VRBottom": case "VRLeft": case "VRRight": break; case "link": //link = InfoTool.GetInt(prop); break; case "timeLimit": timeLimit = InfoTool.GetInt(prop); break; case "lvLimit": lvLimit = InfoTool.GetInt(prop); break; case "onFirstUserEnter": onFirstUserEnter = InfoTool.GetString(prop); break; case "onUserEnter": onUserEnter = InfoTool.GetString(prop); break; case "fly": fly = InfoTool.GetBool(prop); break; case "noMapCmd": noMapCmd = InfoTool.GetBool(prop); break; case "partyOnly": partyOnly = InfoTool.GetBool(prop); break; case "fieldType": int ft = InfoTool.GetInt(prop); if (!Enum.IsDefined(typeof(FieldType), ft)) ft = 0; fieldType = (FieldType)ft; break; case "miniMapOnOff": miniMapOnOff = InfoTool.GetBool(prop); break; case "reactorShuffle": reactorShuffle = InfoTool.GetBool(prop); break; case "reactorShuffleName": reactorShuffleName = InfoTool.GetString(prop); break; case "personalShop": personalShop = InfoTool.GetBool(prop); break; case "entrustedShop": entrustedShop = InfoTool.GetBool(prop); break; case "effect": effect = InfoTool.GetString(prop); break; case "lvForceMove": lvForceMove = InfoTool.GetInt(prop); break; case "timeMob": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int? id = InfoTool.GetOptionalInt(prop["id"]); string message = InfoTool.GetOptionalString(prop["message"]); if (id == null || message == null || (startHour == null ^ endHour == null)) { //System.Windows.Forms.MessageBox.Show("Warning", "Warning - incorrect timeMob structure in map data. Skipped and error log was saved."); WzFile file = (WzFile)image.WzFileParent; if (file != null) ErrorLogger.Log(ErrorLevel.IncorrectStructure, "timeMob, map " + image.Name + " of version " + Enum.GetName(typeof(WzMapleVersion), file.MapleVersion) + ", v" + file.Version.ToString()); } else timeMob = new TimeMob((int?)startHour, (int?)endHour, (int)id, message); break; case "help": help = InfoTool.GetString(prop); break; case "snow": snow = InfoTool.GetBool(prop); break; case "rain": rain = InfoTool.GetBool(prop); break; case "dropExpire": dropExpire = InfoTool.GetInt(prop); break; case "decHP": decHP = InfoTool.GetInt(prop); break; case "decInterval": decInterval = InfoTool.GetInt(prop); break; case "autoLieDetector": startHour = InfoTool.GetOptionalInt(prop["startHour"]); endHour = InfoTool.GetOptionalInt(prop["endHour"]); int? interval = InfoTool.GetOptionalInt(prop["interval"]); int? propInt = InfoTool.GetOptionalInt(prop["prop"]); if (startHour == null || endHour == null || interval == null || propInt == null) { //System.Windows.Forms.MessageBox.Show("Warning", "Warning - incorrect autoLieDetector structure in map data. Skipped and error log was saved."); WzFile file = (WzFile)image.WzFileParent; if (file != null) ErrorLogger.Log(ErrorLevel.IncorrectStructure, "autoLieDetector, map " + image.Name + " of version " + Enum.GetName(typeof(WzMapleVersion), file.MapleVersion) + ", v" + file.Version.ToString()); } else autoLieDetector = new AutoLieDetector((int)startHour, (int)endHour, (int)interval, (int)propInt); break; case "expeditionOnly": expeditionOnly = InfoTool.GetBool(prop); break; case "fs": fs = InfoTool.GetFloat(prop); break; case "protectItem": protectItem = InfoTool.GetInt(prop); break; case "createMobInterval": createMobInterval = InfoTool.GetInt(prop); break; case "fixedMobCapacity": fixedMobCapacity = InfoTool.GetInt(prop); break; case "streetName": streetName = InfoTool.GetString(prop); break; case "noRegenMap": noRegenMap = InfoTool.GetBool(prop); break; case "allowedItems": allowedItems = new List<int>(); if (prop.WzProperties != null && prop.WzProperties.Count > 0) foreach (IWzImageProperty item in prop.WzProperties) allowedItems.Add((int)item); break; case "recovery": recovery = InfoTool.GetFloat(prop); break; case "blockPBossChange": blockPBossChange = InfoTool.GetBool(prop); break; case "everlast": everlast = InfoTool.GetBool(prop); break; case "damageCheckFree": damageCheckFree = InfoTool.GetBool(prop); break; case "dropRate": dropRate = InfoTool.GetFloat(prop); break; case "scrollDisable": scrollDisable = InfoTool.GetBool(prop); break; case "needSkillForFly": needSkillForFly = InfoTool.GetBool(prop); break; case "zakum2Hack": zakum2Hack = InfoTool.GetBool(prop); break; case "allMoveCheck": allMoveCheck = InfoTool.GetBool(prop); break; case "VRLimit": VRLimit = InfoTool.GetBool(prop); break; case "consumeItemCoolTime": consumeItemCoolTime = InfoTool.GetBool(prop); break; default: additionalProps.Add(prop); break; } if (image["info"]["VRLeft"] != null) { IWzImageProperty info = image["info"]; int left = InfoTool.GetInt(info["VRLeft"]); int right = InfoTool.GetInt(info["VRRight"]); int top = InfoTool.GetInt(info["VRTop"]); int bottom = InfoTool.GetInt(info["VRBottom"]); VR = new Rectangle(left, top, right - left, bottom - top); } }