| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961 |
- using Server.MirEnvir;
- namespace Server
- {
- public partial class ItemInfoForm : Form
- {
- public string ItemListPath = Path.Combine(Settings.ExportPath, "ItemList.txt");
- public Envir Envir => SMain.EditEnvir;
- private List<ItemInfo> _selectedItemInfos;
- public class ComboBoxItem
- {
- public string Text { get; set; }
- public object Value { get; set; }
- public override string ToString()
- {
- return Text;
- }
- }
- public ItemInfoForm()
- {
- InitializeComponent();
- ITypeComboBox.Items.AddRange(Enum.GetValues(typeof (ItemType)).Cast<object>().ToArray());
- IGradeComboBox.Items.AddRange(Enum.GetValues(typeof(ItemGrade)).Cast<object>().ToArray());
- RTypeComboBox.Items.AddRange(Enum.GetValues(typeof (RequiredType)).Cast<object>().ToArray());
- RClassComboBox.Items.AddRange(Enum.GetValues(typeof (RequiredClass)).Cast<object>().ToArray());
- RGenderComboBox.Items.AddRange(Enum.GetValues(typeof (RequiredGender)).Cast<object>().ToArray());
- ISetComboBox.Items.AddRange(Enum.GetValues(typeof(ItemSet)).Cast<object>().ToArray());
- ITypeFilterComboBox.Items.AddRange(Enum.GetValues(typeof(ItemType)).Cast<object>().ToArray());
- ITypeFilterComboBox.Items.Add(new ComboBoxItem { Text = "All" });
- ITypeFilterComboBox.SelectedIndex = ITypeFilterComboBox.Items.Count - 1;
- UpdateInterface();
- }
- public void RefreshUniqueTab()
- {
- if ((ITypeComboBox.SelectedItem != null) && ((ItemType)ITypeComboBox.SelectedItem == ItemType.Gem))
- {
- tabControl1.TabPages[3].Text = "Usable on";
- ParalysischeckBox.Text = "Weapon";
- TeleportcheckBox.Text = "Armour";
- ClearcheckBox.Text = "Helmet";
- ProtectioncheckBox.Text = "Necklace";
- RevivalcheckBox.Text = "Bracelet";
- MusclecheckBox.Text = "Ring";
- FlamecheckBox.Text = "Amulet";
- HealingcheckBox.Text = "Belt";
- ProbecheckBox.Text = "Boots";
- SkillcheckBox.Text = "Stone";
- NoDuraLosscheckBox.Text = "Torch";
- PickaxecheckBox.Text = "Unused";
- label50.Text = "Base rate%";
- label52.Text = "Success drop";
- label51.Text = "Max stats (all)";
- label49.Text = "Max gem stat";
- BlinkcheckBox.Text = "Unsure?";
- }
- else
- {
- tabControl1.TabPages[3].Text = "Special Stats";
- ParalysischeckBox.Text = "Paralysis ring";
- TeleportcheckBox.Text = "Teleport ring";
- ClearcheckBox.Text = "Clear ring";
- ProtectioncheckBox.Text = "Protection ring";
- RevivalcheckBox.Text = "Revival ring";
- MusclecheckBox.Text = "Muscle ring";
- FlamecheckBox.Text = "Flame ring";
- HealingcheckBox.Text = "Healing ring";
- ProbecheckBox.Text = "Probe necklace";
- SkillcheckBox.Text = "Skill necklace";
- NoDuraLosscheckBox.Text = "No dura loss";
- PickaxecheckBox.Text = "Pickaxe";
- label50.Text = "Critical rate:";
- label52.Text = "Reflect:";
- label51.Text = "Critical Dmg:";
- label49.Text = "HP Drain:";
- BlinkcheckBox.Text = "Blink";
- }
- }
- public void UpdateInterface(bool refreshList = false)
- {
- if (refreshList)
- {
- ItemInfoListBox.Items.Clear();
- for (int i = 0; i < Envir.ItemInfoList.Count; i++)
- {
- if (ITypeFilterComboBox.SelectedItem == null ||
- ITypeFilterComboBox.SelectedIndex == ITypeFilterComboBox.Items.Count - 1 ||
- Envir.ItemInfoList[i].Type == (ItemType)ITypeFilterComboBox.SelectedItem)
- ItemInfoListBox.Items.Add(Envir.ItemInfoList[i]);
- }
- }
- _selectedItemInfos = ItemInfoListBox.SelectedItems.Cast<ItemInfo>().ToList();
- if (_selectedItemInfos.Count == 0)
- {
- ItemInfoPanel.Enabled = false;
- ItemIndexTextBox.Text = string.Empty;
- ItemNameTextBox.Text = string.Empty;
- WeightTextBox.Text = string.Empty;
- ImageTextBox.Text = string.Empty;
- DuraTextBox.Text = string.Empty;
- ITypeComboBox.SelectedItem = null;
- IGradeComboBox.SelectedItem = null;
- ISetComboBox.SelectedItem = null;
- ShapeTextBox.Text = string.Empty;
- SSizeTextBox.Text = string.Empty;
- PriceTextBox.Text = string.Empty;
- RTypeComboBox.SelectedItem = null;
- RAmountTextBox.Text = string.Empty;
- RClassComboBox.SelectedItem = null;
- RGenderComboBox.SelectedItem = null;
- LightTextBox.Text = string.Empty;
- LightIntensitytextBox.Text = string.Empty;
- MinACTextBox.Text = string.Empty;
- MaxACTextBox.Text = string.Empty;
- MinMACTextBox.Text = string.Empty;
- MaxMACTextBox.Text = string.Empty;
- MinDCTextBox.Text = string.Empty;
- MaxDCTextBox.Text = string.Empty;
- MinMCTextBox.Text = string.Empty;
- MaxMCTextBox.Text = string.Empty;
- MinSCTextBox.Text = string.Empty;
- MaxSCTextBox.Text = string.Empty;
- HPTextBox.Text = string.Empty;
- MPTextBox.Text = string.Empty;
- AccuracyTextBox.Text = string.Empty;
- AgilityTextBox.Text = string.Empty;
- ASpeedTextBox.Text = string.Empty;
- LuckTextBox.Text = string.Empty;
- StartItemCheckBox.Checked = false;
- WWeightTextBox.Text = string.Empty;
- HWeightTextBox.Text = string.Empty;
- BWeightText.Text = string.Empty;
- EffectTextBox.Text = string.Empty;
-
- PoisonRecoverytextBox.Text = string.Empty;
- SpellRecoverytextBox.Text = string.Empty;
- MagicResisttextBox.Text = string.Empty;
- HealthRecoveryTextbox.Text = string.Empty;
- StrongTextbox.Text = string.Empty;
- MacRateTextbox.Text = string.Empty;
- ACRateTextbox.Text = string.Empty;
- PoisonResisttextBox.Text = string.Empty;
- PoisonAttacktextbox.Text = string.Empty;
- Freezingtextbox.Text = string.Empty;
- Holytextbox.Text = string.Empty;
- HPratetextbox.Text = string.Empty;
- MPratetextbox.Text = string.Empty;
- HpDrainRatetextBox.Text = string.Empty;
- CriticalDamagetextBox.Text = string.Empty;
- CriticalRatetextBox.Text = string.Empty;
- ReflecttextBox.Text = string.Empty;
- MaxDCRatetextBox.Text = string.Empty;
- MaxSCRatetextBox.Text = string.Empty;
- MaxMCRatetextBox.Text = string.Empty;
- DamageReductiontextBox.Text = string.Empty;
- ExpRatetextBox.Text = string.Empty;
- DropRatetextBox.Text = string.Empty;
- GoldRatetextBox.Text = string.Empty;
- LevelBasedcheckbox.Checked = false;
- ClassBasedcheckbox.Checked = false;
- Bind_dontstorecheckbox.Checked = false;
- Bind_dontupgradecheckbox.Checked = false;
- Bind_dontrepaircheckbox.Checked = false;
- Bind_donttradecheckbox.Checked = false;
- Bind_dontsellcheckbox.Checked = false;
- Bind_destroyondropcheckbox.Checked = false;
- Bind_dontdeathdropcheckbox.Checked = false;
- Bind_dontdropcheckbox.Checked = false;
- Bind_DontSpecialRepaircheckBox.Checked = false;
- NeedIdentifycheckbox.Checked = false;
- ShowGroupPickupcheckbox.Checked = false;
- globalDropNotify_CheckBox.Checked = false;
- BindOnEquipcheckbox.Checked = false;
- ParalysischeckBox.Checked = false;
- TeleportcheckBox.Checked = false;
- ClearcheckBox.Checked = false;
- ProtectioncheckBox.Checked = false;
- RevivalcheckBox.Checked = false;
- MusclecheckBox.Checked = false;
- FlamecheckBox.Checked = false;
- HealingcheckBox.Checked = false;
- ProbecheckBox.Checked = false;
- SkillcheckBox.Checked = false;
- NoDuraLosscheckBox.Checked = false;
- RandomStatstextBox.Text = string.Empty;
- PickaxecheckBox.Checked = false;
- FastRunCheckBox.Checked = false;
- CanAwaken.Checked = false;
- TooltipTextBox.Text = string.Empty;
- BlinkcheckBox.Checked = false;
- return;
- }
- ItemInfo info = _selectedItemInfos[0];
- ItemInfoPanel.Enabled = true;
- ItemIndexTextBox.Text = info.Index.ToString();
- ItemNameTextBox.Text = info.Name;
- WeightTextBox.Text = info.Weight.ToString();
- ImageTextBox.Text = info.Image.ToString();
- DuraTextBox.Text = info.Durability.ToString();
- ITypeComboBox.SelectedItem = info.Type;
- IGradeComboBox.SelectedItem = info.Grade;
- ISetComboBox.SelectedItem = info.Set;
- ShapeTextBox.Text = info.Shape.ToString();
- SSizeTextBox.Text = info.StackSize.ToString();
- PriceTextBox.Text = info.Price.ToString();
- RTypeComboBox.SelectedItem = info.RequiredType;
- RAmountTextBox.Text = info.RequiredAmount.ToString();
- RClassComboBox.SelectedItem = info.RequiredClass;
- RGenderComboBox.SelectedItem = info.RequiredGender;
- LightTextBox.Text = (info.Light % 15).ToString();
- LightIntensitytextBox.Text = (info.Light / 15).ToString();
- MinACTextBox.Text = info.Stats[Stat.MinAC].ToString();
- MaxACTextBox.Text = info.Stats[Stat.MaxAC].ToString();
- MinMACTextBox.Text = info.Stats[Stat.MinMAC].ToString();
- MaxMACTextBox.Text = info.Stats[Stat.MaxMAC].ToString();
- MinDCTextBox.Text = info.Stats[Stat.MinDC].ToString();
- MaxDCTextBox.Text = info.Stats[Stat.MaxDC].ToString();
- MinMCTextBox.Text = info.Stats[Stat.MinMC].ToString();
- MaxMCTextBox.Text = info.Stats[Stat.MaxMC].ToString();
- MinSCTextBox.Text = info.Stats[Stat.MinSC].ToString();
- MaxSCTextBox.Text = info.Stats[Stat.MaxSC].ToString();
- HPTextBox.Text = info.Stats[Stat.HP].ToString();
- MPTextBox.Text = info.Stats[Stat.MP].ToString();
- AccuracyTextBox.Text = info.Stats[Stat.Accuracy].ToString();
- AgilityTextBox.Text = info.Stats[Stat.Agility].ToString();
- ASpeedTextBox.Text = info.Stats[Stat.AttackSpeed].ToString();
- LuckTextBox.Text = info.Stats[Stat.Luck].ToString();
- WWeightTextBox.Text = info.Stats[Stat.WearWeight].ToString();
- HWeightTextBox.Text = info.Stats[Stat.HandWeight].ToString();
- BWeightText.Text = info.Stats[Stat.BagWeight].ToString();
- StartItemCheckBox.Checked = info.StartItem;
- EffectTextBox.Text = info.Effect.ToString();
- SlotsTextBox.Text = info.Slots.ToString();
- PoisonRecoverytextBox.Text = info.Stats[Stat.PoisonRecovery].ToString();
- SpellRecoverytextBox.Text = info.Stats[Stat.SpellRecovery].ToString();
- MagicResisttextBox.Text = info.Stats[Stat.MagicResist].ToString();
- HealthRecoveryTextbox.Text = info.Stats[Stat.HealthRecovery].ToString();
- StrongTextbox.Text = info.Stats[Stat.Strong].ToString();
- MacRateTextbox.Text = info.Stats[Stat.MaxMACRatePercent].ToString();
- ACRateTextbox.Text = info.Stats[Stat.MaxACRatePercent].ToString();
- PoisonResisttextBox.Text = info.Stats[Stat.PoisonResist].ToString();
- PoisonAttacktextbox.Text = info.Stats[Stat.PoisonAttack].ToString();
- Freezingtextbox.Text = info.Stats[Stat.Freezing].ToString();
- Holytextbox.Text = info.Stats[Stat.Holy].ToString();
- HPratetextbox.Text = info.Stats[Stat.HPRatePercent].ToString();
- MPratetextbox.Text = info.Stats[Stat.MPRatePercent].ToString();
- HpDrainRatetextBox.Text = info.Stats[Stat.HPDrainRatePercent].ToString();
- CriticalRatetextBox.Text = info.Stats[Stat.CriticalRate].ToString();
- CriticalDamagetextBox.Text = info.Stats[Stat.CriticalDamage].ToString();
- ReflecttextBox.Text = info.Stats[Stat.Reflect].ToString();
- MaxDCRatetextBox.Text = info.Stats[Stat.MaxDCRatePercent].ToString();
- MaxSCRatetextBox.Text = info.Stats[Stat.MaxSCRatePercent].ToString();
- MaxMCRatetextBox.Text = info.Stats[Stat.MaxMCRatePercent].ToString();
- DamageReductiontextBox.Text = info.Stats[Stat.DamageReductionPercent].ToString();
- ExpRatetextBox.Text = info.Stats[Stat.ExpRatePercent].ToString();
- DropRatetextBox.Text = info.Stats[Stat.ItemDropRatePercent].ToString();
- GoldRatetextBox.Text = info.Stats[Stat.GoldDropRatePercent].ToString();
- LevelBasedcheckbox.Checked = info.LevelBased;
- ClassBasedcheckbox.Checked = info.ClassBased;
-
- Bind_dontstorecheckbox.Checked = info.Bind.HasFlag(BindMode.DontStore);
- Bind_dontupgradecheckbox.Checked = info.Bind.HasFlag(BindMode.DontUpgrade);
- Bind_dontrepaircheckbox.Checked = info.Bind.HasFlag(BindMode.DontRepair);
- Bind_donttradecheckbox.Checked = info.Bind.HasFlag(BindMode.DontTrade);
- Bind_dontsellcheckbox.Checked = info.Bind.HasFlag(BindMode.DontSell);
- Bind_destroyondropcheckbox.Checked = info.Bind.HasFlag(BindMode.DestroyOnDrop);
- Bind_dontdeathdropcheckbox.Checked = info.Bind.HasFlag(BindMode.DontDeathdrop);
- Bind_dontdropcheckbox.Checked = info.Bind.HasFlag(BindMode.DontDrop);
- Bind_DontSpecialRepaircheckBox.Checked = info.Bind.HasFlag(BindMode.NoSRepair);
- BindOnEquipcheckbox.Checked = info.Bind.HasFlag(BindMode.BindOnEquip);
- BreakOnDeathcheckbox.Checked = info.Bind.HasFlag(BindMode.BreakOnDeath);
- NoWeddingRingcheckbox.Checked = info.Bind.HasFlag(BindMode.NoWeddingRing);
- unableToRent_CheckBox.Checked = info.Bind.HasFlag(BindMode.UnableToRent);
- unableToDisassemble_CheckBox.Checked = info.Bind.HasFlag(BindMode.UnableToDisassemble);
- noMailBox.Checked = info.Bind.HasFlag(BindMode.NoMail);
- NeedIdentifycheckbox.Checked = info.NeedIdentify;
- ShowGroupPickupcheckbox.Checked = info.ShowGroupPickup;
- globalDropNotify_CheckBox.Checked = info.GlobalDropNotify;
-
- ParalysischeckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Paralize);
- TeleportcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Teleport);
- ClearcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.ClearRing);
- ProtectioncheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Protection);
- RevivalcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Revival);
- MusclecheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Muscle);
- FlamecheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Flame);
- HealingcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Healing);
- ProbecheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Probe);
- SkillcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Skill);
- NoDuraLosscheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.NoDuraLoss);
- RandomStatstextBox.Text = info.RandomStatsId.ToString();
- PickaxecheckBox.Checked = info.CanMine;
- FastRunCheckBox.Checked = info.CanFastRun;
- CanAwaken.Checked = info.CanAwakening;
- TooltipTextBox.Text = info.ToolTip;
- BlinkcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Blink);
- for (int i = 1; i < _selectedItemInfos.Count; i++)
- {
- info = _selectedItemInfos[i];
- if (ItemIndexTextBox.Text != info.Index.ToString()) ItemIndexTextBox.Text = string.Empty;
- if (ItemNameTextBox.Text != info.Name) ItemNameTextBox.Text = string.Empty;
- if (WeightTextBox.Text != info.Weight.ToString()) WeightTextBox.Text = string.Empty;
- if (ImageTextBox.Text != info.Image.ToString()) ImageTextBox.Text = string.Empty;
- if (DuraTextBox.Text != info.Durability.ToString()) DuraTextBox.Text = string.Empty;
- if (ITypeComboBox.SelectedItem == null || (ItemType)ITypeComboBox.SelectedItem != info.Type) ITypeComboBox.SelectedItem = null;
- if (IGradeComboBox.SelectedItem == null || (ItemGrade)IGradeComboBox.SelectedItem != info.Grade) IGradeComboBox.SelectedItem = null;
- if (ISetComboBox.SelectedItem == null || (ItemSet)ISetComboBox.SelectedItem != info.Set) ISetComboBox.SelectedItem = null;
- if (ShapeTextBox.Text != info.Shape.ToString()) ShapeTextBox.Text = string.Empty;
- if (SSizeTextBox.Text != info.StackSize.ToString()) SSizeTextBox.Text = string.Empty;
- if (PriceTextBox.Text != info.Price.ToString()) PriceTextBox.Text = string.Empty;
- if (RTypeComboBox.SelectedItem == null || (RequiredType)RTypeComboBox.SelectedItem != info.RequiredType) RTypeComboBox.SelectedItem = null;
- if (RAmountTextBox.Text != info.RequiredAmount.ToString()) RAmountTextBox.Text = string.Empty;
- if (RClassComboBox.SelectedItem == null || (RequiredClass)RClassComboBox.SelectedItem != info.RequiredClass) RClassComboBox.SelectedItem = null;
- if (RGenderComboBox.SelectedItem == null || (RequiredGender)RGenderComboBox.SelectedItem != info.RequiredGender) RGenderComboBox.SelectedItem = null;
- if (LightTextBox.Text != (info.Light % 15).ToString()) LightTextBox.Text = string.Empty;
- if (LightIntensitytextBox.Text != (info.Light / 15).ToString()) LightIntensitytextBox.Text = string.Empty;
- if (MinACTextBox.Text != info.Stats[Stat.MinAC].ToString()) MinACTextBox.Text = string.Empty;
- if (MaxACTextBox.Text != info.Stats[Stat.MaxAC].ToString()) MaxACTextBox.Text = string.Empty;
- if (MinMACTextBox.Text != info.Stats[Stat.MinMAC].ToString()) MinMACTextBox.Text = string.Empty;
- if (MaxMACTextBox.Text != info.Stats[Stat.MaxMAC].ToString()) MaxMACTextBox.Text = string.Empty;
- if (MinDCTextBox.Text != info.Stats[Stat.MinDC].ToString()) MinDCTextBox.Text = string.Empty;
- if (MaxDCTextBox.Text != info.Stats[Stat.MaxDC].ToString()) MaxDCTextBox.Text = string.Empty;
- if (MinMCTextBox.Text != info.Stats[Stat.MinMC].ToString()) MinMCTextBox.Text = string.Empty;
- if (MaxMCTextBox.Text != info.Stats[Stat.MaxMC].ToString()) MaxMCTextBox.Text = string.Empty;
- if (MinSCTextBox.Text != info.Stats[Stat.MinSC].ToString()) MinSCTextBox.Text = string.Empty;
- if (MaxSCTextBox.Text != info.Stats[Stat.MaxSC].ToString()) MaxSCTextBox.Text = string.Empty;
- if (HPTextBox.Text != info.Stats[Stat.HP].ToString()) HPTextBox.Text = string.Empty;
- if (MPTextBox.Text != info.Stats[Stat.MP].ToString()) MPTextBox.Text = string.Empty;
- if (AccuracyTextBox.Text != info.Stats[Stat.Accuracy].ToString()) AccuracyTextBox.Text = string.Empty;
- if (AgilityTextBox.Text != info.Stats[Stat.Agility].ToString()) AgilityTextBox.Text = string.Empty;
- if (ASpeedTextBox.Text != info.Stats[Stat.AttackSpeed].ToString()) ASpeedTextBox.Text = string.Empty;
- if (LuckTextBox.Text != info.Stats[Stat.Luck].ToString()) LuckTextBox.Text = string.Empty;
- if (WWeightTextBox.Text != info.Stats[Stat.WearWeight].ToString()) WWeightTextBox.Text = string.Empty;
- if (HWeightTextBox.Text != info.Stats[Stat.HandWeight].ToString()) HWeightTextBox.Text = string.Empty;
- if (BWeightText.Text != info.Stats[Stat.BagWeight].ToString()) BWeightText.Text = string.Empty;
- if (StartItemCheckBox.Checked != info.StartItem) StartItemCheckBox.CheckState = CheckState.Indeterminate;
- if (EffectTextBox.Text != info.Effect.ToString()) EffectTextBox.Text = string.Empty;
- if (SlotsTextBox.Text != info.Slots.ToString()) SlotsTextBox.Text = string.Empty;
- if (PoisonRecoverytextBox.Text != info.Stats[Stat.PoisonRecovery].ToString()) PoisonRecoverytextBox.Text = string.Empty;
- if (SpellRecoverytextBox.Text != info.Stats[Stat.SpellRecovery].ToString()) SpellRecoverytextBox.Text = string.Empty;
- if (MagicResisttextBox.Text != info.Stats[Stat.MagicResist].ToString()) MagicResisttextBox.Text = string.Empty;
- if (HealthRecoveryTextbox.Text != info.Stats[Stat.HealthRecovery].ToString()) HealthRecoveryTextbox.Text = string.Empty;
- if (StrongTextbox.Text != info.Stats[Stat.Strong].ToString()) StrongTextbox.Text = string.Empty;
- if (MacRateTextbox.Text != info.Stats[Stat.MaxMACRatePercent].ToString()) MacRateTextbox.Text = string.Empty;
- if (ACRateTextbox.Text != info.Stats[Stat.MaxACRatePercent].ToString()) ACRateTextbox.Text = string.Empty;
- if (PoisonResisttextBox.Text != info.Stats[Stat.PoisonResist].ToString()) PoisonResisttextBox.Text = string.Empty;
- if (PoisonAttacktextbox.Text != info.Stats[Stat.PoisonAttack].ToString()) PoisonAttacktextbox.Text = string.Empty;
- if (Freezingtextbox.Text != info.Stats[Stat.Freezing].ToString()) Freezingtextbox.Text = string.Empty;
- if (Holytextbox.Text != info.Stats[Stat.Holy].ToString()) Holytextbox.Text = string.Empty;
- if (HPratetextbox.Text != info.Stats[Stat.HPRatePercent].ToString()) HPratetextbox.Text = string.Empty;
- if (MPratetextbox.Text != info.Stats[Stat.MPRatePercent].ToString()) MPratetextbox.Text = string.Empty;
- if (HpDrainRatetextBox.Text != info.Stats[Stat.HPDrainRatePercent].ToString()) HpDrainRatetextBox.Text = string.Empty;
- if (CriticalRatetextBox.Text != info.Stats[Stat.CriticalRate].ToString()) CriticalRatetextBox.Text = string.Empty;
- if (CriticalDamagetextBox.Text != info.Stats[Stat.CriticalDamage].ToString()) CriticalDamagetextBox.Text = string.Empty;
- if (ReflecttextBox.Text != info.Stats[Stat.Reflect].ToString()) ReflecttextBox.Text = string.Empty;
- if (MaxDCRatetextBox.Text != info.Stats[Stat.MaxDCRatePercent].ToString()) MaxDCRatetextBox.Text = string.Empty;
- if (MaxSCRatetextBox.Text != info.Stats[Stat.MaxSCRatePercent].ToString()) MaxSCRatetextBox.Text = string.Empty;
- if (MaxMCRatetextBox.Text != info.Stats[Stat.MaxMCRatePercent].ToString()) MaxMCRatetextBox.Text = string.Empty;
- if (DamageReductiontextBox.Text != info.Stats[Stat.DamageReductionPercent].ToString()) DamageReductiontextBox.Text = string.Empty;
- if (ExpRatetextBox.Text != info.Stats[Stat.ExpRatePercent].ToString()) ExpRatetextBox.Text = string.Empty;
- if (DropRatetextBox.Text != info.Stats[Stat.ItemDropRatePercent].ToString()) DropRatetextBox.Text = string.Empty;
- if (GoldRatetextBox.Text != info.Stats[Stat.GoldDropRatePercent].ToString()) GoldRatetextBox.Text = string.Empty;
- if (LevelBasedcheckbox.Checked != info.LevelBased) LevelBasedcheckbox.CheckState = CheckState.Indeterminate;
- if (ClassBasedcheckbox.Checked != info.ClassBased) ClassBasedcheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_dontstorecheckbox.Checked != info.Bind.HasFlag(BindMode.DontStore)) Bind_dontstorecheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_dontupgradecheckbox.Checked != info.Bind.HasFlag(BindMode.DontUpgrade)) Bind_dontupgradecheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_dontrepaircheckbox.Checked != info.Bind.HasFlag(BindMode.DontRepair)) Bind_dontrepaircheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_donttradecheckbox.Checked != info.Bind.HasFlag(BindMode.DontTrade)) Bind_donttradecheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_dontsellcheckbox.Checked != info.Bind.HasFlag(BindMode.DontSell)) Bind_dontsellcheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_destroyondropcheckbox.Checked != info.Bind.HasFlag(BindMode.DestroyOnDrop)) Bind_destroyondropcheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_dontdeathdropcheckbox.Checked != info.Bind.HasFlag(BindMode.DontDeathdrop)) Bind_dontdeathdropcheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_dontdropcheckbox.Checked != info.Bind.HasFlag(BindMode.DontDrop)) Bind_dontdropcheckbox.CheckState = CheckState.Indeterminate;
- if (Bind_DontSpecialRepaircheckBox.Checked != info.Bind.HasFlag(BindMode.NoSRepair)) Bind_DontSpecialRepaircheckBox.CheckState = CheckState.Indeterminate;
- if (BindOnEquipcheckbox.Checked != info.Bind.HasFlag(BindMode.BindOnEquip)) BindOnEquipcheckbox.CheckState = CheckState.Indeterminate;
- if (BreakOnDeathcheckbox.Checked != info.Bind.HasFlag(BindMode.BreakOnDeath)) BreakOnDeathcheckbox.CheckState = CheckState.Indeterminate;
- if (NoWeddingRingcheckbox.Checked != info.Bind.HasFlag(BindMode.NoWeddingRing)) NoWeddingRingcheckbox.CheckState = CheckState.Indeterminate;
- if (unableToRent_CheckBox.Checked != info.Bind.HasFlag(BindMode.UnableToRent))
- unableToRent_CheckBox.CheckState = CheckState.Indeterminate;
- if (unableToDisassemble_CheckBox.Checked != info.Bind.HasFlag(BindMode.UnableToDisassemble))
- unableToDisassemble_CheckBox.CheckState = CheckState.Indeterminate;
- if (noMailBox.Checked != info.Bind.HasFlag(BindMode.NoMail)) noMailBox.CheckState = CheckState.Indeterminate;
- if (NeedIdentifycheckbox.Checked != info.NeedIdentify) NeedIdentifycheckbox.CheckState = CheckState.Indeterminate;
- if (ShowGroupPickupcheckbox.Checked != info.ShowGroupPickup) ShowGroupPickupcheckbox.CheckState = CheckState.Indeterminate;
- if (globalDropNotify_CheckBox.Checked != info.GlobalDropNotify)
- globalDropNotify_CheckBox.CheckState = CheckState.Indeterminate;
- if (ParalysischeckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Paralize)) ParalysischeckBox.CheckState = CheckState.Indeterminate;
- if (TeleportcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Teleport)) TeleportcheckBox.CheckState = CheckState.Indeterminate;
- if (ClearcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.ClearRing)) ClearcheckBox.CheckState = CheckState.Indeterminate;
- if (ProtectioncheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Protection)) ProtectioncheckBox.CheckState = CheckState.Indeterminate;
- if (RevivalcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Revival)) RevivalcheckBox.CheckState = CheckState.Indeterminate;
- if (MusclecheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Muscle)) MusclecheckBox.CheckState = CheckState.Indeterminate;
- if (FlamecheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Flame)) FlamecheckBox.CheckState = CheckState.Indeterminate;
- if (HealingcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Healing)) HealingcheckBox.CheckState = CheckState.Indeterminate;
- if (ProbecheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Probe)) ProbecheckBox.CheckState = CheckState.Indeterminate;
- if (SkillcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Skill)) SkillcheckBox.CheckState = CheckState.Indeterminate;
- if (NoDuraLosscheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.NoDuraLoss)) NoDuraLosscheckBox.CheckState = CheckState.Indeterminate;
- if (RandomStatstextBox.Text != info.RandomStatsId.ToString()) RandomStatstextBox.Text = string.Empty;
- if (PickaxecheckBox.Checked != info.CanMine) PickaxecheckBox.CheckState = CheckState.Indeterminate;
- if (FastRunCheckBox.Checked != info.CanFastRun) FastRunCheckBox.CheckState = CheckState.Indeterminate;
- if (CanAwaken.Checked != info.CanAwakening) CanAwaken.CheckState = CheckState.Indeterminate;
- if (TooltipTextBox.Text != info.ToolTip) TooltipTextBox.Text = string.Empty;
- if (BlinkcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Blink)) BlinkcheckBox.CheckState = CheckState.Indeterminate;
- }
- RefreshUniqueTab();
- }
- private void RefreshItemList()
- {
- ItemInfoListBox.SelectedIndexChanged -= ItemInfoListBox_SelectedIndexChanged;
- List<bool> selected = new List<bool>();
- for (int i = 0; i < ItemInfoListBox.Items.Count; i++) selected.Add(ItemInfoListBox.GetSelected(i));
- ItemInfoListBox.Items.Clear();
- for (int i = 0; i < Envir.ItemInfoList.Count; i++)
- {
- if (ITypeFilterComboBox.SelectedItem == null ||
- ITypeFilterComboBox.SelectedIndex == ITypeFilterComboBox.Items.Count - 1 ||
- Envir.ItemInfoList[i].Type == (ItemType)ITypeFilterComboBox.SelectedItem)
- ItemInfoListBox.Items.Add(Envir.ItemInfoList[i]);
- };
- for (int i = 0; i < selected.Count; i++) ItemInfoListBox.SetSelected(i, selected[i]);
- ItemInfoListBox.SelectedIndexChanged += ItemInfoListBox_SelectedIndexChanged;
- }
- private void AddButton_Click(object sender, EventArgs e)
- {
- if (ITypeFilterComboBox.SelectedIndex == ITypeFilterComboBox.Items.Count - 1)
- {
- Envir.CreateItemInfo();
- ITypeFilterComboBox.SelectedIndex = ITypeFilterComboBox.Items.Count - 1;
- }
- else
- {
- Envir.CreateItemInfo((ItemType)ITypeFilterComboBox.SelectedItem);
- }
- UpdateInterface(true);
- }
- private void ItemInfoListBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- UpdateInterface();
- }
- private void ITypeFilterComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- UpdateInterface(true);
- }
- private void RemoveButton_Click(object sender, EventArgs e)
- {
- if (_selectedItemInfos.Count == 0) return;
- if (MessageBox.Show("Are you sure you want to remove the selected Items?", "Remove Items?", MessageBoxButtons.YesNo) != DialogResult.Yes) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++) Envir.Remove(_selectedItemInfos[i]);
- if (Envir.ItemInfoList.Count == 0) Envir.ItemIndex = 0;
- UpdateInterface(true);
- }
- private void ItemNameTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Name = ActiveControl.Text;
- RefreshItemList();
- }
- private void ITypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Type = (ItemType)ITypeComboBox.SelectedItem;
- }
- private void RTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].RequiredType = (RequiredType) RTypeComboBox.SelectedItem;
- }
- private void RGenderComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].RequiredGender = (RequiredGender)RGenderComboBox.SelectedItem;
- }
- private void RClassComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].RequiredClass = (RequiredClass)RClassComboBox.SelectedItem;
- }
- private void StartItemCheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].StartItem = StartItemCheckBox.Checked;
- }
- private void WeightTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Weight = temp;
- }
- private void ImageTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- ushort temp;
- if (!ushort.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Image = temp;
- }
- private void DuraTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- ushort temp;
- if (!ushort.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Durability = temp;
- }
- private void ShapeTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- short temp;
- if (!short.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Shape = temp;
- }
- private void SSizeTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- ushort temp;
- if (!ushort.TryParse(ActiveControl.Text, out temp) || temp > 999)
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].StackSize = temp;
- }
- private void PriceTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- uint temp;
- if (!uint.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Price = temp;
- }
- private void RAmountTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].RequiredAmount = temp;
- }
- private void LightTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- if (temp > 14)
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
-
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Light = (byte)(temp + (_selectedItemInfos[i].Light / 15)*15);
- }
- private void MinACTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MinAC] = temp;
- }
- private void MaxACTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxAC] = temp;
- }
- private void MinMACTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MinMAC] = temp;
- }
- private void MaxMACTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxMAC] = temp;
- }
- private void MinDCTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MinDC] = temp;
- }
- private void MaxDCTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxDC] = temp;
- }
- private void MinMCTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MinMC] = temp;
- }
- private void MaxMCTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxMC] = temp;
- }
- private void MinSCTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MinSC] = temp;
- }
- private void MaxSCTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxSC] = temp;
- }
- private void HPTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- ushort temp;
- if (!ushort.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.HP] = temp;
- }
- private void MPTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- ushort temp;
- if (!ushort.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MP] = temp;
- }
- private void AccuracyTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Accuracy] = temp;
- }
- private void AgilityTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Agility] = temp;
- }
- private void ASpeedTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- sbyte temp;
- if (!sbyte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.AttackSpeed] = temp;
- }
- private void LuckTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- sbyte temp;
- if (!sbyte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Luck] = temp;
- }
- private void BWeightText_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.BagWeight] = temp;
- }
- private void HWeightTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.HandWeight] = temp;
- }
- private void WWeightTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.WearWeight] = temp;
- }
- private void EffectTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Effect = temp;
- }
- private void ItemInfoForm_FormClosed(object sender, FormClosedEventArgs e)
- {
- Envir.SaveDB();
- }
- private void PasteButton_Click(object sender, EventArgs e)
- {
- //string data = Clipboard.GetText();
- //if (!data.StartsWith("Item", StringComparison.OrdinalIgnoreCase))
- //{
- // MessageBox.Show("Cannot Paste, Copied data is not Item Information.");
- // return;
- //}
- //string[] items = data.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
- //for (int i = 1; i < items.Length; i++)
- //{
- // ItemInfo info = ItemInfo.FromText(items[i]);
- // if (info == null) continue;
- // info.Index = ++Envir.ItemIndex;
- // Envir.ItemInfoList.Add(info);
- //}
- //UpdateInterface();
- }
- private void CopyMButton_Click(object sender, EventArgs e)
- {
- }
- private void ExportAllButton_Click(object sender, EventArgs e)
- {
- //ExportItems(Envir.ItemInfoList);
- }
- private void ExportSelectedButton_Click(object sender, EventArgs e)
- {
- //var list = ItemInfoListBox.SelectedItems.Cast<ItemInfo>().ToList();
- //ExportItems(list);
- }
- private void ExportItems(IEnumerable<ItemInfo> items)
- {
- //var itemInfos = items as ItemInfo[] ?? items.ToArray();
- //var list = itemInfos.Select(item => item.ToText()).ToList();
- //File.WriteAllLines(ItemListPath, list);
- //MessageBox.Show(itemInfos.Count() + " Items have been exported");
- }
- private void ImportButton_Click(object sender, EventArgs e)
- {
- //string Path = string.Empty;
- //OpenFileDialog ofd = new OpenFileDialog();
- //ofd.Filter = "Text File|*.txt";
- //ofd.ShowDialog();
- //if (ofd.FileName == string.Empty) return;
- //Path = ofd.FileName;
- //string data;
- //using (var sr = new StreamReader(Path))
- //{
- // data = sr.ReadToEnd();
- //}
- //var items = data.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
- //var count = 0;
- //foreach (var info in items.Select(ItemInfo.FromText).Where(info => info != null))
- //{
- // count++;
- // info.Index = ++Envir.ItemIndex;
- // Envir.ItemInfoList.Add(info);
- //}
- //MessageBox.Show(count + " Items have been imported");
- //UpdateInterface(true);
- }
- private void ISetComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Set = (ItemSet)ISetComboBox.SelectedItem;
- }
- private void ACRateTextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxACRatePercent] = temp;
- }
- private void MacRateTextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxMACRatePercent] = temp;
- }
- private void MagicResisttextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MagicResist] = temp;
- }
- private void PoisonResisttextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.PoisonResist] = temp;
- }
- private void HealthRecoveryTextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.HealthRecovery] = temp;
- }
- private void SpellRecoverytextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.SpellRecovery] = temp;
- }
- private void PoisonRecoverytextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.PoisonRecovery] = temp;
- }
- private void HporMpRatetextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.HPRatePercent] = temp;
- }
- private void Holytextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Holy] = temp;
- }
- private void Freezingtextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Freezing] = temp;
- }
- private void PoisonAttacktextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.PoisonAttack] = temp;
- }
- private void ClassBasedcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].ClassBased = ClassBasedcheckbox.Checked;
- }
- private void LevelBasedcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].LevelBased = LevelBasedcheckbox.Checked;
- }
- private void Bind_dontdropcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_dontdropcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontDrop : _selectedItemInfos[i].Bind ^= BindMode.DontDrop);
- }
- private void Bind_dontdeathdropcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_dontdeathdropcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontDeathdrop : _selectedItemInfos[i].Bind ^= BindMode.DontDeathdrop);
- }
- private void Bind_destroyondropcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_destroyondropcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DestroyOnDrop : _selectedItemInfos[i].Bind ^= BindMode.DestroyOnDrop);
- }
- private void Bind_dontsellcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_dontsellcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontSell : _selectedItemInfos[i].Bind ^= BindMode.DontSell);
- }
- private void Bind_donttradecheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_donttradecheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontTrade : _selectedItemInfos[i].Bind ^= BindMode.DontTrade);
- }
- private void Bind_dontrepaircheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_dontrepaircheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontRepair : _selectedItemInfos[i].Bind ^= BindMode.DontRepair);
- }
- private void Bind_dontstorecheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_dontstorecheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontStore : _selectedItemInfos[i].Bind ^= BindMode.DontStore);
- }
- private void Bind_dontupgradecheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_dontupgradecheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontUpgrade : _selectedItemInfos[i].Bind ^= BindMode.DontUpgrade);
- }
- private void NeedIdentifycheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].NeedIdentify = NeedIdentifycheckbox.Checked;
- }
- private void ShowGroupPickupcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].ShowGroupPickup = ShowGroupPickupcheckbox.Checked;
- }
- private void BindOnEquipcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (BindOnEquipcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.BindOnEquip : _selectedItemInfos[i].Bind ^= BindMode.BindOnEquip);
- }
- private void MPratetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MPRatePercent] = temp;
- }
- private void HpDrainRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.HPDrainRatePercent] = temp;
- }
- private void ParalysischeckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (ParalysischeckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Paralize : _selectedItemInfos[i].Unique ^= SpecialItemMode.Paralize);
- }
- private void TeleportcheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (TeleportcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Teleport : _selectedItemInfos[i].Unique ^= SpecialItemMode.Teleport);
- }
- private void ClearcheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (ClearcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.ClearRing : _selectedItemInfos[i].Unique ^= SpecialItemMode.ClearRing);
- }
- private void ProtectioncheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (ProtectioncheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Protection : _selectedItemInfos[i].Unique ^= SpecialItemMode.Protection);
- }
- private void RevivalcheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (RevivalcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Revival : _selectedItemInfos[i].Unique ^= SpecialItemMode.Revival);
- }
- private void MusclecheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (MusclecheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Muscle : _selectedItemInfos[i].Unique ^= SpecialItemMode.Muscle);
- }
- private void FlamecheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (FlamecheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Flame : _selectedItemInfos[i].Unique ^= SpecialItemMode.Flame);
- }
- private void HealingcheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (HealingcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Healing : _selectedItemInfos[i].Unique ^= SpecialItemMode.Healing);
- }
- private void ProbecheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (ProbecheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Probe : _selectedItemInfos[i].Unique ^= SpecialItemMode.Probe);
- }
- private void SkillcheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (SkillcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Skill : _selectedItemInfos[i].Unique ^= SpecialItemMode.Skill);
- }
- private void NoDuraLosscheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (NoDuraLosscheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.NoDuraLoss : _selectedItemInfos[i].Unique ^= SpecialItemMode.NoDuraLoss);
- }
- private void StrongTextbox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Strong] = temp;
- }
- private void CriticalRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.CriticalRate] = temp;
- }
- private void CriticalDamagetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.CriticalDamage] = temp;
- }
- private void ReflecttextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.Reflect] = temp;
- }
- private void MaxDCRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxDCRatePercent] = temp;
- }
- private void MaxSCRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxSCRatePercent] = temp;
- }
- private void MaxMCRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.MaxMCRatePercent] = temp;
- }
- private void DamageReductiontextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.DamageReductionPercent] = temp;
- }
- private void ExpRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.ExpRatePercent] = temp;
- }
- private void GoldRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.GoldDropRatePercent] = temp;
- }
- private void DropRatetextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Stats[Stat.ItemDropRatePercent] = temp;
- }
- private void Bind_DontSpecialRepaircheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (Bind_DontSpecialRepaircheckBox.Checked ? _selectedItemInfos[i].Bind |= BindMode.NoSRepair : _selectedItemInfos[i].Bind ^= BindMode.NoSRepair);
- }
- private void BlinkcheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Unique = (BlinkcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Blink : _selectedItemInfos[i].Unique ^= SpecialItemMode.Blink);
- }
- private void LightIntensitytextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- if (temp > 4)
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Light = (byte)((_selectedItemInfos[i].Light % 15) + (15 * temp));
- }
- private void RandomStatstextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- if ((temp >= Settings.RandomItemStatsList.Count) && (temp != 255))
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- {
- _selectedItemInfos[i].RandomStatsId = temp;
- if (temp != 255)
- _selectedItemInfos[i].RandomStats = Settings.RandomItemStatsList[temp];
- else
- _selectedItemInfos[i].RandomStats = null;
- }
- }
- private void PickaxecheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].CanMine = PickaxecheckBox.Checked;
- }
- private void IGradeComboBox_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Grade = (ItemGrade)IGradeComboBox.SelectedItem;
- }
- private void FastRunCheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].CanFastRun = FastRunCheckBox.Checked;
- }
- private void TooltipTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].ToolTip = TooltipTextBox.Text;
- }
- private void CanAwakening_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].CanAwakening = CanAwaken.Checked;
- }
- private void BreakOnDeathcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (BreakOnDeathcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.BreakOnDeath : _selectedItemInfos[i].Bind ^= BindMode.BreakOnDeath);
- }
- private void ItemInfoForm_Load(object sender, EventArgs e)
- {
- }
- private void Gameshop_button_Click(object sender, EventArgs e)
- {
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- Envir.AddToGameShop(_selectedItemInfos[i]);
- Envir.SaveDB();
- }
- private void NoWeddingRingcheckbox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind = (NoWeddingRingcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.NoWeddingRing : _selectedItemInfos[i].Bind ^= BindMode.NoWeddingRing);
- }
- private void unableToRent_CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender)
- return;
- foreach (var selectedItem in _selectedItemInfos)
- selectedItem.Bind = unableToRent_CheckBox.Checked
- ? selectedItem.Bind |= BindMode.UnableToRent
- : selectedItem.Bind ^= BindMode.UnableToRent;
- }
- private void unableToDisassemble_CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender)
- return;
- foreach (var selectedItem in _selectedItemInfos)
- selectedItem.Bind = unableToDisassemble_CheckBox.Checked
- ? selectedItem.Bind |= BindMode.UnableToDisassemble
- : selectedItem.Bind ^= BindMode.UnableToDisassemble;
- }
- private void globalDropNotify_CheckBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender)
- return;
- foreach (var itemInfo in _selectedItemInfos)
- itemInfo.GlobalDropNotify = globalDropNotify_CheckBox.Checked;
- }
- private void noMailBox_CheckedChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Bind =
- (noMailBox.Checked ? _selectedItemInfos[i].Bind |= BindMode.NoMail : _selectedItemInfos[i].Bind ^= BindMode.NoMail);
- }
- private void SlotsTextBox_TextChanged(object sender, EventArgs e)
- {
- if (ActiveControl != sender) return;
- byte temp;
- if (!byte.TryParse(ActiveControl.Text, out temp) || temp > 12)
- {
- ActiveControl.BackColor = Color.Red;
- return;
- }
- ActiveControl.BackColor = SystemColors.Window;
- for (int i = 0; i < _selectedItemInfos.Count; i++)
- _selectedItemInfos[i].Slots = temp;
- }
- }
- }
|