mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
- Ported inspect_messages to character_inspect_messages
- Ported character leadership abilities to character_leadership_abilities - Removed player profile debug printing - Refactored total time entitled on account to load from the sum of time_played from all characters in character_data
This commit is contained in:
parent
ca7dd7d741
commit
e50cf5c4be
1648
common/database.cpp
1648
common/database.cpp
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,6 @@
|
|||||||
#include "eq_packet_structs.h"
|
#include "eq_packet_structs.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -37,24 +36,24 @@
|
|||||||
*/
|
*/
|
||||||
struct ExtendedProfile_Struct {
|
struct ExtendedProfile_Struct {
|
||||||
// Pet stuff
|
// Pet stuff
|
||||||
uint16 pet_id;
|
uint16 pet_id; /* Not Used */
|
||||||
uint16 old_pet_hp;
|
uint16 old_pet_hp; /* Not Used */
|
||||||
uint16 old_pet_mana;
|
uint16 old_pet_mana; /* Not Used */
|
||||||
SpellBuff_Struct pet_buffs[BUFF_COUNT];
|
SpellBuff_Struct pet_buffs[BUFF_COUNT]; /* Not Used */
|
||||||
uint32 pet_items[_MaterialCount];
|
uint32 pet_items[_MaterialCount]; /* Not Used */
|
||||||
char merc_name[64];
|
char merc_name[64]; /* Used */
|
||||||
|
|
||||||
uint32 aa_effects;
|
uint32 aa_effects; /* Used */
|
||||||
uint32 perAA; //% of exp going to AAs
|
uint32 perAA; /* Used: % of exp going to AAs */
|
||||||
uint32 expended_aa; // Total of expended AA
|
uint32 expended_aa; /* Used: Total of expended AA */
|
||||||
uint32 pet_hp;
|
uint32 pet_hp; /* Not Used */
|
||||||
uint32 pet_mana;
|
uint32 pet_mana; /* Not Used */
|
||||||
uint32 mercTemplateID;
|
uint32 mercTemplateID; /* Not Used */
|
||||||
uint32 mercSuspendedTime;
|
uint32 mercSuspendedTime; /* Not Used */
|
||||||
bool mercIsSuspended;
|
bool mercIsSuspended; /* Not Used */
|
||||||
uint32 mercTimerRemaining;
|
uint32 mercTimerRemaining; /* Not Used */
|
||||||
uint8 mercGender;
|
uint8 mercGender; /* Not Used */
|
||||||
int32 mercState;
|
int32 mercState; /* Not Used */
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|||||||
@ -114,31 +114,12 @@ bool SharedDatabase::SetGMSpeed(uint32 account_id, uint8 gmspeed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
|
uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
|
||||||
|
|
||||||
uint32 EntitledTime = 0;
|
uint32 EntitledTime = 0;
|
||||||
|
std::string query = StringFormat("SELECT `time_played` FROM `character_data` WHERE `account_id` = %u", AccountID);
|
||||||
const char *EntitledQuery = "select sum(ascii(substring(profile, 237, 1)) + (ascii(substring(profile, 238, 1)) * 256) +"
|
auto results = QueryDatabase(query);
|
||||||
"(ascii(substring(profile, 239, 1)) * 65536) + (ascii(substring(profile, 240, 1)) * 16777216))"
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
"from character_ where account_id = %i";
|
EntitledTime += atoi(row[0]);
|
||||||
|
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
|
||||||
char *query = 0;
|
|
||||||
MYSQL_RES *result;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
if (RunQuery(query, MakeAnyLenString(&query, EntitledQuery, AccountID), errbuf, &result)) {
|
|
||||||
|
|
||||||
if (mysql_num_rows(result) == 1) {
|
|
||||||
|
|
||||||
row = mysql_fetch_row(result);
|
|
||||||
|
|
||||||
EntitledTime = atoi(row[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
return EntitledTime;
|
return EntitledTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2003,38 +1984,19 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedDatabase::GetPlayerInspectMessage(char* playername, InspectMessage_Struct* message) {
|
void SharedDatabase::LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* message) {
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
std::string query = StringFormat("SELECT `inspect_message` FROM `character_inspect_messages` WHERE `id` = %u LIMIT 1", character_id);
|
||||||
char *query = 0;
|
auto results = QueryDatabase(query); ThrowDBError(results.ErrorMessage(), "SharedDatabase::LoadCharacterInspectMessage", query);
|
||||||
MYSQL_RES *result;
|
auto row = results.begin();
|
||||||
MYSQL_ROW row;
|
memcpy(message, "", sizeof(InspectMessage_Struct));
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
if (RunQuery(query, MakeAnyLenString(&query, "SELECT inspectmessage FROM character_ WHERE name='%s'", playername), errbuf, &result)) {
|
memcpy(message, row[0], sizeof(InspectMessage_Struct));
|
||||||
safe_delete_array(query);
|
|
||||||
|
|
||||||
if (mysql_num_rows(result) == 1) {
|
|
||||||
row = mysql_fetch_row(result);
|
|
||||||
memcpy(message, row[0], sizeof(InspectMessage_Struct));
|
|
||||||
}
|
|
||||||
|
|
||||||
mysql_free_result(result);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
std::cerr << "Error in GetPlayerInspectMessage query '" << query << "' " << errbuf << std::endl;
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedDatabase::SetPlayerInspectMessage(char* playername, const InspectMessage_Struct* message) {
|
void SharedDatabase::SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message) {
|
||||||
|
std::string query = StringFormat("REPLACE INTO `character_inspect_messages` (id, inspect_message) VALUES (%u, '%s')", character_id, EscapeString(message->text).c_str());
|
||||||
char errbuf[MYSQL_ERRMSG_SIZE];
|
auto results = QueryDatabase(query); ThrowDBError(results.ErrorMessage(), "SharedDatabase::SaveCharacterInspectMessage", query);
|
||||||
char *query = 0;
|
|
||||||
|
|
||||||
if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE character_ SET inspectmessage='%s' WHERE name='%s'", message->text, playername), errbuf)) {
|
|
||||||
std::cerr << "Error in SetPlayerInspectMessage query '" << query << "' " << errbuf << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
safe_delete_array(query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedDatabase::GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message) {
|
void SharedDatabase::GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message) {
|
||||||
|
|||||||
@ -42,8 +42,8 @@ public:
|
|||||||
bool SetHideMe(uint32 account_id, uint8 hideme);
|
bool SetHideMe(uint32 account_id, uint8 hideme);
|
||||||
int32 DeleteStalePlayerCorpses();
|
int32 DeleteStalePlayerCorpses();
|
||||||
int32 DeleteStalePlayerBackups();
|
int32 DeleteStalePlayerBackups();
|
||||||
void GetPlayerInspectMessage(char* playername, InspectMessage_Struct* message);
|
void LoadCharacterInspectMessage(uint32 character_id, InspectMessage_Struct* message);
|
||||||
void SetPlayerInspectMessage(char* playername, const InspectMessage_Struct* message);
|
void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message);
|
||||||
void GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message);
|
void GetBotInspectMessage(uint32 botid, InspectMessage_Struct* message);
|
||||||
void SetBotInspectMessage(uint32 botid, const InspectMessage_Struct* message);
|
void SetBotInspectMessage(uint32 botid, const InspectMessage_Struct* message);
|
||||||
bool GetCommandSettings(std::map<std::string,uint8> &commands);
|
bool GetCommandSettings(std::map<std::string,uint8> &commands);
|
||||||
|
|||||||
11
zone/aa.cpp
11
zone/aa.cpp
@ -18,6 +18,8 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
|
|||||||
|
|
||||||
// Test 1
|
// Test 1
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
#include "../common/debug.h"
|
#include "../common/debug.h"
|
||||||
#include "aa.h"
|
#include "aa.h"
|
||||||
#include "mob.h"
|
#include "mob.h"
|
||||||
@ -316,13 +318,14 @@ void Client::ActivateAA(aaID activate){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check if AA is expendable
|
// Check if AA is expendable
|
||||||
if (aas_send[activate - activate_val]->special_category == 7)
|
if (aas_send[activate - activate_val]->special_category == 7) {
|
||||||
{
|
|
||||||
// Add the AA cost to the extended profile to track overall total
|
// Add the AA cost to the extended profile to track overall total
|
||||||
m_epp.expended_aa += aas_send[activate]->cost;
|
m_epp.expended_aa += aas_send[activate]->cost;
|
||||||
|
|
||||||
SetAA(activate, 0);
|
SetAA(activate, 0);
|
||||||
|
|
||||||
Save();
|
SaveAA(); /* Save Character AA */
|
||||||
SendAA(activate);
|
SendAA(activate);
|
||||||
SendAATable();
|
SendAATable();
|
||||||
}
|
}
|
||||||
@ -1533,6 +1536,8 @@ void Client::ResetAA(){
|
|||||||
m_pp.raid_leadership_points = 0;
|
m_pp.raid_leadership_points = 0;
|
||||||
m_pp.group_leadership_exp = 0;
|
m_pp.group_leadership_exp = 0;
|
||||||
m_pp.raid_leadership_exp = 0;
|
m_pp.raid_leadership_exp = 0;
|
||||||
|
|
||||||
|
database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
||||||
}
|
}
|
||||||
|
|
||||||
int Client::GroupLeadershipAAHealthEnhancement()
|
int Client::GroupLeadershipAAHealthEnhancement()
|
||||||
|
|||||||
@ -582,7 +582,7 @@ bool Client::Save(uint8 iCommitNow) {
|
|||||||
|
|
||||||
database.SaveCharacterTribute(this->CharacterID(), &m_pp);
|
database.SaveCharacterTribute(this->CharacterID(), &m_pp);
|
||||||
SaveTaskState(); /* Save Character Task */
|
SaveTaskState(); /* Save Character Task */
|
||||||
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp); /* Save Character Data */
|
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */
|
||||||
|
|
||||||
LogFile->write(EQEMuLog::Status, "Client::Save %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
LogFile->write(EQEMuLog::Status, "Client::Save %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC);
|
||||||
return true;
|
return true;
|
||||||
@ -4233,7 +4233,6 @@ void Client::VoiceMacroReceived(uint32 Type, char *Target, uint32 MacroNumber) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Client::ClearGroupAAs() {
|
void Client::ClearGroupAAs() {
|
||||||
|
|
||||||
for(unsigned int i = 0; i < MAX_GROUP_LEADERSHIP_AA_ARRAY; i++)
|
for(unsigned int i = 0; i < MAX_GROUP_LEADERSHIP_AA_ARRAY; i++)
|
||||||
m_pp.leader_abilities.ranks[i] = 0;
|
m_pp.leader_abilities.ranks[i] = 0;
|
||||||
|
|
||||||
@ -4243,28 +4242,18 @@ void Client::ClearGroupAAs() {
|
|||||||
m_pp.raid_leadership_exp = 0;
|
m_pp.raid_leadership_exp = 0;
|
||||||
|
|
||||||
Save();
|
Save();
|
||||||
|
database.SaveCharacterLeadershipAA(this->CharacterID(), &m_pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::UpdateGroupAAs(int32 points, uint32 type) {
|
void Client::UpdateGroupAAs(int32 points, uint32 type) {
|
||||||
|
switch(type) {
|
||||||
switch(type)
|
case 0: { m_pp.group_leadership_points += points; break; }
|
||||||
{
|
case 1: { m_pp.raid_leadership_points += points; break; }
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
m_pp.group_leadership_points += points;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
m_pp.raid_leadership_points += points;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SendLeadershipEXPUpdate();
|
SendLeadershipEXPUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Client::IsLeadershipEXPOn()
|
bool Client::IsLeadershipEXPOn() {
|
||||||
{
|
|
||||||
|
|
||||||
if(!m_pp.leadAAActive)
|
if(!m_pp.leadAAActive)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -494,8 +494,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) {
|
||||||
{
|
|
||||||
if(app->size != sizeof(ClientZoneEntry_Struct))
|
if(app->size != sizeof(ClientZoneEntry_Struct))
|
||||||
return;
|
return;
|
||||||
ClientZoneEntry_Struct *cze = (ClientZoneEntry_Struct *) app->pBuffer;
|
ClientZoneEntry_Struct *cze = (ClientZoneEntry_Struct *) app->pBuffer;
|
||||||
@ -543,7 +542,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
std::string query;
|
std::string query;
|
||||||
unsigned long* lengths;
|
unsigned long* lengths;
|
||||||
|
|
||||||
/* Set item materials */
|
/* Set item material tint */
|
||||||
for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++)
|
for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++)
|
||||||
if (m_pp.item_tint[i].rgb.use_tint == 1)
|
if (m_pp.item_tint[i].rgb.use_tint == 1)
|
||||||
m_pp.item_tint[i].rgb.use_tint = 0xFF;
|
m_pp.item_tint[i].rgb.use_tint = 0xFF;
|
||||||
@ -569,24 +568,24 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
if (account_creation){ account_creation = atoul(row[6]); }
|
if (account_creation){ account_creation = atoul(row[6]); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Load Character Legacy Data: Temp until I move */
|
/* Load Character Data */
|
||||||
query = StringFormat("SELECT id,profile,zonename,x,y,z,guild_id,rank,extprofile,class,level,lfp,lfg,instanceid,xtargets,firstlogon FROM character_ LEFT JOIN guild_members ON id=char_id WHERE id=%i", cid);
|
query = StringFormat("SELECT `lfp`, `lfg`, `xtargets`, `firstlogon`, `guild_id`, `rank` FROM `character_data` LEFT JOIN `guild_members` ON `id` = `char_id` WHERE `id` = %i", cid);
|
||||||
results = database.QueryDatabase(query);
|
results = database.QueryDatabase(query);
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
m_pp.lastlogin = time(nullptr);
|
m_pp.lastlogin = time(nullptr);
|
||||||
if (row[6]){
|
if (row[4]){
|
||||||
guild_id = atoi(row[6]);
|
guild_id = atoi(row[4]);
|
||||||
if (guildrank) {
|
if (guildrank) {
|
||||||
if (row[7] != nullptr){ guildrank = atoi(row[7]); }
|
if (row[5] != nullptr){ guildrank = atoi(row[5]); }
|
||||||
else{ guildrank = GUILD_RANK_NONE; }
|
else{ guildrank = GUILD_RANK_NONE; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (RuleB(Character, SharedBankPlat))
|
if (RuleB(Character, SharedBankPlat))
|
||||||
m_pp.platinum_shared = database.GetSharedPlatinum(database.GetAccountIDByChar(cid));
|
m_pp.platinum_shared = database.GetSharedPlatinum(database.GetAccountIDByChar(cid));
|
||||||
|
|
||||||
if (LFP){ LFP = atoi(row[11]); }
|
if (LFP){ LFP = atoi(row[0]); }
|
||||||
if (LFG){ LFG = atoi(row[12]); }
|
if (LFG){ LFG = atoi(row[1]); }
|
||||||
if (firstlogon){ firstlogon = atoi(row[15]); }
|
if (firstlogon){ firstlogon = atoi(row[3]); }
|
||||||
}
|
}
|
||||||
|
|
||||||
loaditems = database.GetInventory(cid, &m_inv); /* Load Character Inventory */
|
loaditems = database.GetInventory(cid, &m_inv); /* Load Character Inventory */
|
||||||
@ -595,13 +594,14 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
database.LoadCharacterMaterialColor(cid, &m_pp); /* Load Character Material */
|
database.LoadCharacterMaterialColor(cid, &m_pp); /* Load Character Material */
|
||||||
database.LoadCharacterPotions(cid, &m_pp); /* Load Character Potion Belt */
|
database.LoadCharacterPotions(cid, &m_pp); /* Load Character Potion Belt */
|
||||||
database.LoadCharacterCurrency(cid, &m_pp); /* Load Character Currency into PP */
|
database.LoadCharacterCurrency(cid, &m_pp); /* Load Character Currency into PP */
|
||||||
database.LoadCharacterData(cid, &m_pp); /* Load Character Data from DB into PP */
|
database.LoadCharacterData(cid, &m_pp, &m_epp); /* Load Character Data from DB into PP as well as E_PP */
|
||||||
database.LoadCharacterSkills(cid, &m_pp); /* Load Character Skills */
|
database.LoadCharacterSkills(cid, &m_pp); /* Load Character Skills */
|
||||||
database.GetPlayerInspectMessage(m_pp.name, &m_inspect_message); /* Move to another method when can, this is pointless... */
|
database.LoadCharacterInspectMessage(cid, &m_inspect_message); /* Load Character Inspect Message */
|
||||||
database.LoadCharacterSpellBook(cid, &m_pp); /* Load Character Spell Book */
|
database.LoadCharacterSpellBook(cid, &m_pp); /* Load Character Spell Book */
|
||||||
database.LoadCharacterMemmedSpells(cid, &m_pp); /* Load Character Memorized Spells */
|
database.LoadCharacterMemmedSpells(cid, &m_pp); /* Load Character Memorized Spells */
|
||||||
database.LoadCharacterDisciplines(cid, &m_pp); /* Load Character Disciplines */
|
database.LoadCharacterDisciplines(cid, &m_pp); /* Load Character Disciplines */
|
||||||
database.LoadCharacterLanguages(cid, &m_pp); /* Load Character Languages */
|
database.LoadCharacterLanguages(cid, &m_pp); /* Load Character Languages */
|
||||||
|
database.LoadCharacterLeadershipAA(cid, &m_pp); /* Load Character Leadership AA's */
|
||||||
|
|
||||||
if (level){ level = m_pp.level; }
|
if (level){ level = m_pp.level; }
|
||||||
|
|
||||||
@ -619,7 +619,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
m_pp.intoxication = 0;
|
m_pp.intoxication = 0;
|
||||||
strcpy(name, m_pp.name);
|
strcpy(name, m_pp.name);
|
||||||
strcpy(lastname, m_pp.last_name);
|
strcpy(lastname, m_pp.last_name);
|
||||||
/* If PP is set to wierd coordinates */
|
/* If PP is set to weird coordinates */
|
||||||
if ((m_pp.x == -1 && m_pp.y == -1 && m_pp.z == -1) || (m_pp.x == -2 && m_pp.y == -2 && m_pp.z == -2)) {
|
if ((m_pp.x == -1 && m_pp.y == -1 && m_pp.z == -1) || (m_pp.x == -2 && m_pp.y == -2 && m_pp.z == -2)) {
|
||||||
m_pp.x = zone->safe_x();
|
m_pp.x = zone->safe_x();
|
||||||
m_pp.y = zone->safe_y();
|
m_pp.y = zone->safe_y();
|
||||||
@ -901,7 +901,6 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
m_pp.pvp = 1;
|
m_pp.pvp = 1;
|
||||||
/* Time entitled on Account: Move to account */
|
/* Time entitled on Account: Move to account */
|
||||||
m_pp.timeentitledonaccount = database.GetTotalTimeEntitledOnAccount(AccountID()) / 1440;
|
m_pp.timeentitledonaccount = database.GetTotalTimeEntitledOnAccount(AccountID()) / 1440;
|
||||||
|
|
||||||
/* Reset rest timer if the durations have been lowered in the database */
|
/* Reset rest timer if the durations have been lowered in the database */
|
||||||
if ((m_pp.RestTimer > RuleI(Character, RestRegenTimeToActivate)) && (m_pp.RestTimer > RuleI(Character, RestRegenRaidTimeToActivate)))
|
if ((m_pp.RestTimer > RuleI(Character, RestRegenTimeToActivate)) && (m_pp.RestTimer > RuleI(Character, RestRegenRaidTimeToActivate)))
|
||||||
m_pp.RestTimer = 0;
|
m_pp.RestTimer = 0;
|
||||||
@ -926,8 +925,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
in hopes that it adds more consistency...
|
in hopes that it adds more consistency...
|
||||||
Remake pet
|
Remake pet
|
||||||
*/
|
*/
|
||||||
if (m_petinfo.SpellID > 1 && !GetPet() && m_petinfo.SpellID <= SPDAT_RECORDS)
|
if (m_petinfo.SpellID > 1 && !GetPet() && m_petinfo.SpellID <= SPDAT_RECORDS) {
|
||||||
{
|
|
||||||
MakePoweredPet(m_petinfo.SpellID, spells[m_petinfo.SpellID].teleport_zone, m_petinfo.petpower, m_petinfo.Name, m_petinfo.size);
|
MakePoweredPet(m_petinfo.SpellID, spells[m_petinfo.SpellID].teleport_zone, m_petinfo.petpower, m_petinfo.Name, m_petinfo.size);
|
||||||
if (GetPet() && GetPet()->IsNPC()) {
|
if (GetPet() && GetPet()->IsNPC()) {
|
||||||
NPC *pet = GetPet()->CastToNPC();
|
NPC *pet = GetPet()->CastToNPC();
|
||||||
@ -1023,7 +1021,6 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
|
|
||||||
SetAttackTimer();
|
SetAttackTimer();
|
||||||
|
|
||||||
conn_state = ZoneInfoSent;
|
conn_state = ZoneInfoSent;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -7312,7 +7309,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) {
|
|||||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*) insr->text;
|
InspectMessage_Struct* newmessage = (InspectMessage_Struct*) insr->text;
|
||||||
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
||||||
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
|
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
|
||||||
database.SetPlayerInspectMessage(name, &playermessage);
|
database.SaveCharacterInspectMessage(this->CharacterID(), &playermessage);
|
||||||
|
|
||||||
if(tmp != 0 && tmp->IsClient()) { tmp->CastToClient()->QueuePacket(outapp); } // Send answer to requester
|
if(tmp != 0 && tmp->IsClient()) { tmp->CastToClient()->QueuePacket(outapp); } // Send answer to requester
|
||||||
|
|
||||||
@ -7329,7 +7326,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) {
|
|||||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*) app->pBuffer;
|
InspectMessage_Struct* newmessage = (InspectMessage_Struct*) app->pBuffer;
|
||||||
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
||||||
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
|
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
|
||||||
database.SetPlayerInspectMessage(name, &playermessage);
|
database.SaveCharacterInspectMessage(this->CharacterID(), &playermessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 // I dont think there's an op for this now, and we check this
|
#if 0 // I dont think there's an op for this now, and we check this
|
||||||
@ -9559,6 +9556,8 @@ void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) {
|
|||||||
//sell them the ability.
|
//sell them the ability.
|
||||||
m_pp.group_leadership_points -= cost;
|
m_pp.group_leadership_points -= cost;
|
||||||
m_pp.leader_abilities.ranks[aaid]++;
|
m_pp.leader_abilities.ranks[aaid]++;
|
||||||
|
|
||||||
|
database.SaveCharacterLeadershipAA(this->CharacterID(), &m_pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
//success, send them an update
|
//success, send them an update
|
||||||
|
|||||||
234
zone/zonedb.cpp
234
zone/zonedb.cpp
@ -821,7 +821,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity)
|
|||||||
|
|
||||||
#define StructDist(in, f1, f2) (uint32(&in->f2)-uint32(&in->f1))
|
#define StructDist(in, f1, f2) (uint32(&in->f2)-uint32(&in->f1))
|
||||||
|
|
||||||
bool ZoneDatabase::LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp){
|
bool ZoneDatabase::LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp){
|
||||||
std::string query = StringFormat(
|
std::string query = StringFormat(
|
||||||
"SELECT "
|
"SELECT "
|
||||||
"`name`, "
|
"`name`, "
|
||||||
@ -911,100 +911,106 @@ bool ZoneDatabase::LoadCharacterData(uint32 character_id, PlayerProfile_Struct*
|
|||||||
"group_auto_consent, "
|
"group_auto_consent, "
|
||||||
"raid_auto_consent, "
|
"raid_auto_consent, "
|
||||||
"guild_auto_consent, "
|
"guild_auto_consent, "
|
||||||
"RestTimer "
|
"RestTimer, "
|
||||||
|
"`e_aa_effects`, "
|
||||||
|
"`e_percent_to_aa`, "
|
||||||
|
"`e_expended_aa_spent` "
|
||||||
"FROM "
|
"FROM "
|
||||||
"character_data "
|
"character_data "
|
||||||
"WHERE `id` = %i ", character_id);
|
"WHERE `id` = %i ", character_id);
|
||||||
auto results = database.QueryDatabase(query); int r = 0;
|
auto results = database.QueryDatabase(query); int r = 0;
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
strcpy(pp->name, row[r]); r++;
|
strcpy(pp->name, row[r]); r++; // "`name`, "
|
||||||
strcpy(pp->last_name, row[r]); r++;
|
strcpy(pp->last_name, row[r]); r++; // "last_name, "
|
||||||
pp->gender = atoi(row[r]); r++;
|
pp->gender = atoi(row[r]); r++; // "gender, "
|
||||||
pp->race = atoi(row[r]); r++;
|
pp->race = atoi(row[r]); r++; // "race, "
|
||||||
pp->class_ = atoi(row[r]); r++;
|
pp->class_ = atoi(row[r]); r++; // "class, "
|
||||||
pp->level = atoi(row[r]); r++;
|
pp->level = atoi(row[r]); r++; // "`level`, "
|
||||||
pp->deity = atoi(row[r]); r++;
|
pp->deity = atoi(row[r]); r++; // "deity, "
|
||||||
pp->birthday = atoi(row[r]); r++;
|
pp->birthday = atoi(row[r]); r++; // "birthday, "
|
||||||
pp->lastlogin = atoi(row[r]); r++;
|
pp->lastlogin = atoi(row[r]); r++; // "last_login, "
|
||||||
pp->timePlayedMin = atoi(row[r]); r++;
|
pp->timePlayedMin = atoi(row[r]); r++; // "time_played, "
|
||||||
pp->pvp = atoi(row[r]); r++;
|
pp->pvp = atoi(row[r]); r++; // "pvp_status, "
|
||||||
pp->level2 = atoi(row[r]); r++;
|
pp->level2 = atoi(row[r]); r++; // "level2, "
|
||||||
pp->anon = atoi(row[r]); r++;
|
pp->anon = atoi(row[r]); r++; // "anon, "
|
||||||
pp->gm = atoi(row[r]); r++;
|
pp->gm = atoi(row[r]); r++; // "gm, "
|
||||||
pp->intoxication = atoi(row[r]); r++;
|
pp->intoxication = atoi(row[r]); r++; // "intoxication, "
|
||||||
pp->haircolor = atoi(row[r]); r++;
|
pp->haircolor = atoi(row[r]); r++; // "hair_color, "
|
||||||
pp->beardcolor = atoi(row[r]); r++;
|
pp->beardcolor = atoi(row[r]); r++; // "beard_color, "
|
||||||
pp->eyecolor1 = atoi(row[r]); r++;
|
pp->eyecolor1 = atoi(row[r]); r++; // "eye_color_1, "
|
||||||
pp->eyecolor2 = atoi(row[r]); r++;
|
pp->eyecolor2 = atoi(row[r]); r++; // "eye_color_2, "
|
||||||
pp->hairstyle = atoi(row[r]); r++;
|
pp->hairstyle = atoi(row[r]); r++; // "hair_style, "
|
||||||
pp->beard = atoi(row[r]); r++;
|
pp->beard = atoi(row[r]); r++; // "beard, "
|
||||||
pp->ability_time_seconds = atoi(row[r]); r++;
|
pp->ability_time_seconds = atoi(row[r]); r++; // "ability_time_seconds, "
|
||||||
pp->ability_number = atoi(row[r]); r++;
|
pp->ability_number = atoi(row[r]); r++; // "ability_number, "
|
||||||
pp->ability_time_minutes = atoi(row[r]); r++;
|
pp->ability_time_minutes = atoi(row[r]); r++; // "ability_time_minutes, "
|
||||||
pp->ability_time_hours = atoi(row[r]); r++;
|
pp->ability_time_hours = atoi(row[r]); r++; // "ability_time_hours, "
|
||||||
strcpy(pp->title, row[r]); r++;
|
strcpy(pp->title, row[r]); r++; // "title, "
|
||||||
strcpy(pp->suffix, row[r]); r++;
|
strcpy(pp->suffix, row[r]); r++; // "suffix, "
|
||||||
pp->exp = atoi(row[r]); r++;
|
pp->exp = atoi(row[r]); r++; // "exp, "
|
||||||
pp->points = atoi(row[r]); r++;
|
pp->points = atoi(row[r]); r++; // "points, "
|
||||||
pp->mana = atoi(row[r]); r++;
|
pp->mana = atoi(row[r]); r++; // "mana, "
|
||||||
pp->cur_hp = atoi(row[r]); r++;
|
pp->cur_hp = atoi(row[r]); r++; // "cur_hp, "
|
||||||
pp->STR = atoi(row[r]); r++;
|
pp->STR = atoi(row[r]); r++; // "str, "
|
||||||
pp->STA = atoi(row[r]); r++;
|
pp->STA = atoi(row[r]); r++; // "sta, "
|
||||||
pp->CHA = atoi(row[r]); r++;
|
pp->CHA = atoi(row[r]); r++; // "cha, "
|
||||||
pp->DEX = atoi(row[r]); r++;
|
pp->DEX = atoi(row[r]); r++; // "dex, "
|
||||||
pp->INT = atoi(row[r]); r++;
|
pp->INT = atoi(row[r]); r++; // "`int`, "
|
||||||
pp->AGI = atoi(row[r]); r++;
|
pp->AGI = atoi(row[r]); r++; // "agi, "
|
||||||
pp->WIS = atoi(row[r]); r++;
|
pp->WIS = atoi(row[r]); r++; // "wis, "
|
||||||
pp->face = atoi(row[r]); r++;
|
pp->face = atoi(row[r]); r++; // "face, "
|
||||||
pp->y = atof(row[r]); r++;
|
pp->y = atof(row[r]); r++; // "y, "
|
||||||
pp->x = atof(row[r]); r++;
|
pp->x = atof(row[r]); r++; // "x, "
|
||||||
pp->z = atof(row[r]); r++;
|
pp->z = atof(row[r]); r++; // "z, "
|
||||||
pp->heading = atof(row[r]); r++;
|
pp->heading = atof(row[r]); r++; // "heading, "
|
||||||
pp->pvp2 = atoi(row[r]); r++;
|
pp->pvp2 = atoi(row[r]); r++; // "pvp2, "
|
||||||
pp->pvptype = atoi(row[r]); r++;
|
pp->pvptype = atoi(row[r]); r++; // "pvp_type, "
|
||||||
pp->autosplit = atoi(row[r]); r++;
|
pp->autosplit = atoi(row[r]); r++; // "autosplit_enabled, "
|
||||||
pp->zone_change_count = atoi(row[r]); r++;
|
pp->zone_change_count = atoi(row[r]); r++; // "zone_change_count, "
|
||||||
pp->drakkin_heritage = atoi(row[r]); r++;
|
pp->drakkin_heritage = atoi(row[r]); r++; // "drakkin_heritage, "
|
||||||
pp->drakkin_tattoo = atoi(row[r]); r++;
|
pp->drakkin_tattoo = atoi(row[r]); r++; // "drakkin_tattoo, "
|
||||||
pp->drakkin_details = atoi(row[r]); r++;
|
pp->drakkin_details = atoi(row[r]); r++; // "drakkin_details, "
|
||||||
pp->toxicity = atoi(row[r]); r++;
|
pp->toxicity = atoi(row[r]); r++; // "toxicity, "
|
||||||
pp->hunger_level = atoi(row[r]); r++;
|
pp->hunger_level = atoi(row[r]); r++; // "hunger_level, "
|
||||||
pp->thirst_level = atoi(row[r]); r++;
|
pp->thirst_level = atoi(row[r]); r++; // "thirst_level, "
|
||||||
pp->ability_up = atoi(row[r]); r++;
|
pp->ability_up = atoi(row[r]); r++; // "ability_up, "
|
||||||
pp->zone_id = atoi(row[r]); r++;
|
pp->zone_id = atoi(row[r]); r++; // "zone_id, "
|
||||||
pp->zoneInstance = atoi(row[r]); r++;
|
pp->zoneInstance = atoi(row[r]); r++; // "zone_instance, "
|
||||||
pp->leadAAActive = atoi(row[r]); r++;
|
pp->leadAAActive = atoi(row[r]); r++; // "leadership_exp_on, "
|
||||||
pp->ldon_points_guk = atoi(row[r]); r++;
|
pp->ldon_points_guk = atoi(row[r]); r++; // "ldon_points_guk, "
|
||||||
pp->ldon_points_mir = atoi(row[r]); r++;
|
pp->ldon_points_mir = atoi(row[r]); r++; // "ldon_points_mir, "
|
||||||
pp->ldon_points_mmc = atoi(row[r]); r++;
|
pp->ldon_points_mmc = atoi(row[r]); r++; // "ldon_points_mmc, "
|
||||||
pp->ldon_points_ruj = atoi(row[r]); r++;
|
pp->ldon_points_ruj = atoi(row[r]); r++; // "ldon_points_ruj, "
|
||||||
pp->ldon_points_tak = atoi(row[r]); r++;
|
pp->ldon_points_tak = atoi(row[r]); r++; // "ldon_points_tak, "
|
||||||
pp->ldon_points_available = atoi(row[r]); r++;
|
pp->ldon_points_available = atoi(row[r]); r++; // "ldon_points_available, "
|
||||||
pp->tribute_time_remaining = atoi(row[r]); r++;
|
pp->tribute_time_remaining = atoi(row[r]); r++; // "tribute_time_remaining, "
|
||||||
pp->showhelm = atoi(row[r]); r++;
|
pp->showhelm = atoi(row[r]); r++; // "show_helm, "
|
||||||
pp->career_tribute_points = atoi(row[r]); r++;
|
pp->career_tribute_points = atoi(row[r]); r++; // "career_tribute_points, "
|
||||||
pp->tribute_points = atoi(row[r]); r++;
|
pp->tribute_points = atoi(row[r]); r++; // "tribute_points, "
|
||||||
pp->tribute_active = atoi(row[r]); r++;
|
pp->tribute_active = atoi(row[r]); r++; // "tribute_active, "
|
||||||
pp->endurance = atoi(row[r]); r++;
|
pp->endurance = atoi(row[r]); r++; // "endurance, "
|
||||||
pp->group_leadership_exp = atoi(row[r]); r++;
|
pp->group_leadership_exp = atoi(row[r]); r++; // "group_leadership_exp, "
|
||||||
pp->raid_leadership_exp = atoi(row[r]); r++;
|
pp->raid_leadership_exp = atoi(row[r]); r++; // "raid_leadership_exp, "
|
||||||
pp->group_leadership_points = atoi(row[r]); r++;
|
pp->group_leadership_points = atoi(row[r]); r++; // "group_leadership_points, "
|
||||||
pp->raid_leadership_points = atoi(row[r]); r++;
|
pp->raid_leadership_points = atoi(row[r]); r++; // "raid_leadership_points, "
|
||||||
pp->air_remaining = atoi(row[r]); r++;
|
pp->air_remaining = atoi(row[r]); r++; // "air_remaining, "
|
||||||
pp->PVPKills = atoi(row[r]); r++;
|
pp->PVPKills = atoi(row[r]); r++; // "pvp_kills, "
|
||||||
pp->PVPDeaths = atoi(row[r]); r++;
|
pp->PVPDeaths = atoi(row[r]); r++; // "pvp_deaths, "
|
||||||
pp->PVPCurrentPoints = atoi(row[r]); r++;
|
pp->PVPCurrentPoints = atoi(row[r]); r++; // "pvp_current_points, "
|
||||||
pp->PVPCareerPoints = atoi(row[r]); r++;
|
pp->PVPCareerPoints = atoi(row[r]); r++; // "pvp_career_points, "
|
||||||
pp->PVPBestKillStreak = atoi(row[r]); r++;
|
pp->PVPBestKillStreak = atoi(row[r]); r++; // "pvp_best_kill_streak, "
|
||||||
pp->PVPWorstDeathStreak = atoi(row[r]); r++;
|
pp->PVPWorstDeathStreak = atoi(row[r]); r++; // "pvp_worst_death_streak, "
|
||||||
pp->PVPCurrentKillStreak = atoi(row[r]); r++;
|
pp->PVPCurrentKillStreak = atoi(row[r]); r++; // "pvp_current_kill_streak, "
|
||||||
pp->aapoints_spent = atoi(row[r]); r++;
|
pp->aapoints_spent = atoi(row[r]); r++; // "aa_points_spent, "
|
||||||
pp->expAA = atoi(row[r]); r++;
|
pp->expAA = atoi(row[r]); r++; // "aa_exp, "
|
||||||
pp->aapoints = atoi(row[r]); r++;
|
pp->aapoints = atoi(row[r]); r++; // "aa_points, "
|
||||||
pp->groupAutoconsent = atoi(row[r]); r++;
|
pp->groupAutoconsent = atoi(row[r]); r++; // "group_auto_consent, "
|
||||||
pp->raidAutoconsent = atoi(row[r]); r++;
|
pp->raidAutoconsent = atoi(row[r]); r++; // "raid_auto_consent, "
|
||||||
pp->guildAutoconsent = atoi(row[r]); r++;
|
pp->guildAutoconsent = atoi(row[r]); r++; // "guild_auto_consent, "
|
||||||
pp->RestTimer = atoi(row[r]); r++;
|
pp->RestTimer = atoi(row[r]); r++; // "RestTimer, "
|
||||||
|
m_epp->aa_effects = atoi(row[r]); r++; // "`e_aa_effects`, "
|
||||||
|
m_epp->perAA = atoi(row[r]); r++; // "`e_percent_to_aa`, "
|
||||||
|
m_epp->expended_aa = atoi(row[r]); r++; // "`e_expended_aa_spent` "
|
||||||
LogFile->write(EQEMuLog::Status, "Loading Character Data for character ID: %i, done", character_id);
|
LogFile->write(EQEMuLog::Status, "Loading Character Data for character ID: %i, done", character_id);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1060,6 +1066,16 @@ bool ZoneDatabase::LoadCharacterLanguages(uint32 character_id, PlayerProfile_Str
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ZoneDatabase::LoadCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp){
|
||||||
|
std::string query = StringFormat("SELECT slot, rank FROM character_leadership_abilities WHERE `id` = %u", character_id);
|
||||||
|
auto results = database.QueryDatabase(query); uint32 slot = 0;
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
slot = atoi(row[0]);
|
||||||
|
pp->leader_abilities.ranks[slot] = atoi(row[1]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp){
|
bool ZoneDatabase::LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp){
|
||||||
std::string query = StringFormat(
|
std::string query = StringFormat(
|
||||||
"SELECT "
|
"SELECT "
|
||||||
@ -1288,7 +1304,23 @@ bool ZoneDatabase::SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp){
|
bool ZoneDatabase::SaveCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp){
|
||||||
|
uint8 first_entry = 0; std::string query = "";
|
||||||
|
for (int i = 0; i <= MAX_LEADERSHIP_AA_ARRAY; i++){
|
||||||
|
if (pp->leader_abilities.ranks[i] > 0){
|
||||||
|
if (first_entry != 1){
|
||||||
|
query = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, rank) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||||
|
first_entry = 1;
|
||||||
|
}
|
||||||
|
query = query + StringFormat(", (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
auto results = QueryDatabase(query);
|
||||||
|
ThrowDBError(results.ErrorMessage(), "ZoneDatabase::SaveCharacterLeadershipAA", query);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp){
|
||||||
clock_t t = std::clock(); /* Function timer start */
|
clock_t t = std::clock(); /* Function timer start */
|
||||||
std::string query = StringFormat(
|
std::string query = StringFormat(
|
||||||
"REPLACE INTO `character_data` ("
|
"REPLACE INTO `character_data` ("
|
||||||
@ -1381,7 +1413,11 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla
|
|||||||
" group_auto_consent, "
|
" group_auto_consent, "
|
||||||
" raid_auto_consent, "
|
" raid_auto_consent, "
|
||||||
" guild_auto_consent, "
|
" guild_auto_consent, "
|
||||||
" RestTimer) "
|
" RestTimer, "
|
||||||
|
" e_aa_effects, "
|
||||||
|
" e_percent_to_aa, "
|
||||||
|
" e_expended_aa_spent "
|
||||||
|
") "
|
||||||
"VALUES ("
|
"VALUES ("
|
||||||
"%u," // id " id, "
|
"%u," // id " id, "
|
||||||
"%u," // account_id " account_id, "
|
"%u," // account_id " account_id, "
|
||||||
@ -1472,7 +1508,10 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla
|
|||||||
"%u," // group_auto_consent pp->groupAutoconsent, " group_auto_consent, "
|
"%u," // group_auto_consent pp->groupAutoconsent, " group_auto_consent, "
|
||||||
"%u," // raid_auto_consent pp->raidAutoconsent, " raid_auto_consent, "
|
"%u," // raid_auto_consent pp->raidAutoconsent, " raid_auto_consent, "
|
||||||
"%u," // guild_auto_consent pp->guildAutoconsent, " guild_auto_consent, "
|
"%u," // guild_auto_consent pp->guildAutoconsent, " guild_auto_consent, "
|
||||||
"%u" // RestTimer pp->RestTimer, " RestTimer) "
|
"%u," // RestTimer pp->RestTimer, " RestTimer) "
|
||||||
|
"%u," // e_aa_effects
|
||||||
|
"%u," // e_percent_to_aa
|
||||||
|
"%u" // e_expended_aa_spent
|
||||||
")",
|
")",
|
||||||
character_id, // " id, "
|
character_id, // " id, "
|
||||||
account_id, // " account_id, "
|
account_id, // " account_id, "
|
||||||
@ -1563,7 +1602,10 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla
|
|||||||
pp->groupAutoconsent, // " group_auto_consent, "
|
pp->groupAutoconsent, // " group_auto_consent, "
|
||||||
pp->raidAutoconsent, // " raid_auto_consent, "
|
pp->raidAutoconsent, // " raid_auto_consent, "
|
||||||
pp->guildAutoconsent, // " guild_auto_consent, "
|
pp->guildAutoconsent, // " guild_auto_consent, "
|
||||||
pp->RestTimer // " RestTimer) "
|
pp->RestTimer, // " RestTimer) "
|
||||||
|
m_epp->aa_effects,
|
||||||
|
m_epp->perAA,
|
||||||
|
m_epp->expended_aa
|
||||||
);
|
);
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
if (!results.RowsAffected()){ std::cout << "ERROR ZoneDatabase:SaveCharacterData: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; }
|
if (!results.RowsAffected()){ std::cout << "ERROR ZoneDatabase:SaveCharacterData: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; }
|
||||||
@ -1650,6 +1692,10 @@ bool ZoneDatabase::DeleteCharacterBandolier(uint32 character_id, uint32 band_id)
|
|||||||
std::string query = StringFormat("DELETE FROM `character_bandolier` WHERE `bandolier_id` = %u AND `id` = %u", band_id, character_id); QueryDatabase(query); return true;
|
std::string query = StringFormat("DELETE FROM `character_bandolier` WHERE `bandolier_id` = %u AND `id` = %u", band_id, character_id); QueryDatabase(query); return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ZoneDatabase::DeleteCharacterLeadershipAAs(uint32 character_id){
|
||||||
|
std::string query = StringFormat("DELETE FROM `character_leadership_abilities` WHERE `id` = %u", character_id); QueryDatabase(query); return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::DeleteCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id){
|
bool ZoneDatabase::DeleteCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id){
|
||||||
std::string query = StringFormat("DELETE FROM `character_memmed_spells` WHERE `slot_id` = %u AND `id` = %u", slot_id, character_id); QueryDatabase(query); return true;
|
std::string query = StringFormat("DELETE FROM `character_memmed_spells` WHERE `slot_id` = %u AND `id` = %u", slot_id, character_id); QueryDatabase(query); return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -255,18 +255,19 @@ public:
|
|||||||
bool LoadCharacterLanguages(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterLanguages(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterDisciplines(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterSkills(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterSkills(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterData(uint32 character_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp);
|
||||||
bool LoadCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterMaterialColor(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterMaterialColor(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterBandolier(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool LoadCharacterPotions(uint32 character_id, PlayerProfile_Struct* pp);
|
bool LoadCharacterPotions(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
|
bool LoadCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
|
|
||||||
/* Character Data Saves */
|
/* Character Data Saves */
|
||||||
bool SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading, uint8 is_home);
|
bool SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, uint32 instance_id, float x, float y, float z, float heading, uint8 is_home);
|
||||||
bool SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
|
bool SaveCharacterCurrency(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp);
|
bool SaveCharacterData(uint32 character_id, uint32 account_id, PlayerProfile_Struct* pp, ExtendedProfile_Struct* m_epp);
|
||||||
bool SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level);
|
bool SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 current_level);
|
||||||
bool SaveCharacterSpellSwap(uint32 character_id, uint32 spell_id, uint32 from_slot, uint32 to_slot);
|
bool SaveCharacterSpellSwap(uint32 character_id, uint32 spell_id, uint32 from_slot, uint32 to_slot);
|
||||||
bool SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
|
bool SaveCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
|
||||||
@ -278,12 +279,14 @@ public:
|
|||||||
bool SaveCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
|
bool SaveCharacterTribute(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
bool SaveCharacterBandolier(uint32 character_id, uint8 bandolier_id, uint8 bandolier_slot, uint32 item_id, uint32 icon, const char* bandolier_name);
|
bool SaveCharacterBandolier(uint32 character_id, uint8 bandolier_id, uint8 bandolier_slot, uint32 item_id, uint32 icon, const char* bandolier_name);
|
||||||
bool SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id, uint32 item_id, uint32 icon);
|
bool SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id, uint32 item_id, uint32 icon);
|
||||||
|
bool SaveCharacterLeadershipAA(uint32 character_id, PlayerProfile_Struct* pp);
|
||||||
|
|
||||||
/* Character Data Deletes */
|
/* Character Data Deletes */
|
||||||
bool DeleteCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
|
bool DeleteCharacterSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
|
||||||
bool DeleteCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
|
bool DeleteCharacterMemorizedSpell(uint32 character_id, uint32 spell_id, uint32 slot_id);
|
||||||
bool DeleteCharacterDisc(uint32 character_id, uint32 slot_id);
|
bool DeleteCharacterDisc(uint32 character_id, uint32 slot_id);
|
||||||
bool DeleteCharacterBandolier(uint32 character_id, uint32 band_id);
|
bool DeleteCharacterBandolier(uint32 character_id, uint32 band_id);
|
||||||
|
bool DeleteCharacterLeadershipAAs(uint32 character_id);
|
||||||
|
|
||||||
/* Character Inventory */
|
/* Character Inventory */
|
||||||
bool NoRentExpired(const char* name);
|
bool NoRentExpired(const char* name);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user