use std::io::{Read, Write};
use crate::Guid;
use crate::tbc::{
Power, SpellEffect,
};
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
pub enum SpellLog {
None,
Instakill,
SchoolDamage,
Dummy,
PortalTeleport,
TeleportUnits,
ApplyAura,
EnvironmentalDamage,
PowerDrain {
amount: u32,
multiplier: f32,
power: Power,
target1: Guid,
},
HealthLeech,
Heal,
Bind,
Portal,
RitualBase,
RitualSpecialize,
RitualActivatePortal,
QuestComplete,
WeaponDamageNoschool,
Resurrect,
AddExtraAttacks {
extra_attacks: u32,
target4: Guid,
},
Dodge,
Evade,
Parry,
Block,
CreateItem {
item: u32,
},
Weapon,
Defense,
PersistentAreaAura,
Summon {
summon_target: Guid,
},
Leap,
Energize,
WeaponPercentDamage,
TriggerMissile,
OpenLock {
lock_target: Guid,
},
SummonChangeItem,
ApplyAreaAuraParty,
LearnSpell,
SpellDefense,
Dispel,
Language,
DualWield,
Unknown41,
Unknown42,
TeleportUnitsFaceCaster,
SkillStep,
Undefined45,
Spawn,
TradeSkill,
Stealth,
Detect,
TransDoor {
summon_target: Guid,
},
ForceCriticalHit,
GuaranteeHit,
EnchantItem,
EnchantItemTemporary,
Tamecreature,
SummonPet {
summon_target: Guid,
},
LearnPetSpell,
WeaponDamage,
OpenLockItem {
lock_target: Guid,
},
Proficiency,
SendEvent,
PowerBurn,
Threat,
TriggerSpell,
HealthFunnel,
PowerFunnel,
HealMaxHealth,
InterruptCast {
interrupted_spell: u32,
target5: Guid,
},
Distract,
Pull,
Pickpocket,
AddFarsight,
Unknown73,
Unknown74,
HealMechanical,
SummonObjectWild {
summon_target: Guid,
},
ScriptEffect,
Attack,
Sanctuary,
AddComboPoints,
CreateHouse {
summon_target: Guid,
},
BindSight,
Duel {
summon_target: Guid,
},
Stuck,
SummonPlayer,
ActivateObject,
Unknown87,
Unknown88,
Unknown89,
Unknown90,
ThreatAll,
EnchantHeldItem,
Unknown93,
SelfResurrect,
Skinning,
Charge,
Unknown97,
KnockBack,
Disenchant,
Inebriate,
FeedPet {
pet_feed_guid: Guid,
},
DismissPet {
pet_dismiss_guid: Guid,
},
Reputation,
SummonObjectSlot1 {
summon_target: Guid,
},
SummonObjectSlot2 {
summon_target: Guid,
},
SummonObjectSlot3 {
summon_target: Guid,
},
SummonObjectSlot4 {
summon_target: Guid,
},
DispelMechanic,
SummonDeadPet,
DestroyAllTotems,
DurabilityDamage {
item_to_damage: u32,
target6: Guid,
unknown5: u32,
},
Unknown112,
ResurrectNew,
AttackMe,
DurabilityDamagePct,
SkinPlayerCorpse,
SpiritHeal,
Skill,
ApplyAreaAuraPet,
TeleportGraveyard,
NormalizedWeaponDmg,
Unknown122,
SendTaxi,
PlayerPull,
ModifyThreatPercent,
StealBeneficialBuff,
Prospecting,
ApplyAreaAuraFriend,
ApplyAreaAuraEnemy,
RedirectThreat,
PlaySound,
PlayMusic,
UnlearnSpecialization,
KillCreditGroup,
CallPet,
HealPct,
EnergizePct,
LeapBack,
ClearQuest,
ForceCast,
Unknown141,
TriggerSpellWithValue,
ApplyAreaAuraOwner,
KnockbackFromPosition,
Unknown145,
Unknown146,
QuestFail,
Unknown148,
Charge2,
Unknown150,
TriggerSpell2,
Unknown152,
Unknown153,
}
impl SpellLog {
pub const AMOUNT_OF_LOGS_VALUE: u32 = 0x01;
}
impl SpellLog {
pub(crate) fn write_into_vec(&self, mut w: impl Write) -> Result<(), std::io::Error> {
w.write_all(&(self.as_int().to_le_bytes()))?;
w.write_all(&Self::AMOUNT_OF_LOGS_VALUE.to_le_bytes())?;
match &self {
SpellLog::PowerDrain {
amount,
multiplier,
power,
target1,
} => {
crate::util::write_packed_guid(&target1, &mut w)?;
w.write_all(&amount.to_le_bytes())?;
w.write_all(&u32::from(power.as_int()).to_le_bytes())?;
w.write_all(&multiplier.to_le_bytes())?;
}
SpellLog::AddExtraAttacks {
extra_attacks,
target4,
} => {
crate::util::write_packed_guid(&target4, &mut w)?;
w.write_all(&extra_attacks.to_le_bytes())?;
}
SpellLog::CreateItem {
item,
} => {
w.write_all(&item.to_le_bytes())?;
}
SpellLog::Summon {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::OpenLock {
lock_target,
} => {
crate::util::write_packed_guid(&lock_target, &mut w)?;
}
SpellLog::TransDoor {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::SummonPet {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::OpenLockItem {
lock_target,
} => {
crate::util::write_packed_guid(&lock_target, &mut w)?;
}
SpellLog::InterruptCast {
interrupted_spell,
target5,
} => {
crate::util::write_packed_guid(&target5, &mut w)?;
w.write_all(&interrupted_spell.to_le_bytes())?;
}
SpellLog::SummonObjectWild {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::CreateHouse {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::Duel {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::FeedPet {
pet_feed_guid,
} => {
crate::util::write_packed_guid(&pet_feed_guid, &mut w)?;
}
SpellLog::DismissPet {
pet_dismiss_guid,
} => {
crate::util::write_packed_guid(&pet_dismiss_guid, &mut w)?;
}
SpellLog::SummonObjectSlot1 {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::SummonObjectSlot2 {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::SummonObjectSlot3 {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::SummonObjectSlot4 {
summon_target,
} => {
crate::util::write_packed_guid(&summon_target, &mut w)?;
}
SpellLog::DurabilityDamage {
item_to_damage,
target6,
unknown5,
} => {
crate::util::write_packed_guid(&target6, &mut w)?;
w.write_all(&item_to_damage.to_le_bytes())?;
w.write_all(&unknown5.to_le_bytes())?;
}
_ => {}
}
Ok(())
}
}
impl SpellLog {
pub(crate) fn read<R: std::io::Read>(mut r: R) -> Result<Self, crate::errors::ParseErrorKind> {
let effect = crate::util::read_u32_le(&mut r)?.try_into()?;
let _amount_of_logs = crate::util::read_u32_le(&mut r)?;
let effect_if = match effect {
SpellEffect::None => SpellLog::None,
SpellEffect::Instakill => SpellLog::Instakill,
SpellEffect::SchoolDamage => SpellLog::SchoolDamage,
SpellEffect::Dummy => SpellLog::Dummy,
SpellEffect::PortalTeleport => SpellLog::PortalTeleport,
SpellEffect::TeleportUnits => SpellLog::TeleportUnits,
SpellEffect::ApplyAura => SpellLog::ApplyAura,
SpellEffect::EnvironmentalDamage => SpellLog::EnvironmentalDamage,
SpellEffect::PowerDrain => {
let target1 = crate::util::read_packed_guid(&mut r)?;
let amount = crate::util::read_u32_le(&mut r)?;
let power = (crate::util::read_u32_le(&mut r)? as u8).try_into()?;
let multiplier = crate::util::read_f32_le(&mut r)?;
SpellLog::PowerDrain {
amount,
multiplier,
power,
target1,
}
}
SpellEffect::HealthLeech => SpellLog::HealthLeech,
SpellEffect::Heal => SpellLog::Heal,
SpellEffect::Bind => SpellLog::Bind,
SpellEffect::Portal => SpellLog::Portal,
SpellEffect::RitualBase => SpellLog::RitualBase,
SpellEffect::RitualSpecialize => SpellLog::RitualSpecialize,
SpellEffect::RitualActivatePortal => SpellLog::RitualActivatePortal,
SpellEffect::QuestComplete => SpellLog::QuestComplete,
SpellEffect::WeaponDamageNoschool => SpellLog::WeaponDamageNoschool,
SpellEffect::Resurrect => SpellLog::Resurrect,
SpellEffect::AddExtraAttacks => {
let target4 = crate::util::read_packed_guid(&mut r)?;
let extra_attacks = crate::util::read_u32_le(&mut r)?;
SpellLog::AddExtraAttacks {
extra_attacks,
target4,
}
}
SpellEffect::Dodge => SpellLog::Dodge,
SpellEffect::Evade => SpellLog::Evade,
SpellEffect::Parry => SpellLog::Parry,
SpellEffect::Block => SpellLog::Block,
SpellEffect::CreateItem => {
let item = crate::util::read_u32_le(&mut r)?;
SpellLog::CreateItem {
item,
}
}
SpellEffect::Weapon => SpellLog::Weapon,
SpellEffect::Defense => SpellLog::Defense,
SpellEffect::PersistentAreaAura => SpellLog::PersistentAreaAura,
SpellEffect::Summon => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::Summon {
summon_target,
}
}
SpellEffect::Leap => SpellLog::Leap,
SpellEffect::Energize => SpellLog::Energize,
SpellEffect::WeaponPercentDamage => SpellLog::WeaponPercentDamage,
SpellEffect::TriggerMissile => SpellLog::TriggerMissile,
SpellEffect::OpenLock => {
let lock_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::OpenLock {
lock_target,
}
}
SpellEffect::SummonChangeItem => SpellLog::SummonChangeItem,
SpellEffect::ApplyAreaAuraParty => SpellLog::ApplyAreaAuraParty,
SpellEffect::LearnSpell => SpellLog::LearnSpell,
SpellEffect::SpellDefense => SpellLog::SpellDefense,
SpellEffect::Dispel => SpellLog::Dispel,
SpellEffect::Language => SpellLog::Language,
SpellEffect::DualWield => SpellLog::DualWield,
SpellEffect::Unknown41 => SpellLog::Unknown41,
SpellEffect::Unknown42 => SpellLog::Unknown42,
SpellEffect::TeleportUnitsFaceCaster => SpellLog::TeleportUnitsFaceCaster,
SpellEffect::SkillStep => SpellLog::SkillStep,
SpellEffect::Undefined45 => SpellLog::Undefined45,
SpellEffect::Spawn => SpellLog::Spawn,
SpellEffect::TradeSkill => SpellLog::TradeSkill,
SpellEffect::Stealth => SpellLog::Stealth,
SpellEffect::Detect => SpellLog::Detect,
SpellEffect::TransDoor => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::TransDoor {
summon_target,
}
}
SpellEffect::ForceCriticalHit => SpellLog::ForceCriticalHit,
SpellEffect::GuaranteeHit => SpellLog::GuaranteeHit,
SpellEffect::EnchantItem => SpellLog::EnchantItem,
SpellEffect::EnchantItemTemporary => SpellLog::EnchantItemTemporary,
SpellEffect::Tamecreature => SpellLog::Tamecreature,
SpellEffect::SummonPet => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::SummonPet {
summon_target,
}
}
SpellEffect::LearnPetSpell => SpellLog::LearnPetSpell,
SpellEffect::WeaponDamage => SpellLog::WeaponDamage,
SpellEffect::OpenLockItem => {
let lock_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::OpenLockItem {
lock_target,
}
}
SpellEffect::Proficiency => SpellLog::Proficiency,
SpellEffect::SendEvent => SpellLog::SendEvent,
SpellEffect::PowerBurn => SpellLog::PowerBurn,
SpellEffect::Threat => SpellLog::Threat,
SpellEffect::TriggerSpell => SpellLog::TriggerSpell,
SpellEffect::HealthFunnel => SpellLog::HealthFunnel,
SpellEffect::PowerFunnel => SpellLog::PowerFunnel,
SpellEffect::HealMaxHealth => SpellLog::HealMaxHealth,
SpellEffect::InterruptCast => {
let target5 = crate::util::read_packed_guid(&mut r)?;
let interrupted_spell = crate::util::read_u32_le(&mut r)?;
SpellLog::InterruptCast {
interrupted_spell,
target5,
}
}
SpellEffect::Distract => SpellLog::Distract,
SpellEffect::Pull => SpellLog::Pull,
SpellEffect::Pickpocket => SpellLog::Pickpocket,
SpellEffect::AddFarsight => SpellLog::AddFarsight,
SpellEffect::Unknown73 => SpellLog::Unknown73,
SpellEffect::Unknown74 => SpellLog::Unknown74,
SpellEffect::HealMechanical => SpellLog::HealMechanical,
SpellEffect::SummonObjectWild => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::SummonObjectWild {
summon_target,
}
}
SpellEffect::ScriptEffect => SpellLog::ScriptEffect,
SpellEffect::Attack => SpellLog::Attack,
SpellEffect::Sanctuary => SpellLog::Sanctuary,
SpellEffect::AddComboPoints => SpellLog::AddComboPoints,
SpellEffect::CreateHouse => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::CreateHouse {
summon_target,
}
}
SpellEffect::BindSight => SpellLog::BindSight,
SpellEffect::Duel => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::Duel {
summon_target,
}
}
SpellEffect::Stuck => SpellLog::Stuck,
SpellEffect::SummonPlayer => SpellLog::SummonPlayer,
SpellEffect::ActivateObject => SpellLog::ActivateObject,
SpellEffect::Unknown87 => SpellLog::Unknown87,
SpellEffect::Unknown88 => SpellLog::Unknown88,
SpellEffect::Unknown89 => SpellLog::Unknown89,
SpellEffect::Unknown90 => SpellLog::Unknown90,
SpellEffect::ThreatAll => SpellLog::ThreatAll,
SpellEffect::EnchantHeldItem => SpellLog::EnchantHeldItem,
SpellEffect::Unknown93 => SpellLog::Unknown93,
SpellEffect::SelfResurrect => SpellLog::SelfResurrect,
SpellEffect::Skinning => SpellLog::Skinning,
SpellEffect::Charge => SpellLog::Charge,
SpellEffect::Unknown97 => SpellLog::Unknown97,
SpellEffect::KnockBack => SpellLog::KnockBack,
SpellEffect::Disenchant => SpellLog::Disenchant,
SpellEffect::Inebriate => SpellLog::Inebriate,
SpellEffect::FeedPet => {
let pet_feed_guid = crate::util::read_packed_guid(&mut r)?;
SpellLog::FeedPet {
pet_feed_guid,
}
}
SpellEffect::DismissPet => {
let pet_dismiss_guid = crate::util::read_packed_guid(&mut r)?;
SpellLog::DismissPet {
pet_dismiss_guid,
}
}
SpellEffect::Reputation => SpellLog::Reputation,
SpellEffect::SummonObjectSlot1 => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::SummonObjectSlot1 {
summon_target,
}
}
SpellEffect::SummonObjectSlot2 => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::SummonObjectSlot2 {
summon_target,
}
}
SpellEffect::SummonObjectSlot3 => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::SummonObjectSlot3 {
summon_target,
}
}
SpellEffect::SummonObjectSlot4 => {
let summon_target = crate::util::read_packed_guid(&mut r)?;
SpellLog::SummonObjectSlot4 {
summon_target,
}
}
SpellEffect::DispelMechanic => SpellLog::DispelMechanic,
SpellEffect::SummonDeadPet => SpellLog::SummonDeadPet,
SpellEffect::DestroyAllTotems => SpellLog::DestroyAllTotems,
SpellEffect::DurabilityDamage => {
let target6 = crate::util::read_packed_guid(&mut r)?;
let item_to_damage = crate::util::read_u32_le(&mut r)?;
let unknown5 = crate::util::read_u32_le(&mut r)?;
SpellLog::DurabilityDamage {
item_to_damage,
target6,
unknown5,
}
}
SpellEffect::Unknown112 => SpellLog::Unknown112,
SpellEffect::ResurrectNew => SpellLog::ResurrectNew,
SpellEffect::AttackMe => SpellLog::AttackMe,
SpellEffect::DurabilityDamagePct => SpellLog::DurabilityDamagePct,
SpellEffect::SkinPlayerCorpse => SpellLog::SkinPlayerCorpse,
SpellEffect::SpiritHeal => SpellLog::SpiritHeal,
SpellEffect::Skill => SpellLog::Skill,
SpellEffect::ApplyAreaAuraPet => SpellLog::ApplyAreaAuraPet,
SpellEffect::TeleportGraveyard => SpellLog::TeleportGraveyard,
SpellEffect::NormalizedWeaponDmg => SpellLog::NormalizedWeaponDmg,
SpellEffect::Unknown122 => SpellLog::Unknown122,
SpellEffect::SendTaxi => SpellLog::SendTaxi,
SpellEffect::PlayerPull => SpellLog::PlayerPull,
SpellEffect::ModifyThreatPercent => SpellLog::ModifyThreatPercent,
SpellEffect::StealBeneficialBuff => SpellLog::StealBeneficialBuff,
SpellEffect::Prospecting => SpellLog::Prospecting,
SpellEffect::ApplyAreaAuraFriend => SpellLog::ApplyAreaAuraFriend,
SpellEffect::ApplyAreaAuraEnemy => SpellLog::ApplyAreaAuraEnemy,
SpellEffect::RedirectThreat => SpellLog::RedirectThreat,
SpellEffect::PlaySound => SpellLog::PlaySound,
SpellEffect::PlayMusic => SpellLog::PlayMusic,
SpellEffect::UnlearnSpecialization => SpellLog::UnlearnSpecialization,
SpellEffect::KillCreditGroup => SpellLog::KillCreditGroup,
SpellEffect::CallPet => SpellLog::CallPet,
SpellEffect::HealPct => SpellLog::HealPct,
SpellEffect::EnergizePct => SpellLog::EnergizePct,
SpellEffect::LeapBack => SpellLog::LeapBack,
SpellEffect::ClearQuest => SpellLog::ClearQuest,
SpellEffect::ForceCast => SpellLog::ForceCast,
SpellEffect::Unknown141 => SpellLog::Unknown141,
SpellEffect::TriggerSpellWithValue => SpellLog::TriggerSpellWithValue,
SpellEffect::ApplyAreaAuraOwner => SpellLog::ApplyAreaAuraOwner,
SpellEffect::KnockbackFromPosition => SpellLog::KnockbackFromPosition,
SpellEffect::Unknown145 => SpellLog::Unknown145,
SpellEffect::Unknown146 => SpellLog::Unknown146,
SpellEffect::QuestFail => SpellLog::QuestFail,
SpellEffect::Unknown148 => SpellLog::Unknown148,
SpellEffect::Charge2 => SpellLog::Charge2,
SpellEffect::Unknown150 => SpellLog::Unknown150,
SpellEffect::TriggerSpell2 => SpellLog::TriggerSpell2,
SpellEffect::Unknown152 => SpellLog::Unknown152,
SpellEffect::Unknown153 => SpellLog::Unknown153,
};
Ok(effect_if)
}
}
impl SpellLog {
pub(crate) const fn size(&self) -> usize {
(match self {
Self::PowerDrain {
target1,
..
} => {
4
+ 4 + 4 + 4 + crate::util::packed_guid_size(&target1) }
Self::AddExtraAttacks {
target4,
..
} => {
4
+ 4 + crate::util::packed_guid_size(&target4) }
Self::CreateItem {
..
} => {
4
+ 4 }
Self::Summon {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::OpenLock {
lock_target,
} => {
4
+ crate::util::packed_guid_size(&lock_target) }
Self::TransDoor {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::SummonPet {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::OpenLockItem {
lock_target,
} => {
4
+ crate::util::packed_guid_size(&lock_target) }
Self::InterruptCast {
target5,
..
} => {
4
+ 4 + crate::util::packed_guid_size(&target5) }
Self::SummonObjectWild {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::CreateHouse {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::Duel {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::FeedPet {
pet_feed_guid,
} => {
4
+ crate::util::packed_guid_size(&pet_feed_guid) }
Self::DismissPet {
pet_dismiss_guid,
} => {
4
+ crate::util::packed_guid_size(&pet_dismiss_guid) }
Self::SummonObjectSlot1 {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::SummonObjectSlot2 {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::SummonObjectSlot3 {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::SummonObjectSlot4 {
summon_target,
} => {
4
+ crate::util::packed_guid_size(&summon_target) }
Self::DurabilityDamage {
target6,
..
} => {
4
+ 4 + crate::util::packed_guid_size(&target6) + 4 }
_ => 4,
}) + 4 }
}
impl Default for SpellLog {
fn default() -> Self {
Self::None
}
}
impl SpellLog {
pub(crate) const fn as_int(&self) -> u32 {
match self {
Self::None => 0,
Self::Instakill => 1,
Self::SchoolDamage => 2,
Self::Dummy => 3,
Self::PortalTeleport => 4,
Self::TeleportUnits => 5,
Self::ApplyAura => 6,
Self::EnvironmentalDamage => 7,
Self::PowerDrain { .. } => 8,
Self::HealthLeech => 9,
Self::Heal => 10,
Self::Bind => 11,
Self::Portal => 12,
Self::RitualBase => 13,
Self::RitualSpecialize => 14,
Self::RitualActivatePortal => 15,
Self::QuestComplete => 16,
Self::WeaponDamageNoschool => 17,
Self::Resurrect => 18,
Self::AddExtraAttacks { .. } => 19,
Self::Dodge => 20,
Self::Evade => 21,
Self::Parry => 22,
Self::Block => 23,
Self::CreateItem { .. } => 24,
Self::Weapon => 25,
Self::Defense => 26,
Self::PersistentAreaAura => 27,
Self::Summon { .. } => 28,
Self::Leap => 29,
Self::Energize => 30,
Self::WeaponPercentDamage => 31,
Self::TriggerMissile => 32,
Self::OpenLock { .. } => 33,
Self::SummonChangeItem => 34,
Self::ApplyAreaAuraParty => 35,
Self::LearnSpell => 36,
Self::SpellDefense => 37,
Self::Dispel => 38,
Self::Language => 39,
Self::DualWield => 40,
Self::Unknown41 => 41,
Self::Unknown42 => 42,
Self::TeleportUnitsFaceCaster => 43,
Self::SkillStep => 44,
Self::Undefined45 => 45,
Self::Spawn => 46,
Self::TradeSkill => 47,
Self::Stealth => 48,
Self::Detect => 49,
Self::TransDoor { .. } => 50,
Self::ForceCriticalHit => 51,
Self::GuaranteeHit => 52,
Self::EnchantItem => 53,
Self::EnchantItemTemporary => 54,
Self::Tamecreature => 55,
Self::SummonPet { .. } => 56,
Self::LearnPetSpell => 57,
Self::WeaponDamage => 58,
Self::OpenLockItem { .. } => 59,
Self::Proficiency => 60,
Self::SendEvent => 61,
Self::PowerBurn => 62,
Self::Threat => 63,
Self::TriggerSpell => 64,
Self::HealthFunnel => 65,
Self::PowerFunnel => 66,
Self::HealMaxHealth => 67,
Self::InterruptCast { .. } => 68,
Self::Distract => 69,
Self::Pull => 70,
Self::Pickpocket => 71,
Self::AddFarsight => 72,
Self::Unknown73 => 73,
Self::Unknown74 => 74,
Self::HealMechanical => 75,
Self::SummonObjectWild { .. } => 76,
Self::ScriptEffect => 77,
Self::Attack => 78,
Self::Sanctuary => 79,
Self::AddComboPoints => 80,
Self::CreateHouse { .. } => 81,
Self::BindSight => 82,
Self::Duel { .. } => 83,
Self::Stuck => 84,
Self::SummonPlayer => 85,
Self::ActivateObject => 86,
Self::Unknown87 => 87,
Self::Unknown88 => 88,
Self::Unknown89 => 89,
Self::Unknown90 => 90,
Self::ThreatAll => 91,
Self::EnchantHeldItem => 92,
Self::Unknown93 => 93,
Self::SelfResurrect => 94,
Self::Skinning => 95,
Self::Charge => 96,
Self::Unknown97 => 97,
Self::KnockBack => 98,
Self::Disenchant => 99,
Self::Inebriate => 100,
Self::FeedPet { .. } => 101,
Self::DismissPet { .. } => 102,
Self::Reputation => 103,
Self::SummonObjectSlot1 { .. } => 104,
Self::SummonObjectSlot2 { .. } => 105,
Self::SummonObjectSlot3 { .. } => 106,
Self::SummonObjectSlot4 { .. } => 107,
Self::DispelMechanic => 108,
Self::SummonDeadPet => 109,
Self::DestroyAllTotems => 110,
Self::DurabilityDamage { .. } => 111,
Self::Unknown112 => 112,
Self::ResurrectNew => 113,
Self::AttackMe => 114,
Self::DurabilityDamagePct => 115,
Self::SkinPlayerCorpse => 116,
Self::SpiritHeal => 117,
Self::Skill => 118,
Self::ApplyAreaAuraPet => 119,
Self::TeleportGraveyard => 120,
Self::NormalizedWeaponDmg => 121,
Self::Unknown122 => 122,
Self::SendTaxi => 123,
Self::PlayerPull => 124,
Self::ModifyThreatPercent => 125,
Self::StealBeneficialBuff => 126,
Self::Prospecting => 127,
Self::ApplyAreaAuraFriend => 128,
Self::ApplyAreaAuraEnemy => 129,
Self::RedirectThreat => 130,
Self::PlaySound => 131,
Self::PlayMusic => 132,
Self::UnlearnSpecialization => 133,
Self::KillCreditGroup => 134,
Self::CallPet => 135,
Self::HealPct => 136,
Self::EnergizePct => 137,
Self::LeapBack => 138,
Self::ClearQuest => 139,
Self::ForceCast => 140,
Self::Unknown141 => 141,
Self::TriggerSpellWithValue => 142,
Self::ApplyAreaAuraOwner => 143,
Self::KnockbackFromPosition => 144,
Self::Unknown145 => 145,
Self::Unknown146 => 146,
Self::QuestFail => 147,
Self::Unknown148 => 148,
Self::Charge2 => 149,
Self::Unknown150 => 150,
Self::TriggerSpell2 => 151,
Self::Unknown152 => 152,
Self::Unknown153 => 153,
}
}
}
impl std::fmt::Display for SpellLog {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::None => f.write_str("None"),
Self::Instakill => f.write_str("Instakill"),
Self::SchoolDamage => f.write_str("SchoolDamage"),
Self::Dummy => f.write_str("Dummy"),
Self::PortalTeleport => f.write_str("PortalTeleport"),
Self::TeleportUnits => f.write_str("TeleportUnits"),
Self::ApplyAura => f.write_str("ApplyAura"),
Self::EnvironmentalDamage => f.write_str("EnvironmentalDamage"),
Self::PowerDrain{ .. } => f.write_str("PowerDrain"),
Self::HealthLeech => f.write_str("HealthLeech"),
Self::Heal => f.write_str("Heal"),
Self::Bind => f.write_str("Bind"),
Self::Portal => f.write_str("Portal"),
Self::RitualBase => f.write_str("RitualBase"),
Self::RitualSpecialize => f.write_str("RitualSpecialize"),
Self::RitualActivatePortal => f.write_str("RitualActivatePortal"),
Self::QuestComplete => f.write_str("QuestComplete"),
Self::WeaponDamageNoschool => f.write_str("WeaponDamageNoschool"),
Self::Resurrect => f.write_str("Resurrect"),
Self::AddExtraAttacks{ .. } => f.write_str("AddExtraAttacks"),
Self::Dodge => f.write_str("Dodge"),
Self::Evade => f.write_str("Evade"),
Self::Parry => f.write_str("Parry"),
Self::Block => f.write_str("Block"),
Self::CreateItem{ .. } => f.write_str("CreateItem"),
Self::Weapon => f.write_str("Weapon"),
Self::Defense => f.write_str("Defense"),
Self::PersistentAreaAura => f.write_str("PersistentAreaAura"),
Self::Summon{ .. } => f.write_str("Summon"),
Self::Leap => f.write_str("Leap"),
Self::Energize => f.write_str("Energize"),
Self::WeaponPercentDamage => f.write_str("WeaponPercentDamage"),
Self::TriggerMissile => f.write_str("TriggerMissile"),
Self::OpenLock{ .. } => f.write_str("OpenLock"),
Self::SummonChangeItem => f.write_str("SummonChangeItem"),
Self::ApplyAreaAuraParty => f.write_str("ApplyAreaAuraParty"),
Self::LearnSpell => f.write_str("LearnSpell"),
Self::SpellDefense => f.write_str("SpellDefense"),
Self::Dispel => f.write_str("Dispel"),
Self::Language => f.write_str("Language"),
Self::DualWield => f.write_str("DualWield"),
Self::Unknown41 => f.write_str("Unknown41"),
Self::Unknown42 => f.write_str("Unknown42"),
Self::TeleportUnitsFaceCaster => f.write_str("TeleportUnitsFaceCaster"),
Self::SkillStep => f.write_str("SkillStep"),
Self::Undefined45 => f.write_str("Undefined45"),
Self::Spawn => f.write_str("Spawn"),
Self::TradeSkill => f.write_str("TradeSkill"),
Self::Stealth => f.write_str("Stealth"),
Self::Detect => f.write_str("Detect"),
Self::TransDoor{ .. } => f.write_str("TransDoor"),
Self::ForceCriticalHit => f.write_str("ForceCriticalHit"),
Self::GuaranteeHit => f.write_str("GuaranteeHit"),
Self::EnchantItem => f.write_str("EnchantItem"),
Self::EnchantItemTemporary => f.write_str("EnchantItemTemporary"),
Self::Tamecreature => f.write_str("Tamecreature"),
Self::SummonPet{ .. } => f.write_str("SummonPet"),
Self::LearnPetSpell => f.write_str("LearnPetSpell"),
Self::WeaponDamage => f.write_str("WeaponDamage"),
Self::OpenLockItem{ .. } => f.write_str("OpenLockItem"),
Self::Proficiency => f.write_str("Proficiency"),
Self::SendEvent => f.write_str("SendEvent"),
Self::PowerBurn => f.write_str("PowerBurn"),
Self::Threat => f.write_str("Threat"),
Self::TriggerSpell => f.write_str("TriggerSpell"),
Self::HealthFunnel => f.write_str("HealthFunnel"),
Self::PowerFunnel => f.write_str("PowerFunnel"),
Self::HealMaxHealth => f.write_str("HealMaxHealth"),
Self::InterruptCast{ .. } => f.write_str("InterruptCast"),
Self::Distract => f.write_str("Distract"),
Self::Pull => f.write_str("Pull"),
Self::Pickpocket => f.write_str("Pickpocket"),
Self::AddFarsight => f.write_str("AddFarsight"),
Self::Unknown73 => f.write_str("Unknown73"),
Self::Unknown74 => f.write_str("Unknown74"),
Self::HealMechanical => f.write_str("HealMechanical"),
Self::SummonObjectWild{ .. } => f.write_str("SummonObjectWild"),
Self::ScriptEffect => f.write_str("ScriptEffect"),
Self::Attack => f.write_str("Attack"),
Self::Sanctuary => f.write_str("Sanctuary"),
Self::AddComboPoints => f.write_str("AddComboPoints"),
Self::CreateHouse{ .. } => f.write_str("CreateHouse"),
Self::BindSight => f.write_str("BindSight"),
Self::Duel{ .. } => f.write_str("Duel"),
Self::Stuck => f.write_str("Stuck"),
Self::SummonPlayer => f.write_str("SummonPlayer"),
Self::ActivateObject => f.write_str("ActivateObject"),
Self::Unknown87 => f.write_str("Unknown87"),
Self::Unknown88 => f.write_str("Unknown88"),
Self::Unknown89 => f.write_str("Unknown89"),
Self::Unknown90 => f.write_str("Unknown90"),
Self::ThreatAll => f.write_str("ThreatAll"),
Self::EnchantHeldItem => f.write_str("EnchantHeldItem"),
Self::Unknown93 => f.write_str("Unknown93"),
Self::SelfResurrect => f.write_str("SelfResurrect"),
Self::Skinning => f.write_str("Skinning"),
Self::Charge => f.write_str("Charge"),
Self::Unknown97 => f.write_str("Unknown97"),
Self::KnockBack => f.write_str("KnockBack"),
Self::Disenchant => f.write_str("Disenchant"),
Self::Inebriate => f.write_str("Inebriate"),
Self::FeedPet{ .. } => f.write_str("FeedPet"),
Self::DismissPet{ .. } => f.write_str("DismissPet"),
Self::Reputation => f.write_str("Reputation"),
Self::SummonObjectSlot1{ .. } => f.write_str("SummonObjectSlot1"),
Self::SummonObjectSlot2{ .. } => f.write_str("SummonObjectSlot2"),
Self::SummonObjectSlot3{ .. } => f.write_str("SummonObjectSlot3"),
Self::SummonObjectSlot4{ .. } => f.write_str("SummonObjectSlot4"),
Self::DispelMechanic => f.write_str("DispelMechanic"),
Self::SummonDeadPet => f.write_str("SummonDeadPet"),
Self::DestroyAllTotems => f.write_str("DestroyAllTotems"),
Self::DurabilityDamage{ .. } => f.write_str("DurabilityDamage"),
Self::Unknown112 => f.write_str("Unknown112"),
Self::ResurrectNew => f.write_str("ResurrectNew"),
Self::AttackMe => f.write_str("AttackMe"),
Self::DurabilityDamagePct => f.write_str("DurabilityDamagePct"),
Self::SkinPlayerCorpse => f.write_str("SkinPlayerCorpse"),
Self::SpiritHeal => f.write_str("SpiritHeal"),
Self::Skill => f.write_str("Skill"),
Self::ApplyAreaAuraPet => f.write_str("ApplyAreaAuraPet"),
Self::TeleportGraveyard => f.write_str("TeleportGraveyard"),
Self::NormalizedWeaponDmg => f.write_str("NormalizedWeaponDmg"),
Self::Unknown122 => f.write_str("Unknown122"),
Self::SendTaxi => f.write_str("SendTaxi"),
Self::PlayerPull => f.write_str("PlayerPull"),
Self::ModifyThreatPercent => f.write_str("ModifyThreatPercent"),
Self::StealBeneficialBuff => f.write_str("StealBeneficialBuff"),
Self::Prospecting => f.write_str("Prospecting"),
Self::ApplyAreaAuraFriend => f.write_str("ApplyAreaAuraFriend"),
Self::ApplyAreaAuraEnemy => f.write_str("ApplyAreaAuraEnemy"),
Self::RedirectThreat => f.write_str("RedirectThreat"),
Self::PlaySound => f.write_str("PlaySound"),
Self::PlayMusic => f.write_str("PlayMusic"),
Self::UnlearnSpecialization => f.write_str("UnlearnSpecialization"),
Self::KillCreditGroup => f.write_str("KillCreditGroup"),
Self::CallPet => f.write_str("CallPet"),
Self::HealPct => f.write_str("HealPct"),
Self::EnergizePct => f.write_str("EnergizePct"),
Self::LeapBack => f.write_str("LeapBack"),
Self::ClearQuest => f.write_str("ClearQuest"),
Self::ForceCast => f.write_str("ForceCast"),
Self::Unknown141 => f.write_str("Unknown141"),
Self::TriggerSpellWithValue => f.write_str("TriggerSpellWithValue"),
Self::ApplyAreaAuraOwner => f.write_str("ApplyAreaAuraOwner"),
Self::KnockbackFromPosition => f.write_str("KnockbackFromPosition"),
Self::Unknown145 => f.write_str("Unknown145"),
Self::Unknown146 => f.write_str("Unknown146"),
Self::QuestFail => f.write_str("QuestFail"),
Self::Unknown148 => f.write_str("Unknown148"),
Self::Charge2 => f.write_str("Charge2"),
Self::Unknown150 => f.write_str("Unknown150"),
Self::TriggerSpell2 => f.write_str("TriggerSpell2"),
Self::Unknown152 => f.write_str("Unknown152"),
Self::Unknown153 => f.write_str("Unknown153"),
}
}
}