ItemInfoForm.cs 79 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961
  1. using Server.MirEnvir;
  2. namespace Server
  3. {
  4. public partial class ItemInfoForm : Form
  5. {
  6. public string ItemListPath = Path.Combine(Settings.ExportPath, "ItemList.txt");
  7. public Envir Envir => SMain.EditEnvir;
  8. private List<ItemInfo> _selectedItemInfos;
  9. public class ComboBoxItem
  10. {
  11. public string Text { get; set; }
  12. public object Value { get; set; }
  13. public override string ToString()
  14. {
  15. return Text;
  16. }
  17. }
  18. public ItemInfoForm()
  19. {
  20. InitializeComponent();
  21. ITypeComboBox.Items.AddRange(Enum.GetValues(typeof (ItemType)).Cast<object>().ToArray());
  22. IGradeComboBox.Items.AddRange(Enum.GetValues(typeof(ItemGrade)).Cast<object>().ToArray());
  23. RTypeComboBox.Items.AddRange(Enum.GetValues(typeof (RequiredType)).Cast<object>().ToArray());
  24. RClassComboBox.Items.AddRange(Enum.GetValues(typeof (RequiredClass)).Cast<object>().ToArray());
  25. RGenderComboBox.Items.AddRange(Enum.GetValues(typeof (RequiredGender)).Cast<object>().ToArray());
  26. ISetComboBox.Items.AddRange(Enum.GetValues(typeof(ItemSet)).Cast<object>().ToArray());
  27. ITypeFilterComboBox.Items.AddRange(Enum.GetValues(typeof(ItemType)).Cast<object>().ToArray());
  28. ITypeFilterComboBox.Items.Add(new ComboBoxItem { Text = "All" });
  29. ITypeFilterComboBox.SelectedIndex = ITypeFilterComboBox.Items.Count - 1;
  30. UpdateInterface();
  31. }
  32. public void RefreshUniqueTab()
  33. {
  34. if ((ITypeComboBox.SelectedItem != null) && ((ItemType)ITypeComboBox.SelectedItem == ItemType.Gem))
  35. {
  36. tabControl1.TabPages[3].Text = "Usable on";
  37. ParalysischeckBox.Text = "Weapon";
  38. TeleportcheckBox.Text = "Armour";
  39. ClearcheckBox.Text = "Helmet";
  40. ProtectioncheckBox.Text = "Necklace";
  41. RevivalcheckBox.Text = "Bracelet";
  42. MusclecheckBox.Text = "Ring";
  43. FlamecheckBox.Text = "Amulet";
  44. HealingcheckBox.Text = "Belt";
  45. ProbecheckBox.Text = "Boots";
  46. SkillcheckBox.Text = "Stone";
  47. NoDuraLosscheckBox.Text = "Torch";
  48. PickaxecheckBox.Text = "Unused";
  49. label50.Text = "Base rate%";
  50. label52.Text = "Success drop";
  51. label51.Text = "Max stats (all)";
  52. label49.Text = "Max gem stat";
  53. BlinkcheckBox.Text = "Unsure?";
  54. }
  55. else
  56. {
  57. tabControl1.TabPages[3].Text = "Special Stats";
  58. ParalysischeckBox.Text = "Paralysis ring";
  59. TeleportcheckBox.Text = "Teleport ring";
  60. ClearcheckBox.Text = "Clear ring";
  61. ProtectioncheckBox.Text = "Protection ring";
  62. RevivalcheckBox.Text = "Revival ring";
  63. MusclecheckBox.Text = "Muscle ring";
  64. FlamecheckBox.Text = "Flame ring";
  65. HealingcheckBox.Text = "Healing ring";
  66. ProbecheckBox.Text = "Probe necklace";
  67. SkillcheckBox.Text = "Skill necklace";
  68. NoDuraLosscheckBox.Text = "No dura loss";
  69. PickaxecheckBox.Text = "Pickaxe";
  70. label50.Text = "Critical rate:";
  71. label52.Text = "Reflect:";
  72. label51.Text = "Critical Dmg:";
  73. label49.Text = "HP Drain:";
  74. BlinkcheckBox.Text = "Blink";
  75. }
  76. }
  77. public void UpdateInterface(bool refreshList = false)
  78. {
  79. if (refreshList)
  80. {
  81. ItemInfoListBox.Items.Clear();
  82. for (int i = 0; i < Envir.ItemInfoList.Count; i++)
  83. {
  84. if (ITypeFilterComboBox.SelectedItem == null ||
  85. ITypeFilterComboBox.SelectedIndex == ITypeFilterComboBox.Items.Count - 1 ||
  86. Envir.ItemInfoList[i].Type == (ItemType)ITypeFilterComboBox.SelectedItem)
  87. ItemInfoListBox.Items.Add(Envir.ItemInfoList[i]);
  88. }
  89. }
  90. _selectedItemInfos = ItemInfoListBox.SelectedItems.Cast<ItemInfo>().ToList();
  91. if (_selectedItemInfos.Count == 0)
  92. {
  93. ItemInfoPanel.Enabled = false;
  94. ItemIndexTextBox.Text = string.Empty;
  95. ItemNameTextBox.Text = string.Empty;
  96. WeightTextBox.Text = string.Empty;
  97. ImageTextBox.Text = string.Empty;
  98. DuraTextBox.Text = string.Empty;
  99. ITypeComboBox.SelectedItem = null;
  100. IGradeComboBox.SelectedItem = null;
  101. ISetComboBox.SelectedItem = null;
  102. ShapeTextBox.Text = string.Empty;
  103. SSizeTextBox.Text = string.Empty;
  104. PriceTextBox.Text = string.Empty;
  105. RTypeComboBox.SelectedItem = null;
  106. RAmountTextBox.Text = string.Empty;
  107. RClassComboBox.SelectedItem = null;
  108. RGenderComboBox.SelectedItem = null;
  109. LightTextBox.Text = string.Empty;
  110. LightIntensitytextBox.Text = string.Empty;
  111. MinACTextBox.Text = string.Empty;
  112. MaxACTextBox.Text = string.Empty;
  113. MinMACTextBox.Text = string.Empty;
  114. MaxMACTextBox.Text = string.Empty;
  115. MinDCTextBox.Text = string.Empty;
  116. MaxDCTextBox.Text = string.Empty;
  117. MinMCTextBox.Text = string.Empty;
  118. MaxMCTextBox.Text = string.Empty;
  119. MinSCTextBox.Text = string.Empty;
  120. MaxSCTextBox.Text = string.Empty;
  121. HPTextBox.Text = string.Empty;
  122. MPTextBox.Text = string.Empty;
  123. AccuracyTextBox.Text = string.Empty;
  124. AgilityTextBox.Text = string.Empty;
  125. ASpeedTextBox.Text = string.Empty;
  126. LuckTextBox.Text = string.Empty;
  127. StartItemCheckBox.Checked = false;
  128. WWeightTextBox.Text = string.Empty;
  129. HWeightTextBox.Text = string.Empty;
  130. BWeightText.Text = string.Empty;
  131. EffectTextBox.Text = string.Empty;
  132. PoisonRecoverytextBox.Text = string.Empty;
  133. SpellRecoverytextBox.Text = string.Empty;
  134. MagicResisttextBox.Text = string.Empty;
  135. HealthRecoveryTextbox.Text = string.Empty;
  136. StrongTextbox.Text = string.Empty;
  137. MacRateTextbox.Text = string.Empty;
  138. ACRateTextbox.Text = string.Empty;
  139. PoisonResisttextBox.Text = string.Empty;
  140. PoisonAttacktextbox.Text = string.Empty;
  141. Freezingtextbox.Text = string.Empty;
  142. Holytextbox.Text = string.Empty;
  143. HPratetextbox.Text = string.Empty;
  144. MPratetextbox.Text = string.Empty;
  145. HpDrainRatetextBox.Text = string.Empty;
  146. CriticalDamagetextBox.Text = string.Empty;
  147. CriticalRatetextBox.Text = string.Empty;
  148. ReflecttextBox.Text = string.Empty;
  149. MaxDCRatetextBox.Text = string.Empty;
  150. MaxSCRatetextBox.Text = string.Empty;
  151. MaxMCRatetextBox.Text = string.Empty;
  152. DamageReductiontextBox.Text = string.Empty;
  153. ExpRatetextBox.Text = string.Empty;
  154. DropRatetextBox.Text = string.Empty;
  155. GoldRatetextBox.Text = string.Empty;
  156. LevelBasedcheckbox.Checked = false;
  157. ClassBasedcheckbox.Checked = false;
  158. Bind_dontstorecheckbox.Checked = false;
  159. Bind_dontupgradecheckbox.Checked = false;
  160. Bind_dontrepaircheckbox.Checked = false;
  161. Bind_donttradecheckbox.Checked = false;
  162. Bind_dontsellcheckbox.Checked = false;
  163. Bind_destroyondropcheckbox.Checked = false;
  164. Bind_dontdeathdropcheckbox.Checked = false;
  165. Bind_dontdropcheckbox.Checked = false;
  166. Bind_DontSpecialRepaircheckBox.Checked = false;
  167. NeedIdentifycheckbox.Checked = false;
  168. ShowGroupPickupcheckbox.Checked = false;
  169. globalDropNotify_CheckBox.Checked = false;
  170. BindOnEquipcheckbox.Checked = false;
  171. ParalysischeckBox.Checked = false;
  172. TeleportcheckBox.Checked = false;
  173. ClearcheckBox.Checked = false;
  174. ProtectioncheckBox.Checked = false;
  175. RevivalcheckBox.Checked = false;
  176. MusclecheckBox.Checked = false;
  177. FlamecheckBox.Checked = false;
  178. HealingcheckBox.Checked = false;
  179. ProbecheckBox.Checked = false;
  180. SkillcheckBox.Checked = false;
  181. NoDuraLosscheckBox.Checked = false;
  182. RandomStatstextBox.Text = string.Empty;
  183. PickaxecheckBox.Checked = false;
  184. FastRunCheckBox.Checked = false;
  185. CanAwaken.Checked = false;
  186. TooltipTextBox.Text = string.Empty;
  187. BlinkcheckBox.Checked = false;
  188. return;
  189. }
  190. ItemInfo info = _selectedItemInfos[0];
  191. ItemInfoPanel.Enabled = true;
  192. ItemIndexTextBox.Text = info.Index.ToString();
  193. ItemNameTextBox.Text = info.Name;
  194. WeightTextBox.Text = info.Weight.ToString();
  195. ImageTextBox.Text = info.Image.ToString();
  196. DuraTextBox.Text = info.Durability.ToString();
  197. ITypeComboBox.SelectedItem = info.Type;
  198. IGradeComboBox.SelectedItem = info.Grade;
  199. ISetComboBox.SelectedItem = info.Set;
  200. ShapeTextBox.Text = info.Shape.ToString();
  201. SSizeTextBox.Text = info.StackSize.ToString();
  202. PriceTextBox.Text = info.Price.ToString();
  203. RTypeComboBox.SelectedItem = info.RequiredType;
  204. RAmountTextBox.Text = info.RequiredAmount.ToString();
  205. RClassComboBox.SelectedItem = info.RequiredClass;
  206. RGenderComboBox.SelectedItem = info.RequiredGender;
  207. LightTextBox.Text = (info.Light % 15).ToString();
  208. LightIntensitytextBox.Text = (info.Light / 15).ToString();
  209. MinACTextBox.Text = info.Stats[Stat.MinAC].ToString();
  210. MaxACTextBox.Text = info.Stats[Stat.MaxAC].ToString();
  211. MinMACTextBox.Text = info.Stats[Stat.MinMAC].ToString();
  212. MaxMACTextBox.Text = info.Stats[Stat.MaxMAC].ToString();
  213. MinDCTextBox.Text = info.Stats[Stat.MinDC].ToString();
  214. MaxDCTextBox.Text = info.Stats[Stat.MaxDC].ToString();
  215. MinMCTextBox.Text = info.Stats[Stat.MinMC].ToString();
  216. MaxMCTextBox.Text = info.Stats[Stat.MaxMC].ToString();
  217. MinSCTextBox.Text = info.Stats[Stat.MinSC].ToString();
  218. MaxSCTextBox.Text = info.Stats[Stat.MaxSC].ToString();
  219. HPTextBox.Text = info.Stats[Stat.HP].ToString();
  220. MPTextBox.Text = info.Stats[Stat.MP].ToString();
  221. AccuracyTextBox.Text = info.Stats[Stat.Accuracy].ToString();
  222. AgilityTextBox.Text = info.Stats[Stat.Agility].ToString();
  223. ASpeedTextBox.Text = info.Stats[Stat.AttackSpeed].ToString();
  224. LuckTextBox.Text = info.Stats[Stat.Luck].ToString();
  225. WWeightTextBox.Text = info.Stats[Stat.WearWeight].ToString();
  226. HWeightTextBox.Text = info.Stats[Stat.HandWeight].ToString();
  227. BWeightText.Text = info.Stats[Stat.BagWeight].ToString();
  228. StartItemCheckBox.Checked = info.StartItem;
  229. EffectTextBox.Text = info.Effect.ToString();
  230. SlotsTextBox.Text = info.Slots.ToString();
  231. PoisonRecoverytextBox.Text = info.Stats[Stat.PoisonRecovery].ToString();
  232. SpellRecoverytextBox.Text = info.Stats[Stat.SpellRecovery].ToString();
  233. MagicResisttextBox.Text = info.Stats[Stat.MagicResist].ToString();
  234. HealthRecoveryTextbox.Text = info.Stats[Stat.HealthRecovery].ToString();
  235. StrongTextbox.Text = info.Stats[Stat.Strong].ToString();
  236. MacRateTextbox.Text = info.Stats[Stat.MaxMACRatePercent].ToString();
  237. ACRateTextbox.Text = info.Stats[Stat.MaxACRatePercent].ToString();
  238. PoisonResisttextBox.Text = info.Stats[Stat.PoisonResist].ToString();
  239. PoisonAttacktextbox.Text = info.Stats[Stat.PoisonAttack].ToString();
  240. Freezingtextbox.Text = info.Stats[Stat.Freezing].ToString();
  241. Holytextbox.Text = info.Stats[Stat.Holy].ToString();
  242. HPratetextbox.Text = info.Stats[Stat.HPRatePercent].ToString();
  243. MPratetextbox.Text = info.Stats[Stat.MPRatePercent].ToString();
  244. HpDrainRatetextBox.Text = info.Stats[Stat.HPDrainRatePercent].ToString();
  245. CriticalRatetextBox.Text = info.Stats[Stat.CriticalRate].ToString();
  246. CriticalDamagetextBox.Text = info.Stats[Stat.CriticalDamage].ToString();
  247. ReflecttextBox.Text = info.Stats[Stat.Reflect].ToString();
  248. MaxDCRatetextBox.Text = info.Stats[Stat.MaxDCRatePercent].ToString();
  249. MaxSCRatetextBox.Text = info.Stats[Stat.MaxSCRatePercent].ToString();
  250. MaxMCRatetextBox.Text = info.Stats[Stat.MaxMCRatePercent].ToString();
  251. DamageReductiontextBox.Text = info.Stats[Stat.DamageReductionPercent].ToString();
  252. ExpRatetextBox.Text = info.Stats[Stat.ExpRatePercent].ToString();
  253. DropRatetextBox.Text = info.Stats[Stat.ItemDropRatePercent].ToString();
  254. GoldRatetextBox.Text = info.Stats[Stat.GoldDropRatePercent].ToString();
  255. LevelBasedcheckbox.Checked = info.LevelBased;
  256. ClassBasedcheckbox.Checked = info.ClassBased;
  257. Bind_dontstorecheckbox.Checked = info.Bind.HasFlag(BindMode.DontStore);
  258. Bind_dontupgradecheckbox.Checked = info.Bind.HasFlag(BindMode.DontUpgrade);
  259. Bind_dontrepaircheckbox.Checked = info.Bind.HasFlag(BindMode.DontRepair);
  260. Bind_donttradecheckbox.Checked = info.Bind.HasFlag(BindMode.DontTrade);
  261. Bind_dontsellcheckbox.Checked = info.Bind.HasFlag(BindMode.DontSell);
  262. Bind_destroyondropcheckbox.Checked = info.Bind.HasFlag(BindMode.DestroyOnDrop);
  263. Bind_dontdeathdropcheckbox.Checked = info.Bind.HasFlag(BindMode.DontDeathdrop);
  264. Bind_dontdropcheckbox.Checked = info.Bind.HasFlag(BindMode.DontDrop);
  265. Bind_DontSpecialRepaircheckBox.Checked = info.Bind.HasFlag(BindMode.NoSRepair);
  266. BindOnEquipcheckbox.Checked = info.Bind.HasFlag(BindMode.BindOnEquip);
  267. BreakOnDeathcheckbox.Checked = info.Bind.HasFlag(BindMode.BreakOnDeath);
  268. NoWeddingRingcheckbox.Checked = info.Bind.HasFlag(BindMode.NoWeddingRing);
  269. unableToRent_CheckBox.Checked = info.Bind.HasFlag(BindMode.UnableToRent);
  270. unableToDisassemble_CheckBox.Checked = info.Bind.HasFlag(BindMode.UnableToDisassemble);
  271. noMailBox.Checked = info.Bind.HasFlag(BindMode.NoMail);
  272. NeedIdentifycheckbox.Checked = info.NeedIdentify;
  273. ShowGroupPickupcheckbox.Checked = info.ShowGroupPickup;
  274. globalDropNotify_CheckBox.Checked = info.GlobalDropNotify;
  275. ParalysischeckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Paralize);
  276. TeleportcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Teleport);
  277. ClearcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.ClearRing);
  278. ProtectioncheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Protection);
  279. RevivalcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Revival);
  280. MusclecheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Muscle);
  281. FlamecheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Flame);
  282. HealingcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Healing);
  283. ProbecheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Probe);
  284. SkillcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Skill);
  285. NoDuraLosscheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.NoDuraLoss);
  286. RandomStatstextBox.Text = info.RandomStatsId.ToString();
  287. PickaxecheckBox.Checked = info.CanMine;
  288. FastRunCheckBox.Checked = info.CanFastRun;
  289. CanAwaken.Checked = info.CanAwakening;
  290. TooltipTextBox.Text = info.ToolTip;
  291. BlinkcheckBox.Checked = info.Unique.HasFlag(SpecialItemMode.Blink);
  292. for (int i = 1; i < _selectedItemInfos.Count; i++)
  293. {
  294. info = _selectedItemInfos[i];
  295. if (ItemIndexTextBox.Text != info.Index.ToString()) ItemIndexTextBox.Text = string.Empty;
  296. if (ItemNameTextBox.Text != info.Name) ItemNameTextBox.Text = string.Empty;
  297. if (WeightTextBox.Text != info.Weight.ToString()) WeightTextBox.Text = string.Empty;
  298. if (ImageTextBox.Text != info.Image.ToString()) ImageTextBox.Text = string.Empty;
  299. if (DuraTextBox.Text != info.Durability.ToString()) DuraTextBox.Text = string.Empty;
  300. if (ITypeComboBox.SelectedItem == null || (ItemType)ITypeComboBox.SelectedItem != info.Type) ITypeComboBox.SelectedItem = null;
  301. if (IGradeComboBox.SelectedItem == null || (ItemGrade)IGradeComboBox.SelectedItem != info.Grade) IGradeComboBox.SelectedItem = null;
  302. if (ISetComboBox.SelectedItem == null || (ItemSet)ISetComboBox.SelectedItem != info.Set) ISetComboBox.SelectedItem = null;
  303. if (ShapeTextBox.Text != info.Shape.ToString()) ShapeTextBox.Text = string.Empty;
  304. if (SSizeTextBox.Text != info.StackSize.ToString()) SSizeTextBox.Text = string.Empty;
  305. if (PriceTextBox.Text != info.Price.ToString()) PriceTextBox.Text = string.Empty;
  306. if (RTypeComboBox.SelectedItem == null || (RequiredType)RTypeComboBox.SelectedItem != info.RequiredType) RTypeComboBox.SelectedItem = null;
  307. if (RAmountTextBox.Text != info.RequiredAmount.ToString()) RAmountTextBox.Text = string.Empty;
  308. if (RClassComboBox.SelectedItem == null || (RequiredClass)RClassComboBox.SelectedItem != info.RequiredClass) RClassComboBox.SelectedItem = null;
  309. if (RGenderComboBox.SelectedItem == null || (RequiredGender)RGenderComboBox.SelectedItem != info.RequiredGender) RGenderComboBox.SelectedItem = null;
  310. if (LightTextBox.Text != (info.Light % 15).ToString()) LightTextBox.Text = string.Empty;
  311. if (LightIntensitytextBox.Text != (info.Light / 15).ToString()) LightIntensitytextBox.Text = string.Empty;
  312. if (MinACTextBox.Text != info.Stats[Stat.MinAC].ToString()) MinACTextBox.Text = string.Empty;
  313. if (MaxACTextBox.Text != info.Stats[Stat.MaxAC].ToString()) MaxACTextBox.Text = string.Empty;
  314. if (MinMACTextBox.Text != info.Stats[Stat.MinMAC].ToString()) MinMACTextBox.Text = string.Empty;
  315. if (MaxMACTextBox.Text != info.Stats[Stat.MaxMAC].ToString()) MaxMACTextBox.Text = string.Empty;
  316. if (MinDCTextBox.Text != info.Stats[Stat.MinDC].ToString()) MinDCTextBox.Text = string.Empty;
  317. if (MaxDCTextBox.Text != info.Stats[Stat.MaxDC].ToString()) MaxDCTextBox.Text = string.Empty;
  318. if (MinMCTextBox.Text != info.Stats[Stat.MinMC].ToString()) MinMCTextBox.Text = string.Empty;
  319. if (MaxMCTextBox.Text != info.Stats[Stat.MaxMC].ToString()) MaxMCTextBox.Text = string.Empty;
  320. if (MinSCTextBox.Text != info.Stats[Stat.MinSC].ToString()) MinSCTextBox.Text = string.Empty;
  321. if (MaxSCTextBox.Text != info.Stats[Stat.MaxSC].ToString()) MaxSCTextBox.Text = string.Empty;
  322. if (HPTextBox.Text != info.Stats[Stat.HP].ToString()) HPTextBox.Text = string.Empty;
  323. if (MPTextBox.Text != info.Stats[Stat.MP].ToString()) MPTextBox.Text = string.Empty;
  324. if (AccuracyTextBox.Text != info.Stats[Stat.Accuracy].ToString()) AccuracyTextBox.Text = string.Empty;
  325. if (AgilityTextBox.Text != info.Stats[Stat.Agility].ToString()) AgilityTextBox.Text = string.Empty;
  326. if (ASpeedTextBox.Text != info.Stats[Stat.AttackSpeed].ToString()) ASpeedTextBox.Text = string.Empty;
  327. if (LuckTextBox.Text != info.Stats[Stat.Luck].ToString()) LuckTextBox.Text = string.Empty;
  328. if (WWeightTextBox.Text != info.Stats[Stat.WearWeight].ToString()) WWeightTextBox.Text = string.Empty;
  329. if (HWeightTextBox.Text != info.Stats[Stat.HandWeight].ToString()) HWeightTextBox.Text = string.Empty;
  330. if (BWeightText.Text != info.Stats[Stat.BagWeight].ToString()) BWeightText.Text = string.Empty;
  331. if (StartItemCheckBox.Checked != info.StartItem) StartItemCheckBox.CheckState = CheckState.Indeterminate;
  332. if (EffectTextBox.Text != info.Effect.ToString()) EffectTextBox.Text = string.Empty;
  333. if (SlotsTextBox.Text != info.Slots.ToString()) SlotsTextBox.Text = string.Empty;
  334. if (PoisonRecoverytextBox.Text != info.Stats[Stat.PoisonRecovery].ToString()) PoisonRecoverytextBox.Text = string.Empty;
  335. if (SpellRecoverytextBox.Text != info.Stats[Stat.SpellRecovery].ToString()) SpellRecoverytextBox.Text = string.Empty;
  336. if (MagicResisttextBox.Text != info.Stats[Stat.MagicResist].ToString()) MagicResisttextBox.Text = string.Empty;
  337. if (HealthRecoveryTextbox.Text != info.Stats[Stat.HealthRecovery].ToString()) HealthRecoveryTextbox.Text = string.Empty;
  338. if (StrongTextbox.Text != info.Stats[Stat.Strong].ToString()) StrongTextbox.Text = string.Empty;
  339. if (MacRateTextbox.Text != info.Stats[Stat.MaxMACRatePercent].ToString()) MacRateTextbox.Text = string.Empty;
  340. if (ACRateTextbox.Text != info.Stats[Stat.MaxACRatePercent].ToString()) ACRateTextbox.Text = string.Empty;
  341. if (PoisonResisttextBox.Text != info.Stats[Stat.PoisonResist].ToString()) PoisonResisttextBox.Text = string.Empty;
  342. if (PoisonAttacktextbox.Text != info.Stats[Stat.PoisonAttack].ToString()) PoisonAttacktextbox.Text = string.Empty;
  343. if (Freezingtextbox.Text != info.Stats[Stat.Freezing].ToString()) Freezingtextbox.Text = string.Empty;
  344. if (Holytextbox.Text != info.Stats[Stat.Holy].ToString()) Holytextbox.Text = string.Empty;
  345. if (HPratetextbox.Text != info.Stats[Stat.HPRatePercent].ToString()) HPratetextbox.Text = string.Empty;
  346. if (MPratetextbox.Text != info.Stats[Stat.MPRatePercent].ToString()) MPratetextbox.Text = string.Empty;
  347. if (HpDrainRatetextBox.Text != info.Stats[Stat.HPDrainRatePercent].ToString()) HpDrainRatetextBox.Text = string.Empty;
  348. if (CriticalRatetextBox.Text != info.Stats[Stat.CriticalRate].ToString()) CriticalRatetextBox.Text = string.Empty;
  349. if (CriticalDamagetextBox.Text != info.Stats[Stat.CriticalDamage].ToString()) CriticalDamagetextBox.Text = string.Empty;
  350. if (ReflecttextBox.Text != info.Stats[Stat.Reflect].ToString()) ReflecttextBox.Text = string.Empty;
  351. if (MaxDCRatetextBox.Text != info.Stats[Stat.MaxDCRatePercent].ToString()) MaxDCRatetextBox.Text = string.Empty;
  352. if (MaxSCRatetextBox.Text != info.Stats[Stat.MaxSCRatePercent].ToString()) MaxSCRatetextBox.Text = string.Empty;
  353. if (MaxMCRatetextBox.Text != info.Stats[Stat.MaxMCRatePercent].ToString()) MaxMCRatetextBox.Text = string.Empty;
  354. if (DamageReductiontextBox.Text != info.Stats[Stat.DamageReductionPercent].ToString()) DamageReductiontextBox.Text = string.Empty;
  355. if (ExpRatetextBox.Text != info.Stats[Stat.ExpRatePercent].ToString()) ExpRatetextBox.Text = string.Empty;
  356. if (DropRatetextBox.Text != info.Stats[Stat.ItemDropRatePercent].ToString()) DropRatetextBox.Text = string.Empty;
  357. if (GoldRatetextBox.Text != info.Stats[Stat.GoldDropRatePercent].ToString()) GoldRatetextBox.Text = string.Empty;
  358. if (LevelBasedcheckbox.Checked != info.LevelBased) LevelBasedcheckbox.CheckState = CheckState.Indeterminate;
  359. if (ClassBasedcheckbox.Checked != info.ClassBased) ClassBasedcheckbox.CheckState = CheckState.Indeterminate;
  360. if (Bind_dontstorecheckbox.Checked != info.Bind.HasFlag(BindMode.DontStore)) Bind_dontstorecheckbox.CheckState = CheckState.Indeterminate;
  361. if (Bind_dontupgradecheckbox.Checked != info.Bind.HasFlag(BindMode.DontUpgrade)) Bind_dontupgradecheckbox.CheckState = CheckState.Indeterminate;
  362. if (Bind_dontrepaircheckbox.Checked != info.Bind.HasFlag(BindMode.DontRepair)) Bind_dontrepaircheckbox.CheckState = CheckState.Indeterminate;
  363. if (Bind_donttradecheckbox.Checked != info.Bind.HasFlag(BindMode.DontTrade)) Bind_donttradecheckbox.CheckState = CheckState.Indeterminate;
  364. if (Bind_dontsellcheckbox.Checked != info.Bind.HasFlag(BindMode.DontSell)) Bind_dontsellcheckbox.CheckState = CheckState.Indeterminate;
  365. if (Bind_destroyondropcheckbox.Checked != info.Bind.HasFlag(BindMode.DestroyOnDrop)) Bind_destroyondropcheckbox.CheckState = CheckState.Indeterminate;
  366. if (Bind_dontdeathdropcheckbox.Checked != info.Bind.HasFlag(BindMode.DontDeathdrop)) Bind_dontdeathdropcheckbox.CheckState = CheckState.Indeterminate;
  367. if (Bind_dontdropcheckbox.Checked != info.Bind.HasFlag(BindMode.DontDrop)) Bind_dontdropcheckbox.CheckState = CheckState.Indeterminate;
  368. if (Bind_DontSpecialRepaircheckBox.Checked != info.Bind.HasFlag(BindMode.NoSRepair)) Bind_DontSpecialRepaircheckBox.CheckState = CheckState.Indeterminate;
  369. if (BindOnEquipcheckbox.Checked != info.Bind.HasFlag(BindMode.BindOnEquip)) BindOnEquipcheckbox.CheckState = CheckState.Indeterminate;
  370. if (BreakOnDeathcheckbox.Checked != info.Bind.HasFlag(BindMode.BreakOnDeath)) BreakOnDeathcheckbox.CheckState = CheckState.Indeterminate;
  371. if (NoWeddingRingcheckbox.Checked != info.Bind.HasFlag(BindMode.NoWeddingRing)) NoWeddingRingcheckbox.CheckState = CheckState.Indeterminate;
  372. if (unableToRent_CheckBox.Checked != info.Bind.HasFlag(BindMode.UnableToRent))
  373. unableToRent_CheckBox.CheckState = CheckState.Indeterminate;
  374. if (unableToDisassemble_CheckBox.Checked != info.Bind.HasFlag(BindMode.UnableToDisassemble))
  375. unableToDisassemble_CheckBox.CheckState = CheckState.Indeterminate;
  376. if (noMailBox.Checked != info.Bind.HasFlag(BindMode.NoMail)) noMailBox.CheckState = CheckState.Indeterminate;
  377. if (NeedIdentifycheckbox.Checked != info.NeedIdentify) NeedIdentifycheckbox.CheckState = CheckState.Indeterminate;
  378. if (ShowGroupPickupcheckbox.Checked != info.ShowGroupPickup) ShowGroupPickupcheckbox.CheckState = CheckState.Indeterminate;
  379. if (globalDropNotify_CheckBox.Checked != info.GlobalDropNotify)
  380. globalDropNotify_CheckBox.CheckState = CheckState.Indeterminate;
  381. if (ParalysischeckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Paralize)) ParalysischeckBox.CheckState = CheckState.Indeterminate;
  382. if (TeleportcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Teleport)) TeleportcheckBox.CheckState = CheckState.Indeterminate;
  383. if (ClearcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.ClearRing)) ClearcheckBox.CheckState = CheckState.Indeterminate;
  384. if (ProtectioncheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Protection)) ProtectioncheckBox.CheckState = CheckState.Indeterminate;
  385. if (RevivalcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Revival)) RevivalcheckBox.CheckState = CheckState.Indeterminate;
  386. if (MusclecheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Muscle)) MusclecheckBox.CheckState = CheckState.Indeterminate;
  387. if (FlamecheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Flame)) FlamecheckBox.CheckState = CheckState.Indeterminate;
  388. if (HealingcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Healing)) HealingcheckBox.CheckState = CheckState.Indeterminate;
  389. if (ProbecheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Probe)) ProbecheckBox.CheckState = CheckState.Indeterminate;
  390. if (SkillcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Skill)) SkillcheckBox.CheckState = CheckState.Indeterminate;
  391. if (NoDuraLosscheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.NoDuraLoss)) NoDuraLosscheckBox.CheckState = CheckState.Indeterminate;
  392. if (RandomStatstextBox.Text != info.RandomStatsId.ToString()) RandomStatstextBox.Text = string.Empty;
  393. if (PickaxecheckBox.Checked != info.CanMine) PickaxecheckBox.CheckState = CheckState.Indeterminate;
  394. if (FastRunCheckBox.Checked != info.CanFastRun) FastRunCheckBox.CheckState = CheckState.Indeterminate;
  395. if (CanAwaken.Checked != info.CanAwakening) CanAwaken.CheckState = CheckState.Indeterminate;
  396. if (TooltipTextBox.Text != info.ToolTip) TooltipTextBox.Text = string.Empty;
  397. if (BlinkcheckBox.Checked != info.Unique.HasFlag(SpecialItemMode.Blink)) BlinkcheckBox.CheckState = CheckState.Indeterminate;
  398. }
  399. RefreshUniqueTab();
  400. }
  401. private void RefreshItemList()
  402. {
  403. ItemInfoListBox.SelectedIndexChanged -= ItemInfoListBox_SelectedIndexChanged;
  404. List<bool> selected = new List<bool>();
  405. for (int i = 0; i < ItemInfoListBox.Items.Count; i++) selected.Add(ItemInfoListBox.GetSelected(i));
  406. ItemInfoListBox.Items.Clear();
  407. for (int i = 0; i < Envir.ItemInfoList.Count; i++)
  408. {
  409. if (ITypeFilterComboBox.SelectedItem == null ||
  410. ITypeFilterComboBox.SelectedIndex == ITypeFilterComboBox.Items.Count - 1 ||
  411. Envir.ItemInfoList[i].Type == (ItemType)ITypeFilterComboBox.SelectedItem)
  412. ItemInfoListBox.Items.Add(Envir.ItemInfoList[i]);
  413. };
  414. for (int i = 0; i < selected.Count; i++) ItemInfoListBox.SetSelected(i, selected[i]);
  415. ItemInfoListBox.SelectedIndexChanged += ItemInfoListBox_SelectedIndexChanged;
  416. }
  417. private void AddButton_Click(object sender, EventArgs e)
  418. {
  419. if (ITypeFilterComboBox.SelectedIndex == ITypeFilterComboBox.Items.Count - 1)
  420. {
  421. Envir.CreateItemInfo();
  422. ITypeFilterComboBox.SelectedIndex = ITypeFilterComboBox.Items.Count - 1;
  423. }
  424. else
  425. {
  426. Envir.CreateItemInfo((ItemType)ITypeFilterComboBox.SelectedItem);
  427. }
  428. UpdateInterface(true);
  429. }
  430. private void ItemInfoListBox_SelectedIndexChanged(object sender, EventArgs e)
  431. {
  432. UpdateInterface();
  433. }
  434. private void ITypeFilterComboBox_SelectedIndexChanged(object sender, EventArgs e)
  435. {
  436. UpdateInterface(true);
  437. }
  438. private void RemoveButton_Click(object sender, EventArgs e)
  439. {
  440. if (_selectedItemInfos.Count == 0) return;
  441. if (MessageBox.Show("Are you sure you want to remove the selected Items?", "Remove Items?", MessageBoxButtons.YesNo) != DialogResult.Yes) return;
  442. for (int i = 0; i < _selectedItemInfos.Count; i++) Envir.Remove(_selectedItemInfos[i]);
  443. if (Envir.ItemInfoList.Count == 0) Envir.ItemIndex = 0;
  444. UpdateInterface(true);
  445. }
  446. private void ItemNameTextBox_TextChanged(object sender, EventArgs e)
  447. {
  448. if (ActiveControl != sender) return;
  449. for (int i = 0; i < _selectedItemInfos.Count; i++)
  450. _selectedItemInfos[i].Name = ActiveControl.Text;
  451. RefreshItemList();
  452. }
  453. private void ITypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
  454. {
  455. if (ActiveControl != sender) return;
  456. for (int i = 0; i < _selectedItemInfos.Count; i++)
  457. _selectedItemInfos[i].Type = (ItemType)ITypeComboBox.SelectedItem;
  458. }
  459. private void RTypeComboBox_SelectedIndexChanged(object sender, EventArgs e)
  460. {
  461. if (ActiveControl != sender) return;
  462. for (int i = 0; i < _selectedItemInfos.Count; i++)
  463. _selectedItemInfos[i].RequiredType = (RequiredType) RTypeComboBox.SelectedItem;
  464. }
  465. private void RGenderComboBox_SelectedIndexChanged(object sender, EventArgs e)
  466. {
  467. if (ActiveControl != sender) return;
  468. for (int i = 0; i < _selectedItemInfos.Count; i++)
  469. _selectedItemInfos[i].RequiredGender = (RequiredGender)RGenderComboBox.SelectedItem;
  470. }
  471. private void RClassComboBox_SelectedIndexChanged(object sender, EventArgs e)
  472. {
  473. if (ActiveControl != sender) return;
  474. for (int i = 0; i < _selectedItemInfos.Count; i++)
  475. _selectedItemInfos[i].RequiredClass = (RequiredClass)RClassComboBox.SelectedItem;
  476. }
  477. private void StartItemCheckBox_CheckedChanged(object sender, EventArgs e)
  478. {
  479. if (ActiveControl != sender) return;
  480. for (int i = 0; i < _selectedItemInfos.Count; i++)
  481. _selectedItemInfos[i].StartItem = StartItemCheckBox.Checked;
  482. }
  483. private void WeightTextBox_TextChanged(object sender, EventArgs e)
  484. {
  485. if (ActiveControl != sender) return;
  486. byte temp;
  487. if (!byte.TryParse(ActiveControl.Text, out temp))
  488. {
  489. ActiveControl.BackColor = Color.Red;
  490. return;
  491. }
  492. ActiveControl.BackColor = SystemColors.Window;
  493. for (int i = 0; i < _selectedItemInfos.Count; i++)
  494. _selectedItemInfos[i].Weight = temp;
  495. }
  496. private void ImageTextBox_TextChanged(object sender, EventArgs e)
  497. {
  498. if (ActiveControl != sender) return;
  499. ushort temp;
  500. if (!ushort.TryParse(ActiveControl.Text, out temp))
  501. {
  502. ActiveControl.BackColor = Color.Red;
  503. return;
  504. }
  505. ActiveControl.BackColor = SystemColors.Window;
  506. for (int i = 0; i < _selectedItemInfos.Count; i++)
  507. _selectedItemInfos[i].Image = temp;
  508. }
  509. private void DuraTextBox_TextChanged(object sender, EventArgs e)
  510. {
  511. if (ActiveControl != sender) return;
  512. ushort temp;
  513. if (!ushort.TryParse(ActiveControl.Text, out temp))
  514. {
  515. ActiveControl.BackColor = Color.Red;
  516. return;
  517. }
  518. ActiveControl.BackColor = SystemColors.Window;
  519. for (int i = 0; i < _selectedItemInfos.Count; i++)
  520. _selectedItemInfos[i].Durability = temp;
  521. }
  522. private void ShapeTextBox_TextChanged(object sender, EventArgs e)
  523. {
  524. if (ActiveControl != sender) return;
  525. short temp;
  526. if (!short.TryParse(ActiveControl.Text, out temp))
  527. {
  528. ActiveControl.BackColor = Color.Red;
  529. return;
  530. }
  531. ActiveControl.BackColor = SystemColors.Window;
  532. for (int i = 0; i < _selectedItemInfos.Count; i++)
  533. _selectedItemInfos[i].Shape = temp;
  534. }
  535. private void SSizeTextBox_TextChanged(object sender, EventArgs e)
  536. {
  537. if (ActiveControl != sender) return;
  538. ushort temp;
  539. if (!ushort.TryParse(ActiveControl.Text, out temp) || temp > 999)
  540. {
  541. ActiveControl.BackColor = Color.Red;
  542. return;
  543. }
  544. ActiveControl.BackColor = SystemColors.Window;
  545. for (int i = 0; i < _selectedItemInfos.Count; i++)
  546. _selectedItemInfos[i].StackSize = temp;
  547. }
  548. private void PriceTextBox_TextChanged(object sender, EventArgs e)
  549. {
  550. if (ActiveControl != sender) return;
  551. uint temp;
  552. if (!uint.TryParse(ActiveControl.Text, out temp))
  553. {
  554. ActiveControl.BackColor = Color.Red;
  555. return;
  556. }
  557. ActiveControl.BackColor = SystemColors.Window;
  558. for (int i = 0; i < _selectedItemInfos.Count; i++)
  559. _selectedItemInfos[i].Price = temp;
  560. }
  561. private void RAmountTextBox_TextChanged(object sender, EventArgs e)
  562. {
  563. if (ActiveControl != sender) return;
  564. byte temp;
  565. if (!byte.TryParse(ActiveControl.Text, out temp))
  566. {
  567. ActiveControl.BackColor = Color.Red;
  568. return;
  569. }
  570. ActiveControl.BackColor = SystemColors.Window;
  571. for (int i = 0; i < _selectedItemInfos.Count; i++)
  572. _selectedItemInfos[i].RequiredAmount = temp;
  573. }
  574. private void LightTextBox_TextChanged(object sender, EventArgs e)
  575. {
  576. if (ActiveControl != sender) return;
  577. byte temp;
  578. if (!byte.TryParse(ActiveControl.Text, out temp))
  579. {
  580. ActiveControl.BackColor = Color.Red;
  581. return;
  582. }
  583. if (temp > 14)
  584. {
  585. ActiveControl.BackColor = Color.Red;
  586. return;
  587. }
  588. ActiveControl.BackColor = SystemColors.Window;
  589. for (int i = 0; i < _selectedItemInfos.Count; i++)
  590. _selectedItemInfos[i].Light = (byte)(temp + (_selectedItemInfos[i].Light / 15)*15);
  591. }
  592. private void MinACTextBox_TextChanged(object sender, EventArgs e)
  593. {
  594. if (ActiveControl != sender) return;
  595. byte temp;
  596. if (!byte.TryParse(ActiveControl.Text, out temp))
  597. {
  598. ActiveControl.BackColor = Color.Red;
  599. return;
  600. }
  601. ActiveControl.BackColor = SystemColors.Window;
  602. for (int i = 0; i < _selectedItemInfos.Count; i++)
  603. _selectedItemInfos[i].Stats[Stat.MinAC] = temp;
  604. }
  605. private void MaxACTextBox_TextChanged(object sender, EventArgs e)
  606. {
  607. if (ActiveControl != sender) return;
  608. byte temp;
  609. if (!byte.TryParse(ActiveControl.Text, out temp))
  610. {
  611. ActiveControl.BackColor = Color.Red;
  612. return;
  613. }
  614. ActiveControl.BackColor = SystemColors.Window;
  615. for (int i = 0; i < _selectedItemInfos.Count; i++)
  616. _selectedItemInfos[i].Stats[Stat.MaxAC] = temp;
  617. }
  618. private void MinMACTextBox_TextChanged(object sender, EventArgs e)
  619. {
  620. if (ActiveControl != sender) return;
  621. byte temp;
  622. if (!byte.TryParse(ActiveControl.Text, out temp))
  623. {
  624. ActiveControl.BackColor = Color.Red;
  625. return;
  626. }
  627. ActiveControl.BackColor = SystemColors.Window;
  628. for (int i = 0; i < _selectedItemInfos.Count; i++)
  629. _selectedItemInfos[i].Stats[Stat.MinMAC] = temp;
  630. }
  631. private void MaxMACTextBox_TextChanged(object sender, EventArgs e)
  632. {
  633. if (ActiveControl != sender) return;
  634. byte temp;
  635. if (!byte.TryParse(ActiveControl.Text, out temp))
  636. {
  637. ActiveControl.BackColor = Color.Red;
  638. return;
  639. }
  640. ActiveControl.BackColor = SystemColors.Window;
  641. for (int i = 0; i < _selectedItemInfos.Count; i++)
  642. _selectedItemInfos[i].Stats[Stat.MaxMAC] = temp;
  643. }
  644. private void MinDCTextBox_TextChanged(object sender, EventArgs e)
  645. {
  646. if (ActiveControl != sender) return;
  647. byte temp;
  648. if (!byte.TryParse(ActiveControl.Text, out temp))
  649. {
  650. ActiveControl.BackColor = Color.Red;
  651. return;
  652. }
  653. ActiveControl.BackColor = SystemColors.Window;
  654. for (int i = 0; i < _selectedItemInfos.Count; i++)
  655. _selectedItemInfos[i].Stats[Stat.MinDC] = temp;
  656. }
  657. private void MaxDCTextBox_TextChanged(object sender, EventArgs e)
  658. {
  659. if (ActiveControl != sender) return;
  660. byte temp;
  661. if (!byte.TryParse(ActiveControl.Text, out temp))
  662. {
  663. ActiveControl.BackColor = Color.Red;
  664. return;
  665. }
  666. ActiveControl.BackColor = SystemColors.Window;
  667. for (int i = 0; i < _selectedItemInfos.Count; i++)
  668. _selectedItemInfos[i].Stats[Stat.MaxDC] = temp;
  669. }
  670. private void MinMCTextBox_TextChanged(object sender, EventArgs e)
  671. {
  672. if (ActiveControl != sender) return;
  673. byte temp;
  674. if (!byte.TryParse(ActiveControl.Text, out temp))
  675. {
  676. ActiveControl.BackColor = Color.Red;
  677. return;
  678. }
  679. ActiveControl.BackColor = SystemColors.Window;
  680. for (int i = 0; i < _selectedItemInfos.Count; i++)
  681. _selectedItemInfos[i].Stats[Stat.MinMC] = temp;
  682. }
  683. private void MaxMCTextBox_TextChanged(object sender, EventArgs e)
  684. {
  685. if (ActiveControl != sender) return;
  686. byte temp;
  687. if (!byte.TryParse(ActiveControl.Text, out temp))
  688. {
  689. ActiveControl.BackColor = Color.Red;
  690. return;
  691. }
  692. ActiveControl.BackColor = SystemColors.Window;
  693. for (int i = 0; i < _selectedItemInfos.Count; i++)
  694. _selectedItemInfos[i].Stats[Stat.MaxMC] = temp;
  695. }
  696. private void MinSCTextBox_TextChanged(object sender, EventArgs e)
  697. {
  698. if (ActiveControl != sender) return;
  699. byte temp;
  700. if (!byte.TryParse(ActiveControl.Text, out temp))
  701. {
  702. ActiveControl.BackColor = Color.Red;
  703. return;
  704. }
  705. ActiveControl.BackColor = SystemColors.Window;
  706. for (int i = 0; i < _selectedItemInfos.Count; i++)
  707. _selectedItemInfos[i].Stats[Stat.MinSC] = temp;
  708. }
  709. private void MaxSCTextBox_TextChanged(object sender, EventArgs e)
  710. {
  711. if (ActiveControl != sender) return;
  712. byte temp;
  713. if (!byte.TryParse(ActiveControl.Text, out temp))
  714. {
  715. ActiveControl.BackColor = Color.Red;
  716. return;
  717. }
  718. ActiveControl.BackColor = SystemColors.Window;
  719. for (int i = 0; i < _selectedItemInfos.Count; i++)
  720. _selectedItemInfos[i].Stats[Stat.MaxSC] = temp;
  721. }
  722. private void HPTextBox_TextChanged(object sender, EventArgs e)
  723. {
  724. if (ActiveControl != sender) return;
  725. ushort temp;
  726. if (!ushort.TryParse(ActiveControl.Text, out temp))
  727. {
  728. ActiveControl.BackColor = Color.Red;
  729. return;
  730. }
  731. ActiveControl.BackColor = SystemColors.Window;
  732. for (int i = 0; i < _selectedItemInfos.Count; i++)
  733. _selectedItemInfos[i].Stats[Stat.HP] = temp;
  734. }
  735. private void MPTextBox_TextChanged(object sender, EventArgs e)
  736. {
  737. if (ActiveControl != sender) return;
  738. ushort temp;
  739. if (!ushort.TryParse(ActiveControl.Text, out temp))
  740. {
  741. ActiveControl.BackColor = Color.Red;
  742. return;
  743. }
  744. ActiveControl.BackColor = SystemColors.Window;
  745. for (int i = 0; i < _selectedItemInfos.Count; i++)
  746. _selectedItemInfos[i].Stats[Stat.MP] = temp;
  747. }
  748. private void AccuracyTextBox_TextChanged(object sender, EventArgs e)
  749. {
  750. if (ActiveControl != sender) return;
  751. byte temp;
  752. if (!byte.TryParse(ActiveControl.Text, out temp))
  753. {
  754. ActiveControl.BackColor = Color.Red;
  755. return;
  756. }
  757. ActiveControl.BackColor = SystemColors.Window;
  758. for (int i = 0; i < _selectedItemInfos.Count; i++)
  759. _selectedItemInfos[i].Stats[Stat.Accuracy] = temp;
  760. }
  761. private void AgilityTextBox_TextChanged(object sender, EventArgs e)
  762. {
  763. if (ActiveControl != sender) return;
  764. byte temp;
  765. if (!byte.TryParse(ActiveControl.Text, out temp))
  766. {
  767. ActiveControl.BackColor = Color.Red;
  768. return;
  769. }
  770. ActiveControl.BackColor = SystemColors.Window;
  771. for (int i = 0; i < _selectedItemInfos.Count; i++)
  772. _selectedItemInfos[i].Stats[Stat.Agility] = temp;
  773. }
  774. private void ASpeedTextBox_TextChanged(object sender, EventArgs e)
  775. {
  776. if (ActiveControl != sender) return;
  777. sbyte temp;
  778. if (!sbyte.TryParse(ActiveControl.Text, out temp))
  779. {
  780. ActiveControl.BackColor = Color.Red;
  781. return;
  782. }
  783. ActiveControl.BackColor = SystemColors.Window;
  784. for (int i = 0; i < _selectedItemInfos.Count; i++)
  785. _selectedItemInfos[i].Stats[Stat.AttackSpeed] = temp;
  786. }
  787. private void LuckTextBox_TextChanged(object sender, EventArgs e)
  788. {
  789. if (ActiveControl != sender) return;
  790. sbyte temp;
  791. if (!sbyte.TryParse(ActiveControl.Text, out temp))
  792. {
  793. ActiveControl.BackColor = Color.Red;
  794. return;
  795. }
  796. ActiveControl.BackColor = SystemColors.Window;
  797. for (int i = 0; i < _selectedItemInfos.Count; i++)
  798. _selectedItemInfos[i].Stats[Stat.Luck] = temp;
  799. }
  800. private void BWeightText_TextChanged(object sender, EventArgs e)
  801. {
  802. if (ActiveControl != sender) return;
  803. byte temp;
  804. if (!byte.TryParse(ActiveControl.Text, out temp))
  805. {
  806. ActiveControl.BackColor = Color.Red;
  807. return;
  808. }
  809. ActiveControl.BackColor = SystemColors.Window;
  810. for (int i = 0; i < _selectedItemInfos.Count; i++)
  811. _selectedItemInfos[i].Stats[Stat.BagWeight] = temp;
  812. }
  813. private void HWeightTextBox_TextChanged(object sender, EventArgs e)
  814. {
  815. if (ActiveControl != sender) return;
  816. byte temp;
  817. if (!byte.TryParse(ActiveControl.Text, out temp))
  818. {
  819. ActiveControl.BackColor = Color.Red;
  820. return;
  821. }
  822. ActiveControl.BackColor = SystemColors.Window;
  823. for (int i = 0; i < _selectedItemInfos.Count; i++)
  824. _selectedItemInfos[i].Stats[Stat.HandWeight] = temp;
  825. }
  826. private void WWeightTextBox_TextChanged(object sender, EventArgs e)
  827. {
  828. if (ActiveControl != sender) return;
  829. byte temp;
  830. if (!byte.TryParse(ActiveControl.Text, out temp))
  831. {
  832. ActiveControl.BackColor = Color.Red;
  833. return;
  834. }
  835. ActiveControl.BackColor = SystemColors.Window;
  836. for (int i = 0; i < _selectedItemInfos.Count; i++)
  837. _selectedItemInfos[i].Stats[Stat.WearWeight] = temp;
  838. }
  839. private void EffectTextBox_TextChanged(object sender, EventArgs e)
  840. {
  841. if (ActiveControl != sender) return;
  842. byte temp;
  843. if (!byte.TryParse(ActiveControl.Text, out temp))
  844. {
  845. ActiveControl.BackColor = Color.Red;
  846. return;
  847. }
  848. ActiveControl.BackColor = SystemColors.Window;
  849. for (int i = 0; i < _selectedItemInfos.Count; i++)
  850. _selectedItemInfos[i].Effect = temp;
  851. }
  852. private void ItemInfoForm_FormClosed(object sender, FormClosedEventArgs e)
  853. {
  854. Envir.SaveDB();
  855. }
  856. private void PasteButton_Click(object sender, EventArgs e)
  857. {
  858. //string data = Clipboard.GetText();
  859. //if (!data.StartsWith("Item", StringComparison.OrdinalIgnoreCase))
  860. //{
  861. // MessageBox.Show("Cannot Paste, Copied data is not Item Information.");
  862. // return;
  863. //}
  864. //string[] items = data.Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
  865. //for (int i = 1; i < items.Length; i++)
  866. //{
  867. // ItemInfo info = ItemInfo.FromText(items[i]);
  868. // if (info == null) continue;
  869. // info.Index = ++Envir.ItemIndex;
  870. // Envir.ItemInfoList.Add(info);
  871. //}
  872. //UpdateInterface();
  873. }
  874. private void CopyMButton_Click(object sender, EventArgs e)
  875. {
  876. }
  877. private void ExportAllButton_Click(object sender, EventArgs e)
  878. {
  879. //ExportItems(Envir.ItemInfoList);
  880. }
  881. private void ExportSelectedButton_Click(object sender, EventArgs e)
  882. {
  883. //var list = ItemInfoListBox.SelectedItems.Cast<ItemInfo>().ToList();
  884. //ExportItems(list);
  885. }
  886. private void ExportItems(IEnumerable<ItemInfo> items)
  887. {
  888. //var itemInfos = items as ItemInfo[] ?? items.ToArray();
  889. //var list = itemInfos.Select(item => item.ToText()).ToList();
  890. //File.WriteAllLines(ItemListPath, list);
  891. //MessageBox.Show(itemInfos.Count() + " Items have been exported");
  892. }
  893. private void ImportButton_Click(object sender, EventArgs e)
  894. {
  895. //string Path = string.Empty;
  896. //OpenFileDialog ofd = new OpenFileDialog();
  897. //ofd.Filter = "Text File|*.txt";
  898. //ofd.ShowDialog();
  899. //if (ofd.FileName == string.Empty) return;
  900. //Path = ofd.FileName;
  901. //string data;
  902. //using (var sr = new StreamReader(Path))
  903. //{
  904. // data = sr.ReadToEnd();
  905. //}
  906. //var items = data.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
  907. //var count = 0;
  908. //foreach (var info in items.Select(ItemInfo.FromText).Where(info => info != null))
  909. //{
  910. // count++;
  911. // info.Index = ++Envir.ItemIndex;
  912. // Envir.ItemInfoList.Add(info);
  913. //}
  914. //MessageBox.Show(count + " Items have been imported");
  915. //UpdateInterface(true);
  916. }
  917. private void ISetComboBox_SelectedIndexChanged(object sender, EventArgs e)
  918. {
  919. if (ActiveControl != sender) return;
  920. for (int i = 0; i < _selectedItemInfos.Count; i++)
  921. _selectedItemInfos[i].Set = (ItemSet)ISetComboBox.SelectedItem;
  922. }
  923. private void ACRateTextbox_TextChanged(object sender, EventArgs e)
  924. {
  925. if (ActiveControl != sender) return;
  926. byte temp;
  927. if (!byte.TryParse(ActiveControl.Text, out temp))
  928. {
  929. ActiveControl.BackColor = Color.Red;
  930. return;
  931. }
  932. ActiveControl.BackColor = SystemColors.Window;
  933. for (int i = 0; i < _selectedItemInfos.Count; i++)
  934. _selectedItemInfos[i].Stats[Stat.MaxACRatePercent] = temp;
  935. }
  936. private void MacRateTextbox_TextChanged(object sender, EventArgs e)
  937. {
  938. if (ActiveControl != sender) return;
  939. byte temp;
  940. if (!byte.TryParse(ActiveControl.Text, out temp))
  941. {
  942. ActiveControl.BackColor = Color.Red;
  943. return;
  944. }
  945. ActiveControl.BackColor = SystemColors.Window;
  946. for (int i = 0; i < _selectedItemInfos.Count; i++)
  947. _selectedItemInfos[i].Stats[Stat.MaxMACRatePercent] = temp;
  948. }
  949. private void MagicResisttextBox_TextChanged(object sender, EventArgs e)
  950. {
  951. if (ActiveControl != sender) return;
  952. byte temp;
  953. if (!byte.TryParse(ActiveControl.Text, out temp))
  954. {
  955. ActiveControl.BackColor = Color.Red;
  956. return;
  957. }
  958. ActiveControl.BackColor = SystemColors.Window;
  959. for (int i = 0; i < _selectedItemInfos.Count; i++)
  960. _selectedItemInfos[i].Stats[Stat.MagicResist] = temp;
  961. }
  962. private void PoisonResisttextBox_TextChanged(object sender, EventArgs e)
  963. {
  964. if (ActiveControl != sender) return;
  965. byte temp;
  966. if (!byte.TryParse(ActiveControl.Text, out temp))
  967. {
  968. ActiveControl.BackColor = Color.Red;
  969. return;
  970. }
  971. ActiveControl.BackColor = SystemColors.Window;
  972. for (int i = 0; i < _selectedItemInfos.Count; i++)
  973. _selectedItemInfos[i].Stats[Stat.PoisonResist] = temp;
  974. }
  975. private void HealthRecoveryTextbox_TextChanged(object sender, EventArgs e)
  976. {
  977. if (ActiveControl != sender) return;
  978. byte temp;
  979. if (!byte.TryParse(ActiveControl.Text, out temp))
  980. {
  981. ActiveControl.BackColor = Color.Red;
  982. return;
  983. }
  984. ActiveControl.BackColor = SystemColors.Window;
  985. for (int i = 0; i < _selectedItemInfos.Count; i++)
  986. _selectedItemInfos[i].Stats[Stat.HealthRecovery] = temp;
  987. }
  988. private void SpellRecoverytextBox_TextChanged(object sender, EventArgs e)
  989. {
  990. if (ActiveControl != sender) return;
  991. byte temp;
  992. if (!byte.TryParse(ActiveControl.Text, out temp))
  993. {
  994. ActiveControl.BackColor = Color.Red;
  995. return;
  996. }
  997. ActiveControl.BackColor = SystemColors.Window;
  998. for (int i = 0; i < _selectedItemInfos.Count; i++)
  999. _selectedItemInfos[i].Stats[Stat.SpellRecovery] = temp;
  1000. }
  1001. private void PoisonRecoverytextBox_TextChanged(object sender, EventArgs e)
  1002. {
  1003. if (ActiveControl != sender) return;
  1004. byte temp;
  1005. if (!byte.TryParse(ActiveControl.Text, out temp))
  1006. {
  1007. ActiveControl.BackColor = Color.Red;
  1008. return;
  1009. }
  1010. ActiveControl.BackColor = SystemColors.Window;
  1011. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1012. _selectedItemInfos[i].Stats[Stat.PoisonRecovery] = temp;
  1013. }
  1014. private void HporMpRatetextbox_TextChanged(object sender, EventArgs e)
  1015. {
  1016. if (ActiveControl != sender) return;
  1017. byte temp;
  1018. if (!byte.TryParse(ActiveControl.Text, out temp))
  1019. {
  1020. ActiveControl.BackColor = Color.Red;
  1021. return;
  1022. }
  1023. ActiveControl.BackColor = SystemColors.Window;
  1024. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1025. _selectedItemInfos[i].Stats[Stat.HPRatePercent] = temp;
  1026. }
  1027. private void Holytextbox_TextChanged(object sender, EventArgs e)
  1028. {
  1029. if (ActiveControl != sender) return;
  1030. byte temp;
  1031. if (!byte.TryParse(ActiveControl.Text, out temp))
  1032. {
  1033. ActiveControl.BackColor = Color.Red;
  1034. return;
  1035. }
  1036. ActiveControl.BackColor = SystemColors.Window;
  1037. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1038. _selectedItemInfos[i].Stats[Stat.Holy] = temp;
  1039. }
  1040. private void Freezingtextbox_TextChanged(object sender, EventArgs e)
  1041. {
  1042. if (ActiveControl != sender) return;
  1043. byte temp;
  1044. if (!byte.TryParse(ActiveControl.Text, out temp))
  1045. {
  1046. ActiveControl.BackColor = Color.Red;
  1047. return;
  1048. }
  1049. ActiveControl.BackColor = SystemColors.Window;
  1050. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1051. _selectedItemInfos[i].Stats[Stat.Freezing] = temp;
  1052. }
  1053. private void PoisonAttacktextbox_TextChanged(object sender, EventArgs e)
  1054. {
  1055. if (ActiveControl != sender) return;
  1056. byte temp;
  1057. if (!byte.TryParse(ActiveControl.Text, out temp))
  1058. {
  1059. ActiveControl.BackColor = Color.Red;
  1060. return;
  1061. }
  1062. ActiveControl.BackColor = SystemColors.Window;
  1063. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1064. _selectedItemInfos[i].Stats[Stat.PoisonAttack] = temp;
  1065. }
  1066. private void ClassBasedcheckbox_CheckedChanged(object sender, EventArgs e)
  1067. {
  1068. if (ActiveControl != sender) return;
  1069. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1070. _selectedItemInfos[i].ClassBased = ClassBasedcheckbox.Checked;
  1071. }
  1072. private void LevelBasedcheckbox_CheckedChanged(object sender, EventArgs e)
  1073. {
  1074. if (ActiveControl != sender) return;
  1075. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1076. _selectedItemInfos[i].LevelBased = LevelBasedcheckbox.Checked;
  1077. }
  1078. private void Bind_dontdropcheckbox_CheckedChanged(object sender, EventArgs e)
  1079. {
  1080. if (ActiveControl != sender) return;
  1081. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1082. _selectedItemInfos[i].Bind = (Bind_dontdropcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontDrop : _selectedItemInfos[i].Bind ^= BindMode.DontDrop);
  1083. }
  1084. private void Bind_dontdeathdropcheckbox_CheckedChanged(object sender, EventArgs e)
  1085. {
  1086. if (ActiveControl != sender) return;
  1087. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1088. _selectedItemInfos[i].Bind = (Bind_dontdeathdropcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontDeathdrop : _selectedItemInfos[i].Bind ^= BindMode.DontDeathdrop);
  1089. }
  1090. private void Bind_destroyondropcheckbox_CheckedChanged(object sender, EventArgs e)
  1091. {
  1092. if (ActiveControl != sender) return;
  1093. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1094. _selectedItemInfos[i].Bind = (Bind_destroyondropcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DestroyOnDrop : _selectedItemInfos[i].Bind ^= BindMode.DestroyOnDrop);
  1095. }
  1096. private void Bind_dontsellcheckbox_CheckedChanged(object sender, EventArgs e)
  1097. {
  1098. if (ActiveControl != sender) return;
  1099. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1100. _selectedItemInfos[i].Bind = (Bind_dontsellcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontSell : _selectedItemInfos[i].Bind ^= BindMode.DontSell);
  1101. }
  1102. private void Bind_donttradecheckbox_CheckedChanged(object sender, EventArgs e)
  1103. {
  1104. if (ActiveControl != sender) return;
  1105. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1106. _selectedItemInfos[i].Bind = (Bind_donttradecheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontTrade : _selectedItemInfos[i].Bind ^= BindMode.DontTrade);
  1107. }
  1108. private void Bind_dontrepaircheckbox_CheckedChanged(object sender, EventArgs e)
  1109. {
  1110. if (ActiveControl != sender) return;
  1111. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1112. _selectedItemInfos[i].Bind = (Bind_dontrepaircheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontRepair : _selectedItemInfos[i].Bind ^= BindMode.DontRepair);
  1113. }
  1114. private void Bind_dontstorecheckbox_CheckedChanged(object sender, EventArgs e)
  1115. {
  1116. if (ActiveControl != sender) return;
  1117. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1118. _selectedItemInfos[i].Bind = (Bind_dontstorecheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontStore : _selectedItemInfos[i].Bind ^= BindMode.DontStore);
  1119. }
  1120. private void Bind_dontupgradecheckbox_CheckedChanged(object sender, EventArgs e)
  1121. {
  1122. if (ActiveControl != sender) return;
  1123. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1124. _selectedItemInfos[i].Bind = (Bind_dontupgradecheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.DontUpgrade : _selectedItemInfos[i].Bind ^= BindMode.DontUpgrade);
  1125. }
  1126. private void NeedIdentifycheckbox_CheckedChanged(object sender, EventArgs e)
  1127. {
  1128. if (ActiveControl != sender) return;
  1129. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1130. _selectedItemInfos[i].NeedIdentify = NeedIdentifycheckbox.Checked;
  1131. }
  1132. private void ShowGroupPickupcheckbox_CheckedChanged(object sender, EventArgs e)
  1133. {
  1134. if (ActiveControl != sender) return;
  1135. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1136. _selectedItemInfos[i].ShowGroupPickup = ShowGroupPickupcheckbox.Checked;
  1137. }
  1138. private void BindOnEquipcheckbox_CheckedChanged(object sender, EventArgs e)
  1139. {
  1140. if (ActiveControl != sender) return;
  1141. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1142. _selectedItemInfos[i].Bind = (BindOnEquipcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.BindOnEquip : _selectedItemInfos[i].Bind ^= BindMode.BindOnEquip);
  1143. }
  1144. private void MPratetextBox_TextChanged(object sender, EventArgs e)
  1145. {
  1146. if (ActiveControl != sender) return;
  1147. byte temp;
  1148. if (!byte.TryParse(ActiveControl.Text, out temp))
  1149. {
  1150. ActiveControl.BackColor = Color.Red;
  1151. return;
  1152. }
  1153. ActiveControl.BackColor = SystemColors.Window;
  1154. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1155. _selectedItemInfos[i].Stats[Stat.MPRatePercent] = temp;
  1156. }
  1157. private void HpDrainRatetextBox_TextChanged(object sender, EventArgs e)
  1158. {
  1159. if (ActiveControl != sender) return;
  1160. byte temp;
  1161. if (!byte.TryParse(ActiveControl.Text, out temp))
  1162. {
  1163. ActiveControl.BackColor = Color.Red;
  1164. return;
  1165. }
  1166. ActiveControl.BackColor = SystemColors.Window;
  1167. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1168. _selectedItemInfos[i].Stats[Stat.HPDrainRatePercent] = temp;
  1169. }
  1170. private void ParalysischeckBox_CheckedChanged(object sender, EventArgs e)
  1171. {
  1172. if (ActiveControl != sender) return;
  1173. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1174. _selectedItemInfos[i].Unique = (ParalysischeckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Paralize : _selectedItemInfos[i].Unique ^= SpecialItemMode.Paralize);
  1175. }
  1176. private void TeleportcheckBox_CheckedChanged(object sender, EventArgs e)
  1177. {
  1178. if (ActiveControl != sender) return;
  1179. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1180. _selectedItemInfos[i].Unique = (TeleportcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Teleport : _selectedItemInfos[i].Unique ^= SpecialItemMode.Teleport);
  1181. }
  1182. private void ClearcheckBox_CheckedChanged(object sender, EventArgs e)
  1183. {
  1184. if (ActiveControl != sender) return;
  1185. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1186. _selectedItemInfos[i].Unique = (ClearcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.ClearRing : _selectedItemInfos[i].Unique ^= SpecialItemMode.ClearRing);
  1187. }
  1188. private void ProtectioncheckBox_CheckedChanged(object sender, EventArgs e)
  1189. {
  1190. if (ActiveControl != sender) return;
  1191. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1192. _selectedItemInfos[i].Unique = (ProtectioncheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Protection : _selectedItemInfos[i].Unique ^= SpecialItemMode.Protection);
  1193. }
  1194. private void RevivalcheckBox_CheckedChanged(object sender, EventArgs e)
  1195. {
  1196. if (ActiveControl != sender) return;
  1197. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1198. _selectedItemInfos[i].Unique = (RevivalcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Revival : _selectedItemInfos[i].Unique ^= SpecialItemMode.Revival);
  1199. }
  1200. private void MusclecheckBox_CheckedChanged(object sender, EventArgs e)
  1201. {
  1202. if (ActiveControl != sender) return;
  1203. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1204. _selectedItemInfos[i].Unique = (MusclecheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Muscle : _selectedItemInfos[i].Unique ^= SpecialItemMode.Muscle);
  1205. }
  1206. private void FlamecheckBox_CheckedChanged(object sender, EventArgs e)
  1207. {
  1208. if (ActiveControl != sender) return;
  1209. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1210. _selectedItemInfos[i].Unique = (FlamecheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Flame : _selectedItemInfos[i].Unique ^= SpecialItemMode.Flame);
  1211. }
  1212. private void HealingcheckBox_CheckedChanged(object sender, EventArgs e)
  1213. {
  1214. if (ActiveControl != sender) return;
  1215. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1216. _selectedItemInfos[i].Unique = (HealingcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Healing : _selectedItemInfos[i].Unique ^= SpecialItemMode.Healing);
  1217. }
  1218. private void ProbecheckBox_CheckedChanged(object sender, EventArgs e)
  1219. {
  1220. if (ActiveControl != sender) return;
  1221. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1222. _selectedItemInfos[i].Unique = (ProbecheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Probe : _selectedItemInfos[i].Unique ^= SpecialItemMode.Probe);
  1223. }
  1224. private void SkillcheckBox_CheckedChanged(object sender, EventArgs e)
  1225. {
  1226. if (ActiveControl != sender) return;
  1227. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1228. _selectedItemInfos[i].Unique = (SkillcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Skill : _selectedItemInfos[i].Unique ^= SpecialItemMode.Skill);
  1229. }
  1230. private void NoDuraLosscheckBox_CheckedChanged(object sender, EventArgs e)
  1231. {
  1232. if (ActiveControl != sender) return;
  1233. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1234. _selectedItemInfos[i].Unique = (NoDuraLosscheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.NoDuraLoss : _selectedItemInfos[i].Unique ^= SpecialItemMode.NoDuraLoss);
  1235. }
  1236. private void StrongTextbox_TextChanged(object sender, EventArgs e)
  1237. {
  1238. if (ActiveControl != sender) return;
  1239. byte temp;
  1240. if (!byte.TryParse(ActiveControl.Text, out temp))
  1241. {
  1242. ActiveControl.BackColor = Color.Red;
  1243. return;
  1244. }
  1245. ActiveControl.BackColor = SystemColors.Window;
  1246. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1247. _selectedItemInfos[i].Stats[Stat.Strong] = temp;
  1248. }
  1249. private void CriticalRatetextBox_TextChanged(object sender, EventArgs e)
  1250. {
  1251. if (ActiveControl != sender) return;
  1252. byte temp;
  1253. if (!byte.TryParse(ActiveControl.Text, out temp))
  1254. {
  1255. ActiveControl.BackColor = Color.Red;
  1256. return;
  1257. }
  1258. ActiveControl.BackColor = SystemColors.Window;
  1259. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1260. _selectedItemInfos[i].Stats[Stat.CriticalRate] = temp;
  1261. }
  1262. private void CriticalDamagetextBox_TextChanged(object sender, EventArgs e)
  1263. {
  1264. if (ActiveControl != sender) return;
  1265. byte temp;
  1266. if (!byte.TryParse(ActiveControl.Text, out temp))
  1267. {
  1268. ActiveControl.BackColor = Color.Red;
  1269. return;
  1270. }
  1271. ActiveControl.BackColor = SystemColors.Window;
  1272. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1273. _selectedItemInfos[i].Stats[Stat.CriticalDamage] = temp;
  1274. }
  1275. private void ReflecttextBox_TextChanged(object sender, EventArgs e)
  1276. {
  1277. if (ActiveControl != sender) return;
  1278. byte temp;
  1279. if (!byte.TryParse(ActiveControl.Text, out temp))
  1280. {
  1281. ActiveControl.BackColor = Color.Red;
  1282. return;
  1283. }
  1284. ActiveControl.BackColor = SystemColors.Window;
  1285. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1286. _selectedItemInfos[i].Stats[Stat.Reflect] = temp;
  1287. }
  1288. private void MaxDCRatetextBox_TextChanged(object sender, EventArgs e)
  1289. {
  1290. if (ActiveControl != sender) return;
  1291. byte temp;
  1292. if (!byte.TryParse(ActiveControl.Text, out temp))
  1293. {
  1294. ActiveControl.BackColor = Color.Red;
  1295. return;
  1296. }
  1297. ActiveControl.BackColor = SystemColors.Window;
  1298. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1299. _selectedItemInfos[i].Stats[Stat.MaxDCRatePercent] = temp;
  1300. }
  1301. private void MaxSCRatetextBox_TextChanged(object sender, EventArgs e)
  1302. {
  1303. if (ActiveControl != sender) return;
  1304. byte temp;
  1305. if (!byte.TryParse(ActiveControl.Text, out temp))
  1306. {
  1307. ActiveControl.BackColor = Color.Red;
  1308. return;
  1309. }
  1310. ActiveControl.BackColor = SystemColors.Window;
  1311. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1312. _selectedItemInfos[i].Stats[Stat.MaxSCRatePercent] = temp;
  1313. }
  1314. private void MaxMCRatetextBox_TextChanged(object sender, EventArgs e)
  1315. {
  1316. if (ActiveControl != sender) return;
  1317. byte temp;
  1318. if (!byte.TryParse(ActiveControl.Text, out temp))
  1319. {
  1320. ActiveControl.BackColor = Color.Red;
  1321. return;
  1322. }
  1323. ActiveControl.BackColor = SystemColors.Window;
  1324. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1325. _selectedItemInfos[i].Stats[Stat.MaxMCRatePercent] = temp;
  1326. }
  1327. private void DamageReductiontextBox_TextChanged(object sender, EventArgs e)
  1328. {
  1329. if (ActiveControl != sender) return;
  1330. byte temp;
  1331. if (!byte.TryParse(ActiveControl.Text, out temp))
  1332. {
  1333. ActiveControl.BackColor = Color.Red;
  1334. return;
  1335. }
  1336. ActiveControl.BackColor = SystemColors.Window;
  1337. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1338. _selectedItemInfos[i].Stats[Stat.DamageReductionPercent] = temp;
  1339. }
  1340. private void ExpRatetextBox_TextChanged(object sender, EventArgs e)
  1341. {
  1342. if (ActiveControl != sender) return;
  1343. byte temp;
  1344. if (!byte.TryParse(ActiveControl.Text, out temp))
  1345. {
  1346. ActiveControl.BackColor = Color.Red;
  1347. return;
  1348. }
  1349. ActiveControl.BackColor = SystemColors.Window;
  1350. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1351. _selectedItemInfos[i].Stats[Stat.ExpRatePercent] = temp;
  1352. }
  1353. private void GoldRatetextBox_TextChanged(object sender, EventArgs e)
  1354. {
  1355. if (ActiveControl != sender) return;
  1356. byte temp;
  1357. if (!byte.TryParse(ActiveControl.Text, out temp))
  1358. {
  1359. ActiveControl.BackColor = Color.Red;
  1360. return;
  1361. }
  1362. ActiveControl.BackColor = SystemColors.Window;
  1363. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1364. _selectedItemInfos[i].Stats[Stat.GoldDropRatePercent] = temp;
  1365. }
  1366. private void DropRatetextBox_TextChanged(object sender, EventArgs e)
  1367. {
  1368. if (ActiveControl != sender) return;
  1369. byte temp;
  1370. if (!byte.TryParse(ActiveControl.Text, out temp))
  1371. {
  1372. ActiveControl.BackColor = Color.Red;
  1373. return;
  1374. }
  1375. ActiveControl.BackColor = SystemColors.Window;
  1376. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1377. _selectedItemInfos[i].Stats[Stat.ItemDropRatePercent] = temp;
  1378. }
  1379. private void Bind_DontSpecialRepaircheckBox_CheckedChanged(object sender, EventArgs e)
  1380. {
  1381. if (ActiveControl != sender) return;
  1382. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1383. _selectedItemInfos[i].Bind = (Bind_DontSpecialRepaircheckBox.Checked ? _selectedItemInfos[i].Bind |= BindMode.NoSRepair : _selectedItemInfos[i].Bind ^= BindMode.NoSRepair);
  1384. }
  1385. private void BlinkcheckBox_CheckedChanged(object sender, EventArgs e)
  1386. {
  1387. if (ActiveControl != sender) return;
  1388. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1389. _selectedItemInfos[i].Unique = (BlinkcheckBox.Checked ? _selectedItemInfos[i].Unique |= SpecialItemMode.Blink : _selectedItemInfos[i].Unique ^= SpecialItemMode.Blink);
  1390. }
  1391. private void LightIntensitytextBox_TextChanged(object sender, EventArgs e)
  1392. {
  1393. if (ActiveControl != sender) return;
  1394. byte temp;
  1395. if (!byte.TryParse(ActiveControl.Text, out temp))
  1396. {
  1397. ActiveControl.BackColor = Color.Red;
  1398. return;
  1399. }
  1400. if (temp > 4)
  1401. {
  1402. ActiveControl.BackColor = Color.Red;
  1403. return;
  1404. }
  1405. ActiveControl.BackColor = SystemColors.Window;
  1406. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1407. _selectedItemInfos[i].Light = (byte)((_selectedItemInfos[i].Light % 15) + (15 * temp));
  1408. }
  1409. private void RandomStatstextBox_TextChanged(object sender, EventArgs e)
  1410. {
  1411. if (ActiveControl != sender) return;
  1412. byte temp;
  1413. if (!byte.TryParse(ActiveControl.Text, out temp))
  1414. {
  1415. ActiveControl.BackColor = Color.Red;
  1416. return;
  1417. }
  1418. if ((temp >= Settings.RandomItemStatsList.Count) && (temp != 255))
  1419. {
  1420. ActiveControl.BackColor = Color.Red;
  1421. return;
  1422. }
  1423. ActiveControl.BackColor = SystemColors.Window;
  1424. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1425. {
  1426. _selectedItemInfos[i].RandomStatsId = temp;
  1427. if (temp != 255)
  1428. _selectedItemInfos[i].RandomStats = Settings.RandomItemStatsList[temp];
  1429. else
  1430. _selectedItemInfos[i].RandomStats = null;
  1431. }
  1432. }
  1433. private void PickaxecheckBox_CheckedChanged(object sender, EventArgs e)
  1434. {
  1435. if (ActiveControl != sender) return;
  1436. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1437. _selectedItemInfos[i].CanMine = PickaxecheckBox.Checked;
  1438. }
  1439. private void IGradeComboBox_SelectedIndexChanged(object sender, EventArgs e)
  1440. {
  1441. if (ActiveControl != sender) return;
  1442. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1443. _selectedItemInfos[i].Grade = (ItemGrade)IGradeComboBox.SelectedItem;
  1444. }
  1445. private void FastRunCheckBox_CheckedChanged(object sender, EventArgs e)
  1446. {
  1447. if (ActiveControl != sender) return;
  1448. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1449. _selectedItemInfos[i].CanFastRun = FastRunCheckBox.Checked;
  1450. }
  1451. private void TooltipTextBox_TextChanged(object sender, EventArgs e)
  1452. {
  1453. if (ActiveControl != sender) return;
  1454. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1455. _selectedItemInfos[i].ToolTip = TooltipTextBox.Text;
  1456. }
  1457. private void CanAwakening_CheckedChanged(object sender, EventArgs e)
  1458. {
  1459. if (ActiveControl != sender) return;
  1460. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1461. _selectedItemInfos[i].CanAwakening = CanAwaken.Checked;
  1462. }
  1463. private void BreakOnDeathcheckbox_CheckedChanged(object sender, EventArgs e)
  1464. {
  1465. if (ActiveControl != sender) return;
  1466. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1467. _selectedItemInfos[i].Bind = (BreakOnDeathcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.BreakOnDeath : _selectedItemInfos[i].Bind ^= BindMode.BreakOnDeath);
  1468. }
  1469. private void ItemInfoForm_Load(object sender, EventArgs e)
  1470. {
  1471. }
  1472. private void Gameshop_button_Click(object sender, EventArgs e)
  1473. {
  1474. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1475. Envir.AddToGameShop(_selectedItemInfos[i]);
  1476. Envir.SaveDB();
  1477. }
  1478. private void NoWeddingRingcheckbox_CheckedChanged(object sender, EventArgs e)
  1479. {
  1480. if (ActiveControl != sender) return;
  1481. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1482. _selectedItemInfos[i].Bind = (NoWeddingRingcheckbox.Checked ? _selectedItemInfos[i].Bind |= BindMode.NoWeddingRing : _selectedItemInfos[i].Bind ^= BindMode.NoWeddingRing);
  1483. }
  1484. private void unableToRent_CheckBox_CheckedChanged(object sender, EventArgs e)
  1485. {
  1486. if (ActiveControl != sender)
  1487. return;
  1488. foreach (var selectedItem in _selectedItemInfos)
  1489. selectedItem.Bind = unableToRent_CheckBox.Checked
  1490. ? selectedItem.Bind |= BindMode.UnableToRent
  1491. : selectedItem.Bind ^= BindMode.UnableToRent;
  1492. }
  1493. private void unableToDisassemble_CheckBox_CheckedChanged(object sender, EventArgs e)
  1494. {
  1495. if (ActiveControl != sender)
  1496. return;
  1497. foreach (var selectedItem in _selectedItemInfos)
  1498. selectedItem.Bind = unableToDisassemble_CheckBox.Checked
  1499. ? selectedItem.Bind |= BindMode.UnableToDisassemble
  1500. : selectedItem.Bind ^= BindMode.UnableToDisassemble;
  1501. }
  1502. private void globalDropNotify_CheckBox_CheckedChanged(object sender, EventArgs e)
  1503. {
  1504. if (ActiveControl != sender)
  1505. return;
  1506. foreach (var itemInfo in _selectedItemInfos)
  1507. itemInfo.GlobalDropNotify = globalDropNotify_CheckBox.Checked;
  1508. }
  1509. private void noMailBox_CheckedChanged(object sender, EventArgs e)
  1510. {
  1511. if (ActiveControl != sender) return;
  1512. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1513. _selectedItemInfos[i].Bind =
  1514. (noMailBox.Checked ? _selectedItemInfos[i].Bind |= BindMode.NoMail : _selectedItemInfos[i].Bind ^= BindMode.NoMail);
  1515. }
  1516. private void SlotsTextBox_TextChanged(object sender, EventArgs e)
  1517. {
  1518. if (ActiveControl != sender) return;
  1519. byte temp;
  1520. if (!byte.TryParse(ActiveControl.Text, out temp) || temp > 12)
  1521. {
  1522. ActiveControl.BackColor = Color.Red;
  1523. return;
  1524. }
  1525. ActiveControl.BackColor = SystemColors.Window;
  1526. for (int i = 0; i < _selectedItemInfos.Count; i++)
  1527. _selectedItemInfos[i].Slots = temp;
  1528. }
  1529. }
  1530. }