* Change name of recently added scriptAI functions to better reflect purpose

* Fix typo in 3910_world.sql, spotted by irish

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2009-06-11 17:54:59 +02:00
parent 8fed6e39f5
commit 6eaf6e962a
6 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
UPDATE `creature_template` SET `ScriptName` = 'npc_threshwackonator' WHERE `entry` = 6669;
DELETE FROM `script_texts` WHERE `entry` IN (-1000411, -1000412);
DELETE FROM `script_texts` WHERE `entry` IN (-1000413, -1000414);
INSERT INTO script_texts (entry, content_default, sound, type, language, emote, comment) VALUES
(-1000413, 'Threshwackonator First Mate unit prepared to follow', 0, 2, 0, 0, 'threshwackonator EMOTE_START'),
(-1000414, 'YARRR! Swabie, what have ye done?! He\'s gone mad! Baton him down the hatches! Hoist the mast! ARRRR! Every man for hi\'self!', 0, 0, 7, 0, 'threshwackonator SAY_AT_CLOSE');
@@ -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()
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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; }
+1 -1
View File
@@ -184,7 +184,7 @@ bool CreatureAI::_EnterEvadeMode()
me->CombatStop(true);
me->LoadCreaturesAddon();
me->SetLootRecipient(NULL);
me->ResetDamageByPlayers();
me->ResetPlayerDamageReq();
return true;
}
+1 -2
View File
@@ -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)