*Cleanup comments, update THANKS (no idea if I missed anybody o_O), added Themris' Warlock's Death Coil healing and damage fix, corrected some typos

--HG--
branch : trunk
This commit is contained in:
maximius
2009-09-10 22:15:29 -07:00
parent 3441e4ef39
commit bcf19139af
12 changed files with 22 additions and 40 deletions
-1
View File
@@ -78,7 +78,6 @@ void Pet::AddToWorld()
AIM_Initialize();
}
// MrSmite 09-09-2009 PetAI_v1.1
// Prevent stuck pets when zoning. Pets default to "follow" when added to world
// so we'll reset flags and let the AI handle things
if (this->GetCharmInfo() && this->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW))
+2 -13
View File
@@ -70,7 +70,6 @@ void PetAI::_stopAttack()
return;
}
// MrSmite 09-05-2009 PetAI_v1.0
m_creature->AttackStop();
me->GetCharmInfo()->SetIsCommandAttack(false);
HandleReturnMovement();
@@ -100,8 +99,6 @@ void PetAI::UpdateAI(const uint32 diff)
}
else if(owner && m_creature->GetCharmInfo()) //no victim
{
// MrSmite 05-09-2009 PetAI_v1.0
Unit *nextTarget = SelectNextTarget();
if (nextTarget)
@@ -165,7 +162,7 @@ void PetAI::UpdateAI(const uint32 diff)
Spell *spell = new Spell(m_creature, spellInfo, false, 0);
// MrSmite 09-05-2009 PetAI_v1.0 - Fix to allow pets on STAY to autocast
// Fix to allow pets on STAY to autocast
if (inCombat && _CanAttack(me->getVictim()) && spell->CanAutoCast(me->getVictim()))
{
targetSpellStore.push_back(std::make_pair<Unit*, Spell*>(m_creature->getVictim(), spell));
@@ -269,8 +266,6 @@ void PetAI::UpdateAllies()
void PetAI::KilledUnit(Unit *victim)
{
// MrSmite 09-09-2009 PetAI_v1.2
// Called from Unit::Kill() in case where pet or owner kills something
// if owner killed this victim, pet may still be attacking something else
if (me->getVictim() && me->getVictim() != victim)
@@ -290,7 +285,6 @@ void PetAI::KilledUnit(Unit *victim)
void PetAI::AttackStart(Unit *target)
{
// MrSmite 09-05-2009 PetAI_v1.0
// Overrides Unit::AttackStart to correctly evaluate Pet states
// Check all pet states to decide if we can attack this target
@@ -311,8 +305,6 @@ void PetAI::AttackStart(Unit *target)
Unit *PetAI::SelectNextTarget()
{
// MrSmite 09-05-2009 PetAI_v1.0
// Provides next target selection after current target death
// Passive pets don't do next target selection
@@ -334,8 +326,6 @@ Unit *PetAI::SelectNextTarget()
void PetAI::HandleReturnMovement()
{
// MrSmite 09-05-2009 PetAI_v1.0
// Handles moving the pet back to stay or owner
if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY))
@@ -402,7 +392,6 @@ void PetAI::DoAttack(Unit *target, bool chase)
void PetAI::MovementInform(uint32 moveType, uint32 data)
{
// MrSmite 09-05-2009 PetAI_v1.0
// Receives notification when pet reaches stay or follow owner
switch (moveType)
{
@@ -467,4 +456,4 @@ bool PetAI::_CanAttack(Unit *target)
// default, though we shouldn't ever get here
return false;
}␍
}
-2
View File
@@ -39,7 +39,6 @@ class TRINITY_DLL_DECL PetAI : public CreatureAI
void UpdateAI(const uint32);
static int Permissible(const Creature *);
// MrSmite 09-05-2009 PetAI_v1.0
void KilledUnit(Unit *victim);
void AttackStart(Unit *target);
void MovementInform(uint32 moveType, uint32 data);
@@ -56,7 +55,6 @@ class TRINITY_DLL_DECL PetAI : public CreatureAI
std::set<uint64> m_AllySet;
uint32 m_updateAlliesTimer;
// MrSmite 09-05-2009 PetAI_v1.0
Unit *SelectNextTarget();
void HandleReturnMovement();
void DoAttack(Unit *target, bool chase);
+2 -7
View File
@@ -96,7 +96,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
pet->InterruptNonMeleeSpells(false);
pet->GetMotionMaster()->MoveIdle();
charmInfo->SetCommandState( COMMAND_STAY );
// MrSmite 09-05-2009 PetAI_v1.0
charmInfo->SetIsCommandAttack(false);
charmInfo->SetIsAtStay(true);
charmInfo->SetIsFollowing(false);
@@ -108,7 +108,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
pet->InterruptNonMeleeSpells(false);
pet->GetMotionMaster()->MoveFollow(_player,PET_FOLLOW_DIST,pet->GetFollowAngle());
charmInfo->SetCommandState( COMMAND_FOLLOW );
// MrSmite 09-05-2009 PetAI_v1.0
charmInfo->SetIsCommandAttack(false);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsReturning(true);
@@ -150,7 +150,6 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
if(pet->GetTypeId() != TYPEID_PLAYER && ((Creature*)pet)->IsAIEnabled)
{
// MrSmite 09-05-2009 PetAI_v1.0
charmInfo->SetIsCommandAttack(true);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsFollowing(false);
@@ -172,7 +171,6 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
if(pet->getVictim() && pet->getVictim() != TargetUnit)
pet->AttackStop();
// MrSmite 09-05-2009 PetAI_v1.0
charmInfo->SetIsCommandAttack(true);
charmInfo->SetIsAtStay(false);
charmInfo->SetIsFollowing(false);
@@ -212,7 +210,6 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
switch(spellid)
{
case REACT_PASSIVE: //passive
// MrSmite 09-05-2009 PetAI_v1.0
pet->AttackStop();
case REACT_DEFENSIVE: //recovery
@@ -251,7 +248,6 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
if(!pet->HasSpell(spellid) || IsPassiveSpell(spellid))
return;
// MrSmite 09-08-2009 PetAI_v1.1
// Clear the flags as if owner clicked 'attack'. AI will reset them
// after AttackStart, even if spell failed
if (pet->GetCharmInfo())
@@ -330,7 +326,6 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
spell->finish(false);
delete spell;
// MrSmite 09-08-2009 PetAI_v1.1
// reset specific flags in case of spell fail. AI will reset other flags
if (pet->GetCharmInfo())
pet->GetCharmInfo()->SetIsCommandAttack(false);
+1 -2
View File
@@ -17962,8 +17962,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
// prevent stealth flight
//RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
//Hawthorne - Instant Taxi Option
if ((bool)sWorld.getConfig(CONFIG_INSTANT_TAXI))
if (sWorld.getConfig(CONFIG_INSTANT_TAXI))
{
TaxiNodesEntry const* lastnode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]);
m_taxi.ClearTaxiDestinations();
+9 -1
View File
@@ -2744,7 +2744,12 @@ void Spell::EffectHealthLeech(uint32 i)
if(Player *modOwner = m_caster->GetSpellModOwner())
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
int32 new_damage = int32(damage*multiplier);
// Do not apply multiplier to damage if it's Death Coil
int32 new_damage;
if (m_spellInfo->SpellFamilyFlags[0] & 0x80000)
new_damage = damage;
else
int32 new_damage = int32(damage*multiplier);
uint32 curHealth = unitTarget->GetHealth();
new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage );
if(curHealth < new_damage)
@@ -2752,6 +2757,9 @@ void Spell::EffectHealthLeech(uint32 i)
if(m_caster->isAlive())
{
// Insead add it just to healing if it's Death Coil
if (m_spellInfo->SpellFamilyFlags[0] & 0x80000)
new_damage = int32(new_damage*multiplier);
new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL);
m_caster->DealHeal(m_caster, uint32(new_damage), m_spellInfo);
}
+2 -5
View File
@@ -22,7 +22,7 @@
#include "TargetedMovementGenerator.h"
#include "Errors.h"
#include "Creature.h"
#include "CreatureAI.h" // MrSmite 09-05-2009 PetAI_v1.0
#include "CreatureAI.h"
#include "DestinationHolderImp.h"
#include "World.h"
@@ -238,7 +238,6 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff)
}
}
// MrSmite 09-05-2009 PetAI_v1.0
// Implemented for PetAI to handle resetting flags when pet owner reached
if (i_destinationHolder.HasArrived())
MovementInform(owner);
@@ -256,17 +255,15 @@ TargetedMovementGenerator<T>::GetTarget() const
template<class T>
void TargetedMovementGenerator<T>::MovementInform(T &unit)
{
// MrSmite 09-05-2009 PetAI_v1.0
}
template <> void TargetedMovementGenerator<Creature>::MovementInform(Creature &unit)
{
// MrSmite 09-05-2009 PetAI_v1.0
// Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
unit.AI()->MovementInform(TARGETED_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
}
template void TargetedMovementGenerator<Player>::MovementInform(Player&); // MrSmite 09-05-2009 PetAI_v1.0 - Not implemented for players
template void TargetedMovementGenerator<Player>::MovementInform(Player&); // Not implemented for players
template TargetedMovementGenerator<Player>::TargetedMovementGenerator(Unit &target, float offset, float angle);
template TargetedMovementGenerator<Creature>::TargetedMovementGenerator(Unit &target, float offset, float angle);
template bool TargetedMovementGenerator<Player>::_setTargetLocation(Player &);
-1
View File
@@ -49,7 +49,6 @@ class TRINITY_DLL_SPEC TargetedMovementGenerator
bool Update(T &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return TARGETED_MOTION_TYPE; }
// MrSmite 09-05-2009 PetAI_v1.0
void MovementInform(T &);
Unit* GetTarget() const;
+1 -1
View File
@@ -15084,4 +15084,4 @@ void CharmInfo::SetIsReturning(bool val)
bool CharmInfo::IsReturning()
{
return m_isReturning;
}
}
-2
View File
@@ -1011,7 +1011,6 @@ struct CharmInfo
CharmSpellEntry* GetCharmSpell(uint8 index) { return &(m_charmspells[index]); }
// MrSmite 09-05-2009 PetAI_v1.0
void SetIsCommandAttack(bool val);
bool IsCommandAttack();
void SetIsAtStay(bool val);
@@ -1036,7 +1035,6 @@ struct CharmInfo
//for restoration after charmed
ReactStates m_oldReactState;
// MrSmite 09-05-2009 PetAI_v1.0
bool m_isCommandAttack;
bool m_isAtStay;
bool m_isFollowing;