Threat-1.0

From WowAce Wiki
Jump to: navigation, search
Summary
Lib: Threat-1.0
A library to provide group threat information
TOC 2.3 (20300)
Category Libraries
Author Antiarc
Details
Version 2.1
Links
Betas Ace SVN Zip
Changelog FishEye

Contents

API Documentation

Note: This documentation is auto-generated. Please note that direct modifications may be overwritten on next autogenerate.

:ClearStoredThreatTables(mobName)

Arguments

mobName
type - (needs documentation)


:DoesPlayerHavePet()

Notes

Returns true if the player has a pet and an active pet module


:DumpQueriedRevisions()

No arguments string

:DumpThreatTable([sender])

Arguments

sender
string - player to dump the threat table for

Notes

Prints the current threat table to the console


:EncounterMobs()

Notes

Returns the number of mobs in the current encounter as specified by the NPC core. Not generally needed by GUIs; may be needed by Class core


:GetCumulativeThreat()

Returns

integer - this player's cumulative threat in the encounter, suitable for publishing to KTM or similar


:GetMaxThreatOnTarget("target")

Arguments

"target"
string - name of the target to get max threat one.

Notes

Returns the maximum threat value and the name of the player with the maximum threat on the given target


:GetPartyRevisions()

Notes

Returns a pre-formatted hash of party revisions suitable for printing


:GetPetModule()

Notes

Returns the currently active class module for the pet. Not generally needed by GUIs; may be needed by NPC core


:GetPlayerModule()

Notes

Returns the currently active class module for the player. Not generally needed by GUIs; may be needed by NPC core


:GetTPS("player" , "target")

Arguments

"player"
string - name of the player to get TPS for
"target"
string - name of the target to get TPS on

Returns

  • Local TPS (float)
  • Encounter TPS (float)


:GetTPSSamples()

Returns

The current number of threat samples used to calculate TPS


:GetThreat("player" , "target")

Arguments

"player"
string - Name of the player or pet to get threat for
"target"
string - Name or hash of the target to get threat on

Notes

Returns a float corresponding to the given player or pet's threat level on the given target


:GetUnitIDByUnitName("unitName")

Arguments

"unitName"
string - name of the group member to get a unit ID for

Notes

Returns a group id ("player3", "raid4pet") for the given name, nil if not found


:IsActive()

Returns

boolean - whether Threat-1.0 is currently activated.


:IsOutOfDate("name")

Arguments

"name"
string - name of the party member to check

Returns

  • boolean - whether the given party member is using an out-of-date ThreatLib or not
  • integer - our version number
  • integer - the latest revision number we've seen
  • string - the name of the person holding the latest revision


:IsUsingForeignThreatSource("partyMember")

Arguments

"partyMember"
string - name of the party member to check

Notes

Returns a boolean indicating whether the given party member is using ThreatLib (false) or an external source like KTM (true)


:IterateGroupThreatForTarget(target)

Arguments

target
type - (needs documentation)


:PetName()

No arguments

:RequestActiveOnSolo(value)

Arguments

value
boolean - whether to be activated. Default: true

Notes

This is meant to be called by a GUI to allow for testing in solo situations.


:RequestThreatClear()

Notes

Executes a raid-wide threat wipe Must have privileges to execute this; you can clear your own, but other clients are going to verify that you're allowed to do this


:SendThreatTo("targetPlayer" , "targetEnemy" , threat)

Arguments

"targetPlayer"
string - name of the group member to send threat to
"targetEnemy"
string - name of the enemy to send threat for
threat
float - amount of threat to send

Notes

Sends a given amount of threat to a group member. Used for Misdirection. Not needed by GUIs.


:SetNPCModuleValue("var_name" , var_value)

Arguments

"var_name"
string - variable name to set
var_value
float - value to set for variable


:SetTPSSamples(samples)

Arguments

samples
integer - number of threat events to consider for TPS calculations

Notes

Default is 15

A larger sample size will produce a TPS reading for a longer slice of combat, which means that it'll be more stable, but won't reflect your TPS-at-the-moment as accurately.


:ToggleThreatPublish(val)

Arguments

val
boolean - Whether or not to publish threat updates

Notes

Toggles threat publishes on and off, in case you don't want to send threat values to your group for some reason


:UnitInMeleeRange("unitID")

Arguments

"unitID"
string - UnitID to check melee range for

Notes

Returns true if the unit is within 10 yards


:UnitIsUnit("a" , "b")

Arguments

"a"
string - Unit name or hash to check
"b"
string - Unit name or hash to check

Notes

Checks to see if a unit's name matches a unit's hash. Since Threat_ThreatUpdated sends hashes, you'll want to check a raw name against that hash with this method


:WipeRaidThreatOnMob("mob")

Arguments

"mob"
string - name of the enemy to ask the group to wipe threat on

Notes

Sends a comm message to the group instructing them to wipe their threat levels on a specific mob. This is not protected as it needs to be able to be executed by anyone who sees the relevant events.

KTM protects this by requiring 2 or more people to send the event before it is processed.


:zeroGlobalThreat(m)

Arguments

m
type - (needs documentation)