// FamiliarSkill.img/{skillID}/ public string GetSkillCategory(int skillID) { string skillCategory = ""; if (FamiliarImage.GetFromPath($@"{skillID}/knockback") != null) { skillCategory = "Knockback"; } else if (FamiliarImage.GetFromPath($@"{skillID}/stun") != null) { skillCategory = "Stun"; } else if (FamiliarImage.GetFromPath($@"{skillID}/slow") != null) { skillCategory = "Slow"; } else if (FamiliarImage.GetFromPath($@"{skillID}/poison") != null) { skillCategory = "Poison"; } else if (FamiliarImage.GetFromPath($@"{skillID}/attract") != null) { skillCategory = "Attract"; } else { skillCategory = ""; } return(skillCategory); }
// {mobID}.img/info/level public int GetLevel() { if (MobImage == null) { return(0); } int level = MobImage.GetFromPath($@"info/level").GetInt(); return(level); }
// Eqp.img/Eqp/Weapon/{WeaponID}/name public string GetEquipName(int weaponID, string category) { if (EqpImage?.GetFromPath($@"Eqp/{category}/{weaponID}/name") == null) { return(""); } string weaponName = EqpImage?.GetFromPath($@"Eqp/{category}/{weaponID}/name").GetString(); return(weaponName); }
// Familiar.img/skill/{SkillID}/name public string GetSkillName(int skillID) { WzImageProperty property = FamiliarImage?.GetFromPath($@"skill/{skillID}/name"); if (property != null) { string skillName = property.GetString(); return(skillName); } else { return(""); } }
// Familiar/{FamiliarID}.img/info/skill/id public int GetSkillID() { WzImageProperty property = FamiliarImage.GetFromPath($@"info/skill/id"); if (property != null) { int skillID = property.GetInt(); return(skillID); } else { return(-1); } }
private void AddHairRow(WzImage image) { string imgName = Path.GetFileNameWithoutExtension(image.Name); int id = int.Parse(imgName); WzCanvasProperty icon = (WzCanvasProperty)image.GetFromPath("default/hairOverHead"); if (icon == null) { icon = (WzCanvasProperty)image.GetFromPath("default/hair"); } string name = StringUtility.GetEqp(id); EquipHairsView.GridView.Rows.Add(id, icon?.GetBitmap(), name, ""); }
// FamiliarInfo.img/{FamiliarID}/mob public int GetMobID(int familiarID) { WzImageProperty property = familiarInfoImage.GetFromPath($@"{familiarID.ToString()}/mob"); if (property != null) { int mobID = property.GetInt(); return(mobID); } else { return(-1); } }
// Consume.img/{CardID}/name public string GetCardName(int cardID) { WzImageProperty property = ConsumeImage?.GetFromPath($@"{cardID}/name"); if (property != null) { string cardName = property.GetString(); return(cardName); } else { return(""); } }
// {category}/{EquipImage}/info/icon public Bitmap GetEquipImage(WzFile characterWZ) { if (EquipImage == null) { return(null); } Bitmap weaponImage = null; if (EquipImage?.GetFromPath($@"info/icon/_outlink") == null && EquipImage?.GetFromPath($@"info/icon/_inlink") == null) { weaponImage = EquipImage?.GetFromPath($@"info/icon").GetBitmap(); } else if (EquipImage?.GetFromPath($@"info/icon/_outlink") != null) { string outlink = EquipImage?.GetFromPath($@"info/icon/_outlink").GetString(); string treatedlink = outlink.Substring(outlink.IndexOf("/") + 1); string directoryName = treatedlink.Substring(0, treatedlink.IndexOf("/")); treatedlink = treatedlink.Substring(treatedlink.IndexOf("/") + 1); int newWeaponID = Convert.ToInt32(treatedlink.Substring(0, treatedlink.IndexOf("."))); string remainderlink = treatedlink.Substring(treatedlink.IndexOf("/") + 1); WzDirectory directory = characterWZ.WzDirectory.GetDirectoryByName(directoryName); WzImage newWeaponImage = directory.GetImageByName($@"0{newWeaponID}.img"); weaponImage = newWeaponImage?.GetFromPath($@"{remainderlink}").GetBitmap(); } else { string inlink = EquipImage?.GetFromPath($@"info/icon/_inlink").GetString(); weaponImage = EquipImage?.GetFromPath($@"{inlink}").GetBitmap(); } return(weaponImage); }
public string GetPet(int ID) { SetParsed(PetImage); WzImageProperty imgProperty = PetImage.GetFromPath($"{ID}/name"); return(((WzStringProperty)imgProperty)?.Value); }
public string GetEtc(int ID) { SetParsed(EtcImage); WzImageProperty imgProperty = EtcImage.GetFromPath($"Etc/{ID}/name"); return(((WzStringProperty)imgProperty)?.Value); }
public string GetSkill(string ID) { SetParsed(SkillImage); WzImageProperty imgProperty = (WzStringProperty)SkillImage.GetFromPath($"{ID}/name"); return(((WzStringProperty)imgProperty)?.Value); }
// Consume/0287.img/0{CardID}/info/grade public string GetRarity(int cardID) { WzImage image = ConsumeDirectory.GetImageByName("0287.img"); int familiarRarityID = image.GetFromPath($@"0{cardID}/info/grade")?.GetInt() ?? -1; string familiarRarity = ""; switch (familiarRarityID) { case 0: familiarRarity = "Common"; break; case 1: familiarRarity = "Rare"; break; case 2: familiarRarity = "Epic"; break; case 3: familiarRarity = "Unique"; break; } return(familiarRarity); }
public string GetEqp(int ID) { SetParsed(EqpImage); string category = GetEqpCategory(ID); return(GetStringValue(EqpImage.GetFromPath($"Eqp/{category}/{ID}/name"))); }
public override Bitmap GetBitmap() { if (this["_inlink"] is WzStringProperty inlink) { WzObject currentWzObj = this; // first object to work with while ((currentWzObj = currentWzObj.Parent) != null) { if (!(currentWzObj is WzImage)) // keep looping if its not a WzImage { continue; } WzImage wzImageParent = (WzImage)currentWzObj; WzImageProperty foundProperty = wzImageParent.GetFromPath(inlink.Value); if (foundProperty != null && foundProperty is WzImageProperty) { return(foundProperty.GetBitmap()); } } } else if (this["_outlink"] is WzStringProperty outlink) { WzObject foundProperty = WzFileParent.GetObjectFromPath(outlink.Value); if (foundProperty is WzImageProperty) { return(foundProperty.GetBitmap()); } } return(imageProp.GetPNG(false)); }
public static string GetEqp(int id) { SetParsed(_eqp); string category = GetEqpCategory(id); return(GetStringValue(_eqp.GetFromPath($"Eqp/{category}/{id}/name"))); }
public static string GetFieldFullName(int mapId) { string path; int section = mapId / 10000000; if (section <= 9) { path = "maple"; } else if (section >= 10 && section <= 19) { path = "victoria"; } else if (section >= 20 && section <= 28) { path = "ossyria"; } else if (section >= 50 && section <= 55) { path = "singapore"; } else if (section >= 60 && section <= 61) { path = "MasteriaGL"; } else if (section >= 67 && section <= 68) { path = "weddingGL"; } else { path = "etc"; } path += "/" + mapId; WzSubProperty subProperty = (WzSubProperty)_map.GetFromPath(path); if (subProperty == null) { return("NO-NAME"); } string retName = ""; WzStringProperty mapName = (WzStringProperty)subProperty.GetFromPath("mapName"); WzStringProperty streetName = (WzStringProperty)subProperty.GetFromPath("streetName"); if (mapName != null) { retName += mapName.Value; } if (mapName != null && streetName != null) { retName += " - "; // x f*****g d } if (streetName != null) { retName += streetName.Value; } return(retName); }
public string GetEqp(int ID) { SetParsed(EqpImage); string category = GetEqpCategory(ID); WzImageProperty imgProperty = EqpImage.GetFromPath($"Eqp/{category}/{ID}/name"); return(((WzStringProperty)imgProperty)?.Value); }
private Bitmap GetItemImage(int itemID) { var character = Wz.Character.GetFile(); var item = Wz.Item.GetFile(); int fileType = itemID / 1000000; if (fileType == 1 && character != null) { var type = ItemCategory.GetTypeByItemID(itemID); if (type == ItemType.UNKNOWN) { Logger.Log($"Couldn't figure out item type, skipping image retrieval: {itemID}"); return(null); } var dir = character.WzDirectory[type.ToString()]; WzImage img = dir[$"{itemID.ToString().PadLeft(8, '0')}.img"] as WzImage; if (img == null) { return(null); } var icon = (img.GetFromPath("info/iconRaw") ?? img.GetFromPath("info/icon")); if (icon == null) { icon = img.GetFromPath("default/default"); } return(icon?.GetBitmap()); } if (fileType == 5 && item != null) { var dir = item.WzDirectory["Pet"]; WzImage img = dir[$"{itemID}.img"] as WzImage; if (img == null) { return(null); } var icon = (img.GetFromPath("info/iconRaw") ?? img.GetFromPath("info/icon")); return(icon?.GetBitmap()); } return(null); }
private void mapNamesBox_SelectedIndexChanged(object sender, EventArgs e) { if ((string)mapNamesBox.SelectedItem == "MapLogin" || (string)mapNamesBox.SelectedItem == "MapLogin1" || (string)mapNamesBox.SelectedItem == "CashShopPreview" || mapNamesBox.SelectedItem == null) { linkLabel.Visible = false; mapNotExist.Visible = false; minimapBox.Image = (Image) new Bitmap(1, 1); load = mapNamesBox.SelectedItem != null; } else { string mapid = ((string)mapNamesBox.SelectedItem).Substring(0, 9); string mapcat = "Map" + mapid.Substring(0, 1); WzImage mapImage = (WzImage)Program.WzManager["map"]["Map"][mapcat][mapid + ".img"]; if (mapImage == null) { linkLabel.Visible = false; mapNotExist.Visible = true; minimapBox.Image = (Image) new Bitmap(1, 1); load = false; } else { using (WzImageResource rsrc = new WzImageResource(mapImage)) { if (mapImage["info"]["link"] != null) { linkLabel.Visible = true; mapNotExist.Visible = false; minimapBox.Image = (Image) new Bitmap(1, 1); load = false; } else { linkLabel.Visible = false; mapNotExist.Visible = false; load = true; WzCanvasProperty minimap = (WzCanvasProperty)mapImage.GetFromPath("miniMap/canvas"); if (minimap != null) { minimapBox.Image = (Image)minimap.PngProperty.GetPNG(false); } else { minimapBox.Image = (Image) new Bitmap(1, 1); } load = true; } } GC.Collect(); } } SelectionChanged.Invoke(); }
// FamiliarCard.img/{FamiliarID}/normal/0 public Bitmap GetCardImage(int familiarID) { Bitmap cardImage = null; if (familiarCardImage?.GetFromPath($@"{familiarID.ToString()}/normal/0/_inlink") == null) { WzImageProperty property = familiarCardImage?.GetFromPath($@"{familiarID.ToString()}/normal/0"); if (property != null) { cardImage = property.GetBitmap(); } } else { string inlink = familiarCardImage?.GetFromPath($@"{familiarID.ToString()}/normal/0/_inlink").GetString(); cardImage = familiarCardImage?.GetFromPath($@"{inlink}").GetBitmap(); } return(cardImage); }
private void mapNamesBox_SelectedIndexChanged(object sender, EventArgs e) { if ((string)mapNamesBox.SelectedItem == "MapLogin" || (string)mapNamesBox.SelectedItem == "MapLogin1" || (string)mapNamesBox.SelectedItem == "CashShopPreview" || mapNamesBox.SelectedItem == null) { linkLabel.Visible = false; mapNotExist.Visible = false; minimapBox.Image = (Image) new Bitmap(1, 1); loadButton.Enabled = true; return; } string mapid = ((string)mapNamesBox.SelectedItem).Substring(0, 9); string mapcat = "Map" + mapid.Substring(0, 1); WzImage mapImage = (WzImage)Program.WzManager["map"].GetObjectFromPath("Map.wz/Map/" + mapcat + "/" + mapid + ".img"); if (mapImage == null) { linkLabel.Visible = false; mapNotExist.Visible = true; minimapBox.Image = (Image) new Bitmap(1, 1); loadButton.Enabled = false; return; } if (!mapImage.Parsed) { mapImage.ParseImage(); } if (mapImage["info"]["link"] != null) { linkLabel.Visible = true; mapNotExist.Visible = false; minimapBox.Image = (Image) new Bitmap(1, 1); loadButton.Enabled = false; } else { linkLabel.Visible = false; mapNotExist.Visible = false; loadButton.Enabled = true; WzCanvasProperty minimap = (WzCanvasProperty)mapImage.GetFromPath("miniMap/canvas"); if (minimap != null) { minimapBox.Image = (Image)minimap.PngProperty.GetPNG(false); } else { minimapBox.Image = (Image) new Bitmap(1, 1); } } mapImage.UnparseImage(); GC.Collect(); }
// Consume/0287.img/0{CardID}/info/icon public Bitmap GetCardImage(int cardID) { Bitmap cardImage = null; WzImage image = ConsumeDirectory.GetImageByName("0287.img"); if (image?.GetFromPath($@"0{cardID.ToString()}/info/icon/_inlink") == null) { WzImageProperty property = image?.GetFromPath($@"0{cardID.ToString()}/info/icon"); if (property != null) { cardImage = property.GetBitmap(); } } else { string inlink = image?.GetFromPath($@"0{cardID.ToString()}/info/icon/_inlink").GetString(); cardImage = image?.GetFromPath($@"{inlink}").GetBitmap(); } return(cardImage); }
// Mob.img/{MobID}/name public string GetMobName(int mobID) { WzImageProperty property = MobImage?.GetFromPath($@"{mobID.ToString()}/name"); if (property != null) { string mobName = property.GetString(); return(mobName); } else { return(""); } }
/// <summary> /// Gets the '_inlink' WzCanvasProperty of this. /// /// '_inlink' is not implemented as part of WzCanvasProperty as I dont want to override existing Wz structure. /// It will be handled via HaRepackerMainPanel instead. /// </summary> /// <returns></returns> public WzImageProperty GetLinkedWzCanvasProperty() { if (!HaveInlinkProperty() && !HaveOutlinkProperty()) { return(null); } string _inlink = ((WzStringProperty)this[InlinkPropertyName])?.Value; // could get nexon'd here. In case they place an _inlink that's not WzStringProperty string _outlink = ((WzStringProperty)this[OutlinkPropertyName])?.Value; // could get nexon'd here. In case they place an _outlink that's not WzStringProperty if (_inlink != null) { WzObject currentWzObj = this; // first object to work with while ((currentWzObj = currentWzObj.Parent) != null) { if (!(currentWzObj is WzImage)) // keep looping if its not a WzImage { continue; } WzImage wzImageParent = (WzImage)currentWzObj; WzImageProperty foundProperty = wzImageParent.GetFromPath(_inlink); if (foundProperty != null && foundProperty is WzImageProperty) { return((WzImageProperty)foundProperty); } } } else if (_outlink != null) { WzObject currentWzObj = this; // first object to work with while ((currentWzObj = currentWzObj.Parent) != null) { System.Diagnostics.Debug.WriteLine(currentWzObj.ToString()); if (!(currentWzObj is WzDirectory)) // keep looping if its not a WzImage { continue; } WzFile wzFileParent = ((WzDirectory)currentWzObj).wzFile; WzObject foundProperty = wzFileParent.GetObjectFromPath(_outlink); if (foundProperty != null && foundProperty is WzImageProperty) { return((WzImageProperty)foundProperty); } } } return(null); }
// {mobID}.img/stand/0 DON'T CONFUSE THE DIFFERENT MOBIMAGES public Bitmap GetMobImage() { if (MobImage == null) { return(null); } Bitmap mobImage = null; string thumbnailPath; if (MobImage?.GetFromPath($@"info/thumbnail") != null) { mobImage = MobImage?.GetFromPath($@"info/thumbnail").GetBitmap(); return(mobImage); } else if (MobImage?.GetFromPath($@"stand/0") != null) { thumbnailPath = "stand"; } else if (MobImage?.GetFromPath($@"fly/0") != null) { thumbnailPath = "fly"; } else { return(null); } if (MobImage?.GetFromPath($@"{thumbnailPath}/0/_outlink") == null && MobImage?.GetFromPath($@"{thumbnailPath}/0/_inlink") == null) { mobImage = MobImage?.GetFromPath($@"{thumbnailPath}/0").GetBitmap(); } else if (MobImage?.GetFromPath($@"{thumbnailPath}/0/_outlink") != null) { string outlink = MobImage?.GetFromPath($@"{thumbnailPath}/0/_outlink").GetString(); string treatedlink = outlink.Substring(outlink.IndexOf("/") + 1); int newMobID = Convert.ToInt32(treatedlink.Substring(0, treatedlink.IndexOf("."))); string remainderlink = treatedlink.Substring(treatedlink.IndexOf("/") + 1); WzImage newMobImage = MobDirectory.GetImageByName($@"{newMobID}.img"); mobImage = newMobImage?.GetFromPath($@"{remainderlink}").GetBitmap(); } else { string inlink = MobImage?.GetFromPath($@"{thumbnailPath}/0/_inlink").GetString(); mobImage = MobImage?.GetFromPath($@"{inlink}").GetBitmap(); } return(mobImage); }
/// <summary> /// Gets the '_inlink' WzCanvasProperty of this. /// /// '_inlink' is not implemented as part of WzCanvasProperty as I dont want to override existing Wz structure. /// It will be handled via HaRepackerMainPanel instead. /// </summary> /// <returns></returns> public Bitmap GetLinkedWzCanvasBitmap() { string _inlink = ((WzStringProperty)this[InlinkPropertyName])?.Value; // could get nexon'd here. In case they place an _inlink that's not WzStringProperty string _outlink = ((WzStringProperty)this[OutlinkPropertyName])?.Value; // could get nexon'd here. In case they place an _outlink that's not WzStringProperty if (_inlink != null) { WzObject currentWzObj = this; // first object to work with while ((currentWzObj = currentWzObj.Parent) != null) { if (!(currentWzObj is WzImage)) // keep looping if its not a WzImage { continue; } WzImage wzImageParent = (WzImage)currentWzObj; WzImageProperty foundProperty = wzImageParent.GetFromPath(_inlink); if (foundProperty != null && foundProperty is WzImageProperty) { return(((WzImageProperty)foundProperty).GetBitmap()); } } } else if (_outlink != null) { WzObject currentWzObj = this; // first object to work with while ((currentWzObj = currentWzObj.Parent) != null) { if (!(currentWzObj is WzDirectory)) // keep looping if its not a WzImage { continue; } WzFile wzFileParent = ((WzDirectory)currentWzObj).wzFile; WzObject foundProperty = wzFileParent.GetObjectFromPath(_outlink); if (foundProperty != null && foundProperty is WzImageProperty) { return(((WzImageProperty)foundProperty).GetBitmap()); } } } return(this.GetBitmap()); }
public override Bitmap GetBitmap() { if (InLink != null) { WzObject currentWzObj = this; // first object to work with while ((currentWzObj = currentWzObj.Parent) != null) { if (!(currentWzObj is WzImage)) // keep looping if its not a WzImage { continue; } WzImage wzImageParent = (WzImage)currentWzObj; WzImageProperty foundProperty = wzImageParent.GetFromPath(InLink.Value); if (foundProperty != null && foundProperty is WzImageProperty) { return(foundProperty.GetBitmap()); } } } else if (OutLink != null) { WzObject foundProperty = WzFileParent.GetObjectFromPath(OutLink.Value); if (foundProperty?.OutLink != null) { if (foundProperty.WzFileParent.GetObjectFromPath(foundProperty.OutLink.Value) == this) { Console.WriteLine("RECURSION FOUND"); // recursive linking, who the f**k did this?? return(null); } } if (foundProperty is WzImageProperty) { return(foundProperty.GetBitmap()); } } return(imageProp.GetPNG(false)); }
private void AddFaceRow(WzImage image) { string imgName = Path.GetFileNameWithoutExtension(image.Name); int id = int.Parse(imgName); WzObject wzObject = image.GetFromPath("blink/0/face"); WzCanvasProperty icon; if (wzObject is WzUOLProperty ufo) { icon = (WzCanvasProperty)ufo.LinkValue; } else { icon = (WzCanvasProperty)wzObject; } string name = StringUtility.GetEqp(id); Bitmap bitmap = null; try { bitmap = icon?.GetBitmap(); } catch { } EquipFacesView.GridView.Rows.Add(id, bitmap, name, ""); }
private void mapNamesBox_SelectedIndexChanged(object sender, EventArgs e) { string selectedName = (string)mapNamesBox.SelectedItem; if (selectedName == "MapLogin" || selectedName == "MapLogin1" || selectedName == "MapLogin2" || selectedName == "MapLogin3" || selectedName == "CashShopPreview" || selectedName == null) { linkLabel.Visible = false; mapNotExist.Visible = false; minimapBox.Image = (Image) new Bitmap(1, 1); load = mapNamesBox.SelectedItem != null; } else { string mapid = (selectedName).Substring(0, 9); string mapcat = "Map" + mapid.Substring(0, 1); WzImage mapImage = Program.WzManager.FindMapImage(mapid, mapcat); if (mapImage == null) { linkLabel.Visible = false; mapNotExist.Visible = true; minimapBox.Image = (Image) new Bitmap(1, 1); load = false; } else { using (WzImageResource rsrc = new WzImageResource(mapImage)) { if (mapImage["info"]["link"] != null) { linkLabel.Visible = true; mapNotExist.Visible = false; minimapBox.Image = (Image) new Bitmap(1, 1); load = false; } else { linkLabel.Visible = false; mapNotExist.Visible = false; load = true; WzCanvasProperty minimap = (WzCanvasProperty)mapImage.GetFromPath("miniMap/canvas"); if (minimap != null) { minimapBox.Image = (Image)minimap.GetLinkedWzCanvasBitmap(); } else { minimapBox.Image = (Image) new Bitmap(1, 1); } load = true; } } } } SelectionChanged.Invoke(); }