mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-16 17:35:57 -05:00
271673851a
* Added RecordManager implementation to remove d2datadict singletons * fix object lookup test
39 lines
921 B
Go
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
|
|
}
|