mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 22:37:05 +00:00
Merge branch 'master' of git@github.com:mangos/mangos into procflag
This commit is contained in:
commit
fd5a994659
6 changed files with 44 additions and 49 deletions
|
|
@ -171,7 +171,7 @@ void WorldSession::HandleArenaTeamInviteAcceptOpcode(WorldPacket & /*recv_data*/
|
|||
if(!at)
|
||||
return;
|
||||
|
||||
if(_player->GetArenaTeamIdFromDB(_player->GetGUIDLow(), at->GetType()))
|
||||
if(_player->GetArenaTeamId(at->GetType()))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ALREADY_IN_ARENA_TEAM); // already in arena team that size
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3521,27 +3521,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
|||
}
|
||||
|
||||
// remove from arena teams
|
||||
uint32 at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_2v2);
|
||||
if(at_id != 0)
|
||||
{
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
|
||||
if(at)
|
||||
at->DelMember(playerguid);
|
||||
}
|
||||
at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_3v3);
|
||||
if(at_id != 0)
|
||||
{
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
|
||||
if(at)
|
||||
at->DelMember(playerguid);
|
||||
}
|
||||
at_id = GetArenaTeamIdFromDB(playerguid,ARENA_TEAM_5v5);
|
||||
if(at_id != 0)
|
||||
{
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
|
||||
if(at)
|
||||
at->DelMember(playerguid);
|
||||
}
|
||||
LeaveAllArenaTeams(playerguid);
|
||||
|
||||
// the player was uninvited already on logout so just remove from group
|
||||
QueryResult *resultGroup = CharacterDatabase.PQuery("SELECT leaderGuid FROM group_member WHERE memberGuid='%u'", guid);
|
||||
|
|
@ -6145,24 +6125,18 @@ void Player::ModifyArenaPoints( int32 value )
|
|||
|
||||
uint32 Player::GetGuildIdFromDB(uint64 guid)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss<<"SELECT guildid FROM guild_member WHERE guid='"<<guid<<"'";
|
||||
QueryResult *result = CharacterDatabase.Query( ss.str().c_str() );
|
||||
if( result )
|
||||
{
|
||||
uint32 v = result->Fetch()[0].GetUInt32();
|
||||
delete result;
|
||||
return v;
|
||||
}
|
||||
else
|
||||
QueryResult* result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if(!result)
|
||||
return 0;
|
||||
|
||||
uint32 id = result->Fetch()[0].GetUInt32();
|
||||
delete result;
|
||||
return id;
|
||||
}
|
||||
|
||||
uint32 Player::GetRankFromDB(uint64 guid)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss<<"SELECT rank FROM guild_member WHERE guid='"<<guid<<"'";
|
||||
QueryResult *result = CharacterDatabase.Query( ss.str().c_str() );
|
||||
QueryResult *result = CharacterDatabase.PQuery( "SELECT rank FROM guild_member WHERE guid='%u'", GUID_LOPART(guid) );
|
||||
if( result )
|
||||
{
|
||||
uint32 v = result->Fetch()[0].GetUInt32();
|
||||
|
|
@ -6186,10 +6160,8 @@ uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
|
|||
|
||||
uint32 Player::GetZoneIdFromDB(uint64 guid)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
ss<<"SELECT zone FROM characters WHERE guid='"<<GUID_LOPART(guid)<<"'";
|
||||
QueryResult *result = CharacterDatabase.Query( ss.str().c_str() );
|
||||
uint32 guidLow = GUID_LOPART(guid);
|
||||
QueryResult *result = CharacterDatabase.PQuery( "SELECT zone FROM characters WHERE guid='%u'", guidLow );
|
||||
if (!result)
|
||||
return 0;
|
||||
Field* fields = result->Fetch();
|
||||
|
|
@ -6199,9 +6171,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid)
|
|||
if (!zone)
|
||||
{
|
||||
// stored zone is zero, use generic and slow zone detection
|
||||
ss.str("");
|
||||
ss<<"SELECT map,position_x,position_y FROM characters WHERE guid='"<<GUID_LOPART(guid)<<"'";
|
||||
result = CharacterDatabase.Query(ss.str().c_str());
|
||||
result = CharacterDatabase.PQuery("SELECT map,position_x,position_y FROM characters WHERE guid='%u'", guidLow);
|
||||
if( !result )
|
||||
return 0;
|
||||
fields = result->Fetch();
|
||||
|
|
@ -6212,9 +6182,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid)
|
|||
|
||||
zone = MapManager::Instance().GetZoneId(map,posx,posy);
|
||||
|
||||
ss.str("");
|
||||
ss << "UPDATE characters SET zone='"<<zone<<"' WHERE guid='"<<GUID_LOPART(guid)<<"'";
|
||||
CharacterDatabase.Execute(ss.str().c_str());
|
||||
CharacterDatabase.PExecute("UPDATE characters SET zone='%u' WHERE guid='%u'", zone, guidLow);
|
||||
}
|
||||
|
||||
return zone;
|
||||
|
|
@ -16629,6 +16597,27 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type)
|
|||
CharacterDatabase.CommitTransaction();
|
||||
}
|
||||
|
||||
void Player::LeaveAllArenaTeams(uint64 guid)
|
||||
{
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if(!result)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
uint32 at_id = fields[0].GetUInt32();
|
||||
if(at_id != 0)
|
||||
{
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
|
||||
if(at)
|
||||
at->DelMember(guid);
|
||||
}
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
}
|
||||
|
||||
void Player::SetRestBonus (float rest_bonus_new)
|
||||
{
|
||||
// Prevent resting on max level
|
||||
|
|
|
|||
|
|
@ -1598,6 +1598,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
static uint32 GetArenaTeamIdFromDB(uint64 guid, uint8 slot);
|
||||
void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
|
||||
uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; }
|
||||
static void LeaveAllArenaTeams(uint64 guid);
|
||||
|
||||
void SetDifficulty(uint32 dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
|
||||
uint8 GetDifficulty() { return m_dungeonDifficulty; }
|
||||
|
|
|
|||
|
|
@ -1204,7 +1204,10 @@ void Aura::HandleAddModifier(bool apply, bool Real)
|
|||
{
|
||||
case 17941: // Shadow Trance
|
||||
case 22008: // Netherwind Focus
|
||||
case 31834: // Light's Grace
|
||||
case 34754: // Clearcasting
|
||||
case 34936: // Backlash
|
||||
case 48108: // Hot Streak
|
||||
m_procCharges = 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1750,8 +1750,10 @@ void SpellMgr::LoadSpellLearnSpells()
|
|||
if(!sSpellStore.LookupEntry(dbc_node.spell))
|
||||
continue;
|
||||
|
||||
// talent or passive spells or skill-step spells auto-casted, other required explicit dependent learning
|
||||
dbc_node.autoLearned = GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP);
|
||||
// talent or passive spells or skill-step spells auto-casted and not need dependent learning,
|
||||
// pet teaching spells don't must be dependent learning (casted)
|
||||
// other required explicit dependent learning
|
||||
dbc_node.autoLearned = entry->EffectImplicitTargetA[i]==TARGET_PET || GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP);
|
||||
|
||||
SpellLearnSpellMap::const_iterator db_node_begin = GetBeginSpellLearnSpell(spell);
|
||||
SpellLearnSpellMap::const_iterator db_node_end = GetEndSpellLearnSpell(spell);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6953"
|
||||
#define REVISION_NR "6957"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue