1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-09 09:20:44 +00:00
OpenDiablo2/d2common/d2enum/item_event_functions.go
dk a25e42518d
DataDictionary loader for ItemStatCost (#333)
* adding rules for swap files to .gitignore

* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* adding ItemStatCost data dict loader
2020-06-13 19:52:22 -04:00

144 lines
3.3 KiB
Go

package d2enum
type ItemEventFuncID int
const (
// shoots a missile at the owner of a missile that has just hit you
// (Chilling Armor uses this)
ReflectMissile = ItemEventFuncID(iota)
// freezes the attacker for a set duration the attacker
// (Frozen Armor uses this)
FreezeAttacker
// does cold damage to and chills the attacker (Shiver Armor uses this)
FreezeChillAttacker
// % of damage taken is done to the attacker
// (Iron Maiden, thorns uses a hardcoded stat)
ReflectPercentDamage
// % of damage done added to life, bypassing the targets resistance
// (used by Life Tap)
DamageDealtToHealth
// attacker takes physical damage of #
AttackerTakesPhysical
// knocks the target back
Knockback
// induces fear in the target making it run away
InduceFear
// applies Dim Vision to the target (it casts the actual curse on the
// monster)
BlindTarget
// attacker takes lightning damage of #
AttackerTakesLightning
// attacker takes fire damage of #
AttackerTakesFire
// attacker takes cold damage of #
AttackerTakesCold
// % damage taken is added to mana
DamageTakenToMana
// freezes the target
FreezeTarget
// causes the target to bleed and lose life (negative life regen)
OpenWounds
// crushing blow against the target
CrushingBlow
// mana after killing a monster
ManaOnKillMonster
// life after killing a demon
LifeOnKillDemon
// slows the target
SlowTarget
// casts a skill against the defender
CastSkillAgainstDefender
// casts a skill against the attacker
CastSkillAgainstAttacker
// absorbs physical damage taken (used by Bone Armor)
AbsorbPhysical
// transfers damage done from the summon to the owner (used by Blood Golem)
TakeSummonDamage
// used by Energy Shield to absorb damage and shift it from life to mana
ManaAbsorbsDamage
// absorbs elemental damage taken (used by Cyclone Armor)
AbsorbElementalDamage
// transfers damage taken from the summon to the owner (used by Blood Golem)
TakeSummonDamage2
// used to slow the attacker if he hits a unit that has the slow target stat
// (used by Clay Golem)
TargetSlowsTarget
// life after killing a monster
LifeOnKillMonster
// destroys the corpse of a killed monster (rest in peace effect)
RestInPeace
// cast a skill when the event occurs, without a target
CastSkillWithoutTarget
// reanimate the target as the specified monster
ReanimateTargetAsMonster
)
func GetItemEventFuncID(n int) ItemEventFuncID {
m := map[int]ItemEventFuncID{
0: ReflectMissile,
1: FreezeAttacker,
2: FreezeChillAttacker,
3: ReflectPercentDamage,
4: DamageDealtToHealth,
5: AttackerTakesPhysical,
6: Knockback,
7: InduceFear,
8: BlindTarget,
9: AttackerTakesLightning,
10: AttackerTakesFire,
11: AttackerTakesCold,
12: DamageTakenToMana,
13: FreezeTarget,
14: OpenWounds,
15: CrushingBlow,
16: ManaOnKillMonster,
17: LifeOnKillDemon,
18: SlowTarget,
19: CastSkillAgainstDefender,
20: CastSkillAgainstAttacker,
21: AbsorbPhysical,
22: TakeSummonDamage,
23: ManaAbsorbsDamage,
24: AbsorbElementalDamage,
25: TakeSummonDamage2,
26: TargetSlowsTarget,
27: LifeOnKillMonster,
28: RestInPeace,
29: CastSkillWithoutTarget,
30: ReanimateTargetAsMonster,
}
return m[n]
}
//? do i need to do this ? //go:generate stringer -linecomment -type AnimationMode