Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.57 KB | None | 0 0
  1. Imports System.IO
  2.  
  3. Public Class Form1
  4.  
  5. Dim ItemLoc As String
  6.  
  7. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  8. If (Not System.IO.Directory.Exists("collection")) Then
  9. MsgBox("ไม่พบ Folder collection")
  10. Else
  11. Dim strFileSize As String = ""
  12. Dim di As New IO.DirectoryInfo("collection")
  13. Dim aryFi As IO.FileInfo() = di.GetFiles("*.bmp")
  14. Dim fi As IO.FileInfo
  15. For Each fi In aryFi
  16. Dim Name2 As String = fi.Name
  17. Name2 = Name2.Substring(0, Name2.Length - fi.Extension.Length)
  18. ListBox1.Items.Add(Name2)
  19. Next
  20. lb_countitem.Text = "มีไอเท็มทั้งหมด : " & ListBox1.Items.Count & " ไอเท็ม"
  21. ProgressBar1.Maximum = ListBox1.Items.Count
  22. End If
  23.  
  24.  
  25. End Sub
  26.  
  27. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  28. If ListBox1.Items.Count > 0 Then
  29. If upper.Checked = False And middle.Checked = False And lower.Checked = False And cosupper.Checked = False And cosmiddle.Checked = False And coslower.Checked = False Then
  30. MsgBox("กำหนดตำแหน่งของหมวกก่อนนะครับ")
  31. Else
  32. If tbx_viewid.Text = "" Or tbx_itemid.Text = "" Then
  33. MsgBox("ไม่ได้กำหนดค่าวิว หรือ รหัสไอเท็ม")
  34. Else
  35. ProgressBar1.Value = 0
  36. For i = 0 To ListBox1.Items.Count - 1
  37. ' เพิ่ม accessoryid.lua
  38. tbx_accessoryid.AppendText("ACCESSORY_" & ListBox1.Items.Item(i).ToString & " = " & tbx_viewid.Text & "," & vbNewLine)
  39. ' เพิ่ม accname.lua
  40. tbx_accname.AppendText("[ACCESSORY_IDs.ACCESSORY_" & ListBox1.Items.Item(i).ToString & "] = " & Chr(34) & "_" & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
  41. ' เพิ่ม ItemInfo.lua
  42. tbx_ItemInfo.AppendText(" [" & tbx_itemid.Text & "] = {" & vbNewLine)
  43. tbx_ItemInfo.AppendText(" unidentifiedDisplayName = " & Chr(34) & "HAT" & Chr(34) & "," & vbNewLine)
  44. tbx_ItemInfo.AppendText(" unidentifiedResourceName = " & Chr(34) & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
  45. tbx_ItemInfo.AppendText(" unidentifiedDescriptionName = { " & Chr(34) & "Unknown Item" & Chr(34) & " }," & vbNewLine)
  46. tbx_ItemInfo.AppendText(" identifiedDisplayName = " & Chr(34) & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
  47. tbx_ItemInfo.AppendText(" identifiedResourceName = " & Chr(34) & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
  48. tbx_ItemInfo.AppendText(" identifiedDescriptionName = {" & vbNewLine)
  49. tbx_ItemInfo.AppendText(" " & Chr(34) & "Custom Item" & Chr(34) & "," & vbNewLine)
  50. tbx_ItemInfo.AppendText(" " & Chr(34) & "Custom Item" & Chr(34) & "," & vbNewLine)
  51. tbx_ItemInfo.AppendText(" " & Chr(34) & "Class:^6666CC Headgear^000000" & Chr(34) & "," & vbNewLine)
  52. tbx_ItemInfo.AppendText(" " & Chr(34) & "Defense:^0000FF " & tbx_defense.Text & "^000000" & Chr(34) & "," & vbNewLine)
  53. If upper.Checked = True Then
  54. tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Upper^000000" & Chr(34) & "," & vbNewLine)
  55. End If
  56. If middle.Checked = True Then
  57. tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Middle^000000" & Chr(34) & "," & vbNewLine)
  58. End If
  59. If lower.Checked = True Then
  60. tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Lower^000000" & Chr(34) & "," & vbNewLine)
  61. End If
  62. If cosupper.Checked = True Then
  63. tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Custume Upper^000000" & Chr(34) & "," & vbNewLine)
  64. End If
  65. If cosmiddle.Checked = True Then
  66. tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Custume Middle^000000" & Chr(34) & "," & vbNewLine)
  67. End If
  68. If coslower.Checked = True Then
  69. tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Custume Lower^000000" & Chr(34) & "," & vbNewLine)
  70. End If
  71. tbx_ItemInfo.AppendText(" " & Chr(34) & "Weight:^006600 " & tbx_weight.Text & "^000000" & Chr(34) & "," & vbNewLine)
  72. tbx_ItemInfo.AppendText(" " & Chr(34) & "Level Requirement:^006600 " & tbx_level.Text & "^000000" & Chr(34) & "," & vbNewLine)
  73. tbx_ItemInfo.AppendText(" " & Chr(34) & "Jobs:^6666CC All Classes^000000" & Chr(34) & "," & vbNewLine)
  74. tbx_ItemInfo.AppendText(" }," & vbNewLine)
  75. If itemslot_1.Checked = True Then
  76. tbx_ItemInfo.AppendText(" slotCount = 1," & vbNewLine)
  77. Else
  78. tbx_ItemInfo.AppendText(" slotCount = 0," & vbNewLine)
  79. End If
  80. tbx_ItemInfo.AppendText(" ClassNum = " & tbx_viewid.Text & vbNewLine)
  81. tbx_ItemInfo.AppendText(" }," & vbNewLine & vbNewLine)
  82. If upper.Checked = True Then
  83. ItemLoc = 256
  84. End If
  85. If middle.Checked = True Then
  86. ItemLoc = 512
  87. End If
  88. If lower.Checked = True Then
  89. ItemLoc = 1
  90. End If
  91. If cosupper.Checked = True Then
  92. ItemLoc = 1024
  93. End If
  94. If cosmiddle.Checked = True Then
  95. ItemLoc = 2048
  96. End If
  97. If coslower.Checked = True Then
  98. ItemLoc = 4096
  99. End If
  100. If itemslot_1.Checked = True Then
  101. tbx_item_db.AppendText(tbx_itemid.Text & "," & ListBox1.Items.Item(i).ToString & "," & ListBox1.Items.Item(i).ToString & ",4," & tbx_price.Text & "," & tbx_sell.Text & "," & tbx_weight.Text * 10 & ",," & tbx_defense.Text & ",,1," & tbx_job.Text & ",7,2," & ItemLoc & ",,0,1," & tbx_viewid.Text & ",{ " & tbx_script.Text & " },{},{}" & vbNewLine)
  102. Else
  103. tbx_item_db.AppendText(tbx_itemid.Text & "," & ListBox1.Items.Item(i).ToString & "," & ListBox1.Items.Item(i).ToString & ",4," & tbx_price.Text & "," & tbx_sell.Text & "," & tbx_weight.Text * 10 & ",," & tbx_defense.Text & ",,1," & tbx_job.Text & ",7,2," & ItemLoc & ",,0,0," & tbx_viewid.Text & ",{ " & tbx_script.Text & " },{},{}" & vbNewLine)
  104. End If
  105. tbx_viewid.Text = tbx_viewid.Text + 1
  106. tbx_itemid.Text = tbx_itemid.Text + 1
  107. If ProgressBar1.Value < ProgressBar1.Maximum Then
  108. ProgressBar1.Value = ProgressBar1.Value + 1
  109. End If
  110. Next
  111. MsgBox("เสร็จเรียบร้อบแล้ว")
  112. End If
  113. End If
  114. Else
  115. MsgBox("ไม่พบชื่อไฟล์ภาพ")
  116. End If
  117. End Sub
  118.  
  119. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  120. ListBox1.Items.Clear()
  121. tbx_accessoryid.Clear()
  122. tbx_accname.Clear()
  123. tbx_ItemInfo.Clear()
  124. tbx_item_db.Clear()
  125. End Sub
  126.  
  127. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  128. For i = 1 To 237
  129. ListBox1.Items.Add("LowerCostume" & i)
  130. Next
  131. End Sub
  132.  
  133. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  134. Button4.Visible = False
  135. End Sub
  136. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement