mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Merge branch 'master' into 303
Conflicts: src/game/Level2.cpp src/game/Pet.cpp src/game/Player.cpp
This commit is contained in:
commit
9cc6f1f3ec
32 changed files with 353 additions and 238 deletions
|
|
@ -3977,24 +3977,20 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
|||
uint32 LostDurability = maxDurability - curDurability;
|
||||
if(LostDurability>0)
|
||||
{
|
||||
ItemPrototype const *ditemProto = sItemStorage.LookupEntry<ItemPrototype>(item->GetEntry());
|
||||
if(!ditemProto)
|
||||
{
|
||||
sLog.outError("ERROR: RepairDurability: Unknown item id %u", ditemProto);
|
||||
return TotalCost;
|
||||
}
|
||||
ItemPrototype const *ditemProto = item->GetProto();
|
||||
|
||||
DurabilityCostsEntry const *dcost = sDurabilityCostsStore.LookupEntry(ditemProto->ItemLevel);
|
||||
if(!dcost)
|
||||
{
|
||||
sLog.outError("ERROR: RepairDurability: Wrong item lvl %u", dcost);
|
||||
sLog.outError("ERROR: RepairDurability: Wrong item lvl %u", ditemProto->ItemLevel);
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
DurabilityQualityEntry const *dQualitymodEntry = sDurabilityQualityStore.LookupEntry((ditemProto->Quality+1)*2);
|
||||
uint32 dQualitymodEntryId = (ditemProto->Quality+1)*2;
|
||||
DurabilityQualityEntry const *dQualitymodEntry = sDurabilityQualityStore.LookupEntry(dQualitymodEntryId);
|
||||
if(!dQualitymodEntry)
|
||||
{
|
||||
sLog.outError("ERROR: RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntry);
|
||||
sLog.outError("ERROR: RepairDurability: Wrong dQualityModEntry %u", dQualitymodEntryId);
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
|
|
@ -6054,32 +6050,13 @@ uint32 Player::GetRankFromDB(uint64 guid)
|
|||
|
||||
uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type)
|
||||
{
|
||||
// need fix it!
|
||||
QueryResult *result = CharacterDatabase.PQuery("SELECT arenateamid FROM arena_team_member WHERE guid='%u'", GUID_LOPART(guid));
|
||||
if(result)
|
||||
{
|
||||
// init id to 0, check the arena type before assigning a value to id
|
||||
uint32 id = 0;
|
||||
do
|
||||
{
|
||||
QueryResult *result2 = CharacterDatabase.PQuery("SELECT type FROM arena_team WHERE arenateamid='%u'", id);
|
||||
if(result2)
|
||||
{
|
||||
uint8 dbtype = (*result2)[0].GetUInt32();
|
||||
delete result2;
|
||||
if(dbtype == type)
|
||||
{
|
||||
// if the type matches, we've found the id
|
||||
id = (*result)[0].GetUInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(result->NextRow());
|
||||
delete result;
|
||||
return id;
|
||||
}
|
||||
// no arenateam for the specified guid, return 0
|
||||
return 0;
|
||||
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' AND type='%u' LIMIT 1", GUID_LOPART(guid), type);
|
||||
if(!result)
|
||||
return 0;
|
||||
|
||||
uint32 id = (*result)[0].GetUInt32();
|
||||
delete result;
|
||||
return id;
|
||||
}
|
||||
|
||||
uint32 Player::GetZoneIdFromDB(uint64 guid)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue