adjustment
This commit is contained in:
@@ -2,6 +2,17 @@ package item
|
||||
|
||||
import "strings"
|
||||
|
||||
const (
|
||||
ExpCharItemIDThreshold = 508
|
||||
ExpCharItemIDOffset = 15
|
||||
)
|
||||
|
||||
var ExpChar uint16
|
||||
|
||||
func SetExpChar(expChar uint16) {
|
||||
ExpChar = expChar
|
||||
}
|
||||
|
||||
const (
|
||||
ScrollOfTownPortal = "ScrollOfTownPortal"
|
||||
ScrollOfIdentify = "ScrollOfIdentify"
|
||||
@@ -11,15 +22,22 @@ const (
|
||||
)
|
||||
|
||||
func GetNameByEnum(itemNumber uint) Name {
|
||||
if int(itemNumber) >= len(Names) {
|
||||
idx := int(itemNumber)
|
||||
if ExpChar >= 3 && idx >= ExpCharItemIDThreshold {
|
||||
idx += ExpCharItemIDOffset
|
||||
}
|
||||
if idx < 0 || idx >= len(Names) {
|
||||
return Name("")
|
||||
}
|
||||
return Name(Names[itemNumber])
|
||||
return Name(Names[idx])
|
||||
}
|
||||
|
||||
func GetIDByName(itemName string) int {
|
||||
for i, name := range Names {
|
||||
if strings.EqualFold(name, itemName) {
|
||||
if ExpChar >= 3 && i >= ExpCharItemIDThreshold+ExpCharItemIDOffset {
|
||||
return i - ExpCharItemIDOffset
|
||||
}
|
||||
return i
|
||||
}
|
||||
}
|
||||
@@ -63,7 +81,7 @@ var Names = []string{
|
||||
"BroadSword",
|
||||
"LongSword",
|
||||
"WarSword",
|
||||
"Two-HandedSword",
|
||||
"TwoHandedSword",
|
||||
"Claymore",
|
||||
"GiantSword",
|
||||
"BastardSword",
|
||||
@@ -184,7 +202,7 @@ var Names = []string{
|
||||
"Bill",
|
||||
"BattleScythe",
|
||||
"Partizan",
|
||||
"Bec-de-Corbin",
|
||||
"BecDeCorbin",
|
||||
"GrimScythe",
|
||||
"JoStaff",
|
||||
"Quarterstaff",
|
||||
@@ -202,7 +220,7 @@ var Names = []string{
|
||||
"Arbalest",
|
||||
"SiegeCrossbow",
|
||||
"Ballista",
|
||||
"Chu-Ko-Nu",
|
||||
"ChuKoNu",
|
||||
"KhalimsFlail",
|
||||
"KhalimsWill",
|
||||
"Katar",
|
||||
@@ -232,7 +250,7 @@ var Names = []string{
|
||||
"WarSpike",
|
||||
"BerserkerAxe",
|
||||
"FeralAxe",
|
||||
"Silver-edgedAxe",
|
||||
"SilverEdgedAxe",
|
||||
"Decapitator",
|
||||
"ChampionAxe",
|
||||
"GloriousAxe",
|
||||
|
||||
@@ -35,7 +35,6 @@ const (
|
||||
BloodCrescent UniqueName = "Blood Crescent"
|
||||
KrintizsSkewer UniqueName = "Krintizs Skewer"
|
||||
Gleamscythe UniqueName = "Gleamscythe"
|
||||
AzurewrathCrystalSword UniqueName = "Azurewrath"
|
||||
GriswoldsEdge UniqueName = "Griswolds Edge"
|
||||
Hellplague UniqueName = "Hellplague"
|
||||
CulwensPoint UniqueName = "Culwens Point"
|
||||
@@ -267,7 +266,6 @@ const (
|
||||
Doombringer UniqueName = "Doombringer"
|
||||
TheGrandfather UniqueName = "The Grandfather"
|
||||
Wizardspike UniqueName = "Wizardspike"
|
||||
ConstrictingRing UniqueName = "Constricting Ring"
|
||||
Stormspire UniqueName = "Stormspire"
|
||||
Eaglehorn UniqueName = "Eaglehorn"
|
||||
Windforce UniqueName = "Windforce"
|
||||
@@ -440,36 +438,35 @@ type UniqueItemInfo struct {
|
||||
}
|
||||
|
||||
var UniqueItems = map[UniqueName]UniqueItemInfo{
|
||||
TheGnasher: {Name: "The Gnasher", Code: "hax", LevelReq: 5, Rarity: 1, ID: 0},
|
||||
Deathspade: {Name: "Deathspade", Code: "axe", LevelReq: 9, Rarity: 1, ID: 1},
|
||||
Bladebone: {Name: "Bladebone", Code: "2ax", LevelReq: 15, Rarity: 1, ID: 2},
|
||||
Mindrend: {Name: "Mindrend", Code: "mpi", LevelReq: 21, Rarity: 1, ID: 3},
|
||||
Rakescar: {Name: "Rakescar", Code: "wax", LevelReq: 27, Rarity: 1, ID: 4},
|
||||
FechmarsAxe: {Name: "Fechmars Axe", Code: "lax", LevelReq: 8, Rarity: 1, ID: 5},
|
||||
Goreshovel: {Name: "Goreshovel", Code: "bax", LevelReq: 14, Rarity: 1, ID: 6},
|
||||
TheChieftan: {Name: "The Chieftan", Code: "btx", LevelReq: 19, Rarity: 1, ID: 7},
|
||||
Brainhew: {Name: "Brainhew", Code: "gax", LevelReq: 25, Rarity: 1, ID: 8},
|
||||
TheHumongous: {Name: "The Humongous", Code: "gix", LevelReq: 29, Rarity: 1, ID: 9},
|
||||
IrosTorch: {Name: "Iros Torch", Code: "wnd", LevelReq: 5, Rarity: 1, ID: 10},
|
||||
Maelstromwrath: {Name: "Maelstromwrath", Code: "ywn", LevelReq: 14, Rarity: 1, ID: 11},
|
||||
Gravenspine: {Name: "Gravenspine", Code: "bwn", LevelReq: 20, Rarity: 1, ID: 12},
|
||||
UmesLament: {Name: "Umes Lament", Code: "gwn", LevelReq: 28, Rarity: 1, ID: 13},
|
||||
Felloak: {Name: "Felloak", Code: "clb", LevelReq: 3, Rarity: 1, ID: 14},
|
||||
KnellStriker: {Name: "Knell Striker", Code: "scp", LevelReq: 5, Rarity: 1, ID: 15},
|
||||
Rusthandle: {Name: "Rusthandle", Code: "gsc", LevelReq: 17, Rarity: 1, ID: 16},
|
||||
Stormeye: {Name: "Stormeye", Code: "wsp", LevelReq: 23, Rarity: 1, ID: 17},
|
||||
Stoutnail: {Name: "Stoutnail", Code: "spc", LevelReq: 5, Rarity: 1, ID: 18},
|
||||
Crushflange: {Name: "Crushflange", Code: "mac", LevelReq: 9, Rarity: 1, ID: 19},
|
||||
Bloodrise: {Name: "Bloodrise", Code: "mst", LevelReq: 15, Rarity: 1, ID: 20},
|
||||
TheGeneralsTanDoLiGa: {Name: "The Generals Tan Do Li Ga", Code: "fla", LevelReq: 21, Rarity: 1, ID: 21},
|
||||
Ironstone: {Name: "Ironstone", Code: "whm", LevelReq: 27, Rarity: 1, ID: 22},
|
||||
Bonesob: {Name: "Bonesob", Code: "mau", LevelReq: 24, Rarity: 1, ID: 23},
|
||||
Steeldriver: {Name: "Steeldriver", Code: "gma", LevelReq: 29, Rarity: 1, ID: 24},
|
||||
RixotsKeen: {Name: "Rixots Keen", Code: "ssd", LevelReq: 2, Rarity: 1, ID: 25},
|
||||
BloodCrescent: {Name: "Blood Crescent", Code: "scm", LevelReq: 7, Rarity: 1, ID: 26},
|
||||
KrintizsSkewer: {Name: "Krintizs Skewer", Code: "sbr", LevelReq: 10, Rarity: 1, ID: 27},
|
||||
Gleamscythe: {Name: "Gleamscythe", Code: "flc", LevelReq: 13, Rarity: 1, ID: 28},
|
||||
// AzurewrathCrystalSword (ID: 29, Code: "crs") omitted: duplicate name with Phase Blade Azurewrath (ID: 301)
|
||||
TheGnasher: {Name: "The Gnasher", Code: "hax", LevelReq: 5, Rarity: 1, ID: 0},
|
||||
Deathspade: {Name: "Deathspade", Code: "axe", LevelReq: 9, Rarity: 1, ID: 1},
|
||||
Bladebone: {Name: "Bladebone", Code: "2ax", LevelReq: 15, Rarity: 1, ID: 2},
|
||||
Mindrend: {Name: "Mindrend", Code: "mpi", LevelReq: 21, Rarity: 1, ID: 3},
|
||||
Rakescar: {Name: "Rakescar", Code: "wax", LevelReq: 27, Rarity: 1, ID: 4},
|
||||
FechmarsAxe: {Name: "Fechmars Axe", Code: "lax", LevelReq: 8, Rarity: 1, ID: 5},
|
||||
Goreshovel: {Name: "Goreshovel", Code: "bax", LevelReq: 14, Rarity: 1, ID: 6},
|
||||
TheChieftan: {Name: "The Chieftan", Code: "btx", LevelReq: 19, Rarity: 1, ID: 7},
|
||||
Brainhew: {Name: "Brainhew", Code: "gax", LevelReq: 25, Rarity: 1, ID: 8},
|
||||
TheHumongous: {Name: "The Humongous", Code: "gix", LevelReq: 29, Rarity: 1, ID: 9},
|
||||
IrosTorch: {Name: "Iros Torch", Code: "wnd", LevelReq: 5, Rarity: 1, ID: 10},
|
||||
Maelstromwrath: {Name: "Maelstromwrath", Code: "ywn", LevelReq: 14, Rarity: 1, ID: 11},
|
||||
Gravenspine: {Name: "Gravenspine", Code: "bwn", LevelReq: 20, Rarity: 1, ID: 12},
|
||||
UmesLament: {Name: "Umes Lament", Code: "gwn", LevelReq: 28, Rarity: 1, ID: 13},
|
||||
Felloak: {Name: "Felloak", Code: "clb", LevelReq: 3, Rarity: 1, ID: 14},
|
||||
KnellStriker: {Name: "Knell Striker", Code: "scp", LevelReq: 5, Rarity: 1, ID: 15},
|
||||
Rusthandle: {Name: "Rusthandle", Code: "gsc", LevelReq: 17, Rarity: 1, ID: 16},
|
||||
Stormeye: {Name: "Stormeye", Code: "wsp", LevelReq: 23, Rarity: 1, ID: 17},
|
||||
Stoutnail: {Name: "Stoutnail", Code: "spc", LevelReq: 5, Rarity: 1, ID: 18},
|
||||
Crushflange: {Name: "Crushflange", Code: "mac", LevelReq: 9, Rarity: 1, ID: 19},
|
||||
Bloodrise: {Name: "Bloodrise", Code: "mst", LevelReq: 15, Rarity: 1, ID: 20},
|
||||
TheGeneralsTanDoLiGa: {Name: "The Generals Tan Do Li Ga", Code: "fla", LevelReq: 21, Rarity: 1, ID: 21},
|
||||
Ironstone: {Name: "Ironstone", Code: "whm", LevelReq: 27, Rarity: 1, ID: 22},
|
||||
Bonesob: {Name: "Bonesob", Code: "mau", LevelReq: 24, Rarity: 1, ID: 23},
|
||||
Steeldriver: {Name: "Steeldriver", Code: "gma", LevelReq: 29, Rarity: 1, ID: 24},
|
||||
RixotsKeen: {Name: "Rixots Keen", Code: "ssd", LevelReq: 2, Rarity: 1, ID: 25},
|
||||
BloodCrescent: {Name: "Blood Crescent", Code: "scm", LevelReq: 7, Rarity: 1, ID: 26},
|
||||
KrintizsSkewer: {Name: "Krintizs Skewer", Code: "sbr", LevelReq: 10, Rarity: 1, ID: 27},
|
||||
Gleamscythe: {Name: "Gleamscythe", Code: "flc", LevelReq: 13, Rarity: 1, ID: 28},
|
||||
GriswoldsEdge: {Name: "Griswolds Edge", Code: "bsd", LevelReq: 17, Rarity: 1, ID: 30},
|
||||
Hellplague: {Name: "Hellplague", Code: "lsd", LevelReq: 22, Rarity: 1, ID: 31},
|
||||
CulwensPoint: {Name: "Culwens Point", Code: "wsd", LevelReq: 29, Rarity: 1, ID: 32},
|
||||
@@ -701,7 +698,6 @@ var UniqueItems = map[UniqueName]UniqueItemInfo{
|
||||
Doombringer: {Name: "Doombringer", Code: "7b7", LevelReq: 69, Rarity: 1, ID: 260},
|
||||
TheGrandfather: {Name: "The Grandfather", Code: "7gd", LevelReq: 81, Rarity: 1, ID: 261},
|
||||
Wizardspike: {Name: "Wizardspike", Code: "7dg", LevelReq: 61, Rarity: 1, ID: 262},
|
||||
ConstrictingRing: {Name: "Constricting Ring", Code: "rin", LevelReq: 95, Rarity: 1, ID: 263},
|
||||
Stormspire: {Name: "Stormspire", Code: "7wc", LevelReq: 70, Rarity: 1, ID: 264},
|
||||
Eaglehorn: {Name: "Eaglehorn", Code: "6l7", LevelReq: 69, Rarity: 1, ID: 265},
|
||||
Windforce: {Name: "Windforce", Code: "6lw", LevelReq: 73, Rarity: 1, ID: 266},
|
||||
|
||||
Reference in New Issue
Block a user