*Merge.
--HG-- branch : trunk
This commit is contained in:
+4
-4
@@ -247,7 +247,7 @@ CreatureAI* GetAI_boss_nexusprince_shaffar(Creature *_Creature)
|
||||
|
||||
struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
{
|
||||
mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c), CanEvade(false)
|
||||
mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
}
|
||||
@@ -272,7 +272,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
// Send Shaffar to fight
|
||||
Unit* Shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature);
|
||||
Unit* Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
if(!Shaffar || Shaffar->isDead())
|
||||
{
|
||||
KillSelf();
|
||||
@@ -289,7 +289,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
Unit *Shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature);
|
||||
Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
if(Shaffar)
|
||||
((boss_nexusprince_shaffarAI*)(((Creature*)Shaffar)->AI()))->RemoveBeaconFromList(m_creature);
|
||||
}
|
||||
@@ -301,7 +301,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
|
||||
if(Check_Timer < diff)
|
||||
{
|
||||
Unit *Shaffar = FindCreature(ENTRY_SHAFFAR, 100, m_creature);
|
||||
Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
if(!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat())
|
||||
{
|
||||
KillSelf();
|
||||
|
||||
@@ -74,6 +74,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
AddMember(CaptainGuid);
|
||||
sLog.outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain GUID: %u]", GetId(), GetType(), GetCaptain());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,6 +144,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
// hide promote/remove buttons
|
||||
if(CaptainGuid != PlayerGuid)
|
||||
pl->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + 1, 1);
|
||||
sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUID(), GetType(), GetId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -249,7 +251,10 @@ void ArenaTeam::SetCaptain(const uint64& guid)
|
||||
// enable remove/promote buttons
|
||||
Player *newcaptain = objmgr.GetPlayer(guid);
|
||||
if(newcaptain)
|
||||
{
|
||||
newcaptain->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + 1 + (GetSlot() * 6), 0);
|
||||
sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUID(), newcaptain->GetName(), newcaptain->GetGUID(), GetId(), GetType());
|
||||
}
|
||||
}
|
||||
|
||||
void ArenaTeam::DelMember(uint64 guid)
|
||||
@@ -274,8 +279,8 @@ void ArenaTeam::DelMember(uint64 guid)
|
||||
{
|
||||
player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + i, 0);
|
||||
}
|
||||
sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), guid, GetType(), GetId());
|
||||
}
|
||||
|
||||
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
|
||||
}
|
||||
|
||||
@@ -292,6 +297,9 @@ void ArenaTeam::Disband(WorldSession *session)
|
||||
DelMember(members.front().guid);
|
||||
}
|
||||
|
||||
if(Player *player = session->GetPlayer())
|
||||
sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUID(), GetType(), GetId());
|
||||
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", Id);
|
||||
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", Id); //< this should be alredy done by calling DelMember(memberGuids[j]); for each member
|
||||
|
||||
@@ -691,6 +691,7 @@ void BattleGround::EndBattleGround(uint32 winner)
|
||||
sLog.outDebug("--- Winner rating: %u, Loser rating: %u, Winner change: %u, Losser change: %u ---", winner_rating, loser_rating, winner_change, loser_change);
|
||||
SetArenaTeamRatingChangeForTeam(winner, winner_change);
|
||||
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
|
||||
sLog.outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. RatingChange: %i.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1097,8 +1098,9 @@ void BattleGround::StartBattleGround()
|
||||
{
|
||||
///this method should spawn spirit guides and so on
|
||||
SetStartTime(0);
|
||||
|
||||
SetLastResurrectTime(0);
|
||||
if(m_IsRated)
|
||||
sLog.outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
|
||||
}
|
||||
|
||||
void BattleGround::AddPlayer(Player *plr)
|
||||
|
||||
+1
-1
@@ -451,7 +451,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
|
||||
// determine reflection
|
||||
m_canReflect = false;
|
||||
|
||||
if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED))
|
||||
if(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !IsAreaOfEffectSpell(m_spellInfo) && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_CANT_REFLECTED))
|
||||
{
|
||||
for(int j = 0;j < 3; ++j)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ INSTANTIATE_SINGLETON_1( Log );
|
||||
Log::Log() :
|
||||
raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL),
|
||||
dberLogfile(NULL), chatLogfile(NULL), m_gmlog_per_account(false), m_colored(false)
|
||||
, arenaLogFile(NULL)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
@@ -61,6 +62,10 @@ Log::~Log()
|
||||
if (chatLogfile != NULL)
|
||||
fclose(chatLogfile);
|
||||
chatLogfile = NULL;
|
||||
|
||||
if (arenaLogFile != NULL)
|
||||
fclose(arenaLogFile);
|
||||
arenaLogFile = NULL;
|
||||
}
|
||||
|
||||
void Log::SetLogLevel(char *Level)
|
||||
@@ -154,6 +159,7 @@ void Log::Initialize()
|
||||
dberLogfile = openLogFile("DBErrorLogFile",NULL,"a");
|
||||
raLogfile = openLogFile("RaLogFile",NULL,"a");
|
||||
chatLogfile = openLogFile("ChatLogFile","ChatLogTimestamp","a");
|
||||
arenaLogFile = openLogFile("ArenaLogFile",NULL,"a");
|
||||
|
||||
// Main log file settings
|
||||
m_logLevel = sConfig.GetIntDefault("LogLevel", LOGL_NORMAL);
|
||||
@@ -173,6 +179,7 @@ void Log::Initialize()
|
||||
|
||||
// Char log settings
|
||||
m_charLog_Dump = sConfig.GetBoolDefault("CharLogDump", false);
|
||||
|
||||
}
|
||||
|
||||
FILE* Log::openLogFile(char const* configFileName,char const* configTimeStampFlag, char const* mode)
|
||||
@@ -491,6 +498,24 @@ void Log::outError( const char * err, ... )
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
void Log::outArena( const char * str, ... )
|
||||
{
|
||||
if( !str )
|
||||
return;
|
||||
|
||||
if(arenaLogFile)
|
||||
{
|
||||
va_list ap;
|
||||
outTimestamp(arenaLogFile);
|
||||
va_start(ap, str);
|
||||
vfprintf(arenaLogFile, str, ap);
|
||||
fprintf(arenaLogFile, "\n" );
|
||||
va_end(ap);
|
||||
fflush(arenaLogFile);
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void Log::outErrorDb( const char * err, ... )
|
||||
{
|
||||
if( !err )
|
||||
|
||||
@@ -109,6 +109,7 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_
|
||||
void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3,4);
|
||||
void outRemote( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outChat( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outArena( const char * str, ... ) ATTR_PRINTF(2,3);
|
||||
void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name );
|
||||
|
||||
static void outTimestamp(FILE* file);
|
||||
@@ -137,6 +138,7 @@ class Log : public Trinity::Singleton<Log, Trinity::ClassLevelLockable<Log, ACE_
|
||||
FILE* charLogfile;
|
||||
FILE* dberLogfile;
|
||||
FILE* chatLogfile;
|
||||
FILE* arenaLogFile;
|
||||
|
||||
// cache values for after initilization use (like gm log per account case)
|
||||
std::string m_logsDir;
|
||||
|
||||
@@ -310,6 +310,10 @@ AddonChannel = 1
|
||||
# Default: "Ra.log"
|
||||
# "" - Empty name for disable
|
||||
#
|
||||
# ArenaLogFile
|
||||
# Log file of arena fights and arena team creations
|
||||
# Default: "" - do not create arena log file
|
||||
#
|
||||
# LogColors
|
||||
# Color for messages (format "normal basic detail debug")
|
||||
# Colors: 0 - BLACK, 1 - RED, 2 - GREEN, 3 - BROWN, 4 - BLUE, 5 - MAGENTA, 6 - CYAN, 7 - GREY,
|
||||
@@ -419,6 +423,7 @@ GmLogFile = "gm_commands.log"
|
||||
GmLogTimestamp = 0
|
||||
GmLogPerAccount = 0
|
||||
RaLogFile = "ra_commands.log"
|
||||
ArenaLogFile = ""
|
||||
LogColors = ""
|
||||
EnableLogDB = 0
|
||||
DBLogLevel = 1
|
||||
|
||||
Reference in New Issue
Block a user