*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
This commit is contained in:
1 parent
26b5e033ff
commit
e585187b24
2257 files changed
+103863
-761
No files matched your search
@@ -17,22 +17,27 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "HostilRefManager.h"
|
||||
#include "ThreatManager.h"
|
||||
#include "Unit.h"
|
||||
#include "DBCStructure.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
HostilRefManager::~HostilRefManager()
|
||||
{
|
||||
deleteReferences();
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// send threat to all my hateres for the pVictim
|
||||
// The pVictim is hated than by them as well
|
||||
// use for buffs and healing threat functionality
|
||||
|
||||
void HostilRefManager::threatAssist(Unit *pVictim, float pThreat, SpellEntry const *pThreatSpell, bool pSingleTarget)
|
||||
{
|
||||
HostilReference* ref;
|
||||
|
||||
uint32 size = pSingleTarget ? 1 : getSize(); // if pSingleTarget do not devide threat
|
||||
ref = getFirst();
|
||||
while(ref != NULL)
|
||||
@@ -45,10 +50,13 @@ void HostilRefManager::threatAssist(Unit *pVictim, float pThreat, SpellEntry con
|
||||
ref = ref->next();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
|
||||
void HostilRefManager::addThreatPercent(int32 pValue)
|
||||
{
|
||||
HostilReference* ref;
|
||||
|
||||
ref = getFirst();
|
||||
while(ref != NULL)
|
||||
{
|
||||
@@ -56,11 +64,14 @@ void HostilRefManager::addThreatPercent(int32 pValue)
|
||||
ref = ref->next();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// The online / offline status is given to the method. The calculation has to be done before
|
||||
|
||||
void HostilRefManager::setOnlineOfflineState(bool pIsOnline)
|
||||
{
|
||||
HostilReference* ref;
|
||||
|
||||
ref = getFirst();
|
||||
while(ref != NULL)
|
||||
{
|
||||
@@ -68,8 +79,10 @@ void HostilRefManager::setOnlineOfflineState(bool pIsOnline)
|
||||
ref = ref->next();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// The online / offline status is calculated and set
|
||||
|
||||
void HostilRefManager::updateThreatTables()
|
||||
{
|
||||
HostilReference* ref = getFirst();
|
||||
@@ -79,9 +92,11 @@ void HostilRefManager::updateThreatTables()
|
||||
ref = ref->next();
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// The references are not needed anymore
|
||||
// tell the source to remove them from the list and free the mem
|
||||
|
||||
void HostilRefManager::deleteReferences()
|
||||
{
|
||||
HostilReference* ref = getFirst();
|
||||
@@ -93,8 +108,10 @@ void HostilRefManager::deleteReferences()
|
||||
ref = nextRef;
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// delete one reference, defined by Unit
|
||||
|
||||
void HostilRefManager::deleteReference(Unit *pCreature)
|
||||
{
|
||||
HostilReference* ref = getFirst();
|
||||
@@ -110,8 +127,10 @@ void HostilRefManager::deleteReference(Unit *pCreature)
|
||||
ref = nextRef;
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
// set state for one reference, defined by Unit
|
||||
|
||||
void HostilRefManager::setOnlineOfflineState(Unit *pCreature,bool pIsOnline)
|
||||
{
|
||||
HostilReference* ref = getFirst();
|
||||
@@ -126,5 +145,6 @@ void HostilRefManager::setOnlineOfflineState(Unit *pCreature,bool pIsOnline)
|
||||
ref = nextRef;
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================
|
||||
|
||||
Reference in new issue
Block a user