Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class Form1
- Dim ItemLoc As String
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- If (Not System.IO.Directory.Exists("collection")) Then
- MsgBox("ไม่พบ Folder collection")
- Else
- Dim strFileSize As String = ""
- Dim di As New IO.DirectoryInfo("collection")
- Dim aryFi As IO.FileInfo() = di.GetFiles("*.bmp")
- Dim fi As IO.FileInfo
- For Each fi In aryFi
- Dim Name2 As String = fi.Name
- Name2 = Name2.Substring(0, Name2.Length - fi.Extension.Length)
- ListBox1.Items.Add(Name2)
- Next
- lb_countitem.Text = "มีไอเท็มทั้งหมด : " & ListBox1.Items.Count & " ไอเท็ม"
- ProgressBar1.Maximum = ListBox1.Items.Count
- End If
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- If ListBox1.Items.Count > 0 Then
- 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
- MsgBox("กำหนดตำแหน่งของหมวกก่อนนะครับ")
- Else
- If tbx_viewid.Text = "" Or tbx_itemid.Text = "" Then
- MsgBox("ไม่ได้กำหนดค่าวิว หรือ รหัสไอเท็ม")
- Else
- ProgressBar1.Value = 0
- For i = 0 To ListBox1.Items.Count - 1
- ' เพิ่ม accessoryid.lua
- tbx_accessoryid.AppendText("ACCESSORY_" & ListBox1.Items.Item(i).ToString & " = " & tbx_viewid.Text & "," & vbNewLine)
- ' เพิ่ม accname.lua
- tbx_accname.AppendText("[ACCESSORY_IDs.ACCESSORY_" & ListBox1.Items.Item(i).ToString & "] = " & Chr(34) & "_" & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
- ' เพิ่ม ItemInfo.lua
- tbx_ItemInfo.AppendText(" [" & tbx_itemid.Text & "] = {" & vbNewLine)
- tbx_ItemInfo.AppendText(" unidentifiedDisplayName = " & Chr(34) & "HAT" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" unidentifiedResourceName = " & Chr(34) & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" unidentifiedDescriptionName = { " & Chr(34) & "Unknown Item" & Chr(34) & " }," & vbNewLine)
- tbx_ItemInfo.AppendText(" identifiedDisplayName = " & Chr(34) & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" identifiedResourceName = " & Chr(34) & ListBox1.Items.Item(i).ToString & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" identifiedDescriptionName = {" & vbNewLine)
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Custom Item" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Custom Item" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Class:^6666CC Headgear^000000" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Defense:^0000FF " & tbx_defense.Text & "^000000" & Chr(34) & "," & vbNewLine)
- If upper.Checked = True Then
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Upper^000000" & Chr(34) & "," & vbNewLine)
- End If
- If middle.Checked = True Then
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Middle^000000" & Chr(34) & "," & vbNewLine)
- End If
- If lower.Checked = True Then
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Lower^000000" & Chr(34) & "," & vbNewLine)
- End If
- If cosupper.Checked = True Then
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Custume Upper^000000" & Chr(34) & "," & vbNewLine)
- End If
- If cosmiddle.Checked = True Then
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Custume Middle^000000" & Chr(34) & "," & vbNewLine)
- End If
- If coslower.Checked = True Then
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Location:^6666CC Custume Lower^000000" & Chr(34) & "," & vbNewLine)
- End If
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Weight:^006600 " & tbx_weight.Text & "^000000" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Level Requirement:^006600 " & tbx_level.Text & "^000000" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" " & Chr(34) & "Jobs:^6666CC All Classes^000000" & Chr(34) & "," & vbNewLine)
- tbx_ItemInfo.AppendText(" }," & vbNewLine)
- If itemslot_1.Checked = True Then
- tbx_ItemInfo.AppendText(" slotCount = 1," & vbNewLine)
- Else
- tbx_ItemInfo.AppendText(" slotCount = 0," & vbNewLine)
- End If
- tbx_ItemInfo.AppendText(" ClassNum = " & tbx_viewid.Text & vbNewLine)
- tbx_ItemInfo.AppendText(" }," & vbNewLine & vbNewLine)
- If upper.Checked = True Then
- ItemLoc = 256
- End If
- If middle.Checked = True Then
- ItemLoc = 512
- End If
- If lower.Checked = True Then
- ItemLoc = 1
- End If
- If cosupper.Checked = True Then
- ItemLoc = 1024
- End If
- If cosmiddle.Checked = True Then
- ItemLoc = 2048
- End If
- If coslower.Checked = True Then
- ItemLoc = 4096
- End If
- If itemslot_1.Checked = True Then
- 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)
- Else
- 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)
- End If
- tbx_viewid.Text = tbx_viewid.Text + 1
- tbx_itemid.Text = tbx_itemid.Text + 1
- If ProgressBar1.Value < ProgressBar1.Maximum Then
- ProgressBar1.Value = ProgressBar1.Value + 1
- End If
- Next
- MsgBox("เสร็จเรียบร้อบแล้ว")
- End If
- End If
- Else
- MsgBox("ไม่พบชื่อไฟล์ภาพ")
- End If
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- ListBox1.Items.Clear()
- tbx_accessoryid.Clear()
- tbx_accname.Clear()
- tbx_ItemInfo.Clear()
- tbx_item_db.Clear()
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- For i = 1 To 237
- ListBox1.Items.Add("LowerCostume" & i)
- Next
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Button4.Visible = False
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement