diff options
| author | megamage <none@none> | 2009-01-09 16:43:23 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-01-09 16:43:23 -0600 |
| commit | 1ffb1cef3344206dfea149cb78146c30449d51c2 (patch) | |
| tree | 655ac591f6f5aaca3dc65d67f3940f589e2394db /src/bindings/scripts/include | |
| parent | 5c8f52d134899e10484dd47e91b612e2228842bf (diff) | |
| parent | 90a82a81ad5d20d5e7188d6e9d660280f0b1eab4 (diff) | |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/bindings/scripts/include')
| -rw-r--r-- | src/bindings/scripts/include/sc_creature.cpp | 16 | ||||
| -rw-r--r-- | src/bindings/scripts/include/sc_creature.h | 3 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 20c5600dc02..12992eedc52 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -711,11 +711,23 @@ void ScriptedAI::DoResetThreat() { Unit* pUnit = NULL; pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if(pUnit && m_creature->getThreatManager().getThreat(pUnit)) - m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); + if(pUnit && DoGetThreat(pUnit)) + DoModifyThreatPercent(pUnit, -100); } } +float ScriptedAI::DoGetThreat(Unit* pUnit) +{ + if(!pUnit) return 0.0f; + return m_creature->getThreatManager().getThreat(pUnit); +} + +void ScriptedAI::DoModifyThreatPercent(Unit *pUnit, int32 pct) +{ + if(!pUnit) return; + m_creature->getThreatManager().modifyThreatPercent(pUnit, pct); +} + void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float o) { if(!pUnit || pUnit->GetTypeId() != TYPEID_PLAYER) diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 9c7ffc022eb..12ec3f0cbf5 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -144,6 +144,9 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI //Drops all threat to 0%. Does not remove players from the threat list void DoResetThreat(); + float DoGetThreat(Unit *u); + void DoModifyThreatPercent(Unit *pUnit, int32 pct); + //Teleports a player without dropping threat (only teleports to same map) void DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float o); void DoTeleportAll(float x, float y, float z, float o); |
