1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-07 10:47:19 -05:00
OpenDiablo2/d2core/d2records/npc_record.go
gravestench 271673851a
Added RecordManager implementation to remove d2datadict singletons (#736)
* Added RecordManager implementation to remove d2datadict singletons

* fix object lookup test
2020-09-19 14:33:40 -04:00

39 lines
921 B
Go

package d2records
const (
costDivisor = 1024.
)
// NPCs stores the NPCRecords
type NPCs map[string]*NPCRecord
// NPCRecord represents a single line in NPC.txt
// The information has been gathered from [https:// d2mods.info/forum/kb/viewarticle?a=387]
type NPCRecord struct {
// Name is an ID pointer to row of this npc in monstats.txt
Name string
Multipliers *costMultiplier
QuestMultipliers map[int]*costMultiplier
// MaxBuy is the maximum amount of gold an NPC will pay for an item for the corresponding
// difficulty
MaxBuy struct {
Normal int
Nightmare int
Hell int
}
}
type costMultiplier struct {
// Buy is a percentage of base item price used when an item is bought by NPC
Buy float64
// Sell is a percentage of base item price used when an item is sold by NPC
Sell float64
// Repair is a percentage of base item price used to calculate the base repair price
Repair float64
}