[Code Cleanup] Remove this-> in code where its implied (#2088)

This commit is contained in:
Chris Miles 2022-05-01 09:22:09 -05:00 committed by GitHub
parent b02008ec53
commit 5b4aeaa457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 1033 additions and 1033 deletions

View File

@ -23,18 +23,18 @@
BasePacket::BasePacket(const unsigned char *buf, uint32 len)
{
this->pBuffer=nullptr;
this->size=0;
this->_wpos = 0;
this->_rpos = 0;
this->timestamp.tv_sec = 0;
pBuffer=nullptr;
size=0;
_wpos = 0;
_rpos = 0;
timestamp.tv_sec = 0;
if (len>0) {
this->size=len;
size=len;
pBuffer= new unsigned char[len];
if (buf) {
memcpy(this->pBuffer,buf,len);
memcpy(pBuffer,buf,len);
} else {
memset(this->pBuffer,0,len);
memset(pBuffer,0,len);
}
}
}

View File

@ -526,7 +526,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugty
{
continue;
}
return this->GetAugment(i);
return GetAugment(i);
}
}

View File

@ -246,7 +246,7 @@ const std::string &RuleManager::_GetRuleNotes(RuleType type, uint16 index) {
bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool reload) {
int ruleset_id = this->GetRulesetID(database, ruleset_name);
int ruleset_id = GetRulesetID(database, ruleset_name);
if (ruleset_id < 0) {
Log(Logs::Detail, Logs::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset_name);
return (false);

View File

@ -12,25 +12,25 @@ extern Database database;
PlayerLookingForGuild::PlayerLookingForGuild(char *Name, char *Comments, uint32 Level, uint32 Class, uint32 AACount, uint32 Timezone, uint32 TimePosted)
{
this->Name = Name;
this->Comments = Comments;
this->Level = Level;
this->Class = Class;
this->AACount = AACount;
this->TimeZone = Timezone;
this->TimePosted = TimePosted;
Name = Name;
Comments = Comments;
Level = Level;
Class = Class;
AACount = AACount;
TimeZone = Timezone;
TimePosted = TimePosted;
}
GuildLookingForPlayers::GuildLookingForPlayers(char *Name, char *Comments, uint32 FromLevel, uint32 ToLevel, uint32 Classes, uint32 AACount, uint32 Timezone, uint32 TimePosted)
{
this->Name = Name;
this->Comments = Comments;
this->FromLevel = FromLevel;
this->ToLevel = ToLevel;
this->Classes = Classes;
this->AACount = AACount;
this->TimeZone = Timezone;
this->TimePosted = TimePosted;
Name = Name;
Comments = Comments;
FromLevel = FromLevel;
ToLevel = ToLevel;
Classes = Classes;
AACount = AACount;
TimeZone = Timezone;
TimePosted = TimePosted;
}
bool LFGuildManager::LoadDatabase()

View File

@ -31,10 +31,10 @@ Adventure::Adventure(AdventureTemplate *t)
Adventure::Adventure(AdventureTemplate *t, int count, int assassination_count, AdventureStatus status, uint16 instance_id, uint32 time_left)
{
adventure_template = t;
this->count = count;
this->assassination_count = assassination_count;
this->status = status;
this->instance_id = instance_id;
count = count;
assassination_count = assassination_count;
status = status;
instance_id = instance_id;
if(status == AS_Finished)
{

View File

@ -735,7 +735,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) {
}
if (RuleB(World, EnableIPExemptions) || RuleI(World, MaxClientsPerIP) >= 0) {
client_list.GetCLEIP(this->GetIP()); //Check current CLE Entry IPs against incoming connection
client_list.GetCLEIP(GetIP()); //Check current CLE Entry IPs against incoming connection
}
EnterWorld_Struct *ew=(EnterWorld_Struct *)app->pBuffer;
@ -996,9 +996,9 @@ bool Client::HandlePacket(const EQApplicationPacket *app) {
}
// Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses
if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) {
LogInfo("GM Account not permited from source address [{}] and accountid [{}]", long2ip(this->GetIP()).c_str(), this->GetAccountID());
if (RuleB(World, GMAccountIPList) && GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) {
if(!database.CheckGMIPs(long2ip(GetIP()).c_str(), GetAccountID())) {
LogInfo("GM Account not permited from source address [{}] and accountid [{}]", long2ip(GetIP()).c_str(), GetAccountID());
eqs->Close();
}
}

View File

@ -133,7 +133,7 @@ void ClientListEntry::SetChar(uint32 iCharID, const char *iCharName)
void ClientListEntry::SetOnline(ZoneServer *iZS, CLE_Status iOnline)
{
if (iZS == this->Server()) {
if (iZS == Server()) {
SetOnline(iOnline);
}
}

View File

@ -467,7 +467,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID)
int PacketLength = 8;
uint32 Count = 0;
ClientListEntry* from = this->FindCLEByCharacterID(FromID);
ClientListEntry* from = FindCLEByCharacterID(FromID);
if(!from)
{

View File

@ -525,7 +525,7 @@ void Console::ProcessCommand(const char* command) {
if (sep.IsNumber(1) && atoi(sep.arg[1]) > 0) {
auto pack = new ServerPacket(ServerOP_Uptime, sizeof(ServerUptime_Struct));
ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer;
snprintf(sus->adminname, sizeof(sus->adminname), "*%s", this->GetName());
snprintf(sus->adminname, sizeof(sus->adminname), "*%s", GetName());
sus->zoneserverid = atoi(sep.arg[1]);
ZoneServer* zs = zoneserver_list.FindByID(sus->zoneserverid);
if (zs)
@ -544,9 +544,9 @@ void Console::ProcessCommand(const char* command) {
SendMessage(1, "MD5: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", md5[0], md5[1], md5[2], md5[3], md5[4], md5[5], md5[6], md5[7], md5[8], md5[9], md5[10], md5[11], md5[12], md5[13], md5[14], md5[15]);
}
else if (strcasecmp(sep.arg[0], "whoami") == 0) {
SendMessage(1, "You are logged in as '%s'", this->AccountName());
SendMessage(1, "You are known as '*%s'", this->AccountName());
SendMessage(1, "AccessLevel: %d", this->Admin());
SendMessage(1, "You are logged in as '%s'", AccountName());
SendMessage(1, "You are known as '*%s'", AccountName());
SendMessage(1, "AccessLevel: %d", Admin());
}
else if (strcasecmp(sep.arg[0], "echo") == 0) {
if (strcasecmp(sep.arg[1], "on") == 0)
@ -628,15 +628,15 @@ void Console::ProcessCommand(const char* command) {
SendMessage(1, "Character Does Not Exist");
}
}
else if (strcasecmp(sep.arg[0], "flag") == 0 && this->Admin() >= consoleFlagStatus) {
else if (strcasecmp(sep.arg[0], "flag") == 0 && Admin() >= consoleFlagStatus) {
// SCORPIOUS2K - reversed parameter order for flag
if(sep.arg[2][0]==0 || !sep.IsNumber(1))
SendMessage(1, "Usage: flag [status] [accountname]");
else
{
if (atoi(sep.arg[1]) > this->Admin())
if (atoi(sep.arg[1]) > Admin())
SendMessage(1, "You cannot set people's status to higher than your own");
else if (atoi(sep.arg[1]) < 0 && this->Admin() < consoleFlagStatus)
else if (atoi(sep.arg[1]) < 0 && Admin() < consoleFlagStatus)
SendMessage(1, "You have too low of status to change flags");
else if (!database.SetAccountStatus(sep.arg[2], atoi(sep.arg[1])))
SendMessage(1, "Unable to flag account!");
@ -655,7 +655,7 @@ void Console::ProcessCommand(const char* command) {
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*) pack->pBuffer;
strcpy(skp->adminname, tmpname);
strcpy(skp->name, sep.arg[1]);
skp->adminrank = this->Admin();
skp->adminrank = Admin();
zoneserver_list.SendPacket(pack);
delete pack;
}

View File

@ -84,7 +84,7 @@ ZoneServer::ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> conn
}
});
this->console = console;
console = console;
}
ZoneServer::~ZoneServer() {
@ -1567,7 +1567,7 @@ void ZoneServer::TriggerBootup(uint32 iZoneID, uint32 iInstanceID, const char* a
strcpy(s->adminname, adminname);
if (iZoneID == 0)
s->zoneid = this->GetZoneID();
s->zoneid = GetZoneID();
else
s->zoneid = iZoneID;

View File

@ -856,7 +856,7 @@ type', in which case, the answer is yes.
}
while( reverse++ == 0 );
LogDebug("Mob::IsAttackAllowed: don't have a rule for this - [{}] vs [{}]\n", this->GetName(), target->GetName());
LogDebug("Mob::IsAttackAllowed: don't have a rule for this - [{}] vs [{}]\n", GetName(), target->GetName());
return false;
}
@ -881,7 +881,7 @@ bool Mob::IsBeneficialAllowed(Mob *target)
// first figure out if we're pets. we always look at the master's flags.
// no need to compare pets to anything
mob1 = this->GetOwnerID() ? this->GetOwner() : this;
mob1 = GetOwnerID() ? GetOwner() : this;
mob2 = target->GetOwnerID() ? target->GetOwner() : target;
// if it's self target or our own pet it's ok
@ -996,7 +996,7 @@ bool Mob::IsBeneficialAllowed(Mob *target)
}
while( reverse++ == 0 );
LogDebug("Mob::IsBeneficialAllowed: don't have a rule for this - [{}] to [{}]\n", this->GetName(), target->GetName());
LogDebug("Mob::IsBeneficialAllowed: don't have a rule for this - [{}] to [{}]\n", GetName(), target->GetName());
return false;
}

View File

@ -1992,7 +1992,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::Skill
dead_timer.Start(5000, true);
m_pp.zone_id = m_pp.binds[0].zone_id;
m_pp.zoneInstance = m_pp.binds[0].instance_id;
database.MoveCharacterToZone(this->CharacterID(), m_pp.zone_id);
database.MoveCharacterToZone(CharacterID(), m_pp.zone_id);
Save();
GoToDeath();
}
@ -2001,8 +2001,8 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, EQ::skills::Skill
if (RuleB(QueryServ, PlayerLogDeaths)) {
const char * killer_name = "";
if (killerMob && killerMob->GetCleanName()) { killer_name = killerMob->GetCleanName(); }
std::string event_desc = StringFormat("Died in zoneid:%i instid:%i by '%s', spellid:%i, damage:%i", this->GetZoneID(), this->GetInstanceID(), killer_name, spell, damage);
QServ->PlayerLogEvent(Player_Log_Deaths, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Died in zoneid:%i instid:%i by '%s', spellid:%i, damage:%i", GetZoneID(), GetInstanceID(), killer_name, spell, damage);
QServ->PlayerLogEvent(Player_Log_Deaths, CharacterID(), event_desc);
}
parse->EventPlayer(EVENT_DEATH_COMPLETE, this, export_string, 0);
@ -2025,8 +2025,8 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
//Check that we can attack before we calc heading and face our target
if (!IsAttackAllowed(other)) {
if (this->GetOwnerID())
this->SayString(NOT_LEGAL_TARGET);
if (GetOwnerID())
SayString(NOT_LEGAL_TARGET);
if (other) {
if (other->IsClient())
other->CastToClient()->RemoveXTarget(this, false);
@ -2156,7 +2156,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
}
uint8 otherlevel = other->GetLevel();
uint8 mylevel = this->GetLevel();
uint8 mylevel = GetLevel();
otherlevel = otherlevel ? otherlevel : 1;
mylevel = mylevel ? mylevel : 1;
@ -2429,7 +2429,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
if (!IsCharmed() && give_exp_client && !RuleB(NPC, EnableMeritBasedFaction))
hate_list.DoFactionHits(GetNPCFactionID());
bool IsLdonTreasure = (this->GetClass() == LDON_TREASURE);
bool IsLdonTreasure = (GetClass() == LDON_TREASURE);
if (give_exp_client && !IsCorpse()) {
Group *kg = entity_list.GetGroupByClient(give_exp_client);
@ -2478,8 +2478,8 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * PlayerCount));
PlayerCount = 0;
QSPlayerLogNPCKill_Struct* QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
QS->s1.NPCID = this->GetNPCTypeID();
QS->s1.ZoneID = this->GetZoneID();
QS->s1.NPCID = GetNPCTypeID();
QS->s1.ZoneID = GetZoneID();
QS->s1.Type = 2; // Raid Fight
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
if (kr->members[i].member != nullptr && kr->members[i].member->IsClient()) { // If Group Member is Client
@ -2525,8 +2525,8 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * PlayerCount));
PlayerCount = 0;
QSPlayerLogNPCKill_Struct* QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
QS->s1.NPCID = this->GetNPCTypeID();
QS->s1.ZoneID = this->GetZoneID();
QS->s1.NPCID = GetNPCTypeID();
QS->s1.ZoneID = GetZoneID();
QS->s1.Type = 1; // Group Fight
for (int i = 0; i < MAX_GROUP_MEMBERS; i++) {
if (kg->members[i] != nullptr && kg->members[i]->IsClient()) { // If Group Member is Client
@ -2567,8 +2567,8 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
sizeof(QSPlayerLogNPCKill_Struct) +
(sizeof(QSPlayerLogNPCKillsPlayers_Struct) * 1));
QSPlayerLogNPCKill_Struct* QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer;
QS->s1.NPCID = this->GetNPCTypeID();
QS->s1.ZoneID = this->GetZoneID();
QS->s1.NPCID = GetNPCTypeID();
QS->s1.ZoneID = GetZoneID();
QS->s1.Type = 0; // Solo Fight
Client *c = give_exp_client;
QS->Chars[0].char_id = c->CharacterID();
@ -2593,12 +2593,12 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
killer = killer->GetOwner();
if (killer->IsClient() && !killer->CastToClient()->GetGM())
this->CheckTrivialMinMaxLevelDrop(killer);
CheckTrivialMinMaxLevelDrop(killer);
}
entity_list.RemoveFromAutoXTargets(this);
uint16 emoteid = this->GetEmoteID();
uint16 emoteid = GetEmoteID();
auto corpse = new Corpse(this, &itemlist, GetNPCTypeID(), &NPCTypedata,
level > 54 ? RuleI(NPC, MajorNPCCorpseDecayTimeMS)
: RuleI(NPC, MinorNPCCorpseDecayTimeMS));
@ -2610,7 +2610,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
// entity_list.RemoveMobFromCloseLists(this);
close_mobs.clear();
this->SetID(0);
SetID(0);
ApplyIllusionToCorpse(illusion_spell_id, corpse);
if (killer != 0 && emoteid != 0)
@ -2696,9 +2696,9 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
if (oos) {
mod_npc_killed(oos);
uint16 emoteid = this->GetEmoteID();
uint16 emoteid = GetEmoteID();
if (emoteid != 0)
this->DoNPCEmote(ONDEATH, emoteid);
DoNPCEmote(ONDEATH, emoteid);
if (oos->IsNPC()) {
parse->EventNPC(EVENT_NPC_SLAY, oos->CastToNPC(), this, "", 0);
uint16 emoteid = oos->GetEmoteID();
@ -2770,9 +2770,9 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
bool wasengaged = IsEngaged();
Mob* owner = other->GetOwner();
Mob* mypet = this->GetPet();
Mob* myowner = this->GetOwner();
Mob* targetmob = this->GetTarget();
Mob* mypet = GetPet();
Mob* myowner = GetOwner();
Mob* targetmob = GetTarget();
bool on_hatelist = CheckAggro(other);
if (other) {
@ -2913,8 +2913,8 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
// owner must get on list, but he's not actually gained any hate yet
if (
!owner->GetSpecialAbility(IMMUNE_AGGRO) &&
!(this->GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && owner->IsClient()) &&
!(this->GetSpecialAbility(IMMUNE_AGGRO_NPC) && owner->IsNPC())
!(GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && owner->IsClient()) &&
!(GetSpecialAbility(IMMUNE_AGGRO_NPC) && owner->IsNPC())
) {
if (owner->IsClient() && !CheckAggro(owner)) {
owner->CastToClient()->AddAutoXTarget(this);
@ -2928,8 +2928,8 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
if (
!mypet->IsFamiliar() &&
!mypet->GetSpecialAbility(IMMUNE_AGGRO) &&
!(mypet->GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && this->IsClient()) &&
!(mypet->GetSpecialAbility(IMMUNE_AGGRO_NPC) && this->IsNPC())
!(mypet->GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && IsClient()) &&
!(mypet->GetSpecialAbility(IMMUNE_AGGRO_NPC) && IsNPC())
) {
mypet->hate_list.AddEntToHateList(other, 0, 0, bFrenzy);
}
@ -2938,8 +2938,8 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
if (
myowner->IsAIControlled() &&
!myowner->GetSpecialAbility(IMMUNE_AGGRO) &&
!(this->GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && myowner->IsClient()) &&
!(this->GetSpecialAbility(IMMUNE_AGGRO_NPC) && myowner->IsNPC())
!(GetSpecialAbility(IMMUNE_AGGRO_CLIENT) && myowner->IsClient()) &&
!(GetSpecialAbility(IMMUNE_AGGRO_NPC) && myowner->IsNPC())
) {
myowner->hate_list.AddEntToHateList(other, 0, 0, bFrenzy);
}
@ -2952,7 +2952,7 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
if (!wasengaged) {
if (IsNPC() && other->IsClient() && other->CastToClient())
parse->EventNPC(EVENT_AGGRO, this->CastToNPC(), other, "", 0);
parse->EventNPC(EVENT_AGGRO, CastToNPC(), other, "", 0);
AI_Event_Engaged(other, iYellForHelp);
}
}
@ -3674,14 +3674,14 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
//we used to do a message to the client, but its gone now.
// emote goes with every one ... even npcs
entity_list.MessageClose(this, true, RuleI(Range, SpellMessages), Chat::Emote, "%s beams a smile at %s", attacker->GetCleanName(), this->GetCleanName());
entity_list.MessageClose(this, true, RuleI(Range, SpellMessages), Chat::Emote, "%s beams a smile at %s", attacker->GetCleanName(), GetCleanName());
}
// If a client pet is damaged while sitting, stand, fix sit button,
// and remove sitting regen. Removes bug where client clicks sit
// during battle and gains pet hp-regen and bugs the sit button.
if (IsPet()) {
Mob *owner = this->GetOwner();
Mob *owner = GetOwner();
if (owner && owner->IsClient()) {
if (GetPetOrder() == SPO_Sit) {
SetPetOrder(SPO_Follow);
@ -3721,7 +3721,7 @@ void Mob::CommonDamage(Mob* attacker, int &damage, const uint16 spell_id, const
}
// fix GUI sit button to be unpressed and stop sitting regen
this->CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0);
CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0);
pet->SetAppearance(eaStanding);
}
@ -4630,8 +4630,8 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
}
#ifdef BOTS
if (this->IsPet() && this->GetOwner() && this->GetOwner()->IsBot()) {
this->TryPetCriticalHit(defender, hit);
if (IsPet() && GetOwner() && GetOwner()->IsBot()) {
TryPetCriticalHit(defender, hit);
return;
}
#endif // BOTS

View File

@ -127,7 +127,7 @@ void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 resist_adj
caster_id = caster->GetID();
spell_id = cast_spell_id;
this->resist_adjust = resist_adjust;
resist_adjust = resist_adjust;
spell_iterations = spells[spell_id].aoe_duration / 2500;
spell_iterations = spell_iterations < 1 ? 1 : spell_iterations; // at least 1
if (spells[spell_id].aoe_max_targets) {

View File

@ -53,7 +53,7 @@ void Mob::CalcBonuses()
/* Fast walking NPC's are prone to disappear into walls/hills
We set this here because NPC's can cast spells to change walkspeed/runspeed
*/
float get_walk_speed = static_cast<float>(0.025f * this->GetWalkspeed());
float get_walk_speed = static_cast<float>(0.025f * GetWalkspeed());
rooted = FindType(SE_Root);
}

View File

@ -33,11 +33,11 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
GiveNPCTypeData(npcTypeData);
if(botOwner) {
this->SetBotOwner(botOwner);
this->_botOwnerCharacterID = botOwner->CharacterID();
SetBotOwner(botOwner);
_botOwnerCharacterID = botOwner->CharacterID();
} else {
this->SetBotOwner(0);
this->_botOwnerCharacterID = 0;
SetBotOwner(0);
_botOwnerCharacterID = 0;
}
m_inv.SetInventoryVersion(EQ::versions::MobVersion::Bot);
@ -116,7 +116,7 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
for (int i = 0; i < MaxTimer; i++)
timers[i] = 0;
strcpy(this->name, this->GetCleanName());
strcpy(name, GetCleanName());
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
}
@ -126,9 +126,9 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
{
GiveNPCTypeData(npcTypeData);
this->_botOwnerCharacterID = botOwnerCharacterID;
if(this->_botOwnerCharacterID > 0)
this->SetBotOwner(entity_list.GetClientByCharID(this->_botOwnerCharacterID));
_botOwnerCharacterID = botOwnerCharacterID;
if(_botOwnerCharacterID > 0)
SetBotOwner(entity_list.GetClientByCharID(_botOwnerCharacterID));
auto bot_owner = GetBotOwner();
@ -201,7 +201,7 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
else
SetStopMeleeLevel(255);
strcpy(this->name, this->GetCleanName());
strcpy(name, GetCleanName());
memset(&_botInspectMessage, 0, sizeof(InspectMessage_Struct));
if (!database.botdb.LoadInspectMessage(GetBotID(), _botInspectMessage) && bot_owner)
@ -440,12 +440,12 @@ Bot::~Bot() {
}
void Bot::SetBotID(uint32 botID) {
this->_botID = botID;
this->npctype_id = botID;
_botID = botID;
npctype_id = botID;
}
void Bot::SetBotSpellID(uint32 newSpellID) {
this->npc_spells_id = newSpellID;
npc_spells_id = newSpellID;
}
void Bot::SetSurname(std::string bot_surname) {
@ -840,7 +840,7 @@ void Bot::GenerateBaseStats()
int32 CorruptionResist = _baseCorrup;
// pulling fixed values from an auto-increment field is dangerous...
switch(this->GetClass()) {
switch(GetClass()) {
case WARRIOR:
BotSpellID = 3001;
Strength += 10;
@ -967,7 +967,7 @@ void Bot::GenerateBaseStats()
float BotSize = GetSize();
switch(this->GetRace()) {
switch(GetRace()) {
case HUMAN: // Humans have no race bonus
break;
case BARBARIAN:
@ -1127,33 +1127,33 @@ void Bot::GenerateBaseStats()
break;
}
this->STR = Strength;
this->STA = Stamina;
this->DEX = Dexterity;
this->AGI = Agility;
this->WIS = Wisdom;
this->INT = Intelligence;
this->CHA = Charisma;
this->ATK = Attack;
this->MR = MagicResist;
this->FR = FireResist;
this->DR = DiseaseResist;
this->PR = PoisonResist;
this->CR = ColdResist;
this->PhR = 0;
this->Corrup = CorruptionResist;
STR = Strength;
STA = Stamina;
DEX = Dexterity;
AGI = Agility;
WIS = Wisdom;
INT = Intelligence;
CHA = Charisma;
ATK = Attack;
MR = MagicResist;
FR = FireResist;
DR = DiseaseResist;
PR = PoisonResist;
CR = ColdResist;
PhR = 0;
Corrup = CorruptionResist;
SetBotSpellID(BotSpellID);
this->size = BotSize;
this->pAggroRange = 0;
this->pAssistRange = 0;
this->raid_target = false;
this->deity = 396;
size = BotSize;
pAggroRange = 0;
pAssistRange = 0;
raid_target = false;
deity = 396;
}
void Bot::GenerateAppearance() {
// Randomize facial appearance
int iFace = 0;
if(this->GetRace() == 2) // Barbarian w/Tatoo
if(GetRace() == 2) // Barbarian w/Tatoo
iFace = zone->random.Int(0, 79);
else
iFace = zone->random.Int(0, 7);
@ -1161,13 +1161,13 @@ void Bot::GenerateAppearance() {
int iHair = 0;
int iBeard = 0;
int iBeardColor = 1;
if(this->GetRace() == 522) {
if(GetRace() == 522) {
iHair = zone->random.Int(0, 8);
iBeard = zone->random.Int(0, 11);
iBeardColor = zone->random.Int(0, 3);
} else if(this->GetGender()) {
} else if(GetGender()) {
iHair = zone->random.Int(0, 2);
if(this->GetRace() == 8) { // Dwarven Females can have a beard
if(GetRace() == 8) { // Dwarven Females can have a beard
if(zone->random.Int(1, 100) < 50)
iFace += 10;
}
@ -1178,14 +1178,14 @@ void Bot::GenerateAppearance() {
}
int iHairColor = 0;
if(this->GetRace() == 522)
if(GetRace() == 522)
iHairColor = zone->random.Int(0, 3);
else
iHairColor = zone->random.Int(0, 19);
uint8 iEyeColor1 = (uint8)zone->random.Int(0, 9);
uint8 iEyeColor2 = 0;
if(this->GetRace() == 522)
if(GetRace() == 522)
iEyeColor1 = iEyeColor2 = (uint8)zone->random.Int(0, 11);
else if(zone->random.Int(1, 100) > 96)
iEyeColor2 = zone->random.Int(0, 9);
@ -1195,21 +1195,21 @@ void Bot::GenerateAppearance() {
int iHeritage = 0;
int iTattoo = 0;
int iDetails = 0;
if(this->GetRace() == 522) {
if(GetRace() == 522) {
iHeritage = zone->random.Int(0, 6);
iTattoo = zone->random.Int(0, 7);
iDetails = zone->random.Int(0, 7);
}
this->luclinface = iFace;
this->hairstyle = iHair;
this->beard = iBeard;
this->beardcolor = iBeardColor;
this->haircolor = iHairColor;
this->eyecolor1 = iEyeColor1;
this->eyecolor2 = iEyeColor2;
this->drakkin_heritage = iHeritage;
this->drakkin_tattoo = iTattoo;
this->drakkin_details = iDetails;
luclinface = iFace;
hairstyle = iHair;
beard = iBeard;
beardcolor = iBeardColor;
haircolor = iHairColor;
eyecolor1 = iEyeColor1;
eyecolor2 = iEyeColor2;
drakkin_heritage = iHeritage;
drakkin_tattoo = iTattoo;
drakkin_details = iDetails;
}
int32 Bot::acmod() {
@ -1665,7 +1665,7 @@ int32 Bot::GenerateBaseHitPoints() {
new_base_hp = (5) + (GetLevel() * lm / 10) + (((NormalSTA - Post255) * GetLevel() * lm / 3000)) + ((Post255 * 1) * lm / 6000);
}
this->base_hp = new_base_hp;
base_hp = new_base_hp;
return new_base_hp;
}
@ -1730,7 +1730,7 @@ bool Bot::IsValidRaceClassCombo(uint16 bot_race, uint8 bot_class)
bool Bot::IsValidName()
{
std::string name = this->GetCleanName();
std::string name = GetCleanName();
return Bot::IsValidName(name);
}
@ -3567,8 +3567,8 @@ void Bot::PetAIProcess() {
if( !HasPet() || !GetPet() || !GetPet()->IsNPC())
return;
Mob* BotOwner = this->GetBotOwner();
NPC* botPet = this->GetPet()->CastToNPC();
Mob* BotOwner = GetBotOwner();
NPC* botPet = GetPet()->CastToNPC();
if(!botPet->GetOwner() || !botPet->GetID() || !botPet->GetOwnerID()) {
Kill();
return;
@ -3799,25 +3799,25 @@ bool Bot::Spawn(Client* botCharacterOwner) {
_lastZoneId = GetZoneID();
// this change propagates to Bot::FillSpawnStruct()
this->helmtexture = 0; //0xFF;
this->texture = 0; //0xFF;
helmtexture = 0; //0xFF;
texture = 0; //0xFF;
if(this->Save())
this->GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", this->GetCleanName());
if(Save())
GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", GetCleanName());
else
this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName());
GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", GetCleanName());
// Spawn the bot at the bot owner's loc
this->m_Position.x = botCharacterOwner->GetX();
this->m_Position.y = botCharacterOwner->GetY();
this->m_Position.z = botCharacterOwner->GetZ();
m_Position.x = botCharacterOwner->GetX();
m_Position.y = botCharacterOwner->GetY();
m_Position.z = botCharacterOwner->GetZ();
// Make the bot look at the bot owner
FaceTarget(botCharacterOwner);
UpdateEquipmentLight();
UpdateActiveLight();
this->m_targetable = true;
m_targetable = true;
entity_list.AddBot(this, true, true);
// Load pet
LoadPet();
@ -3832,7 +3832,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
if(itemID != 0) {
materialFromSlot = EQ::InventoryProfile::CalcMaterialFromSlot(i);
if(materialFromSlot != 0xFF)
this->SendWearChange(materialFromSlot);
SendWearChange(materialFromSlot);
}
}
@ -3918,7 +3918,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
const EQ::ItemData* item = nullptr;
const EQ::ItemInstance* inst = nullptr;
uint32 spawnedbotid = 0;
spawnedbotid = this->GetBotID();
spawnedbotid = GetBotID();
for (int i = EQ::textures::textureBegin; i < EQ::textures::weaponPrimary; i++) {
inst = GetBotItem(i);
if (inst) {
@ -4131,7 +4131,7 @@ void Bot::BotTradeAddItem(uint32 id, const EQ::ItemInstance* inst, int16 charges
m_inv.PutItem(lootSlot, *inst);
}
this->BotAddEquipItem(lootSlot, id);
BotAddEquipItem(lootSlot, id);
}
bool Bot::RemoveBotFromGroup(Bot* bot, Group* group) {
@ -4557,7 +4557,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
client->Message(Chat::Red, "%s (slot: %i, name: '%s')", BotDatabase::fail::SaveItemBySlot(), trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetItem()->Name : "nullptr"));
m_inv.PutItem(trade_iterator.toBotSlot, *trade_iterator.tradeItemInstance);
this->BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0));
BotAddEquipItem(trade_iterator.toBotSlot, (trade_iterator.tradeItemInstance ? trade_iterator.tradeItemInstance->GetID() : 0));
trade_iterator.tradeItemInstance = nullptr; // actual deletion occurs in client delete below
client->DeleteItemInInventory(trade_iterator.fromClientSlot, 0, (trade_iterator.fromClientSlot == EQ::invslot::slotCursor));
@ -4609,7 +4609,7 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQ::skills::Skill
if(give_exp && give_exp->IsClient())
give_exp_client = give_exp->CastToClient();
bool IsLdonTreasure = (this->GetClass() == LDON_TREASURE);
bool IsLdonTreasure = (GetClass() == LDON_TREASURE);
if(entity_list.GetCorpseByID(GetID()))
entity_list.GetCorpseByID(GetID())->Depop();
@ -4674,7 +4674,7 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, EQ::skills::Skill
my_owner->CastToClient()->SetBotPulling(false);
}
entity_list.RemoveBot(this->GetID());
entity_list.RemoveBot(GetID());
return true;
}
@ -4748,8 +4748,8 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b
LogCombat("Attacking [{}] with hand [{}] [{}]", other->GetCleanName(), Hand, (FromRiposte ? "(this is a riposte)" : ""));
if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || (!IsAttackAllowed(other))) {
if(this->GetOwnerID())
entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName());
if(GetOwnerID())
entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", GetCleanName(), GetTarget()->GetCleanName());
if(other) {
RemoveFromHateList(other);
@ -6390,7 +6390,7 @@ FACTION_VALUE Bot::GetReverseFactionCon(Mob* iOther) {
Mob* Bot::GetOwnerOrSelf() {
Mob* Result = nullptr;
if(this->GetBotOwner())
if(GetBotOwner())
Result = GetBotOwner();
else
Result = this;
@ -6402,7 +6402,7 @@ Mob* Bot::GetOwner() {
Mob* Result = nullptr;
Result = GetBotOwner();
if(!Result)
this->SetBotOwner(0);
SetBotOwner(0);
return Result;
}
@ -6931,8 +6931,8 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) {
}
int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) {
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5) {
int32 mana_back = (this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100);
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5) {
int32 mana_back = (itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100);
if(mana_back > cost)
mana_back = cost;
@ -8854,14 +8854,14 @@ void Bot::CalcBotStats(bool showtext) {
GetSkill(EQ::skills::SkillBrassInstruments), GetSkill(EQ::skills::SkillPercussionInstruments), GetSkill(EQ::skills::SkillSinging), GetSkill(EQ::skills::SkillStringedInstruments), GetSkill(EQ::skills::SkillWindInstruments));
}
//if(this->Save())
// this->GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", this->GetCleanName());
//if(Save())
// GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", GetCleanName());
//else
// this->GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", this->GetCleanName());
// GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", GetCleanName());
CalcBonuses();
AI_AddNPCSpells(this->GetBotSpellID());
AI_AddNPCSpells(GetBotSpellID());
if(showtext) {
GetBotOwner()->Message(Chat::Yellow, "%s has been updated.", GetCleanName());
@ -9331,8 +9331,8 @@ void EntityList::ScanCloseClientMobs(std::unordered_map<uint16, Mob*>& close_mob
uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
uint8 needHealed = 0;
Group *g = nullptr;
if(this->HasGroup()) {
g = this->GetGroup();
if(HasGroup()) {
g = GetGroup();
if(g) {
for(int i = 0; i < MAX_GROUP_MEMBERS; i++) {
if(g->members[i] && !g->members[i]->qglobal) {

View File

@ -192,7 +192,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
else {
float hpRatioToCast = 0.0f;
switch(this->GetBotStance()) {
switch(GetBotStance()) {
case EQ::constants::stanceEfficient:
case EQ::constants::stanceAggressive:
hpRatioToCast = isPrimaryHealer?90.0f:50.0f;
@ -258,8 +258,8 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
}*/
if(botClass != BARD) {
if(IsGroupSpell(botSpell.SpellId)){
if(this->HasGroup()) {
Group *g = this->GetGroup();
if(HasGroup()) {
Group *g = GetGroup();
if(g) {
BotGroupSay(this, "Casting %s.", spells[botSpell.SpellId].name);
@ -331,7 +331,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
continue;
// can not cast buffs for your own pet only on another pet that isn't yours
if((spells[selectedBotSpell.SpellId].target_type == ST_Pet) && (tar != this->GetPet()))
if((spells[selectedBotSpell.SpellId].target_type == ST_Pet) && (tar != GetPet()))
continue;
// Validate target
@ -380,7 +380,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
{
float manaRatioToCast = 75.0f;
switch(this->GetBotStance()) {
switch(GetBotStance()) {
case EQ::constants::stanceEfficient:
manaRatioToCast = 90.0f;
break;
@ -399,7 +399,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
}
//If we're at specified mana % or below, don't rune as enchanter
if(this->GetManaRatio() <= manaRatioToCast)
if(GetManaRatio() <= manaRatioToCast)
break;
}
@ -459,7 +459,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
{
float manaRatioToCast = 75.0f;
switch(this->GetBotStance()) {
switch(GetBotStance()) {
case EQ::constants::stanceEfficient:
manaRatioToCast = 90.0f;
break;
@ -480,7 +480,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
}
//If we're at specified mana % or below, don't nuke as cleric or enchanter
if(this->GetManaRatio() <= manaRatioToCast)
if(GetManaRatio() <= manaRatioToCast)
break;
}
@ -644,7 +644,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
continue;
// can not cast buffs for your own pet only on another pet that isn't yours
if((spells[selectedBotSpell.SpellId].target_type == ST_Pet) && (tar != this->GetPet()))
if((spells[selectedBotSpell.SpellId].target_type == ST_Pet) && (tar != GetPet()))
continue;
// Validate target
@ -929,8 +929,8 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) {
if(IsGroupSpell(botSpell.SpellId)){
Group *g;
if(this->HasGroup()) {
Group *g = this->GetGroup();
if(HasGroup()) {
Group *g = GetGroup();
if(g) {
for( int i = 0; i<MAX_GROUP_MEMBERS; i++) {
@ -1162,7 +1162,7 @@ bool Bot::AI_IdleCastCheck() {
if (AIautocastspell_timer->Check(false)) {
#if BotAI_DEBUG_Spells >= 25
LogAI("Bot Non-Engaged autocast check triggered: [{}]", this->GetCleanName());
LogAI("Bot Non-Engaged autocast check triggered: [{}]", GetCleanName());
#endif
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.

View File

@ -390,16 +390,16 @@ Client::~Client() {
if(IsInAGuild())
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), 0, time(nullptr));
Mob* horse = entity_list.GetMob(this->CastToClient()->GetHorseId());
Mob* horse = entity_list.GetMob(CastToClient()->GetHorseId());
if (horse)
horse->Depop();
Mob* merc = entity_list.GetMob(this->GetMercID());
Mob* merc = entity_list.GetMob(GetMercID());
if (merc)
merc->Depop();
if(Trader)
database.DeleteTraderItem(this->CharacterID());
database.DeleteTraderItem(CharacterID());
if(Buyer)
ToggleBuyerMode(false);
@ -708,7 +708,7 @@ bool Client::Save(uint8 iCommitNow) {
p_timers.Store(&database);
database.SaveCharacterTribute(this->CharacterID(), &m_pp);
database.SaveCharacterTribute(CharacterID(), &m_pp);
SaveTaskState(); /* Save Character Task */
LogFood("Client::Save - hunger_level: [{}] thirst_level: [{}]", m_pp.hunger_level, m_pp.thirst_level);
@ -723,7 +723,7 @@ bool Client::Save(uint8 iCommitNow) {
}
}
database.SaveCharacterData(this->CharacterID(), this->AccountID(), &m_pp, &m_epp); /* Save Character Data */
database.SaveCharacterData(CharacterID(), AccountID(), &m_pp, &m_epp); /* Save Character Data */
return true;
}
@ -895,7 +895,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
sem->guilddbid = 0;
strcpy(sem->message, message);
sem->minstatus = this->Admin();
sem->minstatus = Admin();
sem->type = chan_num;
if(targetname != 0)
strcpy(sem->to, targetname);
@ -1234,7 +1234,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
}
void Client::ChannelMessageSend(const char* from, const char* to, uint8 chan_num, uint8 language, uint8 lang_skill, const char* message, ...) {
if ((chan_num==11 && !(this->GetGM())) || (chan_num==10 && this->Admin() < AccountStatus::QuestTroupe)) // dont need to send /pr & /petition to everybody
if ((chan_num==11 && !(GetGM())) || (chan_num==10 && Admin() < AccountStatus::QuestTroupe)) // dont need to send /pr & /petition to everybody
return;
va_list argptr;
char buffer[4096];
@ -1289,7 +1289,7 @@ void Client::ChannelMessageSend(const char* from, const char* to, uint8 chan_num
QueuePacket(&app);
bool senderCanTrainSelf = RuleB(Client, SelfLanguageLearning);
bool weAreNotSender = strcmp(this->GetCleanName(), cm->sender);
bool weAreNotSender = strcmp(GetCleanName(), cm->sender);
if (senderCanTrainSelf || weAreNotSender) {
if ((chan_num == ChatChannel_Group) && (ListenerSkill < 100)) { // group message in unmastered language, check for skill up
@ -1499,7 +1499,7 @@ void Client::SetSkill(EQ::skills::SkillType skillid, uint16 value) {
return;
m_pp.skills[skillid] = value; // We need to be able to #setskill 254 and 255 to reset skills
database.SaveCharacterSkill(this->CharacterID(), skillid, value);
database.SaveCharacterSkill(CharacterID(), skillid, value);
auto outapp = new EQApplicationPacket(OP_SkillUpdate, sizeof(SkillUpdate_Struct));
SkillUpdate_Struct* skill = (SkillUpdate_Struct*)outapp->pBuffer;
skill->skillId=skillid;
@ -1518,7 +1518,7 @@ void Client::IncreaseLanguageSkill(int skill_id, int value) {
if (m_pp.languages[skill_id] > 100) //Lang skill above max
m_pp.languages[skill_id] = 100;
database.SaveCharacterLanguage(this->CharacterID(), skill_id, m_pp.languages[skill_id]);
database.SaveCharacterLanguage(CharacterID(), skill_id, m_pp.languages[skill_id]);
auto outapp = new EQApplicationPacket(OP_SkillUpdate, sizeof(SkillUpdate_Struct));
SkillUpdate_Struct* skill = (SkillUpdate_Struct*)outapp->pBuffer;
@ -1574,22 +1574,22 @@ void Client::UpdateWho(uint8 remove)
auto pack = new ServerPacket(ServerOP_ClientList, sizeof(ServerClientList_Struct));
auto *s = (ServerClientList_Struct *) pack->pBuffer;
s->remove = remove;
s->wid = this->GetWID();
s->IP = this->GetIP();
s->charid = this->CharacterID();
strcpy(s->name, this->GetName());
s->wid = GetWID();
s->IP = GetIP();
s->charid = CharacterID();
strcpy(s->name, GetName());
s->gm = GetGM();
s->Admin = this->Admin();
s->AccountID = this->AccountID();
strcpy(s->AccountName, this->AccountName());
s->Admin = Admin();
s->AccountID = AccountID();
strcpy(s->AccountName, AccountName());
s->LSAccountID = this->LSAccountID();
s->LSAccountID = LSAccountID();
strn0cpy(s->lskey, lskey, sizeof(s->lskey));
s->zone = zone->GetZoneID();
s->instance_id = zone->GetInstanceID();
s->race = this->GetRace();
s->race = GetRace();
s->class_ = GetClass();
s->level = GetLevel();
@ -1625,9 +1625,9 @@ void Client::WhoAll(Who_All_Struct* whom) {
else {
auto pack = new ServerPacket(ServerOP_Who, sizeof(ServerWhoAll_Struct));
ServerWhoAll_Struct* whoall = (ServerWhoAll_Struct*) pack->pBuffer;
whoall->admin = this->Admin();
whoall->fromid=this->GetID();
strcpy(whoall->from, this->GetName());
whoall->admin = Admin();
whoall->fromid=GetID();
strcpy(whoall->from, GetName());
strn0cpy(whoall->whom, whom->whom, 64);
whoall->lvllow = whom->lvllow;
whoall->lvlhigh = whom->lvlhigh;
@ -1647,7 +1647,7 @@ void Client::FriendsWho(char *FriendsString) {
auto pack =
new ServerPacket(ServerOP_FriendsWho, sizeof(ServerFriendsWho_Struct) + strlen(FriendsString));
ServerFriendsWho_Struct* FriendsWho = (ServerFriendsWho_Struct*) pack->pBuffer;
FriendsWho->FromID = this->GetID();
FriendsWho->FromID = GetID();
strcpy(FriendsWho->FromName, GetName());
strcpy(FriendsWho->FriendsString, FriendsString);
worldserver.SendPacket(pack);
@ -1878,9 +1878,9 @@ void Client::CheckManaEndUpdate() {
safe_delete(outapp);
/* Let others know when our mana percent has changed */
if (this->GetManaPercent() != last_reported_mana_percent) {
Group *group = this->GetGroup();
Raid *raid = this->GetRaid();
if (GetManaPercent() != last_reported_mana_percent) {
Group *group = GetGroup();
Raid *raid = GetRaid();
if (raid) {
raid->SendManaPacketFrom(this);
@ -1899,13 +1899,13 @@ void Client::CheckManaEndUpdate() {
entity_list.QueueClientsByXTarget(this, mana_packet, false, EQ::versions::ClientVersionBitmask::maskSoDAndLater);
safe_delete(mana_packet);
last_reported_mana_percent = this->GetManaPercent();
last_reported_mana_percent = GetManaPercent();
}
/* Let others know when our endurance percent has changed */
if (this->GetEndurancePercent() != last_reported_endurance_percent) {
Group *group = this->GetGroup();
Raid *raid = this->GetRaid();
if (GetEndurancePercent() != last_reported_endurance_percent) {
Group *group = GetGroup();
Raid *raid = GetRaid();
if (raid) {
raid->SendEndurancePacketFrom(this);
@ -1924,7 +1924,7 @@ void Client::CheckManaEndUpdate() {
entity_list.QueueClientsByXTarget(this, endurance_packet, false, EQ::versions::ClientVersionBitmask::maskSoDAndLater);
safe_delete(endurance_packet);
last_reported_endurance_percent = this->GetEndurancePercent();
last_reported_endurance_percent = GetEndurancePercent();
}
last_reported_mana = current_mana;
@ -2350,7 +2350,7 @@ void Client::EVENT_ITEM_ScriptStopReturn(){
char buffer[50];
gettimeofday(&read_time, 0);
sprintf(buffer, "%li.%li \n", read_time.tv_sec, read_time.tv_usec);
this->SetEntityVariable("Stop_Return", buffer);
SetEntityVariable("Stop_Return", buffer);
}
void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, bool update_client){
@ -2763,12 +2763,12 @@ void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32
void Client::Disarm(Client* disarmer, int chance) {
int16 slot = EQ::invslot::SLOT_INVALID;
const EQ::ItemInstance *inst = this->GetInv().GetItem(EQ::invslot::slotPrimary);
const EQ::ItemInstance *inst = GetInv().GetItem(EQ::invslot::slotPrimary);
if (inst && inst->IsWeapon()) {
slot = EQ::invslot::slotPrimary;
}
else {
inst = this->GetInv().GetItem(EQ::invslot::slotSecondary);
inst = GetInv().GetItem(EQ::invslot::slotSecondary);
if (inst && inst->IsWeapon())
slot = EQ::invslot::slotSecondary;
}
@ -2792,14 +2792,14 @@ void Client::Disarm(Client* disarmer, int chance) {
mi->number_in_stack = 0;
FastQueuePacket(&outapp); // this deletes item from the weapon slot on the client
if (PutItemInInventory(slot_id, *InvItem, true))
database.SaveInventory(this->CharacterID(), NULL, slot);
database.SaveInventory(CharacterID(), NULL, slot);
auto matslot = (slot == EQ::invslot::slotPrimary ? EQ::textures::weaponPrimary : EQ::textures::weaponSecondary);
if (matslot != EQ::textures::materialInvalid)
SendWearChange(matslot);
}
MessageString(Chat::Skills, DISARMED);
if (disarmer != this)
disarmer->MessageString(Chat::Skills, DISARM_SUCCESS, this->GetCleanName());
disarmer->MessageString(Chat::Skills, DISARM_SUCCESS, GetCleanName());
if (chance != 1000)
disarmer->CheckIncreaseSkill(EQ::skills::SkillDisarm, nullptr, 4);
CalcBonuses();
@ -3362,7 +3362,7 @@ void Client::SetTint(int16 in_slot, uint32 color) {
EQ::textures::Tint_Struct new_color;
new_color.Color = color;
SetTint(in_slot, new_color);
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color);
database.SaveCharacterMaterialColor(CharacterID(), in_slot, color);
}
// Still need to reconcile bracer01 versus bracer02
@ -3372,7 +3372,7 @@ void Client::SetTint(int16 in_slot, EQ::textures::Tint_Struct& color) {
if (matslot != EQ::textures::materialInvalid)
{
m_pp.item_tint.Slot[matslot].Color = color.Color;
database.SaveCharacterMaterialColor(this->CharacterID(), in_slot, color.Color);
database.SaveCharacterMaterialColor(CharacterID(), in_slot, color.Color);
}
}
@ -3409,7 +3409,7 @@ void Client::SetLanguageSkill(int langid, int value)
value = 100; //Max lang value
m_pp.languages[langid] = value;
database.SaveCharacterLanguage(this->CharacterID(), langid, value);
database.SaveCharacterLanguage(CharacterID(), langid, value);
auto outapp = new EQApplicationPacket(OP_SkillUpdate, sizeof(SkillUpdate_Struct));
SkillUpdate_Struct* skill = (SkillUpdate_Struct*)outapp->pBuffer;
@ -4704,7 +4704,7 @@ void Client::ClearGroupAAs() {
m_pp.raid_leadership_exp = 0;
Save();
database.SaveCharacterLeadershipAA(this->CharacterID(), &m_pp);
database.SaveCharacterLeadershipAA(CharacterID(), &m_pp);
}
void Client::UpdateGroupAAs(int32 points, uint32 type) {
@ -5328,7 +5328,7 @@ void Client::SetStartZone(uint32 zoneid, float x, float y, float z, float headin
// setting city to zero allows the player to use /setstartcity to set the city themselves
if(zoneid == 0) {
m_pp.binds[4].zone_id = 0;
this->Message(Chat::Yellow,"Your starting city has been reset. Use /setstartcity to choose a new one");
Message(Chat::Yellow,"Your starting city has been reset. Use /setstartcity to choose a new one");
return;
}
@ -6434,7 +6434,7 @@ void Client::ConsentCorpses(std::string consent_name, bool deny)
void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_override, int pet_count, int pet_duration)
{
if(!target || !IsValidSpell(spell_id) || this->GetID() == target->GetID())
if(!target || !IsValidSpell(spell_id) || GetID() == target->GetID())
return;
PetRecord record;
@ -7144,8 +7144,8 @@ void Client::AddAlternateCurrencyValue(uint32 currency_id, int32 amount, int8 me
if (method == 1){
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)){
std::string event_desc = StringFormat("Added via Quest :: Cursor to Item :: alt_currency_id:%i amount:%i in zoneid:%i instid:%i", currency_id, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Added via Quest :: Cursor to Item :: alt_currency_id:%i amount:%i in zoneid:%i instid:%i", currency_id, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
}
}
@ -8088,7 +8088,7 @@ void Client::UpdatePersonalFaction(int32 char_id, int32 npc_value, int32 faction
bool repair = false;
bool change = false;
if (this->itembonuses.HeroicCHA)
if (itembonuses.HeroicCHA)
{
int faction_mod = itembonuses.HeroicCHA / 5;
// If our result isn't truncated, then just do that
@ -8787,16 +8787,16 @@ void Client::QuestReward(Mob* target, const QuestReward_Struct &reward, bool fac
}
void Client::SendHPUpdateMarquee(){
if (!this || !this->IsClient() || !this->current_hp || !this->max_hp)
if (!this || !IsClient() || !current_hp || !max_hp)
return;
/* Health Update Marquee Display: Custom*/
uint8 health_percentage = (uint8)(this->current_hp * 100 / this->max_hp);
uint8 health_percentage = (uint8)(current_hp * 100 / max_hp);
if (health_percentage >= 100)
return;
std::string health_update_notification = StringFormat("Health: %u%%", health_percentage);
this->SendMarqueeMessage(Chat::Yellow, 510, 0, 3000, 3000, health_update_notification);
SendMarqueeMessage(Chat::Yellow, 510, 0, 3000, 3000, health_update_notification);
}
uint32 Client::GetMoney(uint8 type, uint8 subtype) {
@ -9374,15 +9374,15 @@ bool Client::GotoPlayer(std::string player_name)
auto heading = static_cast<float>(atof(row[5]));
if (instance_id > 0 && !database.CheckInstanceExists(instance_id)) {
this->Message(Chat::Yellow, "Instance no longer exists...");
Message(Chat::Yellow, "Instance no longer exists...");
return false;
}
if (instance_id > 0) {
database.AddClientToInstance(instance_id, this->CharacterID());
database.AddClientToInstance(instance_id, CharacterID());
}
this->MovePC(zone_id, instance_id, x, y, z, heading);
MovePC(zone_id, instance_id, x, y, z, heading);
return true;
}
@ -10260,7 +10260,7 @@ void Client::SetAnon(uint8 anon_flag) {
m_pp.anon = anon_flag;
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
SpawnAppearance_Struct* spawn_appearance = (SpawnAppearance_Struct*)outapp->pBuffer;
spawn_appearance->spawn_id = this->GetID();
spawn_appearance->spawn_id = GetID();
spawn_appearance->type = AT_Anon;
spawn_appearance->parameter = anon_flag;
entity_list.QueueClients(this, outapp);
@ -10273,7 +10273,7 @@ void Client::SetAFK(uint8 afk_flag) {
AFK = afk_flag;
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
SpawnAppearance_Struct* spawn_appearance = (SpawnAppearance_Struct*)outapp->pBuffer;
spawn_appearance->spawn_id = this->GetID();
spawn_appearance->spawn_id = GetID();
spawn_appearance->type = AT_AFK;
spawn_appearance->parameter = afk_flag;
entity_list.QueueClients(this, outapp);
@ -10393,8 +10393,8 @@ void Client::RemoveItem(uint32 item_id, uint32 quantity)
}
void Client::SetGMStatus(int newStatus) {
if (this->Admin() != newStatus)
database.UpdateGMStatus(this->AccountID(), newStatus);
if (Admin() != newStatus)
database.UpdateGMStatus(AccountID(), newStatus);
}
void Client::ApplyWeaponsStance()

View File

@ -628,7 +628,7 @@ void Client::CompleteConnect()
}
else {
Group *group = nullptr;
group = this->GetGroup();
group = GetGroup();
if (group)
group->SendHPManaEndPacketsTo(this);
}
@ -776,8 +776,8 @@ void Client::CompleteConnect()
parse->EventPlayer(EVENT_CONNECT, this, "", 0);
/* QS: PlayerLogConnectDisconnect */
if (RuleB(QueryServ, PlayerLogConnectDisconnect)) {
std::string event_desc = StringFormat("Connect :: Logged into zoneid:%i instid:%i", this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Connect_State, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Connect :: Logged into zoneid:%i instid:%i", GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Connect_State, CharacterID(), event_desc);
}
/**
@ -828,7 +828,7 @@ void Client::CompleteConnect()
if (IsInAGuild()) {
SendGuildRanks();
guild_mgr.SendGuildMemberUpdateToWorld(GetName(), GuildID(), zone->GetZoneID(), time(nullptr));
guild_mgr.RequestOnlineGuildMembers(this->CharacterID(), this->GuildID());
guild_mgr.RequestOnlineGuildMembers(CharacterID(), GuildID());
}
SendDynamicZoneUpdates();
@ -1185,7 +1185,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
database.LoadCharacterFactionValues(cid, factionvalues);
/* Load Character Account Data: Temp until I move */
query = StringFormat("SELECT `status`, `name`, `ls_id`, `lsaccount_id`, `gmspeed`, `revoked`, `hideme`, `time_creation` FROM `account` WHERE `id` = %u", this->AccountID());
query = StringFormat("SELECT `status`, `name`, `ls_id`, `lsaccount_id`, `gmspeed`, `revoked`, `hideme`, `time_creation` FROM `account` WHERE `id` = %u", AccountID());
auto results = database.QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row) {
admin = atoi(row[0]);
@ -1215,7 +1215,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
}
if (RuleB(Character, SharedBankPlat))
m_pp.platinum_shared = database.GetSharedPlatinum(this->AccountID());
m_pp.platinum_shared = database.GetSharedPlatinum(AccountID());
database.ClearOldRecastTimestamps(cid); /* Clear out our old recast timestamps to keep the DB clean */
// set to full support in case they're a gm with items in disabled expansion slots...but, have their gm flag off...
@ -2535,8 +2535,8 @@ void Client::Handle_OP_AltCurrencyPurchase(const EQApplicationPacket *app)
/* QS: PlayerLogAlternateCurrencyTransactions :: Merchant Purchase */
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)) {
std::string event_desc = StringFormat("Merchant Purchase :: Spent alt_currency_id:%i cost:%i for itemid:%i in zoneid:%i instid:%i", alt_cur_id, cost, item->ID, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Merchant Purchase :: Spent alt_currency_id:%i cost:%i for itemid:%i in zoneid:%i instid:%i", alt_cur_id, cost, item->ID, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
}
AddAlternateCurrencyValue(alt_cur_id, -((int32)cost));
@ -2572,8 +2572,8 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
/* QS: PlayerLogAlternateCurrencyTransactions :: Item to Currency */
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)) {
std::string event_desc = StringFormat("Reclaim :: Item to Currency :: alt_currency_id:%i amount:%i to currency tab in zoneid:%i instid:%i", reclaim->currency_id, removed, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Reclaim :: Item to Currency :: alt_currency_id:%i amount:%i to currency tab in zoneid:%i instid:%i", reclaim->currency_id, removed, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
}
}
}
@ -2595,8 +2595,8 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
}
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)) {
std::string event_desc = StringFormat("Reclaim :: Cursor to Item :: alt_currency_id:%i amount:-%i in zoneid:%i instid:%i", reclaim->currency_id, reclaim->count, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Reclaim :: Cursor to Item :: alt_currency_id:%i amount:-%i in zoneid:%i instid:%i", reclaim->currency_id, reclaim->count, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
}
}
}
@ -2689,8 +2689,8 @@ void Client::Handle_OP_AltCurrencySell(const EQApplicationPacket *app)
/* QS: PlayerLogAlternateCurrencyTransactions :: Sold to Merchant*/
if (RuleB(QueryServ, PlayerLogAlternateCurrencyTransactions)) {
std::string event_desc = StringFormat("Sold to Merchant :: itemid:%u npcid:%u alt_currency_id:%u cost:%u in zoneid:%u instid:%i", item->ID, npc_id, alt_cur_id, cost, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Sold to Merchant :: itemid:%u npcid:%u alt_currency_id:%u cost:%u in zoneid:%u instid:%i", item->ID, npc_id, alt_cur_id, cost, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Alternate_Currency_Transactions, CharacterID(), event_desc);
}
FastQueuePacket(&outapp);
@ -3560,7 +3560,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app)
BazaarSearch_Struct* bss = (BazaarSearch_Struct*)app->pBuffer;
this->SendBazaarResults(bss->TraderID, bss->Class_, bss->Race, bss->ItemStat, bss->Slot, bss->Type,
SendBazaarResults(bss->TraderID, bss->Class_, bss->Race, bss->ItemStat, bss->Slot, bss->Type,
bss->Name, bss->MinPrice * 1000, bss->MaxPrice * 1000);
}
else if (app->size == sizeof(BazaarWelcome_Struct)) {
@ -3628,7 +3628,7 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app)
if (GetLevel() > GetTarget()->GetLevel())
ChanceToAttack = zone->random.Int(0, 15);
else
ChanceToAttack = zone->random.Int(((this->GetTarget()->GetLevel() - this->GetLevel()) * 10) - 5, ((this->GetTarget()->GetLevel() - this->GetLevel()) * 10));
ChanceToAttack = zone->random.Int(((GetTarget()->GetLevel() - GetLevel()) * 10) - 5, ((GetTarget()->GetLevel() - GetLevel()) * 10));
if (ChanceToAttack < 0)
ChanceToAttack = -ChanceToAttack;
@ -3675,7 +3675,7 @@ void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app)
BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer;
Mob* bindmob = entity_list.GetMob(bind_in->to);
if (!bindmob) {
LogError("Bindwound on non-exsistant mob from [{}]", this->GetName());
LogError("Bindwound on non-exsistant mob from [{}]", GetName());
}
else {
LogDebug("BindWound in: to:\'[{}]\' from=\'[{}]\'", bindmob->GetName(), GetName());
@ -3978,7 +3978,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
return;
}
if (IsAIControlled()) {
this->MessageString(Chat::Red, NOT_IN_CONTROL);
MessageString(Chat::Red, NOT_IN_CONTROL);
//Message(Chat::Red, "You cant cast right now, you arent in control of yourself!");
return;
}
@ -4609,8 +4609,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
/* Visual Debugging */
if (RuleB(Character, OPClientUpdateVisualDebug)) {
LogDebug("ClientUpdate: ppu x: [{}] y: [{}] z: [{}] h: [{}]", cx, cy, cz, new_heading);
this->SendAppearanceEffect(78, 0, 0, 0, 0);
this->SendAppearanceEffect(41, 0, 0, 0, 0);
SendAppearanceEffect(78, 0, 0, 0, 0);
SendAppearanceEffect(41, 0, 0, 0, 0);
}
/* Only feed real time updates when client is moving */
@ -4633,8 +4633,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
/* Always send position updates to group - send when beyond normal ClientPositionUpdate range */
Group *group = this->GetGroup();
Raid *raid = this->GetRaid();
Group *group = GetGroup();
Raid *raid = GetRaid();
if (raid) {
raid->QueueClients(this, outapp, true, true, (RuleI(Range, ClientPositionUpdates) * -1));
@ -4956,7 +4956,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app)
if (!boat->IsNPC() || !boat->IsControllableBoat())
{
auto hacked_string = fmt::format("OP_Control Boat was sent against {} which is of race {}", boat->GetName(), boat->GetRace());
database.SetMQDetectionFlag(this->AccountName(), this->GetName(), hacked_string, zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), hacked_string, zone->GetShortName());
return;
}
@ -4967,7 +4967,7 @@ void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app)
}
else {
this->MessageString(Chat::Red, IN_USE);
MessageString(Chat::Red, IN_USE);
return;
}
}
@ -5244,7 +5244,7 @@ void Client::Handle_OP_DeleteSpawn(const EQApplicationPacket *app)
entity_list.QueueClients(this, outapp, false);
safe_delete(outapp);
hate_list.RemoveEntFromHateList(this->CastToMob());
hate_list.RemoveEntFromHateList(CastToMob());
Disconnect();
return;
@ -5277,7 +5277,7 @@ void Client::Handle_OP_Disarm(const EQApplicationPacket *app) {
if (pmob->GetID() != GetID()) {
// Client sent a disarm request with an originator ID not matching their own ID.
auto hack_str = fmt::format("Player {} ({}) sent OP_Disarm with source ID of: {}", GetCleanName(), GetID(), pmob->GetID());
database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName());
database.SetMQDetectionFlag(account_name, name, hack_str, zone->GetShortName());
return;
}
// No disarm on corpses
@ -5303,7 +5303,7 @@ void Client::Handle_OP_Disarm(const EQApplicationPacket *app) {
// We can't disarm someone who is feigned.
if (tmob->IsClient() && tmob->CastToClient()->GetFeigned())
return;
if (GetTarget() == tmob && pmob == this->CastToMob() &&
if (GetTarget() == tmob && pmob == CastToMob() &&
disarm->skill == GetSkill(EQ::skills::SkillDisarm) && IsAttackAllowed(tmob)) {
int p_level = pmob->GetLevel() ? pmob->GetLevel() : 1;
int t_level = tmob->GetLevel() ? tmob->GetLevel() : 1;
@ -5352,7 +5352,7 @@ void Client::Handle_OP_DeleteSpell(const EQApplicationPacket *app)
if (m_pp.spell_book[dss->spell_slot] != SPELLBOOK_UNKNOWN) {
m_pp.spell_book[dss->spell_slot] = SPELLBOOK_UNKNOWN;
database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[dss->spell_slot], dss->spell_slot);
database.DeleteCharacterSpell(CharacterID(), m_pp.spell_book[dss->spell_slot], dss->spell_slot);
dss->success = 1;
}
else
@ -6091,9 +6091,9 @@ void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app)
void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app)
{
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/becomenpc");
database.SetHackerFlag(account_name, name, "/becomenpc");
return;
}
if (app->size != sizeof(BecomeNPC_Struct)) {
@ -6122,9 +6122,9 @@ void Client::Handle_OP_GMDelCorpse(const EQApplicationPacket *app)
{
if (app->size != sizeof(GMDelCorpse_Struct))
return;
if (this->Admin() < commandEditPlayerCorpses) {
if (Admin() < commandEditPlayerCorpses) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/delcorpse");
database.SetHackerFlag(account_name, name, "/delcorpse");
return;
}
GMDelCorpse_Struct* dc = (GMDelCorpse_Struct *)app->pBuffer;
@ -6143,9 +6143,9 @@ void Client::Handle_OP_GMDelCorpse(const EQApplicationPacket *app)
void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app)
{
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/emote");
database.SetHackerFlag(account_name, name, "/emote");
return;
}
if (app->size != sizeof(GMEmoteZone_Struct)) {
@ -6176,9 +6176,9 @@ void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app)
void Client::Handle_OP_GMFind(const EQApplicationPacket *app)
{
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/find");
database.SetHackerFlag(account_name, name, "/find");
return;
}
if (app->size != sizeof(GMSummon_Struct)) {
@ -6214,15 +6214,15 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app)
std::cout << "Wrong size on OP_GMGoto. Got: " << app->size << ", Expected: " << sizeof(GMSummon_Struct) << std::endl;
return;
}
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/goto");
database.SetHackerFlag(account_name, name, "/goto");
return;
}
GMSummon_Struct* gmg = (GMSummon_Struct*)app->pBuffer;
Mob* gt = entity_list.GetMob(gmg->charname);
if (gt != nullptr) {
this->MovePC(zone->GetZoneID(), zone->GetInstanceID(), gt->GetX(), gt->GetY(), gt->GetZ(), gt->GetHeading());
MovePC(zone->GetZoneID(), zone->GetInstanceID(), gt->GetX(), gt->GetY(), gt->GetZ(), gt->GetHeading());
}
else if (!worldserver.Connected())
Message(0, "Error: World server disconnected.");
@ -6230,7 +6230,7 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app)
auto pack = new ServerPacket(ServerOP_GMGoto, sizeof(ServerGMGoto_Struct));
memset(pack->pBuffer, 0, pack->size);
ServerGMGoto_Struct* wsgmg = (ServerGMGoto_Struct*)pack->pBuffer;
strcpy(wsgmg->myname, this->GetName());
strcpy(wsgmg->myname, GetName());
strcpy(wsgmg->gotoname, gmg->charname);
wsgmg->admin = admin;
worldserver.SendPacket(pack);
@ -6241,9 +6241,9 @@ void Client::Handle_OP_GMGoto(const EQApplicationPacket *app)
void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app)
{
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/hideme");
database.SetHackerFlag(account_name, name, "/hideme");
return;
}
if (app->size != sizeof(SpawnAppearance_Struct)) {
@ -6261,9 +6261,9 @@ void Client::Handle_OP_GMKick(const EQApplicationPacket *app)
{
if (app->size != sizeof(GMKick_Struct))
return;
if (this->Admin() < minStatusToKick) {
if (Admin() < minStatusToKick) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/kick");
database.SetHackerFlag(account_name, name, "/kick");
return;
}
GMKick_Struct* gmk = (GMKick_Struct *)app->pBuffer;
@ -6277,7 +6277,7 @@ void Client::Handle_OP_GMKick(const EQApplicationPacket *app)
ServerKickPlayer_Struct* skp = (ServerKickPlayer_Struct*)pack->pBuffer;
strcpy(skp->adminname, gmk->gmname);
strcpy(skp->name, gmk->name);
skp->adminrank = this->Admin();
skp->adminrank = Admin();
worldserver.SendPacket(pack);
safe_delete(pack);
}
@ -6291,9 +6291,9 @@ void Client::Handle_OP_GMKick(const EQApplicationPacket *app)
void Client::Handle_OP_GMKill(const EQApplicationPacket *app)
{
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/kill");
database.SetHackerFlag(account_name, name, "/kill");
return;
}
if (app->size != sizeof(GMKill_Struct)) {
@ -6319,7 +6319,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app)
ServerKillPlayer_Struct* skp = (ServerKillPlayer_Struct*)pack->pBuffer;
strcpy(skp->gmname, gmk->gmname);
strcpy(skp->target, gmk->name);
skp->admin = this->Admin();
skp->admin = Admin();
worldserver.SendPacket(pack);
safe_delete(pack);
}
@ -6343,7 +6343,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app)
Message(Chat::Red, "/LastName: %s not found", gmln->name);
}
else {
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(client->account_name, client->name, "/lastname");
return;
@ -6368,9 +6368,9 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
return;
}
const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer;
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/name");
database.SetHackerFlag(account_name, name, "/name");
return;
}
Client* client = entity_list.GetClientByName(gmn->oldname);
@ -6486,9 +6486,9 @@ void Client::Handle_OP_GMServers(const EQApplicationPacket *app)
if (!worldserver.Connected())
Message(0, "Error: World server disconnected");
else {
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(this->GetName()) + 2);
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(GetName()) + 2);
memset(pack->pBuffer, (uint8)admin, 1);
strcpy((char *)&pack->pBuffer[1], this->GetName());
strcpy((char *)&pack->pBuffer[1], GetName());
worldserver.SendPacket(pack);
safe_delete(pack);
}
@ -6511,20 +6511,20 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app)
std::cout << "Wrong size on OP_GMToggle. Got: " << app->size << ", Expected: " << sizeof(GMToggle_Struct) << std::endl;
return;
}
if (this->Admin() < minStatusToUseGMCommands) {
if (Admin() < minStatusToUseGMCommands) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/toggle");
database.SetHackerFlag(account_name, name, "/toggle");
return;
}
GMToggle_Struct *ts = (GMToggle_Struct *)app->pBuffer;
if (ts->toggle == 0) {
this->MessageString(Chat::White, TOGGLE_OFF);
MessageString(Chat::White, TOGGLE_OFF);
//Message(0, "Turning tells OFF");
tellsoff = true;
}
else if (ts->toggle == 1) {
//Message(0, "Turning tells ON");
this->MessageString(Chat::White, TOGGLE_ON);
MessageString(Chat::White, TOGGLE_ON);
tellsoff = false;
}
else {
@ -6562,9 +6562,9 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app)
std::cout << "Wrong size on OP_GMZoneRequest. Got: " << app->size << ", Expected: " << sizeof(GMZoneRequest_Struct) << std::endl;
return;
}
if (this->Admin() < minStatusToBeGM) {
if (Admin() < minStatusToBeGM) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/zone");
database.SetHackerFlag(account_name, name, "/zone");
return;
}
@ -6600,7 +6600,7 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app)
auto outapp = new EQApplicationPacket(OP_GMZoneRequest, sizeof(GMZoneRequest_Struct));
GMZoneRequest_Struct* gmzr2 = (GMZoneRequest_Struct*)outapp->pBuffer;
strcpy(gmzr2->charname, this->GetName());
strcpy(gmzr2->charname, GetName());
gmzr2->zone_id = gmzr->zone_id;
gmzr2->x = target_x;
gmzr2->y = target_y;
@ -6621,9 +6621,9 @@ void Client::Handle_OP_GMZoneRequest(const EQApplicationPacket *app)
void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app)
{
if (this->Admin() < minStatusToBeGM) {
if (Admin() < minStatusToBeGM) {
Message(Chat::Red, "Your account has been reported for hacking.");
database.SetHackerFlag(this->account_name, this->name, "/zone");
database.SetHackerFlag(account_name, name, "/zone");
return;
}
if (app->size < sizeof(uint32)) {
@ -7097,7 +7097,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app)
case groupActMakeLeader:
{
Mob* newleader = entity_list.GetClientByName(gu->membername[0]);
Group* group = this->GetGroup();
Group* group = GetGroup();
if (newleader && group) {
// the client only sends this if it's the group leader, but check anyway
@ -8312,7 +8312,7 @@ void Client::Handle_OP_Illusion(const EQApplicationPacket *app)
if (!GetGM())
{
database.SetMQDetectionFlag(this->AccountName(), this->GetName(), "OP_Illusion sent by non Game Master.", zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), "OP_Illusion sent by non Game Master.", zone->GetShortName());
return;
}
@ -8366,9 +8366,9 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
}
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)insr->text;
InspectMessage_Struct& playermessage = this->GetInspectMessage();
InspectMessage_Struct& playermessage = GetInspectMessage();
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
database.SaveCharacterInspectMessage(this->CharacterID(), &playermessage);
database.SaveCharacterInspectMessage(CharacterID(), &playermessage);
if (tmp != 0 && tmp->IsClient()) { tmp->CastToClient()->QueuePacket(outapp); } // Send answer to requester
@ -8384,9 +8384,9 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app)
}
InspectMessage_Struct* newmessage = (InspectMessage_Struct*)app->pBuffer;
InspectMessage_Struct& playermessage = this->GetInspectMessage();
InspectMessage_Struct& playermessage = GetInspectMessage();
memcpy(&playermessage, newmessage, sizeof(InspectMessage_Struct));
database.SaveCharacterInspectMessage(this->CharacterID(), &playermessage);
database.SaveCharacterInspectMessage(CharacterID(), &playermessage);
}
void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app)
@ -8776,7 +8776,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
if (IsAIControlled()) {
this->MessageString(Chat::Red, NOT_IN_CONTROL);
MessageString(Chat::Red, NOT_IN_CONTROL);
return;
}
@ -9187,14 +9187,14 @@ void Client::Handle_OP_LeaveAdventure(const EQApplicationPacket *app)
void Client::Handle_OP_LeaveBoat(const EQApplicationPacket *app)
{
Mob* boat = entity_list.GetMob(this->controlling_boat_id); // find the mob corresponding to the boat id
Mob* boat = entity_list.GetMob(controlling_boat_id); // find the mob corresponding to the boat id
if (boat) {
if ((boat->GetTarget() == this) && boat->GetHateAmount(this) == 0) { // if the client somehow left while still controlling the boat (and the boat isn't attacking them)
boat->SetTarget(nullptr); // fix it to stop later problems
}
}
this->controlling_boat_id = 0;
controlling_boat_id = 0;
return;
}
@ -9237,7 +9237,7 @@ void Client::Handle_OP_LFGCommand(const EQApplicationPacket *app)
// Issue outgoing packet to notify other clients
auto outapp = new EQApplicationPacket(OP_LFGAppearance, sizeof(LFG_Appearance_Struct));
LFG_Appearance_Struct* lfga = (LFG_Appearance_Struct*)outapp->pBuffer;
lfga->spawn_id = this->GetID();
lfga->spawn_id = GetID();
lfga->lfg = (uint8)LFG;
entity_list.QueueClients(this, outapp, true);
@ -10215,7 +10215,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
}
char val1[20] = { 0 };
PetCommand_Struct* pet = (PetCommand_Struct*)app->pBuffer;
Mob* mypet = this->GetPet();
Mob* mypet = GetPet();
Mob *target = entity_list.GetMob(pet->target);
if (!mypet || pet->command == PET_LEADER) {
@ -10851,7 +10851,7 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
return;
if (!worldserver.Connected())
Message(0, "Error: World server disconnected");
/*else if(petition_list.FindPetitionByAccountName(this->AccountName()))
/*else if(petition_list.FindPetitionByAccountName(AccountName()))
{
Message(0,"You already have a petition in queue, you cannot petition again until this one has been responded to or you have deleted the petition.");
return;
@ -10864,13 +10864,13 @@ void Client::Handle_OP_Petition(const EQApplicationPacket *app)
return;
}
auto pet = new Petition(CharacterID());
pet->SetAName(this->AccountName());
pet->SetClass(this->GetClass());
pet->SetLevel(this->GetLevel());
pet->SetCName(this->GetName());
pet->SetRace(this->GetRace());
pet->SetAName(AccountName());
pet->SetClass(GetClass());
pet->SetLevel(GetLevel());
pet->SetCName(GetName());
pet->SetRace(GetRace());
pet->SetLastGM("");
pet->SetCName(this->GetName());
pet->SetCName(GetName());
pet->SetPetitionText((char*)app->pBuffer);
pet->SetZone(zone->GetZoneID());
pet->SetUrgency(0);
@ -10911,7 +10911,7 @@ void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app)
Petition* pet = petition_list.GetPetitionByID(inpet->petnumber);
//if (inpet->urgency != pet->GetUrgency())
pet->SetUrgency(inpet->urgency);
pet->SetLastGM(this->GetName());
pet->SetLastGM(GetName());
pet->SetGMText(inpet->gmtext);
pet->SetCheckedOut(false);
@ -10935,7 +10935,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app)
if (getpet != 0) {
getpet->AddCheckout();
getpet->SetCheckedOut(true);
getpet->SendPetitionToPlayer(this->CastToClient());
getpet->SendPetitionToPlayer(CastToClient());
petition_list.UpdatePetition(getpet);
petition_list.UpdateGMQueue();
petition_list.UpdateZoneListQueue();
@ -10974,7 +10974,7 @@ void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app)
void Client::Handle_OP_PetitionQue(const EQApplicationPacket *app)
{
#ifdef _EQDEBUG
printf("%s looking at petitions..\n", this->GetName());
printf("%s looking at petitions..\n", GetName());
#endif
return;
}
@ -11054,7 +11054,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
if (!p_timers.Expired(&database, pTimerBeggingPickPocket, false))
{
Message(Chat::Red, "Ability recovery time not yet met.");
database.SetMQDetectionFlag(this->AccountName(), this->GetName(), "OP_PickPocket was sent again too quickly.", zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), "OP_PickPocket was sent again too quickly.", zone->GetShortName());
return;
}
PickPocket_Struct* pick_in = (PickPocket_Struct*)app->pBuffer;
@ -11081,7 +11081,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
}
else if (Distance(GetPosition(), victim->GetPosition()) > 20) {
Message(Chat::Red, "Attempt to pickpocket out of range detected.");
database.SetMQDetectionFlag(this->AccountName(), this->GetName(), "OP_PickPocket was sent from outside combat range.", zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), "OP_PickPocket was sent from outside combat range.", zone->GetShortName());
}
else if (victim->IsNPC()) {
safe_delete(outapp);
@ -11178,7 +11178,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app)
m_pp.potionbelt.Items[mptbs->SlotNumber].ID = BaseItem->ID;
m_pp.potionbelt.Items[mptbs->SlotNumber].Icon = BaseItem->Icon;
strn0cpy(m_pp.potionbelt.Items[mptbs->SlotNumber].Name, BaseItem->Name, sizeof(BaseItem->Name));
database.SaveCharacterPotionBelt(this->CharacterID(), mptbs->SlotNumber, m_pp.potionbelt.Items[mptbs->SlotNumber].ID, m_pp.potionbelt.Items[mptbs->SlotNumber].Icon);
database.SaveCharacterPotionBelt(CharacterID(), mptbs->SlotNumber, m_pp.potionbelt.Items[mptbs->SlotNumber].ID, m_pp.potionbelt.Items[mptbs->SlotNumber].Icon);
}
}
else {
@ -11225,7 +11225,7 @@ void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app)
m_pp.raid_leadership_points -= cost;
m_pp.leader_abilities.ranks[aaid]++;
database.SaveCharacterLeadershipAA(this->CharacterID(), &m_pp);
database.SaveCharacterLeadershipAA(CharacterID(), &m_pp);
}
else {
//it is a group ability.
@ -11238,7 +11238,7 @@ void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app)
m_pp.group_leadership_points -= cost;
m_pp.leader_abilities.ranks[aaid]++;
database.SaveCharacterLeadershipAA(this->CharacterID(), &m_pp);
database.SaveCharacterLeadershipAA(CharacterID(), &m_pp);
}
//success, send them an update
@ -13443,7 +13443,7 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app)
return;
}
if (tmp->IsEngaged()) {
this->MessageString(Chat::White, MERCHANT_BUSY);
MessageString(Chat::White, MERCHANT_BUSY);
action = 0;
}
if (GetFeigned() || IsInvisible())
@ -13565,7 +13565,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
if (ClientVersion() < EQ::versions::ClientVersion::SoF)
{
auto hack_str = fmt::format("Player sent OP_SpawnAppearance with AT_Invis: {}", sa->parameter);
database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName());
database.SetMQDetectionFlag(account_name, name, hack_str, zone->GetShortName());
}
}
return;
@ -13665,7 +13665,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
if (!HasSkill(EQ::skills::SkillSneak))
{
auto hack_str = fmt::format("Player sent OP_SpawnAppearance with AT_Sneak: {}", sa->parameter);
database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName());
database.SetMQDetectionFlag(account_name, name, hack_str, zone->GetShortName());
}
return;
}
@ -13675,7 +13675,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
else if (sa->type == AT_Size)
{
auto hack_str = fmt::format("Player sent OP_SpawnAppearance with AT_Size: {}", sa->parameter);
database.SetMQDetectionFlag(this->account_name, this->name, hack_str, zone->GetShortName());
database.SetMQDetectionFlag(account_name, name, hack_str, zone->GetShortName());
}
else if (sa->type == AT_Light) // client emitting light (lightstone, shiny shield)
{
@ -13842,11 +13842,11 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app)
m_pp.spell_book[swapspell->to_slot] = swapspelltemp;
/* Save Spell Swaps */
if (!database.SaveCharacterSpell(this->CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot)) {
database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot);
if (!database.SaveCharacterSpell(CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot)) {
database.DeleteCharacterSpell(CharacterID(), m_pp.spell_book[swapspell->from_slot], swapspell->from_slot);
}
if (!database.SaveCharacterSpell(this->CharacterID(), swapspelltemp, swapspell->to_slot)) {
database.DeleteCharacterSpell(this->CharacterID(), swapspelltemp, swapspell->to_slot);
if (!database.SaveCharacterSpell(CharacterID(), swapspelltemp, swapspell->to_slot)) {
database.DeleteCharacterSpell(CharacterID(), swapspelltemp, swapspell->to_slot);
}
QueuePacket(app);
@ -14206,7 +14206,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app)
if (CheckTradeLoreConflict(other) || other->CheckTradeLoreConflict(this)) {
MessageString(Chat::Red, TRADE_CANCEL_LORE);
other->MessageString(Chat::Red, TRADE_CANCEL_LORE);
this->FinishTrade(this);
FinishTrade(this);
other->FinishTrade(other);
other->trade->Reset();
trade->Reset();
@ -14214,7 +14214,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app)
else if (CheckTradeNonDroppable()) {
MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED);
other->MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED);
this->FinishTrade(this);
FinishTrade(this);
other->FinishTrade(other);
other->trade->Reset();
trade->Reset();
@ -14224,7 +14224,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app)
else if (other->CheckTradeNonDroppable()) {
MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED);
other->MessageString(Chat::Red, TRADE_HAS_BEEN_CANCELLED);
this->FinishTrade(this);
FinishTrade(this);
other->FinishTrade(other);
other->trade->Reset();
trade->Reset();
@ -14244,7 +14244,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app)
memset(&event_entry, 0, sizeof(QSPlayerLogTrade_Struct));
// Perform actual trade
this->FinishTrade(other, true, &event_entry, &event_details);
FinishTrade(other, true, &event_entry, &event_details);
other->FinishTrade(this, false, &event_entry, &event_details);
event_entry._detail_count = event_details.size();
@ -14275,7 +14275,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app)
// end QS code
}
else {
this->FinishTrade(other);
FinishTrade(other);
other->FinishTrade(this);
}
@ -14285,7 +14285,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app)
// All done
auto outapp = new EQApplicationPacket(OP_FinishTrade, 0);
other->QueuePacket(outapp);
this->FastQueuePacket(&outapp);
FastQueuePacket(&outapp);
}
}
// Trading with a Mob object that is not a Client.
@ -14462,7 +14462,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
for (uint32 i = 0; i < max_items; i++) {
if (database.GetItem(gis->Items[i])) {
database.SaveTraderItem(this->CharacterID(), gis->Items[i], gis->SerialNumber[i],
database.SaveTraderItem(CharacterID(), gis->Items[i], gis->SerialNumber[i],
gis->Charges[i], ints->ItemCost[i], i);
auto inst = FindTraderItemBySerialNumber(gis->SerialNumber[i]);
@ -14477,7 +14477,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
}
safe_delete(gis);
this->Trader_StartTrader();
Trader_StartTrader();
// This refreshes the Trader window to display the End Trader button
if (ClientVersion() >= EQ::versions::ClientVersion::RoF)
@ -14671,7 +14671,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app)
if (outtcs->Approval) {
this->BulkSendTraderInventory(Trader->CharacterID());
BulkSendTraderInventory(Trader->CharacterID());
Trader->Trader_CustomerBrowsing(this);
TraderID = tcs->TraderID;
LogTrading("Client::Handle_OP_TraderShop: Trader Inventory Sent");

View File

@ -542,7 +542,7 @@ bool Client::Process() {
if (client_state == DISCONNECTED) {
OnDisconnect(true);
std::cout << "Client disconnected (cs=d): " << GetName() << std::endl;
database.SetMQDetectionFlag(this->AccountName(), GetName(), "/MQInstantCamp: Possible instant camp disconnect.", zone->GetShortName());
database.SetMQDetectionFlag(AccountName(), GetName(), "/MQInstantCamp: Possible instant camp disconnect.", zone->GetShortName());
return false;
}
@ -696,8 +696,8 @@ void Client::OnDisconnect(bool hard_disconnect) {
/* QS: PlayerLogConnectDisconnect */
if (RuleB(QueryServ, PlayerLogConnectDisconnect)){
std::string event_desc = StringFormat("Disconnect :: in zoneid:%i instid:%i", this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Connect_State, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Disconnect :: in zoneid:%i instid:%i", GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Connect_State, CharacterID(), event_desc);
}
}
@ -953,9 +953,9 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
sprintf(handy_id, "%i", greet_id);
if (greet_id != MERCHANT_GREETING)
MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName(), handyitem->Name);
MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, GetName(), handyitem->Name);
else
MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, this->GetName());
MessageString(Chat::NPCQuestSay, GENERIC_STRINGID_SAY, merch->GetCleanName(), handy_id, GetName());
}
// safe_delete_array(cpi);
@ -1001,7 +1001,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
// corpse is in has shutdown since the rez spell was cast.
database.MarkCorpseAsRezzed(PendingRezzDBID);
LogSpells("Player [{}] got a [{}] Rezz, spellid [{}] in zone[{}], instance id [{}]",
this->name, (uint16)spells[SpellID].base_value[0],
name, (uint16)spells[SpellID].base_value[0],
SpellID, ZoneID, InstanceID);
BuffFadeNonPersistDeath();
@ -1451,12 +1451,12 @@ void Client::OPMoveCoin(const EQApplicationPacket* app)
}
else{
if (to_bucket == &m_pp.platinum_shared || from_bucket == &m_pp.platinum_shared){
this->SendPopupToClient(
SendPopupToClient(
"Shared Bank Warning",
"<c \"#F62217\">::: WARNING! :::<br>"
"SHARED BANK IS DISABLED AND YOUR PLATINUM WILL BE DESTROYED IF YOU PUT IT HERE!</c>"
);
this->Message(Chat::Red, "::: WARNING! ::: SHARED BANK IS DISABLED AND YOUR PLATINUM WILL BE DESTROYED IF YOU PUT IT HERE!");
Message(Chat::Red, "::: WARNING! ::: SHARED BANK IS DISABLED AND YOUR PLATINUM WILL BE DESTROYED IF YOU PUT IT HERE!");
}
}
}
@ -1759,10 +1759,10 @@ void Client::OPGMSummon(const EQApplicationPacket *app)
if(st)
{
Message(0, "Local: Summoning %s to %f, %f, %f", gms->charname, gms->x, gms->y, gms->z);
if (st->IsClient() && (st->CastToClient()->GetAnon() != 1 || this->Admin() >= st->CastToClient()->Admin()))
st->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), (float)gms->x, (float)gms->y, (float)gms->z, this->GetHeading(), true);
if (st->IsClient() && (st->CastToClient()->GetAnon() != 1 || Admin() >= st->CastToClient()->Admin()))
st->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), (float)gms->x, (float)gms->y, (float)gms->z, GetHeading(), true);
else
st->GMMove(this->GetX(), this->GetY(), this->GetZ(),this->GetHeading());
st->GMMove(GetX(), GetY(), GetZ(),GetHeading());
}
else
{
@ -1775,8 +1775,8 @@ void Client::OPGMSummon(const EQApplicationPacket *app)
{
auto pack = new ServerPacket(ServerOP_ZonePlayer, sizeof(ServerZonePlayer_Struct));
ServerZonePlayer_Struct* szp = (ServerZonePlayer_Struct*) pack->pBuffer;
strcpy(szp->adminname, this->GetName());
szp->adminrank = this->Admin();
strcpy(szp->adminname, GetName());
szp->adminrank = Admin();
strcpy(szp->name, gms->charname);
strcpy(szp->zone, zone->GetShortName());
szp->x_pos = (float)gms->x;

View File

@ -201,7 +201,7 @@ Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, uint32 in_npctypeid, const NP
for (int i = 0; i < MAX_LOOTERS; i++){
allowed_looters[i] = 0;
}
this->rez_experience = 0;
rez_experience = 0;
UpdateEquipmentLight();
UpdateActiveLight();
@ -529,10 +529,10 @@ false),
strcpy(corpse_name, in_charname);
strcpy(name, in_charname);
this->copper = in_copper;
this->silver = in_silver;
this->gold = in_gold;
this->platinum = in_plat;
copper = in_copper;
silver = in_silver;
gold = in_gold;
platinum = in_plat;
rez_experience = in_rezexp;
@ -584,25 +584,25 @@ bool Corpse::Save() {
if (!is_corpse_changed)
return true;
uint32 tmp = this->CountItems();
uint32 tmp = CountItems();
uint32 tmpsize = sizeof(PlayerCorpse_Struct) + (tmp * sizeof(player_lootitem::ServerLootItem_Struct));
PlayerCorpse_Struct* dbpc = (PlayerCorpse_Struct*) new uchar[tmpsize];
memset(dbpc, 0, tmpsize);
dbpc->itemcount = tmp;
dbpc->size = this->size;
dbpc->size = size;
dbpc->locked = is_locked;
dbpc->copper = this->copper;
dbpc->silver = this->silver;
dbpc->gold = this->gold;
dbpc->plat = this->platinum;
dbpc->race = this->race;
dbpc->copper = copper;
dbpc->silver = silver;
dbpc->gold = gold;
dbpc->plat = platinum;
dbpc->race = race;
dbpc->class_ = class_;
dbpc->gender = gender;
dbpc->deity = deity;
dbpc->level = level;
dbpc->texture = this->texture;
dbpc->helmtexture = this->helmtexture;
dbpc->texture = texture;
dbpc->helmtexture = helmtexture;
dbpc->exp = rez_experience;
memcpy(&dbpc->item_tint.Slot, &item_tint.Slot, sizeof(dbpc->item_tint));
@ -831,18 +831,18 @@ void Corpse::RemoveItemByID(uint32 item_id, int quantity) {
}
void Corpse::SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum) {
this->copper = in_copper;
this->silver = in_silver;
this->gold = in_gold;
this->platinum = in_platinum;
copper = in_copper;
silver = in_silver;
gold = in_gold;
platinum = in_platinum;
is_corpse_changed = true;
}
void Corpse::RemoveCash() {
this->copper = 0;
this->silver = 0;
this->gold = 0;
this->platinum = 0;
copper = 0;
silver = 0;
gold = 0;
platinum = 0;
is_corpse_changed = true;
}
@ -892,10 +892,10 @@ bool Corpse::Process() {
Save();
player_corpse_depop = true;
corpse_db_id = 0;
LogDebug("Tagged [{}] player corpse has buried", this->GetName());
LogDebug("Tagged [{}] player corpse has buried", GetName());
}
else {
LogError("Unable to bury [{}] player corpse", this->GetName());
LogError("Unable to bury [{}] player corpse", GetName());
return true;
}
}
@ -1366,7 +1366,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
if (item_data) {
/* Delete needs to be before RemoveItem because its deletes the pointer for
* item_data/bag_item_data */
database.DeleteItemOffCharacterCorpse(this->corpse_db_id, item_data->equip_slot,
database.DeleteItemOffCharacterCorpse(corpse_db_id, item_data->equip_slot,
item_data->item_id);
/* Delete Item Instance */
RemoveItem(item_data->lootslot);
@ -1378,7 +1378,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app)
if (bag_item_data[i]) {
/* Delete needs to be before RemoveItem because its deletes the pointer for
* item_data/bag_item_data */
database.DeleteItemOffCharacterCorpse(this->corpse_db_id,
database.DeleteItemOffCharacterCorpse(corpse_db_id,
bag_item_data[i]->equip_slot,
bag_item_data[i]->item_id);
/* Delete Item Instance */
@ -1438,8 +1438,8 @@ void Corpse::EndLoot(Client* client, const EQApplicationPacket* app) {
client->QueuePacket(outapp);
safe_delete(outapp);
this->being_looted_by = 0xFFFFFFFF;
if (this->IsEmpty())
being_looted_by = 0xFFFFFFFF;
if (IsEmpty())
Delete();
else
Save();
@ -1599,7 +1599,7 @@ uint16 Corpse::GetFirstSlotByItemID(uint32 item_id) {
bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) {
uint32 dist2 = 10000; // pow(100, 2);
if (!spell) {
if (this->GetCharID() == client->CharacterID()) {
if (GetCharID() == client->CharacterID()) {
if (IsLocked() && client->Admin() < AccountStatus::GMAdmin) {
client->Message(Chat::Red, "That corpse is locked by a GM.");
return false;
@ -1668,12 +1668,12 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) {
void Corpse::CompleteResurrection(){
rez_experience = 0;
is_corpse_changed = true;
this->Save();
Save();
}
void Corpse::Spawn() {
auto app = new EQApplicationPacket;
this->CreateSpawnPacket(app, this);
CreateSpawnPacket(app, this);
entity_list.QueueClients(this, app);
safe_delete(app);
}

View File

@ -85,25 +85,25 @@ Doors::Doors(const char *model, const glm::vec4 &position, uint8 open_type, uint
strn0cpy(door_name, model, 32);
strn0cpy(destination_zone_name, "NONE", 32);
this->database_id = (uint32) content_db.GetDoorsCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
this->door_id = (uint8) content_db.GetDoorsDBCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
database_id = (uint32) content_db.GetDoorsCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
door_id = (uint8) content_db.GetDoorsDBCountPlusOne(zone->GetShortName(), zone->GetInstanceVersion());
this->open_type = open_type;
this->size = size;
this->incline = 0;
this->guild_id = 0;
this->lockpick = 0;
this->key_item_id = 0;
this->no_key_ring = 0;
this->trigger_door = 0;
this->trigger_type = 0;
this->triggered = false;
this->door_param = 0;
this->invert_state = 0;
this->is_ldon_door = 0;
this->client_version_mask = 4294967295u;
this->disable_timer = 0;
this->destination_instance_id = 0;
open_type = open_type;
size = size;
incline = 0;
guild_id = 0;
lockpick = 0;
key_item_id = 0;
no_key_ring = 0;
trigger_door = 0;
trigger_type = 0;
triggered = false;
door_param = 0;
invert_state = 0;
is_ldon_door = 0;
client_version_mask = 4294967295u;
disable_timer = 0;
destination_instance_id = 0;
SetOpenState(false);
close_timer.Disable();
@ -137,30 +137,30 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
Log(Logs::Detail, Logs::Doors,
"%s clicked door %s (dbid %d, eqid %d) at %s",
sender->GetName(),
this->door_name,
this->database_id,
this->door_id,
door_name,
database_id,
door_id,
to_string(m_Position).c_str()
);
Log(Logs::Detail, Logs::Doors,
"incline %d, open_type %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d",
this->incline,
this->open_type,
this->lockpick,
this->key_item_id,
this->no_key_ring,
this->trigger_door,
this->trigger_type,
this->door_param
incline,
open_type,
lockpick,
key_item_id,
no_key_ring,
trigger_door,
trigger_type,
door_param
);
Log(Logs::Detail, Logs::Doors,
"disable_timer '%s',size %d, invert %d, dest: %s %s",
(this->disable_timer ? "true" : "false"),
this->size,
this->invert_state,
this->destination_zone_name,
(disable_timer ? "true" : "false"),
size,
invert_state,
destination_zone_name,
to_string(m_Destination).c_str()
);
@ -168,7 +168,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
auto *move_door_packet = (MoveDoor_Struct *) outapp->pBuffer;
move_door_packet->doorid = door_id;
if (this->IsLDoNDoor()) {
if (IsLDoNDoor()) {
if (sender) {
if (RuleI(Adventure, ItemIDToEnablePorts) != 0) {
if (!sender->KeyRingCheck(RuleI(Adventure, ItemIDToEnablePorts))) {
@ -197,7 +197,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
strcpy(adventure_door_click->player, sender->GetName());
adventure_door_click->zone_id = zone->GetZoneID();
adventure_door_click->id = this->GetDoorDBID();
adventure_door_click->id = GetDoorDBID();
worldserver.SendPacket(pack);
safe_delete(pack);
@ -234,13 +234,13 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
/**
* Object is not triggered
*/
if (this->GetTriggerType() == 255) {
if (GetTriggerType() == 255) {
/**
* Door is only triggered by an object
*/
if (trigger == 1) {
if (!this->IsDoorOpen() || (open_type == 58)) {
if (!IsDoorOpen() || (open_type == 58)) {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR);
} else {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR);
@ -256,12 +256,12 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
*
* Door is not locked
*/
bool is_guild_door = (this->GetGuildID() > 0) && (this->GetGuildID() == sender->GuildID());
bool is_door_not_locked = ((required_key_item == 0) && (this->GetLockpick() == 0) && (this->GetGuildID() == 0));
bool is_door_open_and_open_able = (this->IsDoorOpen() && (open_type == 58));
bool is_guild_door = (GetGuildID() > 0) && (GetGuildID() == sender->GuildID());
bool is_door_not_locked = ((required_key_item == 0) && (GetLockpick() == 0) && (GetGuildID() == 0));
bool is_door_open_and_open_able = (IsDoorOpen() && (open_type == 58));
if (is_door_not_locked || is_door_open_and_open_able || is_guild_door) {
if (!this->IsDoorOpen() || (this->GetOpenType() == 58)) {
if (!IsDoorOpen() || (GetOpenType() == 58)) {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR);
} else {
move_door_packet->action = static_cast<uint8>(invert_state == 0 ? CLOSE_DOOR : CLOSE_INVDOOR);
@ -271,7 +271,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
/**
* Guild Doors
*/
if ((this->GetGuildID() > 0) && !sender->GetGM()) {
if ((GetGuildID() > 0) && !sender->GetGM()) {
std::string guild_name;
char door_message[240];
@ -515,7 +515,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) {
} else {
sender->MovePC(
ZoneID(destination_zone_name),
static_cast<uint32>(this->destination_instance_id),
static_cast<uint32>(destination_instance_id),
m_Destination.x,
m_Destination.y,
m_Destination.z,

View File

@ -602,7 +602,7 @@ bool Client::TrainDiscipline(uint32 itemid) {
return(false);
} else if(m_pp.disciplines.values[r] == 0) {
m_pp.disciplines.values[r] = spell_id;
database.SaveCharacterDisc(this->CharacterID(), r, spell_id);
database.SaveCharacterDisc(CharacterID(), r, spell_id);
SendDisciplineUpdate();
Message(0, "You have learned a new discipline!");
return(true);
@ -702,7 +702,7 @@ void Client::TrainDiscBySpellID(int32 spell_id)
for(i = 0; i < MAX_PP_DISCIPLINES; i++) {
if(m_pp.disciplines.values[i] == 0) {
m_pp.disciplines.values[i] = spell_id;
database.SaveCharacterDisc(this->CharacterID(), i, spell_id);
database.SaveCharacterDisc(CharacterID(), i, spell_id);
SendDisciplineUpdate();
Message(Chat::Yellow, "You have learned a new combat ability!");
return;

View File

@ -328,7 +328,7 @@ void Client::CalculateStandardAAExp(uint32 &add_aaxp, uint8 conlevel, bool resex
}
if (RuleB(Character, EnableCharacterEXPMods)) {
add_aaxp *= GetAAEXPModifier(this->GetZoneID());
add_aaxp *= GetAAEXPModifier(GetZoneID());
}
add_aaxp = (uint32)(RuleR(Character, AAExpMultiplier) * add_aaxp * aatotalmod);
@ -491,7 +491,7 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp,
}
if (RuleB(Character, EnableCharacterEXPMods)) {
add_exp *= GetEXPModifier(this->GetZoneID());
add_exp *= GetEXPModifier(GetZoneID());
}
add_exp = GetEXP() + add_exp;
@ -499,7 +499,7 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp,
void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
this->EVENT_ITEM_ScriptStopReturn();
EVENT_ITEM_ScriptStopReturn();
uint32 exp = 0;
uint32 aaexp = 0;
@ -552,7 +552,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
}
void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
LogDebug("Attempting to Set Exp for [{}] (XP: [{}], AAXP: [{}], Rez: [{}])", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
LogDebug("Attempting to Set Exp for [{}] (XP: [{}], AAXP: [{}], Rez: [{}])", GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false");
auto max_AAXP = GetRequiredAAExperience();
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) {
@ -671,7 +671,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
//figure out how many AA points we get from the exp were setting
m_pp.aapoints = set_aaxp / max_AAXP;
LogDebug("Calculating additional AA Points from AAXP for [{}]: [{}] / [{}] = [{}] points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP);
LogDebug("Calculating additional AA Points from AAXP for [{}]: [{}] / [{}] = [{}] points", GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP);
//get remainder exp points, set in PP below
set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints);
@ -699,7 +699,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) {
/* QS: PlayerLogAARate */
if (RuleB(QueryServ, PlayerLogAARate)){
int add_points = (m_pp.aapoints - last_unspentAA);
std::string query = StringFormat("INSERT INTO `qs_player_aa_rate_hourly` (char_id, aa_count, hour_time) VALUES (%i, %i, UNIX_TIMESTAMP() - MOD(UNIX_TIMESTAMP(), 3600)) ON DUPLICATE KEY UPDATE `aa_count` = `aa_count` + %i", this->CharacterID(), add_points, add_points);
std::string query = StringFormat("INSERT INTO `qs_player_aa_rate_hourly` (char_id, aa_count, hour_time) VALUES (%i, %i, UNIX_TIMESTAMP() - MOD(UNIX_TIMESTAMP(), 3600)) ON DUPLICATE KEY UPDATE `aa_count` = `aa_count` + %i", CharacterID(), add_points, add_points);
QServ->SendQuery(query.c_str());
}
@ -819,7 +819,7 @@ void Client::SetLevel(uint8 set_level, bool command)
level = set_level;
if(IsRaidGrouped()) {
Raid *r = this->GetRaid();
Raid *r = GetRaid();
if(r){
r->UpdateLevel(GetName(), set_level);
}
@ -836,15 +836,15 @@ void Client::SetLevel(uint8 set_level, bool command)
parse->EventPlayer(EVENT_LEVEL_UP, this, "", 0);
/* QS: PlayerLogLevels */
if (RuleB(QueryServ, PlayerLogLevels)){
std::string event_desc = StringFormat("Leveled UP :: to Level:%i from Level:%i in zoneid:%i instid:%i", set_level, m_pp.level, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Levels, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Leveled UP :: to Level:%i from Level:%i in zoneid:%i instid:%i", set_level, m_pp.level, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Levels, CharacterID(), event_desc);
}
}
else if (set_level < m_pp.level){
/* QS: PlayerLogLevels */
if (RuleB(QueryServ, PlayerLogLevels)){
std::string event_desc = StringFormat("Leveled DOWN :: to Level:%i from Level:%i in zoneid:%i instid:%i", set_level, m_pp.level, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Levels, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Leveled DOWN :: to Level:%i from Level:%i in zoneid:%i instid:%i", set_level, m_pp.level, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Levels, CharacterID(), event_desc);
}
}
@ -860,7 +860,7 @@ void Client::SetLevel(uint8 set_level, bool command)
}
QueuePacket(outapp);
safe_delete(outapp);
this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change
SendAppearancePacket(AT_WhoLevel, set_level); // who level change
LogInfo("Setting Level for [{}] to [{}]", GetName(), set_level);
@ -1150,13 +1150,13 @@ void Client::SendLeadershipEXPUpdate() {
uint32 Client::GetCharMaxLevelFromQGlobal() {
QGlobalCache *char_c = nullptr;
char_c = this->GetQGlobals();
char_c = GetQGlobals();
std::list<QGlobal> globalMap;
uint32 ntype = 0;
if(char_c) {
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, this->CharacterID(), zone->GetZoneID());
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, CharacterID(), zone->GetZoneID());
}
auto iter = globalMap.begin();
@ -1174,7 +1174,7 @@ uint32 Client::GetCharMaxLevelFromQGlobal() {
uint32 Client::GetCharMaxLevelFromBucket()
{
uint32 char_id = this->CharacterID();
uint32 char_id = CharacterID();
std::string query = StringFormat("SELECT value FROM data_buckets WHERE `key` = '%i-CharMaxLevel'", char_id);
auto results = database.QueryDatabase(query);
if (!results.Success()) {

View File

@ -22,6 +22,6 @@ void Client::Undye()
SendWearChange(cur_slot);
}
database.DeleteCharacterDye(this->CharacterID());
database.DeleteCharacterDye(CharacterID());
}

View File

@ -295,7 +295,7 @@ bool Group::AddMember(Mob* newmember, const char *NewMemberName, uint32 Characte
members[i]->CastToClient()->QueuePacket(outapp);
//put new member into existing group members' list(s)
strcpy(members[i]->CastToClient()->GetPP().groupMembers[this->GroupCount()-1], NewMemberName);
strcpy(members[i]->CastToClient()->GetPP().groupMembers[GroupCount()-1], NewMemberName);
}
//put existing group member(s) into the new member's list

View File

@ -124,11 +124,11 @@ void Client::SendGuildRanks()
auto outapp = new EQApplicationPacket(OP_GuildUpdateURLAndChannel,
sizeof(GuildUpdateRanks_Struct));
GuildUpdateRanks_Struct *guuacs = (GuildUpdateRanks_Struct*) outapp->pBuffer;
//guuacs->Unknown0008 = this->GuildID();
strncpy(guuacs->Unknown0012, this->GetCleanName(), 64);
//guuacs->Unknown0008 = GuildID();
strncpy(guuacs->Unknown0012, GetCleanName(), 64);
guuacs->Action = 5;
guuacs->RankID = j;
guuacs->GuildID = this->GuildID();
guuacs->GuildID = GuildID();
guuacs->PermissionID = i;
guuacs->PermissionVal = 1;
guuacs->Unknown0089[0] = 0x2c;

View File

@ -1481,8 +1481,8 @@ GuildApproval::GuildApproval(const char* guildname, Client* owner,uint32 id)
uint8 tmp = atoi(founders.c_str());
deletion_timer = new Timer(1800000);
strcpy(guild,guildname);
this->owner = owner;
this->refid = id;
owner = owner;
refid = id;
if(owner)
owner->Message(Chat::White,"You can now start getting your guild approved, tell your %i members to #guildapprove %i, you have 30 minutes to create your guild.",tmp,GetID());
for(int i=0;i<tmp;i++)

View File

@ -178,7 +178,7 @@ bool Client::CheckLoreConflict(const EQ::ItemData* item)
}
bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) {
this->EVENT_ITEM_ScriptStopReturn();
EVENT_ITEM_ScriptStopReturn();
// TODO: update calling methods and script apis to handle a failure return
@ -246,10 +246,10 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check to make sure we are a GM if the item is GM-only
/*
else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
else if(item->MinStatus && ((Admin() < item->MinStatus) || (Admin() < RuleI(GM, MinStatusToSummonItem)))) {
Message(Chat::Red, "You are not a GM or do not have the status to summon this item.");
LogInventory("Player [{}] on account [{}] attempted to create a GM-only item with a status of [{}].\n"Item [{}], Aug1: [{}], Aug2: [{}], Aug3: [{}], Aug4: [{}], Aug5: [{}], Aug6: [{}], MinStatus: [{}])\n",
GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
GetName(), account_name, Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
return false;
}
@ -341,10 +341,10 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check to make sure we are a GM if the augment is GM-only
/*
else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
else if(augtest->MinStatus && ((Admin() < augtest->MinStatus) || (Admin() < RuleI(GM, MinStatusToSummonItem)))) {
Message(Chat::Red, "You are not a GM or do not have the status to summon this augment.");
LogInventory("Player [{}] on account [{}] attempted to create a GM-only augment (Aug[{}]) with a status of [{}].\n(Item: [{}], Aug1: [{}], Aug2: [{}], Aug3: [{}], Aug4: [{}], Aug5: [{}], MinStatus: [{}])\n",
GetName(), account_name, augment_slot, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
GetName(), account_name, augment_slot, Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
return false;
}
@ -840,7 +840,7 @@ void Client::DropItem(int16 slot_id, bool recurse)
}
invalid_drop = nullptr;
database.SetHackerFlag(this->AccountName(), this->GetCleanName(), "Tried to drop an item on the ground that was nodrop!");
database.SetHackerFlag(AccountName(), GetCleanName(), "Tried to drop an item on the ground that was nodrop!");
GetInv().DeleteItem(slot_id);
return;
}
@ -914,12 +914,12 @@ void Client::DropItemQS(EQ::ItemInstance* inst, bool pickup) {
std::list<void*> event_details;
memset(&qs_audit, 0, sizeof(QSPlayerDropItem_Struct));
qs_audit.char_id = this->character_id;
qs_audit.char_id = character_id;
qs_audit.pickup = pickup;
qs_audit.zone_id = this->GetZoneID();
qs_audit.x = (int) this->GetX();
qs_audit.y = (int) this->GetY();
qs_audit.z = (int) this->GetZ();
qs_audit.zone_id = GetZoneID();
qs_audit.x = (int) GetX();
qs_audit.y = (int) GetY();
qs_audit.z = (int) GetZ();
if (inst) {
auto detail = new QSDropItems_Struct;
@ -1248,10 +1248,10 @@ bool Client::PutItemInInventory(int16 slot_id, const EQ::ItemInstance& inst, boo
if (slot_id == EQ::invslot::slotCursor) {
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
return database.SaveCursor(this->CharacterID(), s, e);
return database.SaveCursor(CharacterID(), s, e);
}
else {
return database.SaveInventory(this->CharacterID(), &inst, slot_id);
return database.SaveInventory(CharacterID(), &inst, slot_id);
}
CalcBonuses();
@ -1267,11 +1267,11 @@ void Client::PutLootInInventory(int16 slot_id, const EQ::ItemInstance &inst, Ser
if (slot_id == EQ::invslot::slotCursor) {
m_inv.PushCursor(inst);
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
database.SaveCursor(CharacterID(), s, e);
}
else {
m_inv.PutItem(slot_id, inst);
database.SaveInventory(this->CharacterID(), &inst, slot_id);
database.SaveInventory(CharacterID(), &inst, slot_id);
}
// Subordinate items in cursor buffer must be sent via ItemPacketSummonItem or we just overwrite the visible cursor and desync the client
@ -1463,10 +1463,10 @@ void Client::MoveItemCharges(EQ::ItemInstance &from, int16 to_slot, uint8 type)
SendLootItemInPacket(tmp_inst, to_slot);
if (to_slot == EQ::invslot::slotCursor) {
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
database.SaveCursor(CharacterID(), s, e);
}
else {
database.SaveInventory(this->CharacterID(), tmp_inst, to_slot);
database.SaveInventory(CharacterID(), tmp_inst, to_slot);
}
}
}
@ -1705,12 +1705,12 @@ packet with the item number in it, but I cant seem to find it right now
safe_delete(outapp);
if (send_to_all==false)
return;
const char* charname = this->GetName();
const char* charname = GetName();
outapp = new EQApplicationPacket(OP_ItemLinkText,strlen(itemlink)+14+strlen(charname));
char buffer3[150] = {0};
sprintf(buffer3,"%c%c%c%c%c%c%c%c%c%c%c%c%6s%c%s",0x00,0x00,0x00,0x00,0xD2,0x01,0x00,0x00,0x00,0x00,0x00,0x00,charname,0x00,itemlink);
memcpy(outapp->pBuffer,buffer3,outapp->size);
entity_list.QueueCloseClients(this->CastToMob(),outapp,true,200,0,false);
entity_list.QueueCloseClients(CastToMob(),outapp,true,200,0,false);
safe_delete(outapp);
}
@ -1905,8 +1905,8 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
(dstbagid && dstbag->GetItem()->BagType == EQ::item::BagTypeTradersSatchel) ||
(srcitemid && src_inst->GetItem()->BagType == EQ::item::BagTypeTradersSatchel) ||
(dstitemid && dst_inst->GetItem()->BagType == EQ::item::BagTypeTradersSatchel)) {
this->Trader_EndTrader();
this->Message(Chat::Red,"You cannot move your Trader Satchels, or items inside them, while Trading.");
Trader_EndTrader();
Message(Chat::Red,"You cannot move your Trader Satchels, or items inside them, while Trading.");
}
}
@ -2495,11 +2495,11 @@ void Client::DyeArmor(EQ::TintProfile* dye){
if (slot != INVALID_INDEX){
DeleteItemInInventory(slot,1,true);
uint8 slot2=SlotConvert(i);
EQ::ItemInstance* inst = this->m_inv.GetItem(slot2);
EQ::ItemInstance* inst = m_inv.GetItem(slot2);
if(inst){
uint32 armor_color = ((uint32)dye->Slot[i].Red << 16) | ((uint32)dye->Slot[i].Green << 8) | ((uint32)dye->Slot[i].Blue);
inst->SetColor(armor_color);
database.SaveCharacterMaterialColor(this->CharacterID(), i, armor_color);
database.SaveCharacterMaterialColor(CharacterID(), i, armor_color);
database.SaveInventory(CharacterID(),inst,slot2);
if(dye->Slot[i].UseTint)
m_pp.item_tint.Slot[i].UseTint = 0xFF;
@ -2525,11 +2525,11 @@ void Client::DyeArmor(EQ::TintProfile* dye){
void Client::DyeArmorBySlot(uint8 slot, uint8 red, uint8 green, uint8 blue, uint8 use_tint) {
uint8 item_slot = SlotConvert(slot);
EQ::ItemInstance* item_instance = this->m_inv.GetItem(item_slot);
EQ::ItemInstance* item_instance = m_inv.GetItem(item_slot);
if (item_instance) {
uint32 armor_color = ((uint32)red << 16) | ((uint32)green << 8) | ((uint32)blue);
item_instance->SetColor(armor_color);
database.SaveCharacterMaterialColor(this->CharacterID(), slot, armor_color);
database.SaveCharacterMaterialColor(CharacterID(), slot, armor_color);
database.SaveInventory(CharacterID(), item_instance, item_slot);
m_pp.item_tint.Slot[slot].UseTint = (use_tint ? 0xFF : 0x00);
}
@ -2836,7 +2836,7 @@ void Client::DisenchantSummonedBags(bool client_update)
local.clear();
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
database.SaveCursor(CharacterID(), s, e);
}
else {
safe_delete(new_inst); // deletes disenchanted bag if not used
@ -2944,7 +2944,7 @@ void Client::RemoveNoRent(bool client_update)
local.clear();
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
database.SaveCursor(CharacterID(), s, e);
}
}
@ -3075,7 +3075,7 @@ void Client::RemoveDuplicateLore(bool client_update)
local_2.clear();
auto s = m_inv.cursor_cbegin(), e = m_inv.cursor_cend();
database.SaveCursor(this->CharacterID(), s, e);
database.SaveCursor(CharacterID(), s, e);
}
}
@ -3274,7 +3274,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app)
const EQ::ItemData *BaseItem = nullptr;
int16 WeaponSlot = 0;
database.DeleteCharacterBandolier(this->CharacterID(), bs->Number);
database.DeleteCharacterBandolier(CharacterID(), bs->Number);
for(int BandolierSlot = bandolierPrimary; BandolierSlot <= bandolierAmmo; BandolierSlot++) {
WeaponSlot = BandolierSlotToWeaponSlot(BandolierSlot);
@ -3284,7 +3284,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app)
LogInventory("Char: [{}] adding item [{}] to slot [{}]", GetName(),BaseItem->Name, WeaponSlot);
m_pp.bandoliers[bs->Number].Items[BandolierSlot].ID = BaseItem->ID;
m_pp.bandoliers[bs->Number].Items[BandolierSlot].Icon = BaseItem->Icon;
database.SaveCharacterBandolier(this->CharacterID(), bs->Number, BandolierSlot, m_pp.bandoliers[bs->Number].Items[BandolierSlot].ID, m_pp.bandoliers[bs->Number].Items[BandolierSlot].Icon, bs->Name);
database.SaveCharacterBandolier(CharacterID(), bs->Number, BandolierSlot, m_pp.bandoliers[bs->Number].Items[BandolierSlot].ID, m_pp.bandoliers[bs->Number].Items[BandolierSlot].Icon, bs->Name);
}
else {
LogInventory("Char: [{}] no item in slot [{}]", GetName(), WeaponSlot);
@ -3303,7 +3303,7 @@ void Client::RemoveBandolier(const EQApplicationPacket *app)
m_pp.bandoliers[bds->Number].Items[i].ID = 0;
m_pp.bandoliers[bds->Number].Items[i].Icon = 0;
}
database.DeleteCharacterBandolier(this->CharacterID(), bds->Number);
database.DeleteCharacterBandolier(CharacterID(), bds->Number);
}
void Client::SetBandolier(const EQApplicationPacket *app)

View File

@ -91,7 +91,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
Merc::~Merc() {
AI_Stop();
//entity_list.RemoveMerc(this->GetID());
//entity_list.RemoveMerc(GetID());
UninitializeBuffSlots();
}
@ -132,7 +132,7 @@ float Merc::GetDefaultSize() {
float MercSize = GetSize();
switch(this->GetRace())
switch(GetRace())
{
case 1: // Humans
MercSize = 6.0;
@ -946,7 +946,7 @@ int32 Merc::CalcManaRegen()
{
BuffFadeBySitModifier();
if (HasSkill(EQ::skills::SkillMeditate)) {
this->_medding = true;
_medding = true;
regen = ((GetSkill(EQ::skills::SkillMeditate) / 10) + mana_regen);
regen += spellbonuses.ManaRegen + itembonuses.ManaRegen;
}
@ -954,7 +954,7 @@ int32 Merc::CalcManaRegen()
regen = mana_regen + spellbonuses.ManaRegen + itembonuses.ManaRegen;
}
else {
this->_medding = false;
_medding = false;
regen = mana_regen + spellbonuses.ManaRegen + itembonuses.ManaRegen;
}
@ -1636,13 +1636,13 @@ void Merc::AI_Process() {
// TODO: Do mercs berserk? Find this out on live...
//if (GetClass() == WARRIOR || GetClass() == BERSERKER) {
// if(GetHP() > 0 && !berserk && this->GetHPRatio() < 30) {
// if(GetHP() > 0 && !berserk && GetHPRatio() < 30) {
// entity_list.MessageCloseString(this, false, 200, 0, BERSERK_START, GetName());
// this->berserk = true;
// berserk = true;
// }
// if (berserk && this->GetHPRatio() > 30) {
// if (berserk && GetHPRatio() > 30) {
// entity_list.MessageCloseString(this, false, 200, 0, BERSERK_END, GetName());
// this->berserk = false;
// berserk = false;
// }
//}
@ -1862,7 +1862,7 @@ bool Merc::AI_IdleCastCheck() {
if (AIautocastspell_timer->Check(false)) {
#if MercAI_DEBUG_Spells >= 25
LogAI("Merc Non-Engaged autocast check triggered: [{}]", this->GetCleanName());
LogAI("Merc Non-Engaged autocast check triggered: [{}]", GetCleanName());
#endif
AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting.
@ -2184,14 +2184,14 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
}
if(spells[selectedMercSpell.spellid].target_type == ST_Self) {
if( !this->IsImmuneToSpell(selectedMercSpell.spellid, this)
&& (this->CanBuffStack(selectedMercSpell.spellid, mercLevel, true) >= 0)) {
if( !IsImmuneToSpell(selectedMercSpell.spellid, this)
&& (CanBuffStack(selectedMercSpell.spellid, mercLevel, true) >= 0)) {
if( this->GetArchetype() == ARCHETYPE_MELEE && IsEffectInSpell(selectedMercSpell.spellid, SE_IncreaseSpellHaste)) {
if( GetArchetype() == ARCHETYPE_MELEE && IsEffectInSpell(selectedMercSpell.spellid, SE_IncreaseSpellHaste)) {
continue;
}
uint32 TempDontBuffMeBeforeTime = this->DontBuffMeBefore();
uint32 TempDontBuffMeBeforeTime = DontBuffMeBefore();
if(selectedMercSpell.spellid > 0) {
if(isDiscipline) {
@ -2200,8 +2200,8 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
else {
castedSpell = AIDoSpellCast(selectedMercSpell.spellid, this, -1, &TempDontBuffMeBeforeTime);
if(TempDontBuffMeBeforeTime != this->DontBuffMeBefore())
this->SetDontBuffMeBefore(TempDontBuffMeBeforeTime);
if(TempDontBuffMeBeforeTime != DontBuffMeBefore())
SetDontBuffMeBefore(TempDontBuffMeBeforeTime);
}
}
}
@ -2388,8 +2388,8 @@ bool Merc::AICastSpell(int8 iChance, uint32 iSpellTypes) {
if(castedSpell) {
if(IsGroupSpell(selectedMercSpell.spellid)){
if(this->HasGroup()) {
Group *g = this->GetGroup();
if(HasGroup()) {
Group *g = GetGroup();
if(g) {
for( int i = 0; i<MAX_GROUP_MEMBERS; i++) {
@ -2682,8 +2682,8 @@ int32 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic)
for (int i = 0; i < MAX_PP_AA_ARRAY; i++)
{
aa_AA = this->aa[i]->AA;
aa_value = this->aa[i]->value;
aa_AA = aa[i]->AA;
aa_value = aa[i]->value;
if (aa_AA < 1 || aa_value < 1)
continue;
@ -2711,9 +2711,9 @@ int32 Merc::GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic)
int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
{
// Formula = Unknown exact, based off a random percent chance up to mana cost(after focuses) of the cast spell
if(this->itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
if(itembonuses.Clairvoyance && spells[spell_id].classes[(GetClass()%17) - 1] >= GetLevel() - 5)
{
int16 mana_back = this->itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
int16 mana_back = itembonuses.Clairvoyance * zone->random.Int(1, 100) / 100;
// Doesnt generate mana, so best case is a free spell
if(mana_back > cost)
mana_back = cost;
@ -4240,7 +4240,7 @@ bool Merc::CheckConfidence() {
if(DistanceSquared(m_Position, mob->GetPosition()) > AggroRange) continue;
CurrentCon = this->GetLevelCon(mob->GetLevel());
CurrentCon = GetLevelCon(mob->GetLevel());
switch(CurrentCon) {
@ -4513,7 +4513,7 @@ void Merc::SetTarget(Mob* mob) {
Mob* Merc::GetOwnerOrSelf() {
Mob* Result = nullptr;
if(this->GetMercOwner())
if(GetMercOwner())
Result = GetMercOwner();
else
Result = this;
@ -4565,7 +4565,7 @@ Mob* Merc::GetOwner() {
Result = entity_list.GetMob(GetOwnerID());
if(!Result) {
this->SetOwnerID(0);
SetOwnerID(0);
}
return Result->CastToMob();
@ -5052,7 +5052,7 @@ void Merc::UpdateMercAppearance() {
if(itemID != 0) {
materialFromSlot = EQ::InventoryProfile::CalcMaterialFromSlot(i);
if (materialFromSlot != EQ::textures::materialInvalid)
this->SendWearChange(materialFromSlot);
SendWearChange(materialFromSlot);
}
}
@ -5790,7 +5790,7 @@ void Merc::Depop() {
RemoveMercFromGroup(this, GetGroup());
}
entity_list.RemoveMerc(this->GetID());
entity_list.RemoveMerc(GetID());
if(HasPet())
{
@ -6064,9 +6064,9 @@ void Client::SetMerc(Merc* newmerc) {
{
SetMercID(newmerc->GetID());
//Client* oldowner = entity_list.GetClientByID(newmerc->GetOwnerID());
newmerc->SetOwnerID(this->GetID());
newmerc->SetMercCharacterID(this->CharacterID());
newmerc->SetClientVersion((uint8)this->ClientVersion());
newmerc->SetOwnerID(GetID());
newmerc->SetMercCharacterID(CharacterID());
newmerc->SetClientVersion((uint8)ClientVersion());
GetMercInfo().mercid = newmerc->GetMercID();
GetMercInfo().MercTemplateID = newmerc->GetMercTemplateID();
GetMercInfo().myTemplate = zone->GetMercTemplate(GetMercInfo().MercTemplateID);

View File

@ -1410,7 +1410,7 @@ void Mob::CreateDespawnPacket(EQApplicationPacket* app, bool Decay)
void Mob::CreateHPPacket(EQApplicationPacket* app)
{
this->IsFullHP=(current_hp>=max_hp);
IsFullHP=(current_hp>=max_hp);
app->SetOpcode(OP_MobHealth);
app->size = sizeof(SpawnHPUpdate_Struct2);
app->pBuffer = new uchar[app->size];
@ -1669,9 +1669,9 @@ void Mob::MakeSpawnUpdate(PlayerPositionUpdateServer_Struct* spu) {
spu->delta_z = FloatToEQ13(m_Delta.z);
spu->heading = FloatToEQ12(m_Position.w);
#ifdef BOTS
if (this->IsClient() || this->IsBot())
if (IsClient() || IsBot())
#else
if (this->IsClient())
if (IsClient())
#endif
spu->animation = animation;
else
@ -2383,7 +2383,7 @@ void Mob::DoAnim(const int animnum, int type, bool ackreq, eqFilterType filter)
void Mob::ShowBuffs(Client* client) {
if(SPDAT_RECORDS <= 0)
return;
client->Message(Chat::White, "Buffs on: %s", this->GetName());
client->Message(Chat::White, "Buffs on: %s", GetName());
uint32 i;
uint32 buff_count = GetMaxTotalSlots();
for (i=0; i < buff_count; i++) {
@ -2417,7 +2417,7 @@ void Mob::ShowBuffList(Client* client) {
if(SPDAT_RECORDS <= 0)
return;
client->Message(Chat::White, "Buffs on: %s", this->GetCleanName());
client->Message(Chat::White, "Buffs on: %s", GetCleanName());
uint32 i;
uint32 buff_count = GetMaxTotalSlots();
for (i = 0; i < buff_count; i++) {
@ -2885,15 +2885,15 @@ void Mob::SendAppearancePacket(uint32 type, uint32 value, bool WholeZone, bool i
return;
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
SpawnAppearance_Struct* appearance = (SpawnAppearance_Struct*)outapp->pBuffer;
appearance->spawn_id = this->GetID();
appearance->spawn_id = GetID();
appearance->type = type;
appearance->parameter = value;
if (WholeZone)
entity_list.QueueClients(this, outapp, iIgnoreSelf);
else if(specific_target != nullptr)
specific_target->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
else if (this->IsClient())
this->CastToClient()->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
else if (IsClient())
CastToClient()->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
safe_delete(outapp);
}
@ -3250,12 +3250,12 @@ void Mob::ChangeSize(float in_size = 0, bool bNoRestriction) {
// Size Code
if (!bNoRestriction)
{
if (this->IsClient() || this->petid != 0)
if (IsClient() || petid != 0)
if (in_size < 3.0)
in_size = 3.0;
if (this->IsClient() || this->petid != 0)
if (IsClient() || petid != 0)
if (in_size > 15.0)
in_size = 15.0;
}
@ -3274,12 +3274,12 @@ void Mob::ChangeSize(float in_size = 0, bool bNoRestriction) {
Mob* Mob::GetOwnerOrSelf() {
if (!GetOwnerID())
return this;
Mob* owner = entity_list.GetMob(this->GetOwnerID());
Mob* owner = entity_list.GetMob(GetOwnerID());
if (!owner) {
SetOwnerID(0);
return(this);
}
if (owner->GetPetID() == this->GetID()) {
if (owner->GetPetID() == GetID()) {
return owner;
}
if(IsNPC() && CastToNPC()->GetSwarmInfo()){
@ -3290,8 +3290,8 @@ Mob* Mob::GetOwnerOrSelf() {
}
Mob* Mob::GetOwner() {
Mob* owner = entity_list.GetMob(this->GetOwnerID());
if (owner && owner->GetPetID() == this->GetID()) {
Mob* owner = entity_list.GetMob(GetOwnerID());
if (owner && owner->GetPetID() == GetID()) {
return owner;
}
@ -3656,7 +3656,7 @@ bool Mob::HateSummon() {
if(summon_level == 1) {
entity_list.MessageClose(this, true, 500, Chat::Say, "%s says 'You will not evade me, %s!' ", GetCleanName(), target->GetCleanName() );
float summoner_zoff = this->GetZOffset();
float summoner_zoff = GetZOffset();
float summoned_zoff = target->GetZOffset();
auto new_pos = m_Position;
new_pos.z -= (summoner_zoff - summoned_zoff);
@ -4041,7 +4041,7 @@ void Mob::ExecWeaponProc(const EQ::ItemInstance *inst, uint16 spell_id, Mob *on,
if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function
if(IsClient()){
Message(0, "Invalid spell proc %u", spell_id);
LogSpells("Player [{}], Weapon Procced invalid spell [{}]", this->GetName(), spell_id);
LogSpells("Player [{}], Weapon Procced invalid spell [{}]", GetName(), spell_id);
}
return;
}
@ -4364,7 +4364,7 @@ bool Mob::EntityVariableExists(const char *id)
void Mob::SetFlyMode(GravityBehavior flymode)
{
this->flymode = flymode;
flymode = flymode;
}
void Mob::Teleport(const glm::vec3 &pos)
@ -4708,7 +4708,7 @@ void Mob::SetBottomRampageList()
if (mob->IsNPC() && mob->CheckAggro(this)) {
for (int i = 0; i < mob->RampageArray.size(); i++) {
// Find this mob in the rampage list
if (this->GetID() == mob->RampageArray[i]) {
if (GetID() == mob->RampageArray[i]) {
//Move to bottom of Rampage List
auto it = mob->RampageArray.begin() + i;
std::rotate(it, it + 1, mob->RampageArray.end());
@ -4735,7 +4735,7 @@ void Mob::SetTopRampageList()
if (mob->IsNPC() && mob->CheckAggro(this)) {
for (int i = 0; i < mob->RampageArray.size(); i++) {
// Find this mob in the rampage list
if (this->GetID() == mob->RampageArray[i]) {
if (GetID() == mob->RampageArray[i]) {
//Move to Top of Rampage List
auto it = mob->RampageArray.begin() + i;
std::rotate(it, it + 1, mob->RampageArray.end());
@ -4836,20 +4836,20 @@ std::string Mob::GetGlobal(const char *varname) {
int qgCharid = 0;
int qgNpcid = 0;
if (this->IsNPC())
qgNpcid = this->GetNPCTypeID();
if (IsNPC())
qgNpcid = GetNPCTypeID();
if (this->IsClient())
qgCharid = this->CastToClient()->CharacterID();
if (IsClient())
qgCharid = CastToClient()->CharacterID();
QGlobalCache *qglobals = nullptr;
std::list<QGlobal> globalMap;
if (this->IsClient())
qglobals = this->CastToClient()->GetQGlobals();
if (IsClient())
qglobals = CastToClient()->GetQGlobals();
if (this->IsNPC())
qglobals = this->CastToNPC()->GetQGlobals();
if (IsNPC())
qglobals = CastToNPC()->GetQGlobals();
if(qglobals)
QGlobalCache::Combine(globalMap, qglobals->GetBucket(), qgNpcid, qgCharid, zone->GetZoneID());
@ -4871,18 +4871,18 @@ void Mob::SetGlobal(const char *varname, const char *newvalue, int options, cons
int qgCharid = 0;
int qgNpcid = 0;
if (this->IsNPC())
if (IsNPC())
{
qgNpcid = this->GetNPCTypeID();
qgNpcid = GetNPCTypeID();
}
else if (other && other->IsNPC())
{
qgNpcid = other->GetNPCTypeID();
}
if (this->IsClient())
if (IsClient())
{
qgCharid = this->CastToClient()->CharacterID();
qgCharid = CastToClient()->CharacterID();
}
else if (other && other->IsClient())
{
@ -4922,11 +4922,11 @@ void Mob::DelGlobal(const char *varname) {
int qgCharid=0;
int qgNpcid=0;
if (this->IsNPC())
qgNpcid = this->GetNPCTypeID();
if (IsNPC())
qgNpcid = GetNPCTypeID();
if (this->IsClient())
qgCharid = this->CastToClient()->CharacterID();
if (IsClient())
qgCharid = CastToClient()->CharacterID();
else
qgCharid = -qgNpcid; // make char id negative npc id as a fudge
@ -5344,7 +5344,7 @@ int16 Mob::GetMeleeDmgPositionMod(Mob* defender)
int16 Mob::GetSkillReuseTime(uint16 skill)
{
int skill_reduction = this->itembonuses.SkillReuseTime[skill] + this->spellbonuses.SkillReuseTime[skill] + this->aabonuses.SkillReuseTime[skill];
int skill_reduction = itembonuses.SkillReuseTime[skill] + spellbonuses.SkillReuseTime[skill] + aabonuses.SkillReuseTime[skill];
return skill_reduction;
}
@ -5445,7 +5445,7 @@ void Mob::DoGravityEffect()
if(casterId)
caster = entity_list.GetMob(casterId);
if(!caster || casterId == this->GetID())
if(!caster || casterId == GetID())
continue;
caster_x = caster->GetX();
@ -5505,9 +5505,9 @@ void Mob::DoGravityEffect()
}
if(IsClient())
this->CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), cur_x, cur_y, new_ground, GetHeading());
CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), cur_x, cur_y, new_ground, GetHeading());
else
this->GMMove(cur_x, cur_y, new_ground, GetHeading());
GMMove(cur_x, cur_y, new_ground, GetHeading());
}
}
@ -5890,7 +5890,7 @@ FACTION_VALUE Mob::GetSpecialFactionCon(Mob* iOther) {
return FACTION_INDIFFERENTLY;
iOther = iOther->GetOwnerOrSelf();
Mob* self = this->GetOwnerOrSelf();
Mob* self = GetOwnerOrSelf();
bool selfAIcontrolled = self->IsAIControlled();
bool iOtherAIControlled = iOther->IsAIControlled();

View File

@ -355,7 +355,7 @@ bool NPC::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes, bool bInnates
break;
}
default: {
std::cout << "Error: Unknown spell type in AICastSpell. caster:" << this->GetName() << " type:" << AIspells[i].type << " slot:" << i << std::endl;
std::cout << "Error: Unknown spell type in AICastSpell. caster:" << GetName() << " type:" << AIspells[i].type << " slot:" << i << std::endl;
break;
}
}
@ -531,12 +531,12 @@ void NPC::AI_Stop() {
void Client::AI_Stop() {
Mob::AI_Stop();
this->MessageString(Chat::Red,PLAYER_REGAIN);
MessageString(Chat::Red,PLAYER_REGAIN);
auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct));
Charm_Struct *ps = (Charm_Struct*)app->pBuffer;
ps->owner_id = 0;
ps->pet_id = this->GetID();
ps->pet_id = GetID();
ps->command = 0;
entity_list.QueueClients(this, app);
safe_delete(app);
@ -1019,7 +1019,7 @@ void Mob::AI_Process() {
* Make sure we're opening a door within height relevance and not platforms
* above or below
*/
if (std::abs(this->m_Position.z - door->GetPosition().z) > 10) {
if (std::abs(m_Position.z - door->GetPosition().z) > 10) {
continue;
}
@ -1411,8 +1411,8 @@ void Mob::AI_Process() {
continue;
}
if (this->CheckWillAggro(mob)) {
this->AddToHateList(mob);
if (CheckWillAggro(mob)) {
AddToHateList(mob);
}
}
@ -1538,13 +1538,13 @@ void Mob::AI_Process() {
{
// dont move till a bit after you last fought
if (time_until_can_move < Timer::GetCurrentTime()) {
if (this->IsClient()) {
if (IsClient()) {
/**
* LD timer expired, drop out of world
*/
if (this->CastToClient()->IsLD()) {
this->CastToClient()->Disconnect();
if (CastToClient()->IsLD()) {
CastToClient()->Disconnect();
}
return;
@ -1603,7 +1603,7 @@ void NPC::AI_DoMovement() {
Log(
Logs::Detail,
Logs::NPCRoamBox, "(%s) Timer calc | random_timer [%i] roambox_move_delay [%i] move_min [%i] move_max [%i]",
this->GetCleanName(),
GetCleanName(),
random_timer,
roambox_move_delay,
(int) GetRoamboxMinDelay(),
@ -1641,7 +1641,7 @@ void NPC::AI_DoMovement() {
* If mob was not spawned in water, let's not randomly roam them into water
* if the roam box was sloppily configured
*/
if (!this->GetWasSpawnedInWater()) {
if (!GetWasSpawnedInWater()) {
roambox_destination_z = GetGroundZ(roambox_destination_x, roambox_destination_y);
if (zone->HasMap() && zone->HasWaterMap()) {
auto position = glm::vec3(
@ -1661,7 +1661,7 @@ void NPC::AI_DoMovement() {
if (zone->watermap->InLiquid(position)) {
Log(Logs::Detail,
Logs::NPCRoamBox, "%s | My destination is in water and I don't belong there!",
this->GetCleanName());
GetCleanName());
return;
}
@ -1705,7 +1705,7 @@ void NPC::AI_DoMovement() {
Log(
Logs::Detail,
Logs::NPCRoamBox, "(%s) We don't have a path route... exiting...",
this->GetCleanName()
GetCleanName()
);
return;
}
@ -1714,7 +1714,7 @@ void NPC::AI_DoMovement() {
Logs::General,
Logs::NPCRoamBox,
"NPC (%s) distance [%.0f] X (min/max) [%.0f / %.0f] Y (min/max) [%.0f / %.0f] | Dest x/y/z [%.0f / %.0f / %.0f]",
this->GetCleanName(),
GetCleanName(),
roambox_distance,
roambox_min_x,
roambox_max_x,
@ -1854,7 +1854,7 @@ void NPC::AI_DoMovement() {
}
void NPC::AI_SetupNextWaypoint() {
int32 spawn_id = this->GetSpawnPointID();
int32 spawn_id = GetSpawnPointID();
LinkedListIterator<Spawn2*> iterator(zone->spawn2_list);
iterator.Reset();
Spawn2 *found_spawn = nullptr;
@ -1982,7 +1982,7 @@ void Mob::AI_Event_NoLongerEngaged() {
SetAssistAggro(false);
if(CastToNPC()->GetCombatEvent() && GetHP() > 0)
{
if(entity_list.GetNPCByID(this->GetID()))
if(entity_list.GetNPCByID(GetID()))
{
uint16 emoteid = CastToNPC()->GetEmoteID();
parse->EventNPC(EVENT_COMBAT, CastToNPC(), nullptr, "0", 0);
@ -2075,7 +2075,7 @@ bool NPC::AI_IdleCastCheck() {
//last duration it was set to... try to put up a more reasonable timer...
AIautocastspell_timer->Start(RandomTimer(AISpellVar.idle_no_sp_recast_min, AISpellVar.idle_no_sp_recast_max), false);
LogSpells("Triggering AI_IdleCastCheck :: Mob [{}] - Min : [{}] Max : [{}]", this->GetCleanName(), AISpellVar.idle_no_sp_recast_min, AISpellVar.idle_no_sp_recast_max);
LogSpells("Triggering AI_IdleCastCheck :: Mob [{}] - Min : [{}] Max : [{}]", GetCleanName(), AISpellVar.idle_no_sp_recast_min, AISpellVar.idle_no_sp_recast_max);
} //else, spell casting finishing will reset the timer.
} //else, spell casting finishing will reset the timer.
@ -2533,7 +2533,7 @@ bool NPC::AI_AddNPCSpells(uint32 iDBSpellsID) {
}
DBnpcspells_Struct* parentlist = content_db.GetNPCSpells(spell_list->parent_list);
#if MobAI_DEBUG_Spells >= 10
std::string debug_msg = StringFormat("Loading NPCSpells onto %s: dbspellsid=%u, level=%u", this->GetName(), iDBSpellsID, this->GetLevel());
std::string debug_msg = StringFormat("Loading NPCSpells onto %s: dbspellsid=%u, level=%u", GetName(), iDBSpellsID, GetLevel());
if (spell_list) {
debug_msg.append(StringFormat(" (found, %u), parentlist=%u", spell_list->entries.size(), spell_list->parent_list));
if (spell_list->parent_list) {
@ -2708,7 +2708,7 @@ bool NPC::AI_AddNPCSpellsEffects(uint32 iDBSpellsEffectsID) {
uint32 i;
#if MobAI_DEBUG_Spells >= 10
std::string debug_msg = StringFormat("Loading NPCSpellsEffects onto %s: dbspellseffectid=%u", this->GetName(), iDBSpellsEffectsID);
std::string debug_msg = StringFormat("Loading NPCSpellsEffects onto %s: dbspellseffectid=%u", GetName(), iDBSpellsEffectsID);
if (spell_effects_list) {
debug_msg.append(StringFormat(" (found, %u), parentlist=%u", spell_effects_list->numentries, spell_effects_list->parent_list));
if (spell_effects_list->parent_list) {

View File

@ -45,7 +45,7 @@ void Mob::SetMobTextureProfile(uint8 material_slot, uint16 texture, uint32 color
{
Log(Logs::Detail, Logs::MobAppearance,
"Mob::SetMobTextureProfile [%s] material_slot: %u texture: %u color: %u hero_forge_model: %u",
this->GetCleanName(),
GetCleanName(),
material_slot,
texture,
color,
@ -214,7 +214,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
Log(Logs::Detail, Logs::MobAppearance,
"Mob::GetEquipmentMaterial [%s] material_slot: %u texture_profile_material: %i",
this->clean_name,
clean_name,
material_slot,
texture_profile_material
);
@ -235,7 +235,7 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
material_slot == EQ::textures::weaponSecondary;
if (is_primary_or_secondary_weapon) {
if (this->IsClient()) {
if (IsClient()) {
int16 inventory_slot = EQ::InventoryProfile::CalcSlotFromMaterial(material_slot);
if (inventory_slot == INVALID_INDEX) {
@ -408,7 +408,7 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
auto *wear_change = (WearChange_Struct *) packet->pBuffer;
Log(Logs::Detail, Logs::MobAppearance, "Mob::SendWearChange [%s]",
this->GetCleanName()
GetCleanName()
);
wear_change->spawn_id = GetID();
@ -467,14 +467,14 @@ void Mob::SendTextureWC(
auto outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
auto *wear_change = (WearChange_Struct *) outapp->pBuffer;
if (this->IsClient()) {
if (IsClient()) {
wear_change->color.Color = GetEquipmentColor(slot);
}
else {
wear_change->color.Color = this->GetArmorTint(slot);
wear_change->color.Color = GetArmorTint(slot);
}
wear_change->spawn_id = this->GetID();
wear_change->spawn_id = GetID();
wear_change->material = texture;
wear_change->wear_slot_id = slot;
wear_change->unknown06 = unknown06;
@ -506,7 +506,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin
auto outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
auto *wc = (WearChange_Struct *) outapp->pBuffer;
wc->spawn_id = this->GetID();
wc->spawn_id = GetID();
wc->material = GetEquipmentMaterial(material_slot);
wc->hero_forge_model = GetHerosForgeModel(material_slot);
wc->color.Color = color;
@ -539,7 +539,7 @@ void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 h
auto outapp = new EQApplicationPacket(OP_WearChange, sizeof(WearChange_Struct));
auto *wear_change = (WearChange_Struct *) outapp->pBuffer;
wear_change->spawn_id = this->GetID();
wear_change->spawn_id = GetID();
wear_change->material = texture;
wear_change->hero_forge_model = hero_forge_model;
wear_change->color.Color = color;

View File

@ -638,11 +638,11 @@ void Mob::DisplayInfo(Mob *mob)
return;
}
if (this->IsClient()) {
if (IsClient()) {
std::string window_text = "<c \"#FFFF66\">*Drag window open vertically to see all</c><br>";
Client *client = this->CastToClient();
Client *client = CastToClient();
if (!client->IsDevToolsEnabled()) {
return;

View File

@ -825,20 +825,20 @@ bool NPC::Process()
{
if (p_depop)
{
Mob* owner = entity_list.GetMob(this->ownerid);
Mob* owner = entity_list.GetMob(ownerid);
if (owner != 0)
{
//if(GetBodyType() != BT_SwarmPet)
// owner->SetPetID(0);
this->ownerid = 0;
this->petid = 0;
ownerid = 0;
petid = 0;
}
return false;
}
if (IsStunned() && stunned_timer.Check()) {
Mob::UnStun();
this->spun_timer.Disable();
spun_timer.Disable();
}
SpellProcess();
@ -969,7 +969,7 @@ bool NPC::Process()
/**
* Send HP updates when engaged
*/
if (send_hp_update_timer.Check(false) && this->IsEngaged()) {
if (send_hp_update_timer.Check(false) && IsEngaged()) {
SendHPUpdate();
}
@ -1081,9 +1081,9 @@ void NPC::UpdateEquipmentLight()
}
void NPC::Depop(bool StartSpawnTimer) {
uint16 emoteid = this->GetEmoteID();
uint16 emoteid = GetEmoteID();
if(emoteid != 0)
this->DoNPCEmote(ONDESPAWN,emoteid);
DoNPCEmote(ONDESPAWN,emoteid);
p_depop = true;
if (respawn2)
{
@ -1107,7 +1107,7 @@ bool NPC::DatabaseCastAccepted(int spell_id) {
}
case SE_CurrentHPOnce:
case SE_CurrentHP: {
if(this->GetHPRatio() < 100 && spells[spell_id].buff_duration == 0)
if(GetHPRatio() < 100 && spells[spell_id].buff_duration == 0)
return true;
else
return false;
@ -1115,7 +1115,7 @@ bool NPC::DatabaseCastAccepted(int spell_id) {
}
case SE_HealOverTime: {
if(this->GetHPRatio() < 100)
if(GetHPRatio() < 100)
return true;
else
return false;
@ -1140,7 +1140,7 @@ bool NPC::DatabaseCastAccepted(int spell_id) {
break;
}
default:
if(spells[spell_id].good_effect == 1 && !(spells[spell_id].buff_duration == 0 && this->GetHPRatio() == 100) && !IsEngaged())
if(spells[spell_id].good_effect == 1 && !(spells[spell_id].buff_duration == 0 && GetHPRatio() == 100) && !IsEngaged())
return true;
return false;
}
@ -1762,7 +1762,7 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
int32 texture_profile_material = GetTextureProfileMaterial(material_slot);
Log(Logs::Detail, Logs::MobAppearance, "NPC::GetEquipmentMaterial [%s] material_slot: %u",
this->clean_name,
clean_name,
material_slot
);
@ -1983,7 +1983,7 @@ void NPC::Disarm(Client* client, int chance) {
CalcBonuses();
if (inst) {
// create a ground item
Object* object = new Object(inst, this->GetX(), this->GetY(), this->GetZ(), 0.0f, 300000);
Object* object = new Object(inst, GetX(), GetY(), GetZ(), 0.0f, 300000);
entity_list.AddObject(object, true);
object->StartDecay();
safe_delete(inst);
@ -1997,7 +1997,7 @@ void NPC::Disarm(Client* client, int chance) {
SendWearChange(matslot);
if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQ::invslot::slotPrimary)
Say("Ahh! My weapon!");
client->MessageString(Chat::Skills, DISARM_SUCCESS, this->GetCleanName());
client->MessageString(Chat::Skills, DISARM_SUCCESS, GetCleanName());
if (chance != 1000)
client->CheckIncreaseSkill(EQ::skills::SkillDisarm, nullptr, 4);
return;
@ -2151,11 +2151,11 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem
parse++;
}
if(permtag == 1 && this->GetNPCTypeID() > 0)
if(permtag == 1 && GetNPCTypeID() > 0)
{
if(content_db.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse))
if(content_db.SetSpecialAttkFlag(GetNPCTypeID(), orig_parse))
{
LogInfo("NPCTypeID: [{}] flagged to [{}] for Special Attacks.\n",this->GetNPCTypeID(),orig_parse);
LogInfo("NPCTypeID: [{}] flagged to [{}] for Special Attacks.\n",GetNPCTypeID(),orig_parse);
}
}
}
@ -3026,13 +3026,13 @@ void NPC::DoNPCEmote(uint8 event_, uint16 emoteid)
if(emoteid == nes->emoteid)
{
if(nes->type == 1)
this->Emote("%s",nes->text);
Emote("%s",nes->text);
else if(nes->type == 2)
this->Shout("%s",nes->text);
Shout("%s",nes->text);
else if(nes->type == 3)
entity_list.MessageCloseString(this, true, 200, 10, GENERIC_STRING, nes->text);
else
this->Say("%s",nes->text);
Say("%s",nes->text);
}
}
@ -3578,7 +3578,7 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker)
LogAIYellForHelpDetail(
"NPC [{}] is assisting [{}] against target [{}]",
mob->GetCleanName(),
this->GetCleanName(),
GetCleanName(),
attacker->GetCleanName()
);
}

View File

@ -276,7 +276,7 @@ void Object::SetID(uint16 set_id)
Entity::SetID(set_id);
// Store new id as drop_id
m_data.drop_id = (uint32)this->GetID();
m_data.drop_id = (uint32)GetID();
}
// Reset state of object back to zero
@ -365,7 +365,7 @@ void Object::Close() {
last_user = user;
// put any remaining items from the world container back into the player's inventory to avoid item loss
// if they close the container without removing all items
EQ::ItemInstance* container = this->m_inst;
EQ::ItemInstance* container = m_inst;
if(container != nullptr)
{
for (uint8 i = EQ::invbag::SLOT_BEGIN; i <= EQ::invbag::SLOT_END; i++)
@ -512,7 +512,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
std::string export_string = fmt::format("{}", item->ID);
std::vector<EQ::Any> args;
args.push_back(m_inst);
if(parse->EventPlayer(EVENT_PLAYER_PICKUP, sender, export_string, this->GetID(), &args))
if(parse->EventPlayer(EVENT_PLAYER_PICKUP, sender, export_string, GetID(), &args))
{
auto outapp = new EQApplicationPacket(OP_ClickObject, sizeof(ClickObject_Struct));
memcpy(outapp->pBuffer, click_object, sizeof(ClickObject_Struct));
@ -555,7 +555,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
// Remove object
content_db.DeleteObject(m_id);
if(!m_ground_spawn)
entity_list.RemoveEntity(this->GetID());
entity_list.RemoveEntity(GetID());
} else {
// Tradeskill item
auto outapp = new EQApplicationPacket(OP_ClickObjectAction, sizeof(ClickObjectAction_Struct));
@ -751,64 +751,64 @@ void ZoneDatabase::DeleteObject(uint32 id)
uint32 Object::GetDBID()
{
return this->m_id;
return m_id;
}
uint32 Object::GetType()
{
return this->m_type;
return m_type;
}
void Object::SetType(uint32 type)
{
this->m_type = type;
this->m_data.object_type = type;
m_type = type;
m_data.object_type = type;
}
uint32 Object::GetIcon()
{
return this->m_icon;
return m_icon;
}
float Object::GetX()
{
return this->m_data.x;
return m_data.x;
}
float Object::GetY()
{
return this->m_data.y;
return m_data.y;
}
float Object::GetZ()
{
return this->m_data.z;
return m_data.z;
}
float Object::GetHeadingData()
{
return this->m_data.heading;
return m_data.heading;
}
float Object::GetTiltX()
{
return this->m_data.tilt_x;
return m_data.tilt_x;
}
float Object::GetTiltY()
{
return this->m_data.tilt_y;
return m_data.tilt_y;
}
void Object::SetX(float pos)
{
this->m_data.x = pos;
m_data.x = pos;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -817,12 +817,12 @@ void Object::SetX(float pos)
void Object::SetY(float pos)
{
this->m_data.y = pos;
m_data.y = pos;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -831,12 +831,12 @@ void Object::SetY(float pos)
void Object::SetTiltX(float pos)
{
this->m_data.tilt_x = pos;
m_data.tilt_x = pos;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -845,12 +845,12 @@ void Object::SetTiltX(float pos)
void Object::SetTiltY(float pos)
{
this->m_data.tilt_y = pos;
m_data.tilt_y = pos;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -865,18 +865,18 @@ void Object::SetDisplayName(const char *in_name)
void Object::Depop()
{
auto app = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
CreateDeSpawnPacket(app);
entity_list.QueueClients(0, app);
safe_delete(app);
entity_list.RemoveObject(this->GetID());
entity_list.RemoveObject(GetID());
}
void Object::Repop()
{
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -887,12 +887,12 @@ void Object::Repop()
void Object::SetZ(float pos)
{
this->m_data.z = pos;
m_data.z = pos;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -904,8 +904,8 @@ void Object::SetModelName(const char* modelname)
strn0cpy(m_data.object_name, modelname, sizeof(m_data.object_name)); // 32 is the max for chars in object_name, this should be safe
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -917,8 +917,8 @@ void Object::SetSize(float size)
m_data.size = size;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -930,8 +930,8 @@ void Object::SetSolidType(uint16 solidtype)
m_data.solidtype = solidtype;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -950,22 +950,22 @@ uint16 Object::GetSolidType()
const char* Object::GetModelName()
{
return this->m_data.object_name;
return m_data.object_name;
}
void Object::SetIcon(uint32 icon)
{
this->m_icon = icon;
m_icon = icon;
}
uint32 Object::GetItemID()
{
if (this->m_inst == 0)
if (m_inst == 0)
{
return 0;
}
const EQ::ItemData* item = this->m_inst->GetItem();
const EQ::ItemData* item = m_inst->GetItem();
if (item == 0)
{
@ -977,11 +977,11 @@ uint32 Object::GetItemID()
void Object::SetItemID(uint32 itemid)
{
safe_delete(this->m_inst);
safe_delete(m_inst);
if (itemid)
{
this->m_inst = database.CreateItem(itemid);
m_inst = database.CreateItem(itemid);
}
}
@ -989,7 +989,7 @@ void Object::GetObjectData(Object_Struct* Data)
{
if (Data)
{
memcpy(Data, &this->m_data, sizeof(this->m_data));
memcpy(Data, &m_data, sizeof(m_data));
}
}
@ -997,7 +997,7 @@ void Object::SetObjectData(Object_Struct* Data)
{
if (Data)
{
memcpy(&this->m_data, Data, sizeof(this->m_data));
memcpy(&m_data, Data, sizeof(m_data));
}
}
@ -1005,29 +1005,29 @@ void Object::GetLocation(float* x, float* y, float* z)
{
if (x)
{
*x = this->m_data.x;
*x = m_data.x;
}
if (y)
{
*y = this->m_data.y;
*y = m_data.y;
}
if (z)
{
*z = this->m_data.z;
*z = m_data.z;
}
}
void Object::SetLocation(float x, float y, float z)
{
this->m_data.x = x;
this->m_data.y = y;
this->m_data.z = z;
m_data.x = x;
m_data.y = y;
m_data.z = z;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);
@ -1038,17 +1038,17 @@ void Object::GetHeading(float* heading)
{
if (heading)
{
*heading = this->m_data.heading;
*heading = m_data.heading;
}
}
void Object::SetHeading(float heading)
{
this->m_data.heading = heading;
m_data.heading = heading;
auto app = new EQApplicationPacket();
auto app2 = new EQApplicationPacket();
this->CreateDeSpawnPacket(app);
this->CreateSpawnPacket(app2);
CreateDeSpawnPacket(app);
CreateSpawnPacket(app2);
entity_list.QueueClients(0, app);
entity_list.QueueClients(0, app2);
safe_delete(app);

View File

@ -46,23 +46,23 @@ extern WorldServer worldserver;
void Petition::SendPetitionToPlayer(Client* clientto) {
auto outapp = new EQApplicationPacket(OP_PetitionCheckout, sizeof(Petition_Struct));
Petition_Struct* pet = (Petition_Struct*) outapp->pBuffer;
strcpy(pet->accountid,this->GetAccountName());
strcpy(pet->lastgm,this->GetLastGM());
strcpy(pet->charname,this->GetCharName());
pet->petnumber = this->petid;
pet->charclass = this->GetCharClass();
pet->charlevel = this->GetCharLevel();
pet->charrace = this->GetCharRace();
pet->zone = this->GetZone();
//strcpy(pet->zone,this->GetZone());
strcpy(pet->petitiontext,this->GetPetitionText());
pet->checkouts = this->GetCheckouts();
pet->unavail = this->GetUnavails();
pet->senttime = this->GetSentTime();
strcpy(pet->accountid,GetAccountName());
strcpy(pet->lastgm,GetLastGM());
strcpy(pet->charname,GetCharName());
pet->petnumber = petid;
pet->charclass = GetCharClass();
pet->charlevel = GetCharLevel();
pet->charrace = GetCharRace();
pet->zone = GetZone();
//strcpy(pet->zone,GetZone());
strcpy(pet->petitiontext,GetPetitionText());
pet->checkouts = GetCheckouts();
pet->unavail = GetUnavails();
pet->senttime = GetSentTime();
//memset(pet->unknown5, 0, sizeof(pet->unknown5));
//pet->unknown5[3] = 0x1f;
pet->urgency = this->GetUrgency();
strcpy(pet->gmtext, this->GetGMText());
pet->urgency = GetUrgency();
strcpy(pet->gmtext, GetGMText());
clientto->QueuePacket(outapp);
safe_delete(outapp);
return;
@ -85,7 +85,7 @@ Petition::Petition(uint32 id)
memset(petitiontext, 0, sizeof(petitiontext));
memset(gmtext, 0, sizeof(gmtext));
//memset(this->zone, 0, sizeof(this->zone));
//memset(zone, 0, sizeof(zone));
zone = 1;
}
Petition* PetitionList::GetPetitionByID(uint32 id_in) {

View File

@ -194,12 +194,12 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
int16 act_power = 0; // The actual pet power we'll use.
if (petpower == -1) {
if (this->IsClient()) {
if (IsClient()) {
act_power = CastToClient()->GetFocusEffect(focusPetPower, spell_id);//Client only
act_power = CastToClient()->mod_pet_power(act_power, spell_id);
}
#ifdef BOTS
else if (this->IsBot())
else if (IsBot())
act_power = CastToBot()->GetBotFocusEffect(focusPetPower, spell_id);
#endif
}
@ -231,9 +231,9 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
memcpy(npc_type, base, sizeof(NPCType));
// If pet power is set to -1 in the DB, use stat scaling
if ((this->IsClient()
if ((IsClient()
#ifdef BOTS
|| this->IsBot()
|| IsBot()
#endif
) && record.petpower == -1)
{
@ -276,15 +276,15 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
EntityList::RemoveNumbers(npc_type->name);
entity_list.MakeNameUnique(npc_type->name);
} else if (record.petnaming == 0) {
strcpy(npc_type->name, this->GetCleanName());
strcpy(npc_type->name, GetCleanName());
npc_type->name[25] = '\0';
strcat(npc_type->name, "`s_pet");
} else if (record.petnaming == 1) {
strcpy(npc_type->name, this->GetName());
strcpy(npc_type->name, GetName());
npc_type->name[19] = '\0';
strcat(npc_type->name, "`s_familiar");
} else if (record.petnaming == 2) {
strcpy(npc_type->name, this->GetName());
strcpy(npc_type->name, GetName());
npc_type->name[21] = 0;
strcat(npc_type->name, "`s_Warder");
} else if (record.petnaming == 4) {
@ -292,11 +292,11 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
} else if (record.petnaming == 3 && IsClient()) {
GetRandPetName(npc_type->name);
} else if (record.petnaming == 5 && IsClient()) {
strcpy(npc_type->name, this->GetName());
strcpy(npc_type->name, GetName());
npc_type->name[24] = '\0';
strcat(npc_type->name, "`s_ward");
} else {
strcpy(npc_type->name, this->GetCleanName());
strcpy(npc_type->name, GetCleanName());
npc_type->name[25] = '\0';
strcat(npc_type->name, "`s_pet");
}
@ -541,7 +541,7 @@ void Mob::SetPet(Mob* newpet) {
Mob* oldowner = entity_list.GetMob(newpet->GetOwnerID());
if (oldowner)
oldowner->SetPetID(0);
newpet->SetOwnerID(this->GetID());
newpet->SetOwnerID(GetID());
}
}

View File

@ -996,7 +996,7 @@ void Raid::SendRaidAddAll(const char *who)
ram->_class = members[x]._class;
ram->level = members[x].level;
ram->isGroupLeader = members[x].IsGroupLeader;
this->QueuePacket(outapp);
QueuePacket(outapp);
safe_delete(outapp);
return;
}
@ -1555,7 +1555,7 @@ void Raid::SendHPManaEndPacketsTo(Client *client)
if(!client)
return;
uint32 group_id = this->GetGroup(client);
uint32 group_id = GetGroup(client);
EQApplicationPacket hp_packet;
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
@ -1595,7 +1595,7 @@ void Raid::SendHPManaEndPacketsFrom(Mob *mob)
uint32 group_id = 0;
if(mob->IsClient())
group_id = this->GetGroup(mob->CastToClient());
group_id = GetGroup(mob->CastToClient());
EQApplicationPacket hpapp;
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
@ -1631,7 +1631,7 @@ void Raid::SendManaPacketFrom(Mob *mob)
uint32 group_id = 0;
if (mob->IsClient())
group_id = this->GetGroup(mob->CastToClient());
group_id = GetGroup(mob->CastToClient());
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
@ -1658,7 +1658,7 @@ void Raid::SendEndurancePacketFrom(Mob *mob)
uint32 group_id = 0;
if (mob->IsClient())
group_id = this->GetGroup(mob->CastToClient());
group_id = GetGroup(mob->CastToClient());
EQApplicationPacket outapp(OP_MobManaUpdate, sizeof(MobManaUpdate_Struct));
@ -1778,7 +1778,7 @@ void Raid::SetDirtyAutoHaters()
void Raid::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_required /*= true*/, bool ignore_sender /*= true*/, float distance /*= 0*/, bool group_only /*= true*/) {
if (sender && sender->IsClient()) {
uint32 group_id = this->GetGroup(sender->CastToClient());
uint32 group_id = GetGroup(sender->CastToClient());
/* If this is a group only packet and we're not in a group -- return */
if (!group_id == 0xFFFFFFFF && group_only)

View File

@ -295,7 +295,7 @@ void Client::OPCombatAbility(const CombatAbility_Struct *ca_atk)
int32 dmg = 0;
int32 skill_reduction = this->GetSkillReuseTime(ca_atk->m_skill);
int32 skill_reduction = GetSkillReuseTime(ca_atk->m_skill);
// not sure what the '100' indicates..if ->m_atk is not used as 'slot' reference, then change SlotRange above back to '11'
if (ca_atk->m_atk == 100 &&
@ -1661,7 +1661,7 @@ void NPC::DoClassAttacks(Mob *target) {
//general stuff, for all classes....
//only gets used when their primary ability get used too
if (taunting && HasOwner() && target->IsNPC() && target->GetBodyType() != BT_Undead && taunt_time) {
this->GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING);
GetOwner()->MessageString(Chat::PetResponse, PET_TAUNTING);
Taunt(target->CastToNPC(), false);
}

View File

@ -771,7 +771,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct));
Charm_Struct *ps = (Charm_Struct*)app->pBuffer;
ps->owner_id = caster->GetID();
ps->pet_id = this->GetID();
ps->pet_id = GetID();
ps->command = 1;
entity_list.QueueClients(this, app);
safe_delete(app);
@ -1701,10 +1701,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
// can only summon corpses of clients
if(!IsNPC()) {
Client* TargetClient = nullptr;
if(this->GetTarget())
TargetClient = this->GetTarget()->CastToClient();
if(GetTarget())
TargetClient = GetTarget()->CastToClient();
else
TargetClient = this->CastToClient();
TargetClient = CastToClient();
// We now have a valid target for this spell. Either the caster himself or a targetted player. Lets see if the target is in the group.
Group* group = entity_list.GetGroupByClient(TargetClient);
@ -1728,7 +1728,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
}
} else {
if(TargetClient != this->CastToClient()) {
if(TargetClient != CastToClient()) {
Message(Chat::Red, "Your target must be a group member for this spell.");
break;
}
@ -1742,7 +1742,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient);
if(corpse) {
if(TargetClient == this->CastToClient())
if(TargetClient == CastToClient())
MessageString(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName());
else
MessageString(Chat::LightBlue, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName());
@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_SummonCorpseZone:
{
if (IsClient()) {
Client* client_target = this->CastToClient();
Client* client_target = CastToClient();
if (client_target->IsGrouped()) {
Group* group = client_target->GetGroup();
if (!group->IsGroupMember(caster)) {
@ -2744,7 +2744,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_Taunt:
{
if (caster && IsNPC()){
caster->Taunt(this->CastToNPC(), false, spell.base_value[i], true, spell.limit_value[i]);
caster->Taunt(CastToNPC(), false, spell.base_value[i], true, spell.limit_value[i]);
}
break;
}
@ -4157,7 +4157,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
{
if(IsClient())
{
/*Mob* horse = entity_list.GetMob(this->CastToClient()->GetHorseId());
/*Mob* horse = entity_list.GetMob(CastToClient()->GetHorseId());
if (horse) horse->Depop();
CastToClient()->SetHasMount(false);*/
CastToClient()->SetHorseId(0);
@ -4249,7 +4249,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
case SE_Mez:
{
SendAppearancePacket(AT_Anim, ANIM_STAND); // unfreeze
this->mezzed = false;
mezzed = false;
break;
}
@ -4302,7 +4302,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
uint32 buff_count = GetMaxTotalSlots();
for (unsigned int j = 0; j < buff_count; j++) {
if (IsValidSpell(GetBuffs()[j].spellid )) {
auto spell = spells[this->GetBuffs()[j].spellid];
auto spell = spells[GetBuffs()[j].spellid];
if (spell.good_effect == 0 && IsEffectInSpell(spell.id, SE_CurrentHP)) {
BuffFadeBySpellID(spell.id);
}
@ -4354,7 +4354,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if(IsClient())
{
InterruptSpell();
if (this->CastToClient()->IsLD())
if (CastToClient()->IsLD())
CastToClient()->AI_Start(CLIENT_LD_TIMEOUT);
else
{

View File

@ -878,7 +878,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp
Raid *my_raid = GetRaid();
if (target_raid &&
my_raid &&
(target_raid->GetGroup(spell_target->CastToClient()) == my_raid->GetGroup(this->CastToClient()))) {
(target_raid->GetGroup(spell_target->CastToClient()) == my_raid->GetGroup(CastToClient()))) {
cast_failed = false;
}
}
@ -961,7 +961,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
CheckIncreaseSkill(EQ::skills::SkillSinging, nullptr, -15);
break;
case EQ::skills::SkillPercussionInstruments:
if(this->itembonuses.percussionMod > 0) {
if(itembonuses.percussionMod > 0) {
if (GetRawSkill(EQ::skills::SkillPercussionInstruments) > 0) // no skill increases if not trained in the instrument
CheckIncreaseSkill(EQ::skills::SkillPercussionInstruments, nullptr, -15);
else
@ -971,7 +971,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
CheckIncreaseSkill(EQ::skills::SkillSinging, nullptr, -15);
break;
case EQ::skills::SkillStringedInstruments:
if(this->itembonuses.stringedMod > 0) {
if(itembonuses.stringedMod > 0) {
if (GetRawSkill(EQ::skills::SkillStringedInstruments) > 0)
CheckIncreaseSkill(EQ::skills::SkillStringedInstruments, nullptr, -15);
else
@ -981,7 +981,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
CheckIncreaseSkill(EQ::skills::SkillSinging, nullptr, -15);
break;
case EQ::skills::SkillWindInstruments:
if(this->itembonuses.windMod > 0) {
if(itembonuses.windMod > 0) {
if (GetRawSkill(EQ::skills::SkillWindInstruments) > 0)
CheckIncreaseSkill(EQ::skills::SkillWindInstruments, nullptr, -15);
else
@ -991,7 +991,7 @@ void Client::CheckSongSkillIncrease(uint16 spell_id){
CheckIncreaseSkill(EQ::skills::SkillSinging, nullptr, -15);
break;
case EQ::skills::SkillBrassInstruments:
if(this->itembonuses.brassMod > 0) {
if(itembonuses.brassMod > 0) {
if (GetRawSkill(EQ::skills::SkillBrassInstruments) > 0)
CheckIncreaseSkill(EQ::skills::SkillBrassInstruments, nullptr, -15);
else
@ -1466,7 +1466,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
RuleI(Range, SpellMessages),
Chat::Spells,
OTHER_REGAIN_CAST,
this->GetCleanName());
GetCleanName());
}
}
@ -1485,7 +1485,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
} else {
if(reg_focus > 0)
LogSpells("Spell [{}]: Reagent focus item failed to prevent reagent consumption ([{}] chance)", spell_id, reg_focus);
Client *c = this->CastToClient();
Client *c = CastToClient();
int component, component_count, inv_slot_id;
bool missingreags = false;
for(int t_count = 0; t_count < 4; t_count++) {
@ -2197,7 +2197,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
if(!spell_target_tot)
return false;
//Verfied from live - Target's Target needs to be in combat range to recieve the effect
if (!this->CombatRange(spell_target))
if (!CombatRange(spell_target))
return false;
spell_target = spell_target_tot;
@ -2421,7 +2421,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
#ifdef BOTS
if(IsBot()) {
bool StopLogic = false;
if(!this->CastToBot()->DoFinishedSpellSingleTarget(spell_id, spell_target, slot, StopLogic))
if(!CastToBot()->DoFinishedSpellSingleTarget(spell_id, spell_target, slot, StopLogic))
return false;
if(StopLogic)
break;
@ -2490,7 +2490,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
#ifdef BOTS
if(IsBot()) {
bool StopLogic = false;
if(!this->CastToBot()->DoFinishedSpellGroupTarget(spell_id, spell_target, slot, StopLogic))
if(!CastToBot()->DoFinishedSpellGroupTarget(spell_id, spell_target, slot, StopLogic))
return false;
if(StopLogic)
break;
@ -3293,7 +3293,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
LogSpells("Adding buff [{}] failed: stacking prevented by spell [{}] in slot [{}] with caster level [{}]",
spell_id, curbuf.spellid, buffslot, curbuf.casterlevel);
if (caster && caster->IsClient() && RuleB(Client, UseLiveBlockedMessage)) {
caster->Message(Chat::Red, "Your %s did not take hold on %s. (Blocked by %s.)", spells[spell_id].name, this->GetName(), spells[curbuf.spellid].name);
caster->Message(Chat::Red, "Your %s did not take hold on %s. (Blocked by %s.)", spells[spell_id].name, GetName(), spells[curbuf.spellid].name);
}
return -1;
}
@ -3732,7 +3732,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
const uint32 cnWTF = 0xFFFFFFFF + 1; //this should be zero unless on 64bit? forced uint64?
//Caster client pointers
pClient = this->CastToClient();
pClient = CastToClient();
pRaid = entity_list.GetRaidByClient(pClient);
pBasicGroup = entity_list.GetGroupByMob(this);
if(pRaid)
@ -4172,8 +4172,8 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster)
auto outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct));
Resurrect_Struct* rezz = (Resurrect_Struct*) outapp->pBuffer;
// Why are we truncating these names to 30 characters ?
memcpy(rezz->your_name,this->corpse_name,30);
memcpy(rezz->corpse_name,this->name,30);
memcpy(rezz->your_name,corpse_name,30);
memcpy(rezz->corpse_name,name,30);
memcpy(rezz->rezzer_name,Caster->GetName(),30);
rezz->zone_id = zone->GetZoneID();
rezz->instance_id = zone->GetInstanceID();
@ -5027,7 +5027,7 @@ int16 Mob::CalcResistChanceBonus()
int16 Mob::CalcFearResistChance()
{
int resistchance = spellbonuses.ResistFearChance + itembonuses.ResistFearChance;
if(this->IsClient()) {
if(IsClient()) {
resistchance += aabonuses.ResistFearChance;
if(aabonuses.Fearless == true)
resistchance = 100;
@ -5384,7 +5384,7 @@ void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client, bool def
// defer save if we're bulk saving elsewhere
if (!defer_save) {
database.SaveCharacterSpell(this->CharacterID(), spell_id, slot);
database.SaveCharacterSpell(CharacterID(), spell_id, slot);
}
LogSpells("Spell [{}] scribed into spell book slot [{}]", spell_id, slot);
@ -5448,7 +5448,7 @@ void Client::UntrainDisc(int slot, bool update_client, bool defer_save)
m_pp.disciplines.values[slot] = 0;
if (!defer_save) {
database.DeleteCharacterDisc(this->CharacterID(), slot);
database.DeleteCharacterDisc(CharacterID(), slot);
}
if (update_client) {
@ -6155,7 +6155,7 @@ void Client::SendSpellAnim(uint16 targetid, uint16 spell_id)
EQApplicationPacket app(OP_Action, sizeof(Action_Struct));
Action_Struct* a = (Action_Struct*)app.pBuffer;
a->target = targetid;
a->source = this->GetID();
a->source = GetID();
a->type = 231;
a->spell = spell_id;
a->hit_heading = GetHeading();

View File

@ -1070,8 +1070,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
spec->tradeskill,
spec->trivial,
chance,
this->GetZoneID(),
this->GetInstanceID()
GetZoneID(),
GetInstanceID()
).c_str()
);
}
@ -1079,8 +1079,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
/* QS: Player_Log_Trade_Skill_Events */
if (RuleB(QueryServ, PlayerLogTradeSkillEvents)) {
std::string event_desc = StringFormat("Success :: fashioned recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i", spec->recipe_id, spec->tradeskill, spec->trivial, chance, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Trade_Skill_Events, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Success :: fashioned recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i", spec->recipe_id, spec->tradeskill, spec->trivial, chance, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Trade_Skill_Events, CharacterID(), event_desc);
}
if (RuleB(TaskSystem, EnableTaskSystem)) {
@ -1101,16 +1101,16 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) {
MessageString(Chat::Emote,TRADESKILL_FAILED);
LogTradeskills("Tradeskill failed");
if (this->GetGroup())
if (GetGroup())
{
entity_list.MessageGroup(this, true, Chat::Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its");
entity_list.MessageGroup(this, true, Chat::Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),GetGender() == 0 ? "his" : GetGender() == 1 ? "her" : "its");
}
/* QS: Player_Log_Trade_Skill_Events */
if (RuleB(QueryServ, PlayerLogTradeSkillEvents)){
std::string event_desc = StringFormat("Failed :: recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i", spec->recipe_id, spec->tradeskill, spec->trivial, chance, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Trade_Skill_Events, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Failed :: recipe_id:%i tskillid:%i trivial:%i chance:%4.2f in zoneid:%i instid:%i", spec->recipe_id, spec->tradeskill, spec->trivial, chance, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Trade_Skill_Events, CharacterID(), event_desc);
}
itr = spec->onfail.begin();

View File

@ -249,7 +249,7 @@ void Trade::LogTrade()
bool comma = false;
// Log items offered by owner
cash = this->cp + this->sp + this->gp + this->pp;
cash = cp + sp + gp + pp;
if ((cash>0) || (item_count>0)) {
sprintf(logtext, "%s gave %s ", trader->GetName(), with->GetName());
@ -302,7 +302,7 @@ void Trade::DumpTrade()
{
Mob* with = With();
LogTrading("Dumping trade data: [{}] in TradeState [{}] with [{}]",
this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName()));
owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName()));
if (!owner->IsClient())
return;
@ -465,7 +465,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if(other) {
LogTrading("Finishing trade with client [{}]", other->GetName());
this->AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true);
AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true);
// step 0: pre-processing
// QS code
@ -474,20 +474,20 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
qs_log = true;
if (finalizer) {
qs_audit->char2_id = this->character_id;
qs_audit->char2_id = character_id;
qs_audit->char2_money.platinum = this->trade->pp;
qs_audit->char2_money.gold = this->trade->gp;
qs_audit->char2_money.silver = this->trade->sp;
qs_audit->char2_money.copper = this->trade->cp;
qs_audit->char2_money.platinum = trade->pp;
qs_audit->char2_money.gold = trade->gp;
qs_audit->char2_money.silver = trade->sp;
qs_audit->char2_money.copper = trade->cp;
}
else {
qs_audit->char1_id = this->character_id;
qs_audit->char1_id = character_id;
qs_audit->char1_money.platinum = this->trade->pp;
qs_audit->char1_money.gold = this->trade->gp;
qs_audit->char1_money.silver = this->trade->sp;
qs_audit->char1_money.copper = this->trade->cp;
qs_audit->char1_money.platinum = trade->pp;
qs_audit->char1_money.gold = trade->gp;
qs_audit->char1_money.silver = trade->sp;
qs_audit->char1_money.copper = trade->cp;
}
}
@ -508,7 +508,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if (qs_log) {
auto detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_id = character_id;
detail->from_slot = trade_slot;
detail->to_id = other->CharacterID();
detail->to_slot = free_slot;
@ -533,7 +533,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if (bag_inst) {
detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_id = character_id;
detail->from_slot = EQ::InventoryProfile::CalcSlotId(trade_slot, sub_slot);
detail->to_id = other->CharacterID();
detail->to_slot = EQ::InventoryProfile::CalcSlotId(free_slot, sub_slot);
@ -618,7 +618,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if (qs_log) {
auto detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_id = character_id;
detail->from_slot = trade_slot;
detail->to_id = other->CharacterID();
detail->to_slot = partial_slot;
@ -686,9 +686,9 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if (qs_log) {
auto detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_id = character_id;
detail->from_slot = trade_slot;
detail->to_id = this->character_id;
detail->to_id = character_id;
detail->to_slot = bias_slot;
detail->item_id = inst->GetID();
detail->charges = (old_charges - inst->GetCharges());
@ -726,7 +726,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if (qs_log) {
auto detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_id = character_id;
detail->from_slot = trade_slot;
detail->to_id = other->CharacterID();
detail->to_slot = free_slot;
@ -752,7 +752,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if (bag_inst) {
detail = new QSTradeItems_Struct;
detail->from_id = this->character_id;
detail->from_id = character_id;
detail->from_slot = trade_slot;
detail->to_id = other->CharacterID();
detail->to_slot = free_slot;
@ -947,7 +947,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
if(!tradingWith->IsMoving())
tradingWith->FaceTarget(this);
this->EVENT_ITEM_ScriptStopReturn();
EVENT_ITEM_ScriptStopReturn();
}
}
@ -1031,7 +1031,7 @@ void Client::Trader_ShowItems(){
auto outapp = new EQApplicationPacket(OP_Trader, sizeof(Trader_Struct));
Trader_Struct* outints = (Trader_Struct*)outapp->pBuffer;
Trader_Struct* TraderItems = database.LoadTraderItem(this->CharacterID());
Trader_Struct* TraderItems = database.LoadTraderItem(CharacterID());
for(int i = 0; i < 80; i++){
outints->ItemCost[i] = TraderItems->ItemCost[i];
@ -1091,7 +1091,7 @@ void Client::Trader_StartTrader() {
sis->Code = BazaarTrader_StartTraderMode;
sis->TraderID = this->GetID();
sis->TraderID = GetID();
QueuePacket(outapp);
@ -1106,7 +1106,7 @@ void Client::Trader_StartTrader() {
bts->Code = 1;
bts->ID = this->GetID();
bts->ID = GetID();
strn0cpy(bts->Name, GetName(), sizeof(bts->Name));
@ -1155,7 +1155,7 @@ void Client::Trader_EndTrader() {
}
}
database.DeleteTraderItem(this->CharacterID());
database.DeleteTraderItem(CharacterID());
// Notify other clients we are no longer in trader mode.
//
@ -1165,7 +1165,7 @@ void Client::Trader_EndTrader() {
bts->Code = 0;
bts->ID = this->GetID();
bts->ID = GetID();
strn0cpy(bts->Name, GetName(), sizeof(bts->Name));
@ -1188,7 +1188,7 @@ void Client::Trader_EndTrader() {
WithCustomer(0);
this->Trader = false;
Trader = false;
}
void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) {
@ -1269,12 +1269,12 @@ uint32 Client::FindTraderItemSerialNumber(int32 ItemID) {
EQ::ItemInstance* item = nullptr;
uint16 SlotID = 0;
for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
item = GetInv().GetItem(i);
if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){
for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = EQ::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
item = GetInv().GetItem(SlotID);
if (item) {
if (item->GetID() == ItemID)
return item->GetSerialNumber();
@ -1292,12 +1292,12 @@ EQ::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
EQ::ItemInstance* item = nullptr;
uint16 SlotID = 0;
for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++){
item = this->GetInv().GetItem(i);
item = GetInv().GetItem(i);
if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){
for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++) {
// we already have the parent bag and a contents iterator..why not just iterate the bag!??
SlotID = EQ::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
item = GetInv().GetItem(SlotID);
if(item) {
if(item->GetSerialNumber() == SerialNumber)
return item;
@ -1325,7 +1325,7 @@ GetItems_Struct* Client::GetTraderItems(){
for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++) {
if (ndx >= 80)
break;
item = this->GetInv().GetItem(i);
item = GetInv().GetItem(i);
if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){
for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++) {
if (ndx >= 80)
@ -1333,7 +1333,7 @@ GetItems_Struct* Client::GetTraderItems(){
SlotID = EQ::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
item = GetInv().GetItem(SlotID);
if(item){
gis->Items[ndx] = item->GetItem()->ID;
@ -1352,12 +1352,12 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
const EQ::ItemInstance* item= nullptr;
uint16 SlotID = 0;
for (int i = EQ::invslot::GENERAL_BEGIN; i <= EQ::invslot::GENERAL_END; i++) {
item = this->GetInv().GetItem(i);
item = GetInv().GetItem(i);
if (item && item->GetItem()->BagType == EQ::item::BagTypeTradersSatchel){
for (int x = EQ::invbag::SLOT_BEGIN; x <= EQ::invbag::SLOT_END; x++){
SlotID = EQ::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
item = GetInv().GetItem(SlotID);
if (item && item->GetSerialNumber() == SerialNumber &&
(item->GetCharges() >= Quantity || (item->GetCharges() <= 0 && Quantity == 1)))
@ -1368,7 +1368,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){
}
}
LogTrading("Could NOT find a match for Item: [{}] with a quantity of: [{}] on Trader: [{}]\n",
SerialNumber , Quantity, this->GetName());
SerialNumber , Quantity, GetName());
return 0;
}
@ -1382,7 +1382,7 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,int16 Quantity,Client* Cus
if(Quantity < Charges)
{
Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber);
Customer->SendSingleTraderItem(CharacterID(), SerialNumber);
m_inv.DeleteItem(Slot, Quantity);
}
else
@ -1432,7 +1432,7 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,int16 Quantity,Client* Cus
for(int i = 0; i < Quantity; i++) {
this->QueuePacket(outapp2);
QueuePacket(outapp2);
}
safe_delete(outapp2);
@ -1461,15 +1461,15 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, int16 Quantity, Client* C
if(SlotID > 0) {
item = this->GetInv().GetItem(SlotID);
item = GetInv().GetItem(SlotID);
if (!item)
{
LogTrading("Could not find Item: [{}] on Trader: [{}]", SerialNumber, Quantity, this->GetName());
LogTrading("Could not find Item: [{}] on Trader: [{}]", SerialNumber, Quantity, GetName());
return;
}
Charges = this->GetInv().GetItem(SlotID)->GetCharges();
Charges = GetInv().GetItem(SlotID)->GetCharges();
Stackable = item->IsStackable();
@ -1480,9 +1480,9 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, int16 Quantity, Client* C
if (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)
{
this->DeleteItemInInventory(SlotID, Quantity);
DeleteItemInInventory(SlotID, Quantity);
TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(this->CharacterID());
TraderCharges_Struct* TraderItems = database.LoadTraderItemWithCharges(CharacterID());
uint8 Count = 0;
@ -1492,7 +1492,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, int16 Quantity, Client* C
if(TestSlot && TraderItems->SerialNumber[i] == SerialNumber)
{
database.DeleteTraderItem(this->CharacterID(),i);
database.DeleteTraderItem(CharacterID(),i);
NukeTraderItem(SlotID, Charges, Quantity, Customer, TraderSlot, TraderItems->SerialNumber[i], TraderItems->ItemID[i]);
TestSlot=false;
}
@ -1510,7 +1510,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, int16 Quantity, Client* C
}
else
{
database.UpdateTraderItemCharges(this->CharacterID(), item->GetSerialNumber(), Charges-Quantity);
database.UpdateTraderItemCharges(CharacterID(), item->GetSerialNumber(), Charges-Quantity);
NukeTraderItem(SlotID, Charges, Quantity, Customer, TraderSlot, item->GetSerialNumber(), item->GetID());
@ -1519,7 +1519,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, int16 Quantity, Client* C
}
}
LogTrading("Could NOT find a match for Item: [{}] with a quantity of: [{}] on Trader: [{}]\n",SerialNumber,
Quantity,this->GetName());
Quantity,GetName());
}
void Client::ReturnTraderReq(const EQApplicationPacket* app, int16 TraderItemCharges, uint32 itemid){
@ -1553,7 +1553,7 @@ void Client::ReturnTraderReq(const EQApplicationPacket* app, int16 TraderItemCha
outtbs->Quantity = TraderItemCharges;
// This should probably be trader ID, not customer ID as it is below.
outtbs->TraderID = this->GetID();
outtbs->TraderID = GetID();
outtbs->AlreadySold = 0;
QueuePacket(outapp);
@ -1702,7 +1702,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
ReturnTraderReq(app, outtbs->Quantity, ItemID);
outtbs->TraderID = this->GetID();
outtbs->TraderID = GetID();
outtbs->Action = BazaarBuyItem;
strn0cpy(outtbs->ItemName, BuyItem->GetItem()->Name, 64);
@ -1998,7 +1998,7 @@ void Client::SendBazaarResults(
brds->Unknown008 = 0xFFFFFFFF;
brds->Unknown012 = 0xFFFFFFFF;
brds->Unknown016 = 0xFFFFFFFF;
this->QueuePacket(outapp2);
QueuePacket(outapp2);
safe_delete(outapp2);
return;
}
@ -2067,7 +2067,7 @@ void Client::SendBazaarResults(
memcpy(outapp->pBuffer, buffer, Size);
this->QueuePacket(outapp);
QueuePacket(outapp);
safe_delete(outapp);
safe_delete_array(buffer);
@ -2082,7 +2082,7 @@ void Client::SendBazaarResults(
brds->Unknown012 = 0xFFFFFFFF;
brds->Unknown016 = 0xFFFFFFFF;
this->QueuePacket(outapp2);
QueuePacket(outapp2);
safe_delete(outapp2);
}

View File

@ -843,7 +843,7 @@ int Mob::TuneNPCAttack(Mob* other, bool no_avoid, bool no_hit_chance, int hit_ch
OffHandAtk(false);
uint8 otherlevel = other->GetLevel();
uint8 mylevel = this->GetLevel();
uint8 mylevel = GetLevel();
otherlevel = otherlevel ? otherlevel : 1;
mylevel = mylevel ? mylevel : 1;

View File

@ -237,7 +237,7 @@ void NPC::MoveTo(const glm::vec4 &position, bool saveguardspot)
} //hack to make IsGuarding simpler
if (m_GuardPoint.w == -1)
m_GuardPoint.w = this->CalculateHeadingToTarget(position.x, position.y);
m_GuardPoint.w = CalculateHeadingToTarget(position.x, position.y);
LogAI("Setting guard position to [{}]", to_string(static_cast<glm::vec3>(m_GuardPoint)).c_str());
}
@ -632,7 +632,7 @@ void NPC::AssignWaypoints(int32 grid_id, int start_wp)
if (grid_id < 0) {
// Allow setting negative grid values for pausing pathing
this->CastToNPC()->SetGrid(grid_id);
CastToNPC()->SetGrid(grid_id);
return;
}
@ -767,9 +767,9 @@ float Mob::GetFixedZ(const glm::vec3 &destination, int32 z_find_offset) {
/*
* Any more than 5 in the offset makes NPC's hop/snap to ceiling in small corridors
*/
new_z = this->FindDestGroundZ(destination, z_find_offset);
new_z = FindDestGroundZ(destination, z_find_offset);
if (new_z != BEST_Z_INVALID) {
new_z += this->GetZOffset();
new_z += GetZOffset();
if (new_z < -2000) {
new_z = m_Position.z;
@ -779,7 +779,7 @@ float Mob::GetFixedZ(const glm::vec3 &destination, int32 z_find_offset) {
auto duration = timer.elapsed();
LogFixZ("Mob::GetFixedZ() ([{}]) returned [{}] at [{}], [{}], [{}] - Took [{}]",
this->GetCleanName(),
GetCleanName(),
new_z,
destination.x,
destination.y,
@ -811,17 +811,17 @@ void Mob::FixZ(int32 z_find_offset /*= 5*/, bool fix_client_z /*= false*/) {
if ((new_z > -2000) && new_z != BEST_Z_INVALID) {
if (RuleB(Map, MobZVisualDebug)) {
this->SendAppearanceEffect(78, 0, 0, 0, 0);
SendAppearanceEffect(78, 0, 0, 0, 0);
}
m_Position.z = new_z;
}
else {
if (RuleB(Map, MobZVisualDebug)) {
this->SendAppearanceEffect(103, 0, 0, 0, 0);
SendAppearanceEffect(103, 0, 0, 0, 0);
}
LogFixZ("[{}] is failing to find Z [{}]", this->GetCleanName(), std::abs(m_Position.z - new_z));
LogFixZ("[{}] is failing to find Z [{}]", GetCleanName(), std::abs(m_Position.z - new_z));
}
}

View File

@ -1560,7 +1560,7 @@ bool Zone::Process() {
if(Weather_Timer->Check())
{
Weather_Timer->Disable();
this->ChangeWeather();
ChangeWeather();
}
if(qGlobals)
@ -1690,7 +1690,7 @@ void Zone::ChangeWeather()
else
{
LogDebug("The weather for zone: [{}] has changed. Old weather was = [{}]. New weather is = [{}] The next check will be in [{}] seconds. Rain chance: [{}], Rain duration: [{}], Snow chance [{}], Snow duration: [{}]", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration);
this->weatherSend();
weatherSend();
if (zone->weather_intensity == 0)
{
zone->zone_weather = 0;

View File

@ -442,15 +442,15 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc
/* QS: PlayerLogZone */
if (RuleB(QueryServ, PlayerLogZone)){
std::string event_desc = StringFormat("Zoning :: zoneid:%u instid:%u x:%4.2f y:%4.2f z:%4.2f h:%4.2f zonemode:%d from zoneid:%u instid:%i", zone_id, instance_id, dest_x, dest_y, dest_z, dest_h, zone_mode, this->GetZoneID(), this->GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Zoning, this->CharacterID(), event_desc);
std::string event_desc = StringFormat("Zoning :: zoneid:%u instid:%u x:%4.2f y:%4.2f z:%4.2f h:%4.2f zonemode:%d from zoneid:%u instid:%i", zone_id, instance_id, dest_x, dest_y, dest_z, dest_h, zone_mode, GetZoneID(), GetInstanceID());
QServ->PlayerLogEvent(Player_Log_Zoning, CharacterID(), event_desc);
}
/* Dont clear aggro until the zone is successful */
entity_list.RemoveFromHateLists(this);
if(this->GetPet())
entity_list.RemoveFromHateLists(this->GetPet());
if(GetPet())
entity_list.RemoveFromHateLists(GetPet());
if (GetPendingExpeditionInviteID() != 0)
{
@ -810,9 +810,9 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
// 76 is orignial Plane of Hate
// WildcardX 27 January 2008. Tested this for 6.2 and Titanium clients.
if(this->GetZoneID() == 1)
if(GetZoneID() == 1)
gmg->zone_id = 2;
else if(this->GetZoneID() == 2)
else if(GetZoneID() == 2)
gmg->zone_id = 1;
else
gmg->zone_id = 1;
@ -886,9 +886,9 @@ void Client::GoToSafeCoords(uint16 zone_id, uint16 instance_id) {
void Mob::Gate(uint8 bind_number) {
GoToBind(bind_number);
if (RuleB(NPC, NPCHealOnGate) && this->IsNPC() && this->GetHPRatio() <= RuleR(NPC, NPCHealOnGateAmount)) {
if (RuleB(NPC, NPCHealOnGate) && IsNPC() && GetHPRatio() <= RuleR(NPC, NPCHealOnGateAmount)) {
auto HealAmount = (RuleR(NPC, NPCHealOnGateAmount) / 100);
SetHP(int(this->GetMaxHP() * HealAmount));
SetHP(int(GetMaxHP() * HealAmount));
}
}
@ -920,7 +920,7 @@ void Client::SetBindPoint(int bind_number, int to_zone, int to_instance, const g
m_pp.binds[bind_number].y = location.y;
m_pp.binds[bind_number].z = location.z;
}
database.SaveCharacterBindPoint(this->CharacterID(), m_pp.binds[bind_number], bind_number);
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[bind_number], bind_number);
}
void Client::SetBindPoint2(int bind_number, int to_zone, int to_instance, const glm::vec4 &location)
@ -943,7 +943,7 @@ void Client::SetBindPoint2(int bind_number, int to_zone, int to_instance, const
m_pp.binds[bind_number].z = location.z;
m_pp.binds[bind_number].heading = location.w;
}
database.SaveCharacterBindPoint(this->CharacterID(), m_pp.binds[bind_number], bind_number);
database.SaveCharacterBindPoint(CharacterID(), m_pp.binds[bind_number], bind_number);
}
void Client::GoToBind(uint8 bind_number) {