aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <none@none>2009-06-11 17:54:59 +0200
committerMachiavelli <none@none>2009-06-11 17:54:59 +0200
commit6eaf6e962a31aa308406289d538aef30a56b95cb (patch)
tree5980ff3267545a42b3b8f248754c5cbc3f1f70d0 /src
parent8fed6e39f5de4c62825bcd87f06189a3637c1541 (diff)
* Change name of recently added scriptAI functions to better reflect purpose
* Fix typo in 3910_world.sql, spotted by irish --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp2
-rw-r--r--src/game/Creature.cpp4
-rw-r--r--src/game/Creature.h4
-rw-r--r--src/game/CreatureAI.cpp2
-rw-r--r--src/game/Unit.cpp3
5 files changed, 7 insertions, 8 deletions
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
index 66b99a98f9e..b38db40af32 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp
@@ -62,7 +62,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
//database should have `RegenHealth`=0 to prevent regen
uint32 hp = (m_creature->GetMaxHealth()*40)/100;
if (hp) m_creature->SetHealth(hp);
- m_creature->ResetDamageByPlayers();
+ m_creature->ResetPlayerDamageReq();
}
void SonicBoomEffect()
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index f31dcbf4df7..eb7c93f2d0b 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1351,7 +1351,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
SetCreateHealth(health);
SetMaxHealth(health);
SetHealth(health);
- ResetDamageByPlayers();
+ ResetPlayerDamageReq();
// mana
uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana);
@@ -1742,7 +1742,7 @@ void Creature::setDeathState(DeathState s)
// setActive(true);
SetHealth(GetMaxHealth());
SetLootRecipient(NULL);
- ResetDamageByPlayers();
+ ResetPlayerDamageReq();
Unit::setDeathState(ALIVE);
CreatureInfo const *cinfo = GetCreatureInfo();
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
diff --git a/src/game/Creature.h b/src/game/Creature.h
index 7ec203d8f3b..56b6088c036 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -723,12 +723,12 @@ class TRINITY_DLL_SPEC Creature : public Unit
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
bool IsDamageEnoughForLootingAndReward() { return m_PlayerDamageReq == 0; }
- void AddDamageByPlayers(uint32 unDamage)
+ void LowerPlayerDamageReq(uint32 unDamage)
{
if(m_PlayerDamageReq)
m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0;
}
- void ResetDamageByPlayers() { m_PlayerDamageReq = GetHealth() / 2; }
+ void ResetPlayerDamageReq() { m_PlayerDamageReq = GetHealth() / 2; }
uint32 m_PlayerDamageReq;
void SetOriginalEntry(uint32 entry) { m_originalEntry = entry; }
diff --git a/src/game/CreatureAI.cpp b/src/game/CreatureAI.cpp
index 1c3179b2e23..9f06ca38b56 100644
--- a/src/game/CreatureAI.cpp
+++ b/src/game/CreatureAI.cpp
@@ -184,7 +184,7 @@ bool CreatureAI::_EnterEvadeMode()
me->CombatStop(true);
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
- me->ResetDamageByPlayers();
+ me->ResetPlayerDamageReq();
return true;
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b8bcf656b9f..101793a507c 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -588,7 +588,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if(pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsAIEnabled)
{
((Creature*)pVictim)->AI()->DamageTaken(this, damage);
- ((Creature*)pVictim)->AddDamageByPlayers(damage);
}
if (damagetype != NODAMAGE)
{
@@ -706,7 +705,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
((Creature*)pVictim)->SetLootRecipient(this);
if(IsControlledByPlayer())
- ((Creature*)pVictim)->AddDamageByPlayers(health < damage ? health : damage);
+ ((Creature*)pVictim)->LowerPlayerDamageReq(health < damage ? health : damage);
}
if (health <= damage)