*Merge.
*"Fix Glowing Blood" is not merged. Outdated patch? --HG-- branch : trunk
This commit is contained in:
@@ -940,7 +940,7 @@ void LoadDatabase()
|
||||
|
||||
//Creature does not exist in database
|
||||
if (!GetCreatureTemplateStore(temp.creature_id))
|
||||
error_db_log("TSCR: Event %u has script for non-existing creature.", i);
|
||||
error_db_log("TSCR: Event %u has script for non-existing creature.", i);
|
||||
|
||||
//Report any errors in event
|
||||
if (temp.event_type >= EVENT_T_END)
|
||||
@@ -1125,7 +1125,7 @@ void LoadDatabase()
|
||||
{
|
||||
const SpellEntry *spell = GetSpellStore()->LookupEntry(temp.action[j].param1);
|
||||
if (!spell)
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param1);
|
||||
error_db_log("SD2: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param1);
|
||||
else
|
||||
{
|
||||
if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE)
|
||||
@@ -1183,7 +1183,7 @@ void LoadDatabase()
|
||||
error_db_log("TSCR: Event %u Action %u uses non-existant SpellID %u.", i, j+1, temp.action[j].param2);
|
||||
|
||||
if (temp.action[j].param3 >= TARGET_T_END)
|
||||
error_db_log("TSCR: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
error_db_log("SD2: Event %u Action %u uses incorrect Target type", i, j+1);
|
||||
}
|
||||
break;
|
||||
case ACTION_T_CASTCREATUREGO_ALL:
|
||||
@@ -1249,7 +1249,7 @@ void LoadDatabase()
|
||||
|
||||
case ACTION_T_INC_PHASE:
|
||||
if (!temp.action[j].param1)
|
||||
error_db_log("TSCR: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
|
||||
error_db_log("SD2: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1);
|
||||
break;
|
||||
|
||||
case ACTION_T_SET_INST_DATA:
|
||||
|
||||
@@ -166,7 +166,6 @@ void ScriptedAI::DoStartNoMovement(Unit* victim)
|
||||
return;
|
||||
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->StopMoving();
|
||||
}
|
||||
|
||||
void ScriptedAI::DoStopAttack()
|
||||
|
||||
@@ -687,7 +687,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
AttackDistance = 0;
|
||||
AttackAngle = 0;
|
||||
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
}
|
||||
@@ -804,19 +803,12 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
//Allow movement (create new targeted movement gen only if idle)
|
||||
if (CombatMovementEnabled)
|
||||
{
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE)
|
||||
{
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
else
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
{
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->StopMoving();
|
||||
}
|
||||
{
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACTION_T_SET_PHASE:
|
||||
@@ -886,10 +878,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
if (CombatMovementEnabled)
|
||||
{
|
||||
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE)
|
||||
{
|
||||
//Drop current movement gen
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
}
|
||||
@@ -1099,7 +1087,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
@@ -1234,7 +1222,6 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
else
|
||||
{
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->StopMoving();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1450,7 +1437,7 @@ void AddSC_mob_event()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_eventai";
|
||||
newscript->Name = "mob_eventai";
|
||||
newscript->GetAI = &GetAI_Mob_EventAI;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -350,9 +350,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI
|
||||
DoScriptText(SAY_RIZZLE_FINAL, m_creature);
|
||||
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 1);
|
||||
m_creature->setFaction(35);
|
||||
m_creature->StopMoving();
|
||||
m_creature->GetMotionMaster()->MovementExpired();
|
||||
m_creature->GetMotionMaster()->Clear(true);
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
|
||||
Reached = true;
|
||||
}
|
||||
|
||||
@@ -1086,8 +1086,8 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
|
||||
Illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
|
||||
m_creature->SetInFront(Illidan);
|
||||
Illidan->SetInFront(m_creature);
|
||||
m_creature->StopMoving();
|
||||
Illidan->StopMoving();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
Illidan->GetMotionMaster()->MoveIdle();
|
||||
((boss_illidan_stormrageAI*)Illidan->AI())->AkamaGUID = m_creature->GetGUID();
|
||||
((boss_illidan_stormrageAI*)Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE);
|
||||
}
|
||||
@@ -1919,8 +1919,8 @@ void boss_illidan_stormrageAI::HandleTalkSequence()
|
||||
Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported!
|
||||
Maiev->SetInFront(m_creature); // Have her face us
|
||||
m_creature->SetInFront(Maiev); // Face her, so it's not rude =P
|
||||
Maiev->StopMoving();
|
||||
m_creature->StopMoving();
|
||||
Maiev->GetMotionMaster()->MoveIdle();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
}break;
|
||||
case 14:
|
||||
if(GETCRE(Maiev, MaievGUID))
|
||||
|
||||
@@ -709,7 +709,6 @@ void mob_headAI::Disappear()
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->StopMoving();
|
||||
((boss_headless_horsemanAI*)body->AI())->returned = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,6 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
m_creature->SetHealth(0);
|
||||
m_creature->StopMoving();
|
||||
m_creature->ClearComboPointHolders();
|
||||
m_creature->RemoveAllAurasOnDeath();
|
||||
m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
|
||||
@@ -864,7 +863,6 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
|
||||
DoScriptText(SAY_PHASE5_NUTS, m_creature);
|
||||
|
||||
m_creature->StopMoving();
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
DoTeleportTo(GRAVITY_X, GRAVITY_Y, GRAVITY_Z);
|
||||
@@ -928,7 +926,6 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
switch(GravityLapse_Phase)
|
||||
{
|
||||
case 0:
|
||||
m_creature->StopMoving();
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
DoTeleportTo(GRAVITY_X, GRAVITY_Y, GRAVITY_Z);
|
||||
|
||||
@@ -478,7 +478,12 @@ void Creature::Update(uint32 diff)
|
||||
break;
|
||||
|
||||
// if creature is charmed, switch to charmed AI
|
||||
UpdateCharmAI();
|
||||
if(NeedChangeAI)
|
||||
{
|
||||
UpdateCharmAI();
|
||||
NeedChangeAI = false;
|
||||
IsAIEnabled = true;
|
||||
}
|
||||
|
||||
if(!IsInEvadeMode() && IsAIEnabled)
|
||||
{
|
||||
@@ -1613,9 +1618,6 @@ void Creature::setDeathState(DeathState s)
|
||||
|
||||
if (canFly() && FallGround())
|
||||
return;
|
||||
|
||||
if(!IsStopped())
|
||||
StopMoving();
|
||||
}
|
||||
Unit::setDeathState(s);
|
||||
|
||||
|
||||
@@ -63,7 +63,12 @@ void UnitAI::DoMeleeAttackIfReady()
|
||||
void PlayerAI::OnCharmed(bool apply) { me->IsAIEnabled = apply; }
|
||||
|
||||
//Disable CreatureAI when charmed
|
||||
void CreatureAI::OnCharmed(bool apply) { /*me->IsAIEnabled = !apply;*/ }
|
||||
void CreatureAI::OnCharmed(bool apply)
|
||||
{
|
||||
//me->IsAIEnabled = !apply;*/
|
||||
me->NeedChangeAI = true;
|
||||
me->IsAIEnabled = false;
|
||||
}
|
||||
|
||||
void CreatureAI::MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
|
||||
@@ -656,10 +656,13 @@ namespace Trinity
|
||||
AnyUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u) && !((Creature*)u)->isTotem())
|
||||
return true;
|
||||
else
|
||||
if(!u->isAlive())
|
||||
return false;
|
||||
|
||||
if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isTotem())
|
||||
return false;
|
||||
|
||||
return i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u);
|
||||
}
|
||||
private:
|
||||
WorldObject const* i_obj;
|
||||
|
||||
@@ -62,7 +62,6 @@ void GuardAI::EnterEvadeMode()
|
||||
if( !i_creature.isAlive() )
|
||||
{
|
||||
DEBUG_LOG("Creature stopped attacking because he's dead [guid=%u]", i_creature.GetGUIDLow());
|
||||
i_creature.StopMoving();
|
||||
i_creature.GetMotionMaster()->MoveIdle();
|
||||
|
||||
i_state = STATE_NORMAL;
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
|
||||
IdleMovementGenerator si_idleMovement;
|
||||
|
||||
void IdleMovementGenerator::Initialize(Unit &owner)
|
||||
{
|
||||
owner.StopMoving();
|
||||
}
|
||||
|
||||
void
|
||||
IdleMovementGenerator::Reset(Unit& /*owner*/)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ class TRINITY_DLL_SPEC IdleMovementGenerator : public MovementGenerator
|
||||
{
|
||||
public:
|
||||
|
||||
void Initialize(Unit &) { }
|
||||
void Initialize(Unit &);
|
||||
void Finalize(Unit &) { }
|
||||
void Reset(Unit &);
|
||||
bool Update(Unit &, const uint32 &) { return true; }
|
||||
|
||||
@@ -7631,6 +7631,16 @@ CreatureInfo const *GetCreatureInfo(uint32 id)
|
||||
return objmgr.GetCreatureTemplate(id);
|
||||
}
|
||||
|
||||
CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
|
||||
{
|
||||
return sCreatureStorage.LookupEntry<CreatureInfo>(entry);
|
||||
}
|
||||
|
||||
Quest const* GetQuestTemplateStore(uint32 entry)
|
||||
{
|
||||
return objmgr.GetQuestTemplate(entry);
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadTransportEvents()
|
||||
{
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ void PetAI::_stopAttack()
|
||||
if( !i_pet.isAlive() )
|
||||
{
|
||||
DEBUG_LOG("Creature stoped attacking cuz his dead [guid=%u]", i_pet.GetGUIDLow());
|
||||
i_pet.StopMoving();
|
||||
i_pet.GetMotionMaster()->Clear();
|
||||
i_pet.GetMotionMaster()->MoveIdle();
|
||||
i_pet.CombatStop();
|
||||
|
||||
@@ -84,7 +84,6 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
|
||||
case COMMAND_STAY: //flat=1792 //STAY
|
||||
pet->AttackStop();
|
||||
pet->InterruptNonMeleeSpells(false);
|
||||
pet->StopMoving();
|
||||
pet->GetMotionMaster()->MoveIdle();
|
||||
charmInfo->SetCommandState( COMMAND_STAY );
|
||||
break;
|
||||
|
||||
+1
-1
@@ -20158,7 +20158,7 @@ void Player::StopCastingBindSight()
|
||||
if (WorldObject* target = GetFarsightTarget())
|
||||
{
|
||||
if (target->isType(TYPEMASK_UNIT))
|
||||
((Unit*)target)->RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT);
|
||||
((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_BIND_SIGHT, GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4187,6 +4187,7 @@ void Aura::HandleAuraModResistance(bool apply, bool Real)
|
||||
m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_positive,m_modifier.m_amount, apply);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Aura::HandleAuraModBaseResistancePCT(bool apply, bool Real)
|
||||
|
||||
+24
-4
@@ -77,7 +77,7 @@ static bool procPrepared = InitTriggerAuraData();
|
||||
|
||||
Unit::Unit()
|
||||
: WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this)
|
||||
, m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false)
|
||||
, m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false)
|
||||
, i_AI(NULL), i_disabledAI(NULL)
|
||||
{
|
||||
m_objectType |= TYPEMASK_UNIT;
|
||||
@@ -479,6 +479,28 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType)
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAuraTypeByCaster(AuraType auraType, uint64 casterGUID)
|
||||
{
|
||||
if (auraType >= TOTAL_AURAS) return;
|
||||
AuraList::iterator iter, next;
|
||||
for(iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); ++iter)
|
||||
{
|
||||
next = iter;
|
||||
++next;
|
||||
|
||||
if (*iter)
|
||||
{
|
||||
RemoveAurasByCasterSpell((*iter)->GetId(), casterGUID);
|
||||
continue;
|
||||
RemoveAurasDueToSpell((*iter)->GetId());
|
||||
if (!m_modAuras[auraType].empty())
|
||||
next = m_modAuras[auraType].begin();
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell)
|
||||
{
|
||||
if (auraType >= TOTAL_AURAS) return;
|
||||
@@ -498,7 +520,7 @@ void Unit::RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell)
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::deque <Aura *> dispel_list;
|
||||
|
||||
@@ -10321,7 +10343,6 @@ void Unit::setDeathState(DeathState s)
|
||||
ClearDiminishings();
|
||||
GetMotionMaster()->Clear(false);
|
||||
GetMotionMaster()->MoveIdle();
|
||||
StopMoving();
|
||||
//without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
|
||||
//do not why since in IncreaseMaxHealth currenthealth is checked
|
||||
SetHealth(0);
|
||||
@@ -13088,7 +13109,6 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
|
||||
if(GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
((Creature*)this)->AI()->OnCharmed(true);
|
||||
StopMoving();
|
||||
GetMotionMaster()->Clear(false);
|
||||
GetMotionMaster()->MoveIdle();
|
||||
}
|
||||
|
||||
+2
-1
@@ -1244,6 +1244,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
|
||||
void RemoveSpellsCausingAura(AuraType auraType);
|
||||
void RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell);
|
||||
void RemoveAuraTypeByCaster(AuraType auraType, uint64 casterGUID);
|
||||
void RemoveRankAurasDueToSpell(uint32 spellId);
|
||||
bool RemoveNoStackAurasDueToAura(Aura *Aur);
|
||||
void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except = 0);
|
||||
@@ -1549,7 +1550,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
uint32 GetReducedThreatPercent() { return m_reducedThreatPercent; }
|
||||
Unit *GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; }
|
||||
|
||||
bool IsAIEnabled;
|
||||
bool IsAIEnabled, NeedChangeAI;
|
||||
protected:
|
||||
explicit Unit ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user