*Update to Trinity 707.
--HG-- branch : trunk
This commit is contained in:
@@ -189,37 +189,13 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
bool IsBanished;
|
||||
bool HasKilledAkama;
|
||||
bool reseting;
|
||||
bool GridSearcherSucceeded;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
reseting = true;
|
||||
|
||||
m_creature->setActive(true); // TODO: setActive(true, time);
|
||||
FindChannelers();
|
||||
|
||||
if(!Channelers.empty())
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
|
||||
{
|
||||
Creature* Channeler = NULL;
|
||||
Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
|
||||
if(Channeler)
|
||||
{
|
||||
if(Channeler->isDead())
|
||||
{
|
||||
Channeler->RemoveCorpse();
|
||||
Channeler->Respawn();
|
||||
}
|
||||
if(m_creature->isAlive())
|
||||
{
|
||||
Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
|
||||
Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
|
||||
Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
|
||||
}
|
||||
|
||||
}
|
||||
GridSearcherSucceeded = false;
|
||||
|
||||
if(!Sorcerers.empty())
|
||||
{
|
||||
@@ -252,8 +228,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->GetMotionMaster()->MoveIdle();
|
||||
//m_creature->GetMotionMaster()->Clear();
|
||||
//m_creature->GetMotionMaster()->MoveIdle();
|
||||
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
|
||||
|
||||
if(pInstance && m_creature->isAlive())
|
||||
@@ -262,6 +238,42 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
reseting = false;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if(!GridSearcherSucceeded)
|
||||
{
|
||||
FindChannelers();
|
||||
|
||||
if (!Channelers.empty())
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
|
||||
{
|
||||
Creature* Channeler = NULL;
|
||||
Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
|
||||
|
||||
if (Channeler)
|
||||
{
|
||||
if (Channeler->isDead())
|
||||
{
|
||||
Channeler->RemoveCorpse();
|
||||
Channeler->Respawn();
|
||||
Channeler->InterruptNonMeleeSpells(true);
|
||||
Channeler->RemoveAurasDueToSpell(SPELL_SHADE_SOUL_CHANNEL);
|
||||
}
|
||||
|
||||
if (Channeler->isAlive())
|
||||
{
|
||||
Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true);
|
||||
Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true);
|
||||
Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
GridSearcherSucceeded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit* who) { }
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
@@ -272,13 +284,6 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
DoStartMovement(who);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if(IsBanished) return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer
|
||||
{
|
||||
if(reseting)
|
||||
@@ -324,6 +329,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
{
|
||||
Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z);
|
||||
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1);
|
||||
Spawn->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,6 +440,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
Akama->AddThreat(m_creature, 10000000.0f);
|
||||
m_creature->Attack(Akama, true);
|
||||
Akama->Attack(m_creature, true);
|
||||
m_creature->SetInCombatWith(Akama);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1677,7 +1677,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution()
|
||||
if(!result)
|
||||
{
|
||||
sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now.");
|
||||
m_NextAutoDistributionTime = sWorld.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"I64FMTD"')", m_NextAutoDistributionTime);
|
||||
}
|
||||
else
|
||||
|
||||
+5
-4
@@ -878,8 +878,10 @@ int ChatHandler::ParseCommands(const char* text)
|
||||
ASSERT(text);
|
||||
ASSERT(*text);
|
||||
|
||||
if(m_session->GetSecurity() == 0)
|
||||
return 0;
|
||||
std::string fullcmd = text;
|
||||
|
||||
//if(m_session->GetSecurity() == 0)
|
||||
// return 0;
|
||||
|
||||
/// chat case (.command or !command format)
|
||||
if(m_session)
|
||||
@@ -891,8 +893,7 @@ int ChatHandler::ParseCommands(const char* text)
|
||||
/// ignore single . and ! in line
|
||||
if(strlen(text) < 2)
|
||||
return 0;
|
||||
|
||||
std::string fullcmd = text; // original `text` can't be used. It content destroyed in command code processing.
|
||||
// original `text` can't be used. It content destroyed in command code processing.
|
||||
|
||||
/// ignore messages staring from many dots.
|
||||
if(text[0] == '.' && text[1] == '.' || text[0] == '!' && text[1] == '!')
|
||||
|
||||
+3
-3
@@ -3673,7 +3673,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
|
||||
{
|
||||
int32 basePoints = aur->GetBasePoints();
|
||||
// construct the new aura for the attacker
|
||||
Aura * new_aur = CreateAura(aur->GetSpellProto(), aur->GetEffIndex(), &basePoints, stealer);
|
||||
Aura * new_aur = CreateAura(aur->GetSpellProto(), aur->GetEffIndex(), NULL/*&basePoints*/, stealer);
|
||||
if(!new_aur)
|
||||
continue;
|
||||
|
||||
@@ -4049,7 +4049,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId, uint32 effIndex)
|
||||
{
|
||||
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
|
||||
{
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*m_dynObjGUIDs.begin());
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this, *i);
|
||||
if(!dynObj)
|
||||
{
|
||||
i = m_dynObjGUIDs.erase(i);
|
||||
@@ -4067,7 +4067,7 @@ DynamicObject * Unit::GetDynObject(uint32 spellId)
|
||||
{
|
||||
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
|
||||
{
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this,*m_dynObjGUIDs.begin());
|
||||
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this, *i);
|
||||
if(!dynObj)
|
||||
{
|
||||
i = m_dynObjGUIDs.erase(i);
|
||||
|
||||
Reference in New Issue
Block a user