latest updates for raid gear

This commit is contained in:
2025-08-07 23:21:16 -04:00
parent 574525809d
commit fffa4405e1
4 changed files with 1781 additions and 180 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -21,11 +21,11 @@ var InvTypeModifiers = map[int]float64{
19: 1.0, // Tabard (assuming same as Chest for simplicity)
20: 1.0, // Robe (see also Chest = 5)
21: 0.80, // Main hand
22: 0.42, // Off Hand weapons (see also One-Hand = 13)
22: 0.50, // Off Hand weapons (see also One-Hand = 13)
23: 0.56, // Held in Off-Hand (class = armor, not weapon even if in weapon slot)
24: 1.0, // Ammo (assuming same as Chest for simplicity)
25: 0.32, // Thrown
26: 0.32, // Ranged right (Wands, Guns) (see also Ranged = 15)
25: 0.38, // Thrown
26: 0.38, // Ranged right (Wands, Guns) (see also Ranged = 15)
27: 1.0, // Quiver (assuming same as Chest for simplicity)
}
@@ -34,7 +34,7 @@ var QualityModifiers = map[int]float64{
1: 0.9, // Common
2: 1.0, // UnCommon
3: 1.2, // Rare
4: 1.4, // Epic
4: 1.5, // Epic
5: 2.0, // Legendary
}
@@ -48,11 +48,11 @@ var MaterialModifiers = map[int]float64{
// Modifies stats flat for difficulty of dungeon / raid itself.
var GearTierModifiers = map[int]float64{
1: 1.10,
2: 1.15,
3: 1.20,
4: 1.25,
5: 1.30,
1: 1.05,
2: 1.10,
3: 1.15,
4: 1.20,
5: 1.25,
}
var StatModifiers = map[int]float64{
@@ -151,17 +151,17 @@ var StatModifierNames = map[int]string{
var ScalingFactor = map[int]float64{
0: 1.1, // ITEM_MOD_MANA
1: 1.5, // ITEM_MOD_HEALTH
1: 1.2, // ITEM_MOD_HEALTH
3: 1.35, // ITEM_MOD_AGILITY
4: 1.35, // ITEM_MOD_STRENGTH
5: 1.35, // ITEM_MOD_INTELLECT
6: 1.35, // ITEM_MOD_SPIRIT
7: 1.40, // ITEM_MOD_STAMINA
12: 1.3, // ITEM_MOD_DEFENSE_SKILL_RATING
13: 1.15, // ITEM_MOD_DODGE_RATING
14: 1.15, // ITEM_MOD_PARRY_RATING
15: 1.2, // ITEM_MOD_BLOCK_RATING
16: 1.1, // ITEM_MOD_HIT_MELEE_RATING
12: 1.1, // ITEM_MOD_DEFENSE_SKILL_RATING
13: 1.0, // ITEM_MOD_DODGE_RATING
14: 0.85, // ITEM_MOD_PARRY_RATING
15: 1.15, // ITEM_MOD_BLOCK_RATING
16: 1.0, // ITEM_MOD_HIT_MELEE_RATING
17: 1.1, // ITEM_MOD_HIT_RANGED_RATING
18: 1.1, // ITEM_MOD_HIT_SPELL_RATING
19: 1.2, // ITEM_MOD_CRIT_MELEE_RATING
@@ -173,25 +173,25 @@ var ScalingFactor = map[int]float64{
25: 1.3, // ITEM_MOD_CRIT_TAKEN_MELEE_RATING
26: 1.3, // ITEM_MOD_CRIT_TAKEN_RANGED_RATING
27: 1.3, // ITEM_MOD_CRIT_TAKEN_SPELL_RATING
28: 1.25, // ITEM_MOD_HASTE_MELEE_RATING
29: 1.25, // ITEM_MOD_HASTE_RANGED_RATING
30: 1.25, // ITEM_MOD_HASTE_SPELL_RATING
28: 1.0, // ITEM_MOD_HASTE_MELEE_RATING
29: 1.0, // ITEM_MOD_HASTE_RANGED_RATING
30: 1.0, // ITEM_MOD_HASTE_SPELL_RATING
31: 1.15, // ITEM_MOD_HIT_RATING
32: 1.30, // ITEM_MOD_CRIT_RATING
33: 1.3, // ITEM_MOD_HIT_TAKEN_RATING
34: 1.3, // ITEM_MOD_CRIT_TAKEN_RATING
35: 1.0, // ITEM_MOD_RESILIENCE_RATING
36: 1.25, // ITEM_MOD_HASTE_RATING
36: 1.0, // ITEM_MOD_HASTE_RATING
37: 0.8, // ITEM_MOD_EXPERTISE_RATING
38: 1.5, // ITEM_MOD_ATTACK_POWER
39: 1.5, // ITEM_MOD_RANGED_ATTACK_POWER
40: 1.5, // ITEM_MOD_FERAL_ATTACK_POWER (not used as of 3.3)
41: 1.5, // ITEM_MOD_SPELL_HEALING_DONE
42: 1.5, // ITEM_MOD_SPELL_DAMAGE_DONE
43: 1.3, // ITEM_MOD_MANA_REGENERATION
38: 1.0, // ITEM_MOD_ATTACK_POWER
39: 1.0, // ITEM_MOD_RANGED_ATTACK_POWER
40: 1.0, // ITEM_MOD_FERAL_ATTACK_POWER (not used as of 3.3)
41: 1.0, // ITEM_MOD_SPELL_HEALING_DONE
42: 1.0, // ITEM_MOD_SPELL_DAMAGE_DONE
43: 1.0, // ITEM_MOD_MANA_REGENERATION
44: 1.1, // ITEM_MOD_ARMOR_PENETRATION_RATING
45: 1.5, // ITEM_MOD_SPELL_POWER
45: 1.0, // ITEM_MOD_SPELL_POWER
46: 1.3, // ITEM_MOD_HEALTH_REGEN
47: 1.0, // ITEM_MOD_SPELL_PENETRATION
48: 1.4, // ITEM_MOD_BLOCK_VALUE
48: 1.2, // ITEM_MOD_BLOCK_VALUE
}

View File

@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"log"
"strings"
"time"
"github.com/araxiaonline/endgame-item-generator/internal/config"
@@ -177,31 +178,77 @@ func (db *MySqlDb) GetRarePlusItems(limit, offset int) ([]DbItem, error) {
return items, nil
}
func (db *MySqlDb) GetBossMapItems(mapId, limit, offset int) ([]DbItem, error) {
func (db *MySqlDb) GetBossMapItems(mapId int, bossEntries []int, gameObjectEntries []int, limit, offset int) ([]DbItem, error) {
items := []DbItem{}
sql := `SELECT DISTINCT ` + GetItemFields("it") + `
FROM acore_world.creature c
JOIN acore_world.creature_template ct ON c.id1 = ct.entry
JOIN acore_world.map_dbc m ON c.map = m.ID
LEFT JOIN acore_world.creature_loot_template clt ON ct.lootid = clt.Entry
LEFT JOIN acore_world.reference_loot_template rlt ON clt.Reference = rlt.Entry
LEFT JOIN acore_world.item_template it ON rlt.Item = it.entry
WHERE
m.ID = ?
AND ct.rank = 3
-- AND it.StatsCount = 0
AND it.class IN (2, 4) -- Weapons and armor
AND it.bonding IN (1, 2) -- Binds when picked up/equipped
AND it.Quality >= 3 -- Epic and above
`
if limit != 0 && offset != 0 {
sql += fmt.Sprintf("LIMIT %v OFFSET %v", limit, offset)
// Build the boss entries condition
bossEntriesCondition := ""
if len(bossEntries) > 0 {
bossEntriesStr := make([]string, len(bossEntries))
for i, entry := range bossEntries {
bossEntriesStr[i] = fmt.Sprintf("%d", entry)
}
bossEntriesCondition = fmt.Sprintf("OR ct.entry IN (%s)", strings.Join(bossEntriesStr, ","))
}
err := db.Select(&items, sql, mapId)
// Build the GameObject entries condition
gameObjectEntriesCondition := ""
if len(gameObjectEntries) > 0 {
gameObjectEntriesStr := make([]string, len(gameObjectEntries))
for i, entry := range gameObjectEntries {
gameObjectEntriesStr[i] = fmt.Sprintf("%d", entry)
}
gameObjectEntriesCondition = fmt.Sprintf("AND got.entry IN (%s)", strings.Join(gameObjectEntriesStr, ","))
}
sql := `SELECT DISTINCT ` + GetItemFields("it") + `
FROM acore_world.creature_template ct
LEFT JOIN acore_world.creature c ON c.id1 = ct.entry
LEFT JOIN acore_world.map_dbc m ON c.map = m.ID
LEFT JOIN acore_world.creature_loot_template clt ON ct.lootid = clt.Entry
LEFT JOIN acore_world.reference_loot_template rlt ON clt.Reference = rlt.Entry
LEFT JOIN acore_world.item_template it ON rlt.Item = it.entry
WHERE
( m.ID = ? ` + bossEntriesCondition + ` )
AND ct.rank IN (3)
AND it.class IN (2, 4) -- Weapons and armor
AND it.bonding IN (1, 2) -- Binds when picked up/equipped
AND it.Quality >= 4 -- Epic and above`
// Only add the UNION clause if we have GameObject entries
if len(gameObjectEntries) > 0 {
sql += `
UNION
SELECT DISTINCT ` + GetItemFields("it") + `
FROM acore_world.gameobject go
JOIN acore_world.gameobject_template got ON go.id = got.entry
LEFT JOIN acore_world.gameobject_loot_template glt ON got.Data1 = glt.Entry
LEFT JOIN acore_world.reference_loot_template rlt ON glt.Reference = rlt.Entry
LEFT JOIN acore_world.item_template it ON rlt.Item = it.entry
WHERE go.map = ?
` + gameObjectEntriesCondition + `
AND it.class IN (2, 4) -- Weapons and armor
AND it.bonding IN (1, 2) -- Binds when picked up/equipped
AND it.Quality >= 4`
}
if limit != 0 && offset != 0 {
sql += fmt.Sprintf(" LIMIT %v OFFSET %v", limit, offset)
}
// Prepare query parameters
var args []interface{}
args = append(args, mapId)
if len(gameObjectEntries) > 0 {
args = append(args, mapId) // Second mapId for the UNION query
}
err := db.Select(&items, sql, args...)
if err != nil {
return []DbItem{}, err
}

View File

@@ -883,6 +883,22 @@ func correctSpellAttackPower(item *Item, allStats map[int]*ItemStat) {
* @return int
**/
func (item *Item) GetClassUserType() int {
// Debug: Print item details for troubleshooting
log.Printf("[DEBUG] GetClassUserType for %s (Entry: %d)", item.Name, item.Entry)
log.Printf("[DEBUG] Class: %v, Material: %v, InventoryType: %v, Subclass: %v",
item.Class, item.Material, item.InventoryType, item.Subclass)
// Debug: Print all stats on the item
log.Printf("[DEBUG] Item stats:")
for i := 1; i <= 7; i++ {
statTypeField := fmt.Sprintf("StatType%d", i)
statValueField := fmt.Sprintf("StatValue%d", i)
statType, _ := item.GetField(statTypeField)
statValue, _ := item.GetField(statValueField)
if statType > 0 {
log.Printf("[DEBUG] Stat%d: Type=%d, Value=%d", i, statType, statValue)
}
}
// loop over the stats and check if any of them are parry, defense, block
for i := 1; i <= 7; i++ {
@@ -1027,7 +1043,7 @@ func (item *Item) GetClassUserType() int {
statTypeField := fmt.Sprintf("StatType%d", i)
statTypePtr, _ := item.GetField(statTypeField)
if statTypePtr == STAT.AttackPower || statTypePtr == STAT.HasteMeleeRating || statTypePtr == STAT.CritMeleeRating {
return 7
return 2
}
}
@@ -1049,6 +1065,7 @@ func (item *Item) GetClassUserType() int {
}
}
log.Printf("[DEBUG] GetClassUserType for %s returning: 7 (Generic - Could not determine)", item.Name)
return 7
}