eq2go/internal/combat/constants.go
2025-08-30 11:51:05 -05:00

203 lines
4.8 KiB
Go

package combat
// Combat type constants
const (
CombatTypeMelee = iota
CombatTypeRanged
CombatTypeSpell
)
// Damage type constants matching EQ2 database
const (
DamageTypeSlashing = 0
DamageTypeCrushing = 1
DamageTypePiercing = 2
DamageTypeFire = 3
DamageTypeCold = 4
DamageTypePoison = 5
DamageTypeDisease = 6
DamageTypeMagic = 7
DamageTypeMental = 8
DamageTypeDivine = 9
DamageTypeHeat = 10
DamageTypeArcane = 11
DamageTypeNoxious = 12
DamageTypeElemental = 13
)
// Hit type constants
const (
HitTypeMiss = 0
HitTypeHit = 1
HitTypeCritical = 2
HitTypeGlancing = 3
HitTypeDodge = 4
HitTypeParry = 5
HitTypeRiposte = 6
HitTypeBlock = 7
HitTypeDeflect = 8
HitTypeImmune = 9
HitTypeInterrupt = 10
)
// Attack type constants
const (
AttackTypePrimary = 0
AttackTypeSecondary = 1
AttackTypeRanged = 2
AttackTypeSpell = 3
AttackTypeProc = 4
)
// Combat state constants
const (
CombatStateNone = 0
CombatStateMelee = 1
CombatStateRanged = 2
CombatStateCasting = 3
CombatStateFizzled = 4
)
// Equipment slot constants for weapons
const (
SlotPrimary = 0
SlotSecondary = 1
SlotRanged = 2
SlotAmmo = 3
)
// PVP type constants
const (
PVPTypeNone = 0
PVPTypeAlignment = 1
PVPTypeFaction = 2
PVPTypeFFA = 3
PVPTypeOpen = 4
PVPTypeRace = 5
PVPTypeClass = 6
PVPTypeGuild = 7
)
// Encounter state constants
const (
EncounterStateNormal = 0
EncounterStateLocked = 1
EncounterStateOvermatched = 2
)
// Combat flags
const (
CombatFlagMultiAttack = 1 << 0
CombatFlagFlurry = 1 << 1
CombatFlagBerserk = 1 << 2
CombatFlagDualWield = 1 << 3
CombatFlagRangedAttack = 1 << 4
CombatFlagSpellAttack = 1 << 5
)
// Weapon type constants
const (
WeaponType1HSlash = 0
WeaponType2HSlash = 1
WeaponType1HPierce = 2
WeaponType1HCrush = 3
WeaponType2HCrush = 4
WeaponType2HPierce = 5
WeaponTypeBow = 6
WeaponTypeThrown = 7
WeaponTypeCrossbow = 8
WeaponTypeWand = 9
WeaponTypeFist = 10
WeaponTypeShield = 11
)
// Default combat values
const (
DefaultAttackSpeed = 4.0 // Default attack speed in seconds
DefaultRangeDistance = 15.0 // Default range for ranged attacks
DefaultMeleeDistance = 5.0 // Default melee range
DefaultHateDecayRate = 0.1 // Hate decay per second
DefaultCriticalChance = 5.0 // Base critical hit chance
DefaultDodgeChance = 5.0 // Base dodge chance
DefaultParryChance = 5.0 // Base parry chance
DefaultBlockChance = 5.0 // Base block chance
DefaultMitigationCap = 75.0 // Maximum mitigation percentage
)
// Combat rule categories
const (
RuleCategoryPVP = "PVP"
RuleCategoryCombat = "Combat"
RuleCategorySpells = "Spells"
RuleCategoryExperience = "Experience"
)
// Combat rule names
const (
RuleAllowPVP = "AllowPVP"
RulePVPType = "PVPType"
RulePVPLevelRange = "LevelRange"
RulePVPNewbieLevel = "PVPNewbieLevel"
RulePVPDamageMultiplier = "PVPDamageMultiplier"
RulePVPHealingMultiplier = "PVPHealingMultiplier"
RulePVPRangedAllowed = "PVPRangedAllowed"
RulePVPSpellsAllowed = "PVPSpellsAllowed"
RulePVPCombatCooldown = "PVPCombatCooldown"
RuleLockedEncounterNoAttack = "LockedEncounterNoAttack"
RuleArmorMitigationLimit = "ArmorMitigationLimit"
RuleMaxDamageVariance = "MaxDamageVariance"
RuleMinDamageVariance = "MinDamageVariance"
RuleDefaultHitChance = "DefaultHitChance"
RuleSpellInterruptChance = "SpellInterruptChance"
RuleFizzleChance = "FizzleChance"
)
// Packet opcodes (will be added to main opcodes file)
var CombatOpcodes = map[string]int32{
"OP_CombatLogDataMsg": 0x0000,
"OP_AttackAllowedMsg": 0x0001,
"OP_AttackNotAllowedMsg": 0x0002,
"OP_StartAttackMsg": 0x0003,
"OP_InterruptCastMsg": 0x0004,
"OP_FinishAttackMsg": 0x0005,
"OP_IncomingAttackMsg": 0x0006,
}
// Stat type constants for combat calculations
const (
StatSTR = 0
StatSTA = 1
StatAGI = 2
StatWIS = 3
StatINT = 4
StatDEX = 5
StatVS_Heat = 200
StatVS_Cold = 201
StatVS_Magic = 202
StatVS_Mental = 203
StatVS_Divine = 204
StatVS_Disease = 205
StatVS_Poison = 206
StatVS_Elemental = 207
StatVS_Arcane = 208
StatVS_Noxious = 209
StatPhysicalMitigation = 1000
StatElementalMitigation = 1001
StatNoxiousMitigation = 1002
StatArcaneMitigation = 1003
)
// Combat message channels
const (
CombatChannelGeneral = 4
CombatChannelDamage = 11
CombatChannelMiss = 12
CombatChannelCombat = 13
)
// Interrupt types
const (
InterruptTypeSpell = 0
InterruptTypeCrafting = 1
InterruptTypeAll = 2
)