diff --git a/common/base_packet.cpp b/common/base_packet.cpp index 50f9b84f9..67f8f9034 100644 --- a/common/base_packet.cpp +++ b/common/base_packet.cpp @@ -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); } } } diff --git a/common/item_instance.cpp b/common/item_instance.cpp index cd6d17712..5bd685bf2 100644 --- a/common/item_instance.cpp +++ b/common/item_instance.cpp @@ -214,7 +214,7 @@ EQ::ItemInstance::~ItemInstance() bool EQ::ItemInstance::IsType(item::ItemClass item_class) const { // IsType() does not protect against 'm_item = nullptr' - + // Check usage type if ((m_use_type == ItemInstWorldContainer) && (item_class == item::ItemClassBag)) return true; @@ -245,7 +245,7 @@ bool EQ::ItemInstance::IsStackable() const { if (!m_item) return false; - + return m_item->Stackable; } @@ -253,7 +253,7 @@ bool EQ::ItemInstance::IsCharged() const { if (!m_item) return false; - + if (m_item->MaxCharges > 1) return true; else @@ -381,7 +381,7 @@ EQ::ItemInstance* EQ::ItemInstance::PopItem(uint8 index) m_contents.erase(index); return inst; // Return pointer that needs to be deleted (or otherwise managed) } - + return nullptr; } @@ -476,7 +476,7 @@ uint8 EQ::ItemInstance::GetTotalItemCount() const { if (!m_item) return 0; - + uint8 item_count = 1; if (m_item && !m_item->IsClassBag()) { return item_count; } @@ -526,7 +526,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugty { continue; } - return this->GetAugment(i); + return GetAugment(i); } } @@ -549,7 +549,7 @@ uint32 EQ::ItemInstance::GetOrnamentHeroModel(int32 material_slot) const { bool EQ::ItemInstance::UpdateOrnamentationInfo() { if (!m_item || !m_item->IsClassCommon()) return false; - + bool ornamentSet = false; int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType); @@ -642,7 +642,7 @@ void EQ::ItemInstance::PutAugment(uint8 slot, const ItemInstance& augment) { if (!m_item || !m_item->IsClassCommon()) return; - + PutItem(slot, augment); } @@ -655,7 +655,7 @@ void EQ::ItemInstance::PutAugment(SharedDatabase *db, uint8 slot, uint32 item_id if (aug) { PutAugment(slot, *aug); safe_delete(aug); - } + } } // Remove augment from item and destroy it @@ -663,7 +663,7 @@ void EQ::ItemInstance::DeleteAugment(uint8 index) { if (!m_item || !m_item->IsClassCommon()) return; - + DeleteItem(index); } @@ -672,7 +672,7 @@ EQ::ItemInstance* EQ::ItemInstance::RemoveAugment(uint8 index) { if (!m_item || !m_item->IsClassCommon()) return nullptr; - + return PopItem(index); } @@ -680,7 +680,7 @@ bool EQ::ItemInstance::IsAugmented() { if (!m_item || !m_item->IsClassCommon()) return false; - + for (int index = invaug::SOCKET_BEGIN; index <= invaug::SOCKET_END; ++index) { if (GetAugmentItemID(index)) return true; @@ -698,7 +698,7 @@ bool EQ::ItemInstance::ContainsAugmentByID(uint32 item_id) if (!item_id) { return false; } - + for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) { if (GetAugmentItemID(augment_slot) == item_id) { return true; @@ -718,7 +718,7 @@ int EQ::ItemInstance::CountAugmentByID(uint32 item_id) if (!item_id) { return quantity; } - + for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) { if (GetAugmentItemID(augment_slot) == item_id) { quantity++; @@ -873,7 +873,7 @@ bool EQ::ItemInstance::IsDroppable(bool recurse) const return false; } } - + return true; } @@ -1745,4 +1745,4 @@ EvolveInfo::EvolveInfo(uint32 first, uint8 max, bool allkills, uint32 L2, uint32 EvolveInfo::~EvolveInfo() { -} \ No newline at end of file +} diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 4c6063042..d5b7332d5 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -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); @@ -309,7 +309,7 @@ bool RuleManager::LoadRules(Database *database, const char *ruleset_name, bool r } void RuleManager::SaveRules(Database *database, const char *ruleset_name) { - + if (ruleset_name != nullptr) { //saving to a specific name if (m_activeName != ruleset_name) { @@ -347,7 +347,7 @@ void RuleManager::_SaveRule(Database *database, RuleType type, uint16 index) { return; if (type == BoolRule && strcasecmp(_GetRuleName(type, index), "World:UseClientBasedExpansionSettings") == 0) return; - + switch (type) { case IntRule: sprintf(value_string, "%d", m_RuleIntValues[index]); @@ -432,7 +432,7 @@ bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bo // build injected entries for (const auto &rd_iter : rule_data) { - + const auto &dd_iter = std::find(database_data.begin(), database_data.end(), rd_iter.first); if (dd_iter == database_data.end()) { @@ -440,7 +440,7 @@ bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bo std::tuple( ruleset_id, // `ruleset_id` rd_iter.first, // `rule_name` - rd_iter.second.first, // `rule_value` + rd_iter.second.first, // `rule_value` EscapeString(*rd_iter.second.second) // `notes` ) ); @@ -481,7 +481,7 @@ bool RuleManager::UpdateInjectedRules(Database *db, const char *ruleset_name, bo ruleset_id ); } - + return true; } @@ -509,7 +509,7 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) // build orphaned entries for (auto row : results) { - + const auto &rd_iter = std::find(rule_data.begin(), rule_data.end(), row[0]); if (rd_iter == rule_data.end()) { @@ -539,7 +539,7 @@ bool RuleManager::UpdateOrphanedRules(Database *db, bool quiet_update) LogInfo("[{}] Orphaned Rule(s) Deleted from [All Rulesets] (-1)", orphaned_rule_entries.size()); } - + return true; } @@ -586,7 +586,7 @@ bool RuleManager::RestoreRuleNotes(Database *db) if (!db->QueryDatabase(query).Success()) { continue; } - + ++update_count; } diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index ff7271832..df2a50c24 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -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() diff --git a/world/adventure.cpp b/world/adventure.cpp index d2b316b3c..d7874ad87 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -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) { diff --git a/world/client.cpp b/world/client.cpp index 7013b790b..f471200c2 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -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(); } } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index 68252c802..0003e70f1 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -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); } } diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 1513cb2df..7f7011987 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -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) { @@ -1125,7 +1125,7 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, - 0, + 0, AccountStatus::Player, Chat::NPCQuestSay, output.c_str() @@ -1160,7 +1160,7 @@ void ClientList::ConsoleSendWhoAll(const char* to, int16 admin, Who_All_Struct* auto output = fmt::to_string(out); connection->SendEmoteMessageRaw( to, - 0, + 0, AccountStatus::Player, Chat::NPCQuestSay, output.c_str() @@ -1414,7 +1414,7 @@ void ClientList::SendClientVersionSummary(const char *Name) Chat::White, fmt::format( "There {} {} Titanium, {} SoF, {} SoD, {} UF, {} RoF, and {} RoF2 Client{} currently connected for a total of {} Client{} and {} Unique IP{} connected.", - (total_clients != 1 ? "are" : "is"), + (total_clients != 1 ? "are" : "is"), client_count[EQ::versions::ClientVersion::Titanium], client_count[EQ::versions::ClientVersion::SoF], client_count[EQ::versions::ClientVersion::SoD], diff --git a/world/console.old.cpp b/world/console.old.cpp index 0bc08899c..49e14f68e 100644 --- a/world/console.old.cpp +++ b/world/console.old.cpp @@ -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; } diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index c79190b9e..9e74d1b54 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -84,7 +84,7 @@ ZoneServer::ZoneServer(std::shared_ptr 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; diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 8d091140b..bd1f91426 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -76,7 +76,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo if(owner) { faction_id = owner->GetPrimaryFaction(); } - + std::string faction_name = ( faction_id > 0 ? content_db.GetFactionName(faction_id) : @@ -147,7 +147,7 @@ void EntityList::DescribeAggro(Client *towho, NPC *from_who, float d, bool verbo } } -void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { +void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { //this logic is duplicated from below, try to keep it up to date. float aggro_range = GetAggroRange(); float x_range = std::abs(mob->GetX() - GetX()); @@ -356,7 +356,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { mob->GetPrimaryFaction() != GetPrimaryFaction() && mob->GetPrimaryFaction() == -4 && !GetOwner() - ) + ) ) ) { towho->Message( @@ -413,7 +413,7 @@ bool Mob::CheckWillAggro(Mob *mob) { return false; } } - + // We don't want to aggro clients outside of water if we're water only. if ( mob->IsClient() && @@ -442,7 +442,7 @@ bool Mob::CheckWillAggro(Mob *mob) { ) { return false; } - + if (IsNPC() && mob->IsNPC() && mob->GetSpecialAbility(IMMUNE_AGGRO_NPC)) { return false; } @@ -453,7 +453,7 @@ bool Mob::CheckWillAggro(Mob *mob) { // Check if it's not a Interactive NPC // Trumpcard: The 1st 3 checks are low cost calcs to filter out unnessecary distance checks. Leave them at the beginning, they are the most likely occurence. // Image: I moved this up by itself above faction and distance checks because if one of these return true, theres no reason to go through the other information - + float aggro_range = GetAggroRange(); float x_range = std::abs(mob->GetX() - GetX()); float y_range = std::abs(mob->GetY() - GetY()); @@ -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; } diff --git a/zone/attack.cpp b/zone/attack.cpp index 8a610e3fc..6eff80ded 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -149,7 +149,7 @@ EQ::skills::SkillType Mob::AttackAnimation(int Hand, const EQ::ItemInstance* wea SetDualWieldingSameDelayWeapons(3); } } - + //If both weapons have same delay this allows a chance for DW animation if (GetDualWieldingSameDelayWeapons() && Hand == EQ::invslot::slotPrimary) { @@ -1395,7 +1395,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts, boo FromRiposte = false; } - // check to see if we hit.. + // check to see if we hit.. if (!FromRiposte && other->AvoidDamage(this, hit)) { int strike_through = itembonuses.StrikeThrough + spellbonuses.StrikeThrough + aabonuses.StrikeThrough; if (strike_through && zone->random.Roll(strike_through)) { @@ -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); } } @@ -3380,7 +3380,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi // Reduce damage by the Spell Shielding first so that the runes don't take the raw damage. int total_spellshielding = itembonuses.SpellShield + itembonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] + aabonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT]; damage -= (damage * total_spellshielding / 100); - + //Only mitigate if damage is above the minimium specified. if (spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT]) { slot = spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT]; @@ -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); } @@ -4232,7 +4232,7 @@ void Mob::TryDefensiveProc(Mob *on, uint16 hand) { int32 aa_spell_id = aabonuses.DefensiveProc[i + SBIndex::COMBAT_PROC_SPELL_ID]; int32 aa_proc_chance = 100 + aabonuses.DefensiveProc[i + SBIndex::COMBAT_PROC_RATE_MOD]; uint32 aa_proc_reuse_timer = aabonuses.DefensiveProc[i + SBIndex::COMBAT_PROC_REUSE_TIMER]; - + if (aa_rank_id) { if (!IsProcLimitTimerActive(-aa_rank_id, aa_proc_reuse_timer, ProcType::DEFENSIVE_PROC)) { float chance = ProcChance * (static_cast(aa_proc_chance) / 100.0f); @@ -4508,7 +4508,7 @@ void Mob::TrySpellProc(const EQ::ItemInstance *inst, const EQ::ItemData *weapon, aa_proc_reuse_timer = aabonuses.RangedProc[i + SBIndex::COMBAT_PROC_RATE_MOD]; proc_type = ProcType::RANGED_PROC; } - + if (aa_rank_id) { passed_skill_limit_check = PassLimitToSkill(skillinuse, 0, proc_type, aa_rank_id); @@ -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 @@ -5180,7 +5180,7 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b proc_spell_id = spells[base_spell_id].base_value[i]; ProcMod = static_cast(spells[base_spell_id].limit_value[i]); } - + else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) { if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) { float final_chance = chance * (ProcMod / 100.0f); @@ -5330,7 +5330,7 @@ float Mob::GetSkillProcChances(uint16 ReuseTime, uint16 hand) { } void Mob::TryCastOnSkillUse(Mob *on, EQ::skills::SkillType skill) { - + if (!spellbonuses.HasSkillAttackProc[skill] && !itembonuses.HasSkillAttackProc[skill] && !aabonuses.HasSkillAttackProc[skill]) { return; } diff --git a/zone/beacon.cpp b/zone/beacon.cpp index 1563b151b..c9eb703fd 100644 --- a/zone/beacon.cpp +++ b/zone/beacon.cpp @@ -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) { diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 9de70a76d..4d212a4f2 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -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(0.025f * this->GetWalkspeed()); + float get_walk_speed = static_cast(0.025f * GetWalkspeed()); rooted = FindType(SE_Root); } @@ -1118,7 +1118,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_Proc_Timer_Modifier: { /* - AA can multiples of this in a single effect, proc should use the timer + AA can multiples of this in a single effect, proc should use the timer that comes after the respective proc spell effect, thus rank.id will be already set when this is checked. */ @@ -1220,7 +1220,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) newbon->SkillAttackProc[i + SBIndex::SKILLATK_PROC_SPELL_ID] = rank.spell; // spell to proc newbon->SkillAttackProc[i + SBIndex::SKILLATK_PROC_CHANCE] = base_value; // Chance base 1000 = 100% proc rate newbon->SkillAttackProc[i + SBIndex::SKILLATK_PROC_SKILL] = limit_value; // Skill to Proc Offr - + if (limit_value < EQ::skills::HIGHEST_SKILL) { newbon->HasSkillAttackProc[limit_value] = true; //check first before looking for any effects. } @@ -1341,7 +1341,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) } case SE_MitigateDamageShield: { - + //AA that increase mitigation are set to negative. if (base_value < 0) { base_value = base_value * (-1); @@ -1736,7 +1736,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; } - case SE_ExtendedShielding: + case SE_ExtendedShielding: { if (newbon->ExtendedShielding < base_value) { newbon->ExtendedShielding = base_value; @@ -1744,7 +1744,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) break; } - case SE_ShieldDuration: + case SE_ShieldDuration: { if (newbon->ShieldDuration < base_value) { newbon->ShieldDuration = base_value; @@ -1762,7 +1762,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) newbon->SecondaryForte = base_value; } break; - + case SE_ZoneSuspendMinion: newbon->ZoneSuspendMinion = base_value; break; @@ -3610,7 +3610,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->SkillAttackProc[i + SBIndex::SKILLATK_PROC_SPELL_ID] = max_value; // spell to proc new_bonus->SkillAttackProc[i + SBIndex::SKILLATK_PROC_CHANCE] = effect_value; // Chance base 1000 = 100% proc rate new_bonus->SkillAttackProc[i + SBIndex::SKILLATK_PROC_SKILL] = limit_value; // Skill to Proc Offr - + if (limit_value < EQ::skills::HIGHEST_SKILL) { new_bonus->HasSkillAttackProc[limit_value] = true; //check first before looking for any effects. } @@ -3808,7 +3808,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne if (spells[new_bonus->WeaponStance[limit_value]].rank < spells[effect_value].rank) { //If so, check if any new spellids with higher rank exist (live spells for this are ranked). new_bonus->WeaponStance[limit_value] = effect_value; //Overwrite with new effect SetWeaponStanceEnabled(true); - + if (WornType) { weaponstance.itembonus_enabled = true; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 900657a39..2f7c409b1 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -31,13 +31,13 @@ extern volatile bool is_zone_loaded; // This constructor is used during the bot create command Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1) { 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,19 +116,19 @@ 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)); } // This constructor is used when the bot is loaded out of the database -Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType *npcTypeData) +Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType *npcTypeData) : NPC(npcTypeData, nullptr, glm::vec4(), Ground, false), rest_timer(1), ping_timer(1) { 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) @@ -209,7 +209,7 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to if (!database.botdb.LoadGuildMembership(GetBotID(), _guildId, _guildRank, _guildName) && bot_owner) bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadGuildMembership(), GetCleanName()); - + std::string error_message; EquipBot(&error_message); @@ -384,7 +384,7 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to } } - + } else { bot_owner->Message(Chat::Red, "&s for '%s'", BotDatabase::fail::LoadBuffs(), GetCleanName()); @@ -407,7 +407,7 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to GetRace() == DWARF || GetRace() == TROLL || GetRace() == OGRE - ) ? + ) ? RuleI(Bots, OldResurrectionSicknessSpell) : RuleI(Bots, ResurrectionSicknessSpell) ); @@ -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,12 +1665,12 @@ 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; } void Bot::LoadAAs() { - + aa_ranks.clear(); int id = 0; @@ -1689,7 +1689,7 @@ void Bot::LoadAAs() { points = 0; AA::Rank *current = ability->first; - + if (current->level_req > GetLevel()) { ++iter; continue; @@ -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); } @@ -1740,7 +1740,7 @@ bool Bot::IsValidName(std::string& name) return false; if (!isupper(name[0])) return false; - + for (int i = 1; i < name.length(); ++i) { if ((!RuleB(Bots, AllowCamelCaseNames) && !islower(name[i])) && name[i] != '_') { return false; @@ -1772,7 +1772,7 @@ bool Bot::Save() return false; } } - + // All of these continue to process if any fail if (!database.botdb.SaveBuffs(this)) bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveBuffs(), GetCleanName()); @@ -1780,10 +1780,10 @@ bool Bot::Save() bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveTimers(), GetCleanName()); if (!database.botdb.SaveStance(this)) bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveStance(), GetCleanName()); - + if (!SavePet()) bot_owner->Message(Chat::Red, "Failed to save pet for '%s'", GetCleanName()); - + return true; } @@ -1887,7 +1887,7 @@ bool Bot::LoadPet() } } } - + std::string error_message; uint32 pet_index = 0; @@ -1948,7 +1948,7 @@ bool Bot::SavePet() { if (!GetPet() || GetPet()->IsFamiliar()) // dead? return true; - + NPC *pet_inst = GetPet()->CastToNPC(); if (!pet_inst->GetPetSpellID() || !IsValidSpell(pet_inst->GetPetSpellID())) return false; @@ -1964,9 +1964,9 @@ bool Bot::SavePet() memset(pet_name, 0, 64); memset(pet_buffs, 0, (sizeof(SpellBuff_Struct) * PET_BUFF_COUNT)); memset(pet_items, 0, (sizeof(uint32) * EQ::invslot::EQUIPMENT_COUNT)); - + pet_inst->GetPetState(pet_buffs, pet_items, pet_name); - + std::string pet_name_str = pet_name; safe_delete_array(pet_name); @@ -1976,7 +1976,7 @@ bool Bot::SavePet() bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::SavePetStats(), GetCleanName()); return false; } - + if (!database.botdb.SavePetBuffs(GetBotID(), pet_buffs)) bot_owner->Message(Chat::Red, "%s for %s's pet", BotDatabase::fail::SavePetBuffs(), GetCleanName()); if (!database.botdb.SavePetItems(GetBotID(), pet_items)) @@ -1990,7 +1990,7 @@ bool Bot::DeletePet() auto bot_owner = GetBotOwner(); if (!bot_owner) return false; - + std::string error_message; if (!database.botdb.DeletePetItems(GetBotID())) { @@ -2433,7 +2433,7 @@ void Bot::AI_Process() ) { InterruptSpell(); } - + return; } } @@ -2532,7 +2532,7 @@ void Bot::AI_Process() SetPullingFlag(); bot_owner->SetBotPulling(); if (HasPet() && (GetClass() != ENCHANTER || GetPet()->GetPetType() != petAnimation || GetAA(aaAnimationEmpathy) >= 1)) { - + GetPet()->WipeHateList(); GetPet()->SetTarget(nullptr); m_previous_pet_order = GetPet()->GetPetOrder(); @@ -2547,7 +2547,7 @@ void Bot::AI_Process() //#pragma region ALT COMBAT (ACQUIRE HATE) else if (bo_alt_combat && m_alt_combat_hate_timer.Check(false)) { // 'Alt Combat' gives some more 'control' options on how bots process aggro - + // Empty hate list - let's find some aggro if (!IsEngaged() && NOT_HOLDING && NOT_PASSIVE && (!bot_owner->GetBotPulling() || NOT_PULLING_BOT)) { @@ -2745,7 +2745,7 @@ void Bot::AI_Process() Mob* tar = GetTarget(); // We should have a target..if not, we're awaiting new orders if (!tar || PASSIVE) { - + SetTarget(nullptr); WipeHateList(); SetAttackFlag(false); @@ -3026,7 +3026,7 @@ void Bot::AI_Process() // We can fight if (atCombatRange) { - + //if (IsMoving() || GetCombatJitterFlag()) { // StopMoving() needs to be called so that the jitter timer can be reset if (IsMoving()) { @@ -3373,7 +3373,7 @@ void Bot::AI_Process() // This is a mob that is fleeing either because it has been feared or is low on hitpoints AI_PursueCastCheck(); // This appears to always return true..can't trust for success/fail - + return; } } // End not in combat range @@ -3393,7 +3393,7 @@ void Bot::AI_Process() } } else { // Out-of-combat behavior - + SetAttackFlag(false); SetAttackingFlag(false); if (!bot_owner->GetBotPulling()) { @@ -3413,7 +3413,7 @@ void Bot::AI_Process() m_auto_defend_timer.Start(zone->random.Int(250, 1250)); // random timer to simulate 'awareness' (cuts down on scanning overhead) return; } - + if (m_auto_defend_timer.Check() && bot_owner->GetAggroCount()) { if (NOT_HOLDING && NOT_PASSIVE) { @@ -3455,7 +3455,7 @@ void Bot::AI_Process() } //#pragma endregion - + SetTarget(nullptr); if (HasPet() && (GetClass() != ENCHANTER || GetPet()->GetPetType() != petAnimation || GetAA(aaAnimationEmpathy) >= 1)) { @@ -3469,7 +3469,7 @@ void Bot::AI_Process() } //#pragma region OK TO IDLE - + // Ok to idle if ((NOT_GUARDING && fm_distance <= GetFollowDistance()) || (GUARDING && DistanceSquared(GetPosition(), GetGuardPoint()) <= GetFollowDistance())) { @@ -3566,9 +3566,9 @@ void Bot::AI_Process() 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) { @@ -3967,10 +3967,10 @@ Bot* Bot::LoadBot(uint32 botID) Bot* loaded_bot = nullptr; if (!botID) return loaded_bot; - + if (!database.botdb.LoadBot(botID, loaded_bot)) // TODO: Consider update to message handler return loaded_bot; - + return loaded_bot; } @@ -3987,7 +3987,7 @@ void Bot::LoadAndSpawnAllZonedBots(Client* botOwner) { botOwner->Message(Chat::Red, "%s", BotDatabase::fail::LoadGroupedBotsByGroupID()); return; } - + if(!ActiveBots.empty()) { for(std::list::iterator itr = ActiveBots.begin(); itr != ActiveBots.end(); ++itr) { Bot* activeBot = Bot::LoadBot(*itr); @@ -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) { @@ -4216,7 +4216,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli int16 toBotSlot; int adjustStackSize; std::string acceptedItemName; - + ClientTrade(const ItemInstance* item, int16 from, const char* name = "") : tradeItemInstance(item), fromClientSlot(from), toBotSlot(invslot::SLOT_INVALID), adjustStackSize(0), acceptedItemName(name) { } }; @@ -4226,7 +4226,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli int16 toClientSlot; int adjustStackSize; std::string failedItemName; - + ClientReturn(const ItemInstance* item, int16 from, const char* name = "") : returnItemInstance(item), fromBotSlot(from), toClientSlot(invslot::SLOT_INVALID), adjustStackSize(0), failedItemName(name) { } }; @@ -4240,7 +4240,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli }; enum { stageStackable = 0, stageEmpty, stageReplaceable }; - + if (!client) { Emote("NO CLIENT"); return; @@ -4331,7 +4331,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli continue; if (!check_iterator.tradeItemInstance->GetItem()->LoreFlag) continue; - + if ((trade_iterator.tradeItemInstance->GetItem()->LoreGroup == -1) && (check_iterator.tradeItemInstance->GetItem()->ID == trade_iterator.tradeItemInstance->GetItem()->ID)) { // TODO: add logging client->Message(Chat::Red, "Trade hack detected - Trade Canceled."); @@ -4440,7 +4440,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli } ++trade_iterator; } - + // out-going return checks for client for (auto& return_iterator : client_return) { auto return_instance = return_iterator.returnItemInstance; @@ -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; } @@ -4725,7 +4725,7 @@ void Bot::AddToHateList(Mob* other, uint32 hate, int32 damage, bool iYellForHelp Mob::AddToHateList(other, hate, damage, iYellForHelp, bFrenzy, iBuffTic, pet_command); } -bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) { +bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, bool IsFromSpell, ExtraAttackOptions *opts) { if (!other) { SetTarget(nullptr); LogError("A null Mob object was passed to Bot::Attack for evaluation!"); @@ -4745,11 +4745,11 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b SetTarget(other); // takes more to compare a call result, load for a call, load a compare to address and compare, and finally // push a value to an address than to just load for a call and push a value to an address. - + 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); @@ -6100,7 +6100,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { } if(ka_time){ - + switch(GetClass()){ case SHADOWKNIGHT: { CastSpell(SPELL_NPC_HARM_TOUCH, target->GetID()); @@ -6137,7 +6137,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { switch (GetClass()) { case MONK: { int reuse = (MonkSpecialAttack(target, EQ::skills::SkillTigerClaw) - 1); - + // Live AA - Technique of Master Wu int wuchance = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack; @@ -6300,7 +6300,7 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) { skill_to_use == EQ::skills::SkillRoundKick ) { reuse = (MonkSpecialAttack(target, skill_to_use) - 1); - + // Live AA - Technique of Master Wu int wuchance = itembonuses.DoubleSpecialAttack + spellbonuses.DoubleSpecialAttack + aabonuses.DoubleSpecialAttack; @@ -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; } @@ -6506,7 +6506,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { guildOfficer->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveGuildMembership(), botToGuild->GetCleanName()); return; } - + ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guildOfficer->GuildID(); @@ -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; @@ -7143,7 +7143,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot s } Result = Mob::CastSpell(spell_id, target_id, slot, cast_time, mana_cost, oSpellWillFinish, item_slot, 0xFFFFFFFF, 0, resist_adjust, aa_id); - + } return Result; } @@ -8164,7 +8164,7 @@ void Bot::UpdateGroupCastingRoles(const Group* group, bool disband) { if (!group) return; - + for (auto iter : group->members) { if (!iter) continue; @@ -8201,7 +8201,7 @@ void Bot::UpdateGroupCastingRoles(const Group* group, bool disband) default: healer = iter; } - + break; case DRUID: if (!healer) @@ -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& 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) { @@ -9497,7 +9497,7 @@ bool Bot::GetNeedsHateRedux(Mob *tar) { // TODO: Still awaiting bot spell rework.. if (!tar || !tar->IsEngaged() || !tar->HasTargetReflection() || !tar->GetTarget()->IsNPC()) return false; - + //if (tar->IsClient()) { // switch (tar->GetClass()) { // // TODO: figure out affectable classes.. @@ -9590,7 +9590,7 @@ bool Bot::UseDiscipline(uint32 spell_id, uint32 target) { if(spells[spell_id].timer_id > 0 && spells[spell_id].timer_id < MAX_DISCIPLINE_TIMERS) SetDisciplineRecastTimer(spells[spell_id].timer_id, spell.recast_time); } else { - uint32 remaining_time = (GetDisciplineRemainingTime(this, spells[spell_id].timer_id) / 1000); + uint32 remaining_time = (GetDisciplineRemainingTime(this, spells[spell_id].timer_id) / 1000); GetOwner()->Message( Chat::White, fmt::format( @@ -9617,7 +9617,7 @@ bool Bot::CreateHealRotation(uint32 interval_ms, bool fast_heals, bool adaptive_ return false; if (!IsHealRotationMemberClass(GetClass())) return false; - + m_member_of_heal_rotation = std::make_shared(this, interval_ms, fast_heals, adaptive_targeting, casting_override); return IsHealRotationMember(); @@ -9670,7 +9670,7 @@ bool Bot::UseHealRotationFastHeals() { if (!IsHealRotationMember()) return false; - + return m_member_of_heal_rotation->FastHeals(); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 22eb103c5..2653af032 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -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; } @@ -622,7 +622,7 @@ bool Bot::AICastSpell(Mob* tar, uint8 iChance, uint32 iSpellTypes) { break; } } - else if(botClass == BARD) { + else if(botClass == BARD) { if (tar->DontBuffMeBefore() < Timer::GetCurrentTime()) { std::list inCombatBuffList = GetBotSpellsBySpellType(this, SpellType_InCombatBuff); @@ -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; iCheck(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. @@ -1265,7 +1265,7 @@ bool Bot::AI_IdleCastCheck() { } } } - + result = true; break; } diff --git a/zone/client.cpp b/zone/client.cpp index 6dd8c31c5..556fc02fd 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -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){ @@ -2461,7 +2461,7 @@ bool Client::CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who, return false; if (skillid > EQ::skills::HIGHEST_SKILL) return false; - int skillval = GetRawSkill(skillid); + int skillval = GetRawSkill(skillid); int maxskill = GetMaxSkillAfterSpecializationRules(skillid, MaxSkill(skillid)); std::string export_string = fmt::format( "{} {}", @@ -2486,7 +2486,7 @@ bool Client::CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who, // Make sure we're not already at skill cap if (skillval < maxskill) { - double Chance = 0; + double Chance = 0; if (RuleI(Character, SkillUpMaximumChancePercentage) + chancemodi - RuleI(Character, SkillUpMinimumChancePercentage) <= RuleI(Character, SkillUpMinimumChancePercentage)) { Chance = RuleI(Character, SkillUpMinimumChancePercentage); } @@ -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; } @@ -5425,10 +5425,10 @@ void Client::ShowSkillsWindow() // Row End popup_text += ""; } - + // Table End popup_text += ""; - + SendPopupToClient( "Skills", popup_text.c_str() @@ -6335,7 +6335,7 @@ void Client::NPCSpawn(NPC *target_npc, const char *identifier, uint32 extra) this, target_npc->CastToNPC(), extra - ); + ); } else if (is_delete || is_remove || is_update) { uint8 spawn_update_type = ( is_delete ? @@ -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); } } @@ -7483,7 +7483,7 @@ void Client::ProcessXTargetAutoHaters() std::queue empty_slots; for (int i = 0; i < GetMaxXTargets(); ++i) { if (XTargets[i].Type != Auto) - continue; + continue; if (XTargets[i].ID != 0 && !GetXTargetAutoMgr()->contains_mob(XTargets[i].ID)) { XTargets[i].ID = 0; @@ -7522,7 +7522,7 @@ void Client::ProcessXTargetAutoHaters() break; } } - + m_dirtyautohaters = false; SendXTargetUpdates(); } @@ -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(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() @@ -10885,7 +10885,7 @@ uint16 Client::LearnDisciplines(uint8 min_level, uint8 max_level) ); break; } - + if (HasDisciplineLearned(spell_id)) { continue; } @@ -10944,7 +10944,7 @@ uint16 Client::GetClassTrackingDistanceMultiplier(uint16 class_) { return RuleI(Character, BeastlordTrackingDistanceMultiplier); case BERSERKER: return RuleI(Character, BerserkerTrackingDistanceMultiplier); - default: + default: return 0; } } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 4a7cc15cf..e14266a23 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -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)); @@ -4852,7 +4852,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) time_string ).c_str() ); - + if (target->IsPlayerCorpse()) { Message( Chat::NPCQuestSay, @@ -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 @@ -5881,7 +5881,7 @@ void Client::Handle_OP_FeignDeath(const EQApplicationPacket *app) if (!HasSkill(EQ::skills::SkillFeignDeath)) { return; } - + if (!p_timers.Expired(&database, pTimerFeignDeath, false)) { Message(Chat::Red, "Ability recovery time not yet met."); return; @@ -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); @@ -9598,7 +9598,7 @@ void Client::Handle_OP_ManaChange(const EQApplicationPacket *app) with a length, just the 0 len ones for stopping songs ManaChange_Struct* p = (ManaChange_Struct*)app->pBuffer; */ - else{ + else{ printf("OP_ManaChange from client:\n"); DumpPacket(app); } @@ -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; @@ -11072,7 +11072,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) pick_out->myskill = GetSkill(EQ::skills::SkillPickPockets); pick_out->type = 0; //if we do not send this packet the client will lock up and require the player to relog. - + if (victim == this) { Message(0, "You catch yourself red-handed."); } @@ -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); @@ -14109,7 +14109,7 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app) std::cout << "Wrong size on OP_Taunt. Got: " << app->size << ", Expected: " << sizeof(ClientTarget_Struct) << std::endl; return; } - + if (!HasSkill(EQ::skills::SkillTaunt)) { return; } @@ -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"); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index af3609355..6ac77a58c 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -202,7 +202,7 @@ bool Client::Process() { if (heroforge_wearchange_timer.Check()) { /* This addresses bug where on zone in heroforge models would not be sent to other clients when this was - in Client::CompleteConnect(). Sending after a small 250 ms delay after that function resolves the issue. + in Client::CompleteConnect(). Sending after a small 250 ms delay after that function resolves the issue. Unclear the underlying reason for this, if a better solution can be found then can move this back. */ if (queue_wearchange_slot >= 0) { //Resend slot from Client::SwapItem if heroforge item is swapped. @@ -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(); @@ -1017,7 +1017,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I GetRace() == DWARF || GetRace() == TROLL || GetRace() == OGRE - ) ? + ) ? RuleI(Character, OldResurrectionSicknessSpellID) : RuleI(Character, ResurrectionSicknessSpellID) ); @@ -1049,7 +1049,7 @@ void Client::OPTGB(const EQApplicationPacket *app) { if(!app) return; if(!app->pBuffer) return; - + if(!RuleB(Character, EnableTGB)) { return; @@ -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", "::: WARNING! :::
" "SHARED BANK IS DISABLED AND YOUR PLATINUM WILL BE DESTROYED IF YOU PUT IT HERE!
" ); - 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; diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 3289564f2..627d8f2c7 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -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; } } @@ -1302,7 +1302,7 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) } } } - + if (parse->EventPlayer(EVENT_LOOT, client, export_string, 0, &args) != 0) { prevent_loot = true; } @@ -1323,14 +1323,14 @@ void Corpse::LootItem(Client *client, const EQApplicationPacket *app) if (parse->EventItem(EVENT_LOOT, client, inst, this, export_string, 0) != 0) { prevent_loot = true; } - + if (prevent_loot) { lootitem->auto_loot = -1; client->QueuePacket(app); safe_delete(inst); return; } - + // safe to ACK now client->QueuePacket(app); @@ -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(); @@ -1547,7 +1547,7 @@ bool Corpse::HasItem(uint32 item_id) { if (loot_item->item_id == item_id) { return true; } - } + } return false; } @@ -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); } @@ -1833,7 +1833,7 @@ std::vector Corpse::GetLootList() { if (std::find(corpse_items.begin(), corpse_items.end(), loot_item->item_id) != corpse_items.end()) { continue; } - + corpse_items.push_back(loot_item->item_id); } return corpse_items; diff --git a/zone/doors.cpp b/zone/doors.cpp index ef785b8d7..9ed2c4dc6 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -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(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); } else { move_door_packet->action = static_cast(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(invert_state == 0 ? OPEN_DOOR : OPEN_INVDOOR); } else { move_door_packet->action = static_cast(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]; @@ -407,7 +407,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { if (!IsDoorOpen() || (open_type == 58)) { if (!disable_timer) close_timer.Start(); - + if(strncmp(destination_zone_name, "NONE", strlen("NONE")) == 0) SetOpenState(true); } else { @@ -515,7 +515,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) { } else { sender->MovePC( ZoneID(destination_zone_name), - static_cast(this->destination_instance_id), + static_cast(destination_instance_id), m_Destination.x, m_Destination.y, m_Destination.z, diff --git a/zone/effects.cpp b/zone/effects.cpp index b7aae17ca..904944ec0 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -196,7 +196,7 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_ if (target == nullptr) return value; - + if (IsNPC()) { value += value * CastToNPC()->GetSpellFocusDMG() / 100; } @@ -226,7 +226,7 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_ GetFocusEffect(focusFcDamageAmt, spell_id, nullptr, from_buff_tic) + GetFocusEffect(focusFcDamageAmt2, spell_id, nullptr, from_buff_tic) + GetFocusEffect(focusFcAmplifyAmt, spell_id, nullptr, from_buff_tic); - + if (RuleB(Spells, DOTsScaleWithSpellDmg)) { if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) { extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value)*ratio/100; @@ -257,7 +257,7 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target, bool from_ GetFocusEffect(focusFcDamageAmt, spell_id, nullptr, from_buff_tic) + GetFocusEffect(focusFcDamageAmt2, spell_id, nullptr, from_buff_tic) + GetFocusEffect(focusFcAmplifyAmt, spell_id, nullptr, from_buff_tic); - + if (RuleB(Spells, DOTsScaleWithSpellDmg)) { if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) { extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value); @@ -422,7 +422,7 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target, bool fr extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, base_value); } } - + if (extra_heal) { int duration = CalcBuffDuration(this, target, spell_id); if (duration > 0) { @@ -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; @@ -733,9 +733,9 @@ void Client::SendDisciplineUpdate() { bool Client::UseDiscipline(uint32 spell_id, uint32 target) { // Dont let client waste a reuse timer if they can't use the disc if ((IsStunned() && !IgnoreCastingRestriction(spell_id))|| - IsFeared() || + IsFeared() || (IsMezzed() && !IgnoreCastingRestriction(spell_id)) || - IsAmnesiad() || + IsAmnesiad() || IsPet()) { if (IsAmnesiad()) { diff --git a/zone/exp.cpp b/zone/exp.cpp index b7261ccf7..aad0f141b 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -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); @@ -691,7 +691,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { MessageString(Chat::Experience, GAIN_SINGLE_AA_MULTI_AA, ConvertArray(m_pp.aapoints, val1)); //You have gained an ability point! You now have %1 ability points. else MessageString(Chat::Experience, GAIN_MULTI_AA_MULTI_AA, ConvertArray(gained, val1), ConvertArray(m_pp.aapoints, val2)); //You have gained %1 ability point(s)! You now have %2 ability point(s). - + if (RuleB(AA, SoundForAAEarned)) { SendSound(); } @@ -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 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()) { diff --git a/zone/gm_commands/path.cpp b/zone/gm_commands/path.cpp index 69604e271..80207e07c 100755 --- a/zone/gm_commands/path.cpp +++ b/zone/gm_commands/path.cpp @@ -22,6 +22,6 @@ void Client::Undye() SendWearChange(cur_slot); } - database.DeleteCharacterDye(this->CharacterID()); + database.DeleteCharacterDye(CharacterID()); } diff --git a/zone/groups.cpp b/zone/groups.cpp index 40110b10e..4fa3b9ff9 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -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 @@ -586,7 +586,7 @@ void Group::SendGroupJoinOOZ(Mob* NewMember) { { return; } - + if (!NewMember->HasGroup()) { return; @@ -686,7 +686,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender) { for(uint32 nl = 0; nl < MAX_GROUP_MEMBERS; nl++) { - if(members[nl]) + if(members[nl]) { if (members[nl]->IsClient()) { @@ -696,7 +696,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender) } } } - + if (!GetLeaderName()) { DisbandGroup(); @@ -741,14 +741,14 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender) if(oldmember->IsClient()) oldmember->CastToClient()->QueuePacket(outapp); } - + safe_delete(outapp); if(oldmember->IsClient()) { database.SetGroupID(oldmember->GetCleanName(), 0, oldmember->CastToClient()->CharacterID(), false); } - + if(oldmember->IsMerc()) { Client* owner = oldmember->CastToMerc()->GetMercOwner(); @@ -940,7 +940,7 @@ void Group::DisbandGroup(bool joinraid) { if (!joinraid) members[i]->CastToClient()->LeaveGroupXTargets(this); } - + if (members[i]->IsMerc()) { Client* owner = members[i]->CastToMerc()->GetMercOwner(); @@ -1217,7 +1217,7 @@ void Group::GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const if(members[i] == sender) continue; - + if(!members[i]->IsClient()) continue; @@ -1236,7 +1236,7 @@ void Client::LeaveGroup() { { MemberCount -= 1; } - + if(MemberCount < 3) { g->DisbandGroup(); @@ -2420,7 +2420,7 @@ bool Group::AmIPuller(const char *mob_name) { if (!mob_name) return false; - + return !((bool)PullerName.compare(mob_name)); } diff --git a/zone/guild.cpp b/zone/guild.cpp index 17ca7e61f..76e22b4f5 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -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; diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 81e221b6b..f17bf499b 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -199,7 +199,7 @@ void ZoneGuildManager::ListGuilds(Client *c) const { m_guilds.size() != 1 ? "s" : "" ).c_str() ); - + for (const auto& guild : m_guilds) { auto leader_name = database.GetCharNameByID(guild.second->leader_char_id); c->Message( @@ -242,7 +242,7 @@ void ZoneGuildManager::DescribeGuild(Client *c, uint32 guild_id) const { const GuildInfo *info = res->second; - auto leader_name = database.GetCharNameByID(info->leader_char_id); + auto leader_name = database.GetCharNameByID(info->leader_char_id); std::string popup_text = ""; popup_text += fmt::format( "", @@ -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;iEVENT_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 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."); } } @@ -2223,7 +2223,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { dst_inst->IsStackable() ? dst_inst->GetCharges() : 1, src_slot_id ); - + parse->EventPlayer(EVENT_EQUIP_ITEM_CLIENT, this, export_string, dst_inst->GetItem()->ID); } } @@ -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); + item_instance->SetColor(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) diff --git a/zone/merc.cpp b/zone/merc.cpp index daab3e407..63c3d7f35 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -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; iaa[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); diff --git a/zone/mob.cpp b/zone/mob.cpp index 2ebec62ab..738462335 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -603,7 +603,7 @@ void Mob::CalcInvisibleLevel() SetInvisible(Invisibility::Invisible, true); return; } - + if (is_invisible && !invisible) { SetInvisible(invisible, true); return; @@ -624,7 +624,7 @@ void Mob::SetInvisible(uint8 state, bool set_on_bonus_calc) } else { /* - if your setting invisible from a script, or escape/fading memories effect then + if your setting invisible from a script, or escape/fading memories effect then we use the internal invis variable which allows invisible without a buff on mob. */ if (!set_on_bonus_calc) { @@ -644,10 +644,10 @@ void Mob::SetInvisible(uint8 state, bool set_on_bonus_calc) } } -void Mob::ZeroInvisibleVars(uint8 invisible_type) +void Mob::ZeroInvisibleVars(uint8 invisible_type) { switch (invisible_type) { - + case T_INVISIBLE: invisible = 0; nobuff_invisible = 0; @@ -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 @@ -1791,13 +1791,13 @@ void Mob::ShowStats(Client* client) target_name, ( !target_last_name.empty() ? - fmt::format(" ({})", target_last_name) : + fmt::format(" ({})", target_last_name) : "" ), target->GetLevel() ).c_str() ); - + // Race / Class / Gender client->Message( Chat::White, @@ -1879,7 +1879,7 @@ void Mob::ShowStats(Client* client) target->GetHairColor() ).c_str() ); - + // Beard client->Message( Chat::White, @@ -1912,7 +1912,7 @@ void Mob::ShowStats(Client* client) target->GetHelmTexture() ).c_str() ); - + if ( target->GetArmTexture() || target->GetBracerTexture() || @@ -1928,7 +1928,7 @@ void Mob::ShowStats(Client* client) ).c_str() ); } - + if ( target->GetFeetTexture() || target->GetLegTexture() @@ -2152,7 +2152,7 @@ void Mob::ShowStats(Client* client) target->GetINT() ).c_str() ); - + client->Message( Chat::White, fmt::format( @@ -2182,7 +2182,7 @@ void Mob::ShowStats(Client* client) target->GetCharmedAvoidance() ).c_str() ); - + client->Message( Chat::White, fmt::format( @@ -2324,7 +2324,7 @@ void Mob::ShowStats(Client* client) (target->GetProximityMaxX() - target->GetProximityMinX()) ).c_str() ); - + client->Message( Chat::White, fmt::format( @@ -2334,7 +2334,7 @@ void Mob::ShowStats(Client* client) (target->GetProximityMaxY() - target->GetProximityMinY()) ).c_str() ); - + client->Message( Chat::White, fmt::format( @@ -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); } @@ -2932,11 +2932,11 @@ void Mob::SendStunAppearance() safe_delete(outapp); } -void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5, Client *specific_target, - uint32 value1slot, uint32 value1ground, uint32 value2slot, uint32 value2ground, uint32 value3slot, uint32 value3ground, +void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 parm4, uint32 parm5, Client *specific_target, + uint32 value1slot, uint32 value1ground, uint32 value2slot, uint32 value2ground, uint32 value3slot, uint32 value3ground, uint32 value4slot, uint32 value4ground, uint32 value5slot, uint32 value5ground){ auto outapp = new EQApplicationPacket(OP_LevelAppearance, sizeof(LevelAppearance_Struct)); - + /* Location of the effect from value#slot, this is removed upon mob death/despawn. 0 = pelvis1 1 = pelvis2 @@ -3014,7 +3014,7 @@ void Mob::SendAppearanceEffect(uint32 parm1, uint32 parm2, uint32 parm3, uint32 safe_delete(outapp); } -void Mob::SetAppearenceEffects(int32 slot, int32 value) +void Mob::SetAppearenceEffects(int32 slot, int32 value) { for (int i = 0; i < MAX_APPEARANCE_EFFECTS; i++) { if (!appearance_effects_id[i]) { @@ -3032,7 +3032,7 @@ void Mob::GetAppearenceEffects() Message(Chat::Red, "No Appearance Effects exist on this mob"); return; } - + for (int i = 0; i < MAX_APPEARANCE_EFFECTS; i++) { Message(Chat::Red, "ID: %i :: App Effect ID %i :: Slot %i", i, appearance_effects_id[i], appearance_effects_slot[i]); } @@ -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) @@ -4593,7 +4593,7 @@ int32 Mob::GetVulnerability(Mob *caster, uint32 spell_id, uint32 ticsremaining, fc_spell_vulnerability_mod = GetFocusEffect(focusSpellVulnerability, spell_id, caster, from_buff_tic); fc_spell_damage_pct_incomingPC_mod = GetFocusEffect(focusFcSpellDamagePctIncomingPC, spell_id, caster, from_buff_tic); - + total_mod = fc_spell_vulnerability_mod + fc_spell_damage_pct_incomingPC_mod; //Don't let focus derived mods reduce past 99% mitigation. Quest related can, and for custom functionality if negative will give a healing affect instead of damage. @@ -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 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(); @@ -6190,7 +6190,7 @@ uint8 Mob::GetSeeInvisibleLevelFromNPCStat(uint16 in_see_invis) if (in_see_invis == 1) { return 1; } - + //random chance to apply standard level 1 see invs if (in_see_invis > 1 && in_see_invis < 100) { if (zone->random.Int(0, 99) < in_see_invis) { @@ -6550,7 +6550,7 @@ bool Mob::ShieldAbility(uint32 target_id, int shielder_max_distance, int shield_ if (shield_target->CalculateDistance(GetX(), GetY(), GetZ()) > static_cast(shielder_max_distance)) { MessageString(Chat::Blue, TARGET_TOO_FAR); - return false; + return false; } entity_list.MessageCloseString(this, false, 100, 0, START_SHIELDING, GetCleanName(), shield_target->GetCleanName()); @@ -6617,7 +6617,7 @@ void Mob::ShieldAbilityClearVariables() } void Mob::SetFeigned(bool in_feigned) { - + if (in_feigned) { if (IsClient()) { if (RuleB(Character, FeignKillsPet)){ diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index efaa0fa39..4373e4bd1 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -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); @@ -842,7 +842,7 @@ void Client::AI_Process() std::set::iterator remembered_feigned_mobid; remembered_feigned_mobid = feign_memory_list.begin(); while (remembered_feigned_mobid != feign_memory_list.end()) { - + Mob* remembered_mob = entity_list.GetMob(*remembered_feigned_mobid); if (remembered_mob == nullptr || remembered_mob->IsCorpse()) { //they are gone now... @@ -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 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) { diff --git a/zone/mob_appearance.cpp b/zone/mob_appearance.cpp index 112ad81c1..1af45e727 100644 --- a/zone/mob_appearance.cpp +++ b/zone/mob_appearance.cpp @@ -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; diff --git a/zone/mob_info.cpp b/zone/mob_info.cpp index 5b7011f33..12da818fd 100644 --- a/zone/mob_info.cpp +++ b/zone/mob_info.cpp @@ -638,11 +638,11 @@ void Mob::DisplayInfo(Mob *mob) return; } - if (this->IsClient()) { + if (IsClient()) { std::string window_text = "*Drag window open vertically to see all
"; - Client *client = this->CastToClient(); + Client *client = CastToClient(); if (!client->IsDevToolsEnabled()) { return; diff --git a/zone/npc.cpp b/zone/npc.cpp index 1e8cf824c..a36e22e18 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -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); } } } @@ -2392,9 +2392,9 @@ void NPC::PetOnSpawn(NewSpawn_Struct* ns) if (tmp_lastname.size() < sizeof(ns->spawn.lastName)) strn0cpy(ns->spawn.lastName, tmp_lastname.c_str(), sizeof(ns->spawn.lastName)); } - else + else { - if (entity_list.GetNPCByID(GetOwnerID())) + if (entity_list.GetNPCByID(GetOwnerID())) { SetPetOwnerNPC(true); } @@ -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() ); } @@ -3666,7 +3666,7 @@ std::vector NPC::GetLootList() { if (std::find(npc_items.begin(), npc_items.end(), loot_item->item_id) != npc_items.end()) { continue; } - + npc_items.push_back(loot_item->item_id); } return npc_items; diff --git a/zone/object.cpp b/zone/object.cpp index 30222c404..7962c7ef9 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -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 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); diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 112a630e4..b55236634 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -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) { diff --git a/zone/pets.cpp b/zone/pets.cpp index 699ca5f8d..017c6a66a 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -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"); } @@ -404,7 +404,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, activiate_pet = true; } } - + if (activiate_pet){ npc->AddToHateList(m_target, 1); npc->SetPetTargetLockID(m_target->GetID()); @@ -465,7 +465,7 @@ Pet::Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 po // Familiar and animation pets don't get taunt until an AA. if (owner && owner->IsClient()) { if (!(owner->CastToClient()->ClientVersionBit() & EQ::versions::maskUFAndLater)) { - if ((typeofpet != petFamiliar && typeofpet != petAnimation) || + if ((typeofpet != petFamiliar && typeofpet != petAnimation) || aabonuses.PetCommands[PET_TAUNT]) { taunting=true; } @@ -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()); } } @@ -743,7 +743,7 @@ bool Pet::CheckSpellLevelRestriction(uint16 spell_id) return true; } -BeastlordPetData::PetStruct ZoneDatabase::GetBeastlordPetData(uint16 race_id) { +BeastlordPetData::PetStruct ZoneDatabase::GetBeastlordPetData(uint16 race_id) { BeastlordPetData::PetStruct beastlord_pet_data; std::string query = fmt::format( SQL( diff --git a/zone/raids.cpp b/zone/raids.cpp index 712d0a1d5..db57a4eed 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -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) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 4d9114dde..3fac88c15 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -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 && @@ -816,7 +816,7 @@ void Mob::DoArcheryAttackDmg(Mob *other, const EQ::ItemInstance *RangeWeapon, co if (!RangeWeapon && !Ammo && range_id && ammo_id) { if (IsClient()) { _RangeWeapon = CastToClient()->m_inv[EQ::invslot::slotRange]; - if (_RangeWeapon && _RangeWeapon->GetItem() && + if (_RangeWeapon && _RangeWeapon->GetItem() && _RangeWeapon->GetItem()->ID == range_id) RangeWeapon = _RangeWeapon; @@ -1304,7 +1304,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 int ammo_slot = EQ::invslot::slotRange; const EQ::ItemInstance* RangeWeapon = m_inv[EQ::invslot::slotRange]; - + if (!RangeWeapon || !RangeWeapon->IsClassCommon()) { LogCombat("Ranged attack canceled. Missing or invalid ranged weapon ([{}]) in slot [{}]", GetItemIDAt(EQ::invslot::slotRange), EQ::invslot::slotRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(EQ::invslot::slotRange)); @@ -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); } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 2e0309d95..84f43c5e2 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -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); @@ -1104,7 +1104,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name); break; } - + int chance = spells[spell_id].base_value[i]; int buff_count = GetMaxTotalSlots(); for(int slot = 0; slot < buff_count; slot++) { @@ -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; } @@ -3362,14 +3362,14 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, /* Calculate base effects modifier for casters who are not bards. */ - + //This is checked from Mob::SpellEffects and applied to instant spells and runes. if (caster && caster->GetClass() != BARD && caster->HasBaseEffectFocus()) { oval = effect_value; int mod = caster->GetFocusEffect(focusFcBaseEffects, spell_id); effect_value += effect_value * mod / 100; - + LogSpells("Instant Effect value [{}] altered with base effects modifier of [{}] to yeild [{}]", oval, mod, effect_value); } @@ -3385,7 +3385,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, oval, instrument_mod, effect_value); } } - + effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effect_id[effect_id], caster, caster_id); return effect_value; @@ -3786,7 +3786,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster) // doing it every time up here, since most buff effects dont need it switch (effect) { - case SE_CurrentHP: { + case SE_CurrentHP: { if (spells[buff.spellid].limit_value[i] && !PassCastRestriction(spells[buff.spellid].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 { @@ -4437,7 +4437,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient()) { NPC* tmp_eye_of_zomm = entity_list.GetNPCByID(CastToClient()->GetControlledMobId()); - //On live there is about a 6 second delay before it despawns once new one spawns. + //On live there is about a 6 second delay before it despawns once new one spawns. if (tmp_eye_of_zomm) { tmp_eye_of_zomm->GetSwarmInfo()->duration->Disable(); tmp_eye_of_zomm->GetSwarmInfo()->duration->Start(6000); @@ -5312,11 +5312,11 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo uint32 Caston_spell_id = 0; int index_id = -1; uint32 focus_reuse_time = 0; //If this is set and all limits pass, start timer at end of script. - + bool is_from_item_click = false; bool try_apply_to_item_click = false; bool has_item_limit_check = false; - + if (casting_spell_inventory_slot && casting_spell_inventory_slot != -1) { is_from_item_click = true; } @@ -5341,7 +5341,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo for (int i = 0; i < EFFECT_COUNT; i++) { switch (focus_spell.effect_id[i]) { - + case SE_Blank: break; @@ -6048,7 +6048,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; } } - + /* For item click cast/recast focus modifiers. Only use if SPA 415 exists. This is an item click but does not have SPA 415 limiter. Fail here. @@ -6787,8 +6787,8 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id) } else if (IsClient()) { // still have numhits and client, update CastToClient()->SendBuffNumHitPacket(buffs[buff_slot], buff_slot); } - } - } + } + } else { for (int d = 0; d < buff_max; d++) { if (IsValidSpell(buffs[d].spellid) && buffs[d].hit_number > 0 && @@ -9625,7 +9625,7 @@ bool Mob::HarmonySpellLevelCheck(int32 spell_id, Mob *target) } bool Mob::PassCharmTargetRestriction(Mob *target) { - + //Level restriction check should not go here. if (!target) { return false; @@ -9680,7 +9680,7 @@ bool Mob::PassLimitToSkill(EQ::skills::SkillType skill, int32 spell_id, int proc match_proc_type = true; } if (match_proc_type && spells[spell_id].effect_id[i] == SE_LimitToSkill && spells[spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) { - + has_limit_check = true; if (spells[spell_id].base_value[i] == skill) { return true; @@ -9921,7 +9921,7 @@ void Mob::SpreadVirusEffect(int32 spell_id, uint32 caster_id, int32 buff_tics_re bool Mob::IsFocusProcLimitTimerActive(int32 focus_spell_id) { /* - Used with SPA 511 SE_Ff_FocusTimerMin to limit how often a focus effect can be applied. + Used with SPA 511 SE_Ff_FocusTimerMin to limit how often a focus effect can be applied. Ie. Can only have a spell trigger once every 15 seconds, or to be more creative can only have the fire spells received a very high special focused once every 30 seconds. Note, this stores timers for both spell, item and AA related focuses For AA the focus_spell_id @@ -9975,7 +9975,7 @@ bool Mob::IsProcLimitTimerActive(int32 base_spell_id, uint32 proc_reuse_time, in } for (int i = 0; i < MAX_PROC_LIMIT_TIMERS; i++) { - + if (proc_type == ProcType::MELEE_PROC) { if (spell_proclimit_spellid[i] == base_spell_id) { if (spell_proclimit_timer[i].Enabled()) { @@ -10258,7 +10258,7 @@ void Mob::SetBuffDuration(int32 spell_id, int32 duration) { int buff_count = GetMaxTotalSlots(); for (int slot = 0; slot < buff_count; slot++) { - + if (!adjust_all_buffs) { if (buffs[slot].spellid != SPELL_UNKNOWN && buffs[slot].spellid == spell_id) { SpellOnTarget(buffs[slot].spellid, this, 0, false, 0, false, -1, duration, true); @@ -10285,7 +10285,7 @@ void Mob::ApplySpellBuff(int32 spell_id, int32 duration) if (!spells[spell_id].buff_duration) { return; } - + if (duration < -1) { duration = PERMANENT_BUFF_DURATION; } @@ -10302,7 +10302,7 @@ int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier) if (!stat_identifier) { return 0; } - + std::string id = str_tolower(stat_identifier); int buff_count = GetMaxTotalSlots(); @@ -10314,7 +10314,7 @@ int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier) return 0; } -int Mob::GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier) +int Mob::GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier) { if (slot > GetMaxTotalSlots()) { return 0; diff --git a/zone/spells.cpp b/zone/spells.cpp index 57102de25..2354687f1 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -373,7 +373,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, else if (cast_time && IsClient() && slot == CastingSlot::Item && item_slot != 0xFFFFFFFF) { orgcasttime = cast_time; if (cast_time) { - cast_time = GetActSpellCasttime(spell_id, cast_time); + cast_time = GetActSpellCasttime(spell_id, cast_time); } } else { @@ -421,7 +421,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot, //clients produce messages... npcs should not for this case MessageString(Chat::Red, INSUFFICIENT_MANA); InterruptSpell(); - } + } else { InterruptSpell(0, 0, 0); //the 0 args should cause no messages } @@ -533,7 +533,7 @@ bool Mob::DoCastingChecksOnCaster(int32 spell_id, CastingSlot slot) { return false; } /* - Can not cast if spell + Can not cast if spell */ if ((IsSilenced() && !IsDiscipline(spell_id))) { MessageString(Chat::Red, SILENCED_STRING); @@ -851,7 +851,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp return false; } /* - Various charm related target restrictions + Various charm related target restrictions */ if (IsEffectInSpell(spell_id, SE_Charm) && !PassCharmTargetRestriction(spell_target)) { LogSpells("Spell casting canceled [{}] : can not use charm on this target.", spell_id); @@ -867,7 +867,7 @@ bool Mob::DoCastingChecksOnTarget(bool check_on_casting, int32 spell_id, Mob *sp if (spell_target->IsGrouped()) { Group *target_group = spell_target->GetGroup(); Group *my_group = GetGroup(); - if (target_group && + if (target_group && my_group && (target_group->GetID() == my_group->GetID())) { cast_failed = false; @@ -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 @@ -1359,7 +1359,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if (IsPulsingBardSong(spell_id)) { bardsong = spell_id; bardsong_slot = slot; - + if (spell_target) { bardsong_target_id = spell_target->GetID(); } @@ -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++) { @@ -1643,7 +1643,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if(IsClient()) { TrySympatheticProc(target, spell_id); } - + TryTwincast(this, target, spell_id); TryTriggerOnCastFocusEffect(focusTriggerOnCast, spell_id); @@ -1700,7 +1700,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo if (spells[spell_id].timer_id > 0 && slot < CastingSlot::MaxGems) { c->SetLinkedSpellReuseTimer(spells[spell_id].timer_id, (spells[spell_id].recast_time / 1000) - (casting_spell_recast_adjust / 1000)); } - + c->MemorizeSpell(static_cast(slot), spell_id, memSpellSpellbar, casting_spell_recast_adjust); // this tells the client that casting may happen again @@ -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; @@ -2312,7 +2312,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui LogSpells("Spell [{}]: target type [{}], target [{}], AE center [{}]", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target - // spell that's recast every 2500 msec for AEDuration msec. + // spell that's recast every 2500 msec for AEDuration msec. if(IsAEDurationSpell(spell_id)) { // the spells are AE target, but we aim them on a beacon glm::vec4 beacon_loc; @@ -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; @@ -2681,16 +2681,16 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui } recast = std::max(recast, 0); } - + LogSpells("Spell [{}]: Setting long reuse timer to [{}] s (orig [{}])", spell_id, recast, spells[spell_id].recast_time); - + if (recast > 0) { CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } } /* - Set Recast Timer on item clicks, including augmenets. + Set Recast Timer on item clicks, including augmenets. */ if(IsClient() && (slot == CastingSlot::Item || slot == CastingSlot::PotionBelt)){ CastToClient()->SetItemRecastTimer(spell_id, inventory_slot); @@ -2746,7 +2746,7 @@ bool Mob::ApplyBardPulse(int32 spell_id, Mob *spell_target, CastingSlot slot) { return true; } /* - Fear will stop pulsing. + Fear will stop pulsing. */ if (IsFeared()) { return false; @@ -2907,7 +2907,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, } if (spellid1 == spellid2 ) { - + if (spellid1 == SPELL_EYE_OF_ZOMM && spellid2 == SPELL_EYE_OF_ZOMM) {//only the original Eye of Zomm spell will not take hold if affect is already on you, other versions client fades the buff as soon as cast. MessageString(Chat::Red, SPELL_NO_HOLD); return -1; @@ -3269,7 +3269,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid LogSpells("Buff [{}] failed to add because its duration came back as 0", spell_id); return -2; // no duration? this isn't a buff } - + LogSpells("Trying to add buff [{}] cast by [{}] (cast level [{}]) with duration [{}]", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); @@ -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(); @@ -6187,7 +6187,7 @@ void Client::SendItemRecastTimer(int32 recast_type, uint32 recast_delay) void Client::SetItemRecastTimer(int32 spell_id, uint32 inventory_slot) { EQ::ItemInstance *item = CastToClient()->GetInv().GetItem(inventory_slot); - + int recast_delay = 0; int recast_type = 0; bool from_augment = false; @@ -6513,7 +6513,7 @@ void Client::ResetCastbarCooldownBySlot(int slot) { m_pp.spellSlotRefresh[i] = 1; GetPTimers().Clear(&database, (pTimerSpellStart + m_pp.mem_spells[i])); if (!IsLinkedSpellReuseTimerReady(spells[m_pp.mem_spells[i]].timer_id)) { - GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[i]].timer_id)); + GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[i]].timer_id)); } if (spells[m_pp.mem_spells[i]].timer_id > 0 && spells[m_pp.mem_spells[i]].timer_id < MAX_DISCIPLINE_TIMERS) { SetLinkedSpellReuseTimer(spells[m_pp.mem_spells[i]].timer_id, 0); @@ -6527,7 +6527,7 @@ void Client::ResetCastbarCooldownBySlot(int slot) { GetPTimers().Clear(&database, (pTimerSpellStart + m_pp.mem_spells[slot])); if (!IsLinkedSpellReuseTimerReady(spells[m_pp.mem_spells[slot]].timer_id)) { GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[slot]].timer_id)); - + } if (spells[m_pp.mem_spells[slot]].timer_id > 0 && spells[m_pp.mem_spells[slot]].timer_id < MAX_DISCIPLINE_TIMERS) { SetLinkedSpellReuseTimer(spells[m_pp.mem_spells[slot]].timer_id, 0); @@ -6543,7 +6543,7 @@ void Client::ResetAllCastbarCooldowns() { m_pp.spellSlotRefresh[i] = 1; GetPTimers().Clear(&database, (pTimerSpellStart + m_pp.mem_spells[i])); if (!IsLinkedSpellReuseTimerReady(spells[m_pp.mem_spells[i]].timer_id)) { - GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[i]].timer_id)); + GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[i]].timer_id)); } if (spells[m_pp.mem_spells[i]].timer_id > 0 && spells[m_pp.mem_spells[i]].timer_id < MAX_DISCIPLINE_TIMERS) { SetLinkedSpellReuseTimer(spells[m_pp.mem_spells[i]].timer_id, 0); @@ -6559,7 +6559,7 @@ void Client::ResetCastbarCooldownBySpellID(uint32 spell_id) { m_pp.spellSlotRefresh[i] = 1; GetPTimers().Clear(&database, (pTimerSpellStart + m_pp.mem_spells[i])); if (!IsLinkedSpellReuseTimerReady(spells[m_pp.mem_spells[i]].timer_id)) { - GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[i]].timer_id)); + GetPTimers().Clear(&database, (pTimerLinkedSpellReuseStart + spells[m_pp.mem_spells[i]].timer_id)); } if (spells[m_pp.mem_spells[i]].timer_id > 0 && spells[m_pp.mem_spells[i]].timer_id < MAX_DISCIPLINE_TIMERS) { SetLinkedSpellReuseTimer(spells[m_pp.mem_spells[i]].timer_id, 0); @@ -6571,7 +6571,7 @@ void Client::ResetCastbarCooldownBySpellID(uint32 spell_id) { } bool Mob::IsActiveBardSong(int32 spell_id) { - + if (spell_id == bardsong) { return true; } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 8e25b7fc3..9afde880b 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -59,7 +59,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme inst = user_inv.GetItem(in_augment->container_slot); if (inst) { const EQ::ItemData* item = inst->GetItem(); - if (item && inst->IsType(EQ::item::ItemClassBag) && item->BagType == EQ::item::BagTypeAugmentationSealer) { // We have found an appropriate inventory augmentation sealer + if (item && inst->IsType(EQ::item::ItemClassBag) && item->BagType == EQ::item::BagTypeAugmentationSealer) { // We have found an appropriate inventory augmentation sealer container = inst; // Verify that no more than two items are in container to guarantee no inadvertant wipes. @@ -105,11 +105,11 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme user->Message(Chat::Red, "Error: There must be 1 augmentable item in the sealer."); return; } - } else { // This happens if the augment button is clicked more than once quickly while augmenting + } else { // This happens if the augment button is clicked more than once quickly while augmenting if (!container->GetItem(0)) { user->Message(Chat::Red, "Error: No item in the first slot of sealer."); } - + if (!container->GetItem(1)) { user->Message(Chat::Red, "Error: No item in the second slot of sealer."); } @@ -204,7 +204,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme user->DeleteItemInInventory(EQ::InventoryProfile::CalcSlotId(in_augment->container_slot, i), 0, true); } } - + container->Clear(); // Explicitly mark container as cleared. } } @@ -763,7 +763,7 @@ void Client::SendTradeskillSearchResults( uint32 comp_count = (uint32) atoi(row[3]); uint32 tradeskill = (uint16) atoi(row[4]); uint32 must_learn = (uint16) atoi(row[5]); - + // Skip the recipes that exceed the threshold in skill difference // Recipes that have either been made before or were @@ -787,7 +787,7 @@ void Client::SendTradeskillSearchResults( //Skip recipes that must be learned if ((must_learn & 0xf) && !character_learned_recipe.recipe_id) { - continue; + continue; } @@ -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(); @@ -1536,7 +1536,7 @@ bool ZoneDatabase::GetTradeRecipe( "FROM tradeskill_recipe_entries " "WHERE salvagecount > 0 AND recipe_id = %u", recipe_id ); - + results = QueryDatabase(query); if (results.Success()) { for (auto row = results.begin(); row != results.end(); ++row) { diff --git a/zone/trading.cpp b/zone/trading.cpp index 414dfa56f..741c6b888 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -163,7 +163,7 @@ void Trade::SendItemData(const EQ::ItemInstance* inst, int16 dest_slot_id) { if (inst == nullptr) return; - + // @merth: This needs to be redone with new item classes Mob* mob = With(); if (!mob->IsClient()) @@ -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; @@ -890,11 +890,11 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const EQ::ItemData* item = inst->GetItem(); if(item && quest_npc == false) { - bool isPetAndCanHaveNoDrop = (RuleB(Pets, CanTakeNoDrop) && - _CLIENTPET(tradingWith) && + bool isPetAndCanHaveNoDrop = (RuleB(Pets, CanTakeNoDrop) && + _CLIENTPET(tradingWith) && tradingWith->GetPetType()<=petOther); // if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it - if(GetGM() || (inst->IsAttuned() == false && + if(GetGM() || (inst->IsAttuned() == false && (item->NoDrop != 0 || isPetAndCanHaveNoDrop))) { // pets need to look inside bags and try to equip items found there if (item->IsClassBag() && item->BagSlots > 0) { @@ -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(); } } @@ -965,7 +965,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st parse->AddVar(temp1, temp2); snprintf(temp1, 100, "platinum.%d", tradingWith->GetNPCTypeID()); snprintf(temp2, 100, "%u", trade->pp); - parse->AddVar(temp1, temp2); + parse->AddVar(temp1, temp2); if(tradingWith->GetAppearance() != eaDead) { tradingWith->FaceTarget(this); @@ -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); @@ -1458,18 +1458,18 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, int16 Quantity, Client* C int16 Charges=0; uint16 SlotID = FindTraderItem(SerialNumber, Quantity); - + 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); } diff --git a/zone/tune.cpp b/zone/tune.cpp index 00f16e85d..ea514738d 100644 --- a/zone/tune.cpp +++ b/zone/tune.cpp @@ -116,7 +116,7 @@ void Mob::TuneGetStats(Mob* defender, Mob *attacker) Message(0, "[#Tune] Total Offense: %i ", TuneGetOffense(defender, attacker)); Message(0, "[#Tune] Chance to hit: %.0f pct", round(hit_chance)); Message(0, "[#Tune] Total Accuracy: %i ", TuneGetAccuracy( defender,attacker)); - + if (attacker->IsNPC()) { Message(0, "[#Tune] NPC STAT ATK: %i ", static_cast(attacker->CastToNPC()->GetNPCStat("atk"))); @@ -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; diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 283e3f507..e27ec4e03 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -97,10 +97,10 @@ void NPC::DisplayWaypointInfo(Client *client) { GetID(), GetSpawnGroupId(), GetSpawnPointID() - ).c_str() + ).c_str() ); - + for (const auto& current_waypoint : Waypoints) { client->Message( Chat::White, @@ -118,7 +118,7 @@ void NPC::DisplayWaypointInfo(Client *client) { "{} ({})", ConvertSecondsToTime(current_waypoint.pause), current_waypoint.pause - ) : + ) : "" ) ).c_str() @@ -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(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)); } } diff --git a/zone/zone.cpp b/zone/zone.cpp index 2dffad339..a7876c980 100755 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -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; diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 581208f90..7ce199d80 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -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) {
Name{}Guild ID{}