12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 21 ■ Responding to the Combat Log <strong>and</strong> Threat In<strong>for</strong>mation 389Combat Event PrefixThe event prefix indicates the type <strong>of</strong> the event, such as whether it involvesphysical damage like an auto-attack, a ranged attack, spell, or damage toa building or structure in-game. The additional arguments will be after theinitial eight arguments that come with the COMBAT_LOG_EVENT_UNFILTERED.SWING—This prefix is encountered <strong>for</strong> any auto-attack damage. No additionalarguments are sent <strong>for</strong> this type <strong>of</strong> event prefix.RANGE—Any ranged attacks, such as auto shot, shoot bow/gun/crossbow/w<strong>and</strong>, <strong>and</strong> throwing, will use this prefix, which sends the spellin<strong>for</strong>mation as additional arguments. The spell in<strong>for</strong>mation is passed inadditional arguments: spellId, spellName,<strong>and</strong>spellSchool.SPELL—This prefix is used <strong>for</strong> all spellcast events, as well as other types <strong>of</strong>non-periodic spell actions. The spell in<strong>for</strong>mation is passed in additionalarguments: spellId, spellName,<strong>and</strong>spellSchool.ENVIRONMENTAL—This prefix is used <strong>for</strong> damage caused by the environment,such as when a player touches a bonfire, is immersed in lava, fallsfrom great height, or begins to drown. The type <strong>of</strong> environmental damageis passed as an additional argument: environmentType.Bit Fields <strong>and</strong> Spell SchoolsThroughout the combat log, bit fields are used <strong>for</strong> arguments where more thanone setting might be set in a single argument. The term bit field comes from thebinary representation <strong>of</strong> numbers, where a number is made up <strong>of</strong> a number<strong>of</strong> bits. Table 21-1 shows the basic spell schools with their numeric values <strong>and</strong>binary representation.Table 21-1: Spell Schools <strong>and</strong> Numeric RepresentationsSPELL SCHOOL NUMERIC VALUE BINARY REPRESENTATIONPhysical 1 00000001Holy 2 00000010Fire 4 00000100Nature 8 00001000Frost 16 00010000Shadow 32 00100000Arcane 64 01000000Frostfire 20 00010100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!