Reworked ClientVersion into EQEmu::versions; Added EQEmu::versions::InventoryVersion

This commit is contained in:
Uleat
2016-04-22 03:49:17 -04:00
parent 6bc60391fb
commit b3475d7b50
66 changed files with 732 additions and 561 deletions
+2 -2
View File
@@ -471,7 +471,7 @@ void Client::ResetAA() {
database.DeleteCharacterLeadershipAAs(CharacterID());
// undefined for these clients
if (GetClientVersionBit() & BIT_TitaniumAndEarlier)
if (ClientVersionBit() & EQEmu::versions::bit_TitaniumAndEarlier)
Kick();
}
@@ -1411,7 +1411,7 @@ bool Mob::CanUseAlternateAdvancementRank(AA::Rank *rank) {
//the one titanium hack i will allow
//just to make sure we dont crash the client with newer aas
//we'll exclude any expendable ones
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_TitaniumAndEarlier) {
if(IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_TitaniumAndEarlier) {
if(ability->charges > 0) {
return false;
}
+6 -6
View File
@@ -93,7 +93,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w
}
case ItemType2HPiercing: // 2H Piercing
{
if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2)
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skillinuse = Skill1HPiercing;
else
skillinuse = Skill2HPiercing;
@@ -1486,7 +1486,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
//this generates a lot of 'updates' to the client that the client does not need
BuffFadeNonPersistDeath();
if (RuleB(Character, UnmemSpellsOnDeath)) {
if((GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover))
if((ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && RuleB(Character, RespawnFromHover))
UnmemSpellAll(true);
else
UnmemSpellAll(false);
@@ -1549,7 +1549,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
from these and overwrite what we set in pp anyway
*/
if(LeftCorpse && (GetClientVersionBit() & BIT_SoFAndLater) && RuleB(Character, RespawnFromHover))
if(LeftCorpse && (ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && RuleB(Character, RespawnFromHover))
{
ClearDraggedCorpses();
RespawnFromHoverTimer.Start(RuleI(Character, RespawnFromHoverTimer) * 1000);
@@ -3425,14 +3425,14 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
if (IsBuffSpell(spell_id)) { // hots
// message to caster
if (caster->IsClient() && caster == this) {
if (caster->CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)
if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater)
FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime,
HOT_HEAL_SELF, itoa(acthealed), spells[spell_id].name);
else
FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime,
YOU_HEALED, GetCleanName(), itoa(acthealed));
} else if (caster->IsClient() && caster != this) {
if (caster->CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)
if (caster->CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater)
caster->FilteredMessage_StringID(caster, MT_NonMelee, FilterHealOverTime,
HOT_HEAL_OTHER, GetCleanName(), itoa(acthealed),
spells[spell_id].name);
@@ -3442,7 +3442,7 @@ void Mob::HealDamage(uint32 amount, Mob *caster, uint16 spell_id)
}
// message to target
if (IsClient() && caster != this) {
if (CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)
if (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater)
FilteredMessage_StringID(this, MT_NonMelee, FilterHealOverTime,
HOT_HEALED_OTHER, caster->GetCleanName(),
itoa(acthealed), spells[spell_id].name);
+3 -3
View File
@@ -163,7 +163,7 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
}
//Power Source Slot
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
const ItemInst* inst = m_inv[SlotPowerSource];
if(inst)
@@ -3293,7 +3293,7 @@ void Client::CalcItemScale() {
changed = true;
//Power Source Slot
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if(CalcItemScale(SlotPowerSource, SlotPowerSource))
changed = true;
@@ -3387,7 +3387,7 @@ void Client::DoItemEnterZone() {
changed = true;
//Power Source Slot
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
if(DoItemEnterZone(SlotPowerSource, SlotPowerSource))
changed = true;
+5 -5
View File
@@ -1255,7 +1255,7 @@ int32 Bot::GenerateBaseHitPoints() {
uint32 lm = GetClassLevelFactor();
int32 Post255;
int32 NormalSTA = GetSTA();
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
float SoDPost255;
if(((NormalSTA - 255) / 2) > 0)
SoDPost255 = ((NormalSTA - 255) / 2);
@@ -6127,7 +6127,7 @@ int32 Bot::GenerateBaseManaPoints() {
switch(GetCasterClass()) {
case 'I':
WisInt = INT;
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if(WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if(WisInt > 201)
@@ -6162,7 +6162,7 @@ int32 Bot::GenerateBaseManaPoints() {
break;
case 'W':
WisInt = WIS;
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if(WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if(WisInt > 201)
@@ -6346,7 +6346,7 @@ int32 Bot::GetMaxStat() {
int32 base = 0;
if (level < 61)
base = 255;
else if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoF)
else if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
base = (255 + 5 * (level - 60));
else if (level < 71)
base = (255 + 5 * (level - 60));
@@ -6841,7 +6841,7 @@ int32 Bot::CalcBaseEndurance() {
int32 ConvertedStats = 0;
int32 sta_end = 0;
int Stats = 0;
if(GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->GetClientVersion() >= ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetOwner() && GetOwner()->CastToClient() && GetOwner()->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int HeroicStats = 0;
Stats = ((GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4);
HeroicStats = ((GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4);
+1 -1
View File
@@ -4709,7 +4709,7 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep)
if (helper_is_help_or_usage(sep->arg[1])) {
c->Message(m_usage, "usage: %s [set | clear] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]);
c->Message(m_note, "Notes:");
if (c->GetClientVersion() >= ClientVersion::SoF) {
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
c->Message(m_message, "- Self-inspect and type your bot's inspect message");
c->Message(m_message, "- Close the self-inspect window to update the server");
c->Message(m_message, "- Type '%s set' to set the bot's inspect message", sep->arg[0]);
+24 -24
View File
@@ -257,7 +257,7 @@ Client::Client(EQStreamInterface* ieqs)
GlobalChatLimiterTimer = new Timer(RuleI(Chat, IntervalDurationMS));
AttemptedMessages = 0;
TotalKarma = 0;
m_ClientVersion = ClientVersion::Unknown;
m_ClientVersion = EQEmu::versions::ClientVersion::Unknown;
m_ClientVersionBit = 0;
AggroCount = 0;
RestRegenHP = 0;
@@ -1533,7 +1533,7 @@ void Client::UpdateWho(uint8 remove) {
else if (m_pp.anon >= 2)
scl->anon = 2;
scl->ClientVersion = static_cast<unsigned int>(GetClientVersion());
scl->ClientVersion = static_cast<unsigned int>(ClientVersion());
scl->tellsoff = tellsoff;
scl->guild_id = guild_id;
scl->LFG = LFG;
@@ -1789,7 +1789,7 @@ void Client::SendManaUpdatePacket() {
if (!Connected() || IsCasting())
return;
if (GetClientVersion() >= ClientVersion::SoD) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD) {
SendManaUpdate();
SendEnduranceUpdate();
}
@@ -1824,7 +1824,7 @@ void Client::SendManaUpdatePacket() {
for(int i = 0; i < MAX_GROUP_MEMBERS; ++i)
if(g->members[i] && g->members[i]->IsClient() && (g->members[i] != this) && (g->members[i]->CastToClient()->GetClientVersion() >= ClientVersion::SoD))
if (g->members[i] && g->members[i]->IsClient() && (g->members[i] != this) && (g->members[i]->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD))
{
g->members[i]->CastToClient()->QueuePacket(outapp);
g->members[i]->CastToClient()->QueuePacket(outapp2);
@@ -2007,7 +2007,7 @@ void Client::ReadBook(BookRequest_Struct *book) {
BookText_Struct *out = (BookText_Struct *) outapp->pBuffer;
out->window = book->window;
if(GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
const ItemInst *inst = m_inv[book->invslot];
if(inst)
@@ -2364,7 +2364,7 @@ bool Client::HasSkill(SkillUseTypes skill_id) const {
}
bool Client::CanHaveSkill(SkillUseTypes skill_id) const {
if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skill_id == Skill1HPiercing)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skill_id == Skill1HPiercing)
skill_id = Skill2HPiercing;
return(database.GetSkillCap(GetClass(), skill_id, RuleI(Character, MaxLevel)) > 0);
@@ -2372,7 +2372,7 @@ bool Client::CanHaveSkill(SkillUseTypes skill_id) const {
}
uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) const {
if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
skillid = Skill2HPiercing;
return(database.GetSkillCap(class_, skillid, level));
@@ -2380,7 +2380,7 @@ uint16 Client::MaxSkill(SkillUseTypes skillid, uint16 class_, uint16 level) cons
uint8 Client::SkillTrainLevel(SkillUseTypes skillid, uint16 class_)
{
if (GetClientVersion() < ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && class_ == BERSERKER && skillid == Skill1HPiercing)
skillid = Skill2HPiercing;
return(database.GetTrainLevel(class_, skillid, RuleI(Character, MaxLevel)));
@@ -2817,7 +2817,7 @@ void Client::ServerFilter(SetServerFilter_Struct* filter){
Filter0(FilterMissedMe);
Filter1(FilterDamageShields);
if (GetClientVersionBit() & BIT_SoDAndLater) {
if (ClientVersionBit() & EQEmu::versions::bit_SoDAndLater) {
if (filter->filters[FilterDOT] == 0)
ClientFilters[FilterDOT] = FilterShow;
else if (filter->filters[FilterDOT] == 1)
@@ -2838,7 +2838,7 @@ void Client::ServerFilter(SetServerFilter_Struct* filter){
Filter1(FilterFocusEffects);
Filter1(FilterPetSpells);
if (GetClientVersionBit() & BIT_SoDAndLater) {
if (ClientVersionBit() & EQEmu::versions::bit_SoDAndLater) {
if (filter->filters[FilterHealOverTime] == 0)
ClientFilters[FilterHealOverTime] = FilterShow;
// This is called 'Show Mine Only' in the clients, but functions the same as show
@@ -4123,7 +4123,7 @@ bool Client::GroupFollow(Client* inviter) {
group->UpdateGroupAAs();
//Invite the inviter into the group first.....dont ask
if (inviter->GetClientVersion() < ClientVersion::SoD)
if (inviter->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
GroupJoin_Struct* outgj = (GroupJoin_Struct*)outapp->pBuffer;
@@ -4169,13 +4169,13 @@ bool Client::GroupFollow(Client* inviter) {
return false;
}
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
SendGroupJoinAcknowledge();
}
// Temporary hack for SoD, as things seem to work quite differently
if (inviter->IsClient() && inviter->GetClientVersion() >= ClientVersion::SoD)
if (inviter->IsClient() && inviter->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
database.RefreshGroupFromDB(inviter);
}
@@ -4242,7 +4242,7 @@ uint16 Client::GetPrimarySkillValue()
}
case ItemType2HPiercing: // 2H Piercing
{
if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2)
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
skill = Skill1HPiercing;
else
skill = Skill2HPiercing;
@@ -4412,7 +4412,7 @@ void Client::IncrementAggroCount() {
if (AggroCount == 1)
SavedRaidRestTimer = rest_timer.GetRemainingTime();
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RestState, 1);
char *Buffer = (char *)outapp->pBuffer;
@@ -4457,7 +4457,7 @@ void Client::DecrementAggroCount() {
rest_timer.Start(time_until_rest);
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
EQApplicationPacket *outapp = new EQApplicationPacket(OP_RestState, 5);
char *Buffer = (char *)outapp->pBuffer;
@@ -4978,12 +4978,12 @@ void Client::ShowSkillsWindow()
std::string WindowText;
std::map<SkillUseTypes, std::string> Skills = EQEmu::GetSkillUseTypesMap();
if (GetClientVersion() < ClientVersion::RoF2)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
Skills[Skill1HPiercing] = "Piercing";
// print out all available skills
for (auto skills_iter : Skills) {
if (skills_iter.first == Skill2HPiercing && GetClientVersion() < ClientVersion::RoF2)
if (skills_iter.first == Skill2HPiercing && ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
continue;
if (!GetSkill(skills_iter.first) && !MaxSkill(skills_iter.first))
continue;
@@ -6115,7 +6115,7 @@ void Client::SendZonePoints()
while(iterator.MoreElements())
{
ZonePoint* data = iterator.GetData();
if(GetClientVersionBit() & data->client_version_mask)
if(ClientVersionBit() & data->client_version_mask)
{
count++;
}
@@ -6132,7 +6132,7 @@ void Client::SendZonePoints()
while(iterator.MoreElements())
{
ZonePoint* data = iterator.GetData();
if(GetClientVersionBit() & data->client_version_mask)
if(ClientVersionBit() & data->client_version_mask)
{
zp->zpe[i].iterator = data->number;
zp->zpe[i].x = data->target_x;
@@ -6852,7 +6852,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
if(use_window) {
if(final_stats.size() < 4096)
{
uint32 Buttons = (client->GetClientVersion() < ClientVersion::SoD) ? 0 : 1;
uint32 Buttons = (client->ClientVersion() < EQEmu::versions::ClientVersion::SoD) ? 0 : 1;
client->SendWindow(0, POPUPID_UPDATE_SHOWSTATSWINDOW, Buttons, "Cancel", "Update", 0, 1, this, "", "%s", final_stats.c_str());
goto Extra_Info;
}
@@ -6888,7 +6888,7 @@ void Client::SendStatsWindow(Client* client, bool use_window)
}
void Client::SendAltCurrencies() {
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
uint32 count = zone->AlternateCurrencies.size();
if(count == 0) {
return;
@@ -7439,7 +7439,7 @@ void Client::SendMercPersonalInfo()
if(mercData)
{
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
if (mercCount > 0)
{
@@ -7550,7 +7550,7 @@ void Client::SendClearMercInfo()
void Client::DuplicateLoreMessage(uint32 ItemID)
{
if (!(m_ClientVersionBit & BIT_RoFAndLater))
if (!(m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater))
{
Message_StringID(0, PICK_LORE);
return;
+8 -7
View File
@@ -33,7 +33,8 @@ struct Item_Struct;
#include "../common/ptimer.h"
#include "../common/emu_opcodes.h"
#include "../common/eq_packet_structs.h"
#include "../common/eq_constants.h"
//#include "../common/eq_constants.h"
#include "../common/emu_constants.h" // inv2 watch
#include "../common/eq_stream_intf.h"
#include "../common/eq_packet.h"
#include "../common/linked_list.h"
@@ -43,7 +44,7 @@ struct Item_Struct;
#include "../common/item.h"
#include "../common/guilds.h"
#include "../common/item_struct.h"
#include "../common/clientversions.h"
//#include "../common/clientversions.h"
#include "common.h"
#include "merc.h"
@@ -976,9 +977,9 @@ public:
inline int ActiveTasksInSet(int TaskSet) { return (taskstate ? taskstate->ActiveTasksInSet(TaskSet) :0); }
inline int CompletedTasksInSet(int TaskSet) { return (taskstate ? taskstate->CompletedTasksInSet(TaskSet) :0); }
inline const ClientVersion GetClientVersion() const { return m_ClientVersion; }
inline const uint32 GetClientVersionBit() const { return m_ClientVersionBit; }
inline void SetClientVersion(ClientVersion in) { m_ClientVersion = in; }
inline const EQEmu::versions::ClientVersion ClientVersion() const { return m_ClientVersion; }
inline const uint32 ClientVersionBit() const { return m_ClientVersionBit; }
inline void SetClientVersion(EQEmu::versions::ClientVersion client_version) { m_ClientVersion = client_version; }
/** Adventure Stuff **/
void SendAdventureError(const char *error);
@@ -1096,7 +1097,7 @@ public:
void HandleLFGuildResponse(ServerPacket *pack);
void SendLFGuildStatus();
void SendGuildLFGuildStatus();
inline bool XTargettingAvailable() const { return ((m_ClientVersionBit & BIT_UFAndLater) && RuleB(Character, EnableXTargetting)); }
inline bool XTargettingAvailable() const { return ((m_ClientVersionBit & EQEmu::versions::bit_UFAndLater) && RuleB(Character, EnableXTargetting)); }
inline uint8 GetMaxXTargets() const { return MaxXTargets; }
void SetMaxXTargets(uint8 NewMax);
bool IsXTarget(const Mob *m) const;
@@ -1489,7 +1490,7 @@ private:
Timer *GlobalChatLimiterTimer; //60 seconds
uint32 AttemptedMessages;
ClientVersion m_ClientVersion;
EQEmu::versions::ClientVersion m_ClientVersion;
uint32 m_ClientVersionBit;
int XPRate;
+6 -6
View File
@@ -42,7 +42,7 @@ int32 Client::GetMaxStat() const
if (level < 61) {
base = 255;
}
else if (GetClientVersion() >= ClientVersion::SoF) {
else if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
base = 255 + 5 * (level - 60);
}
else if (level < 71) {
@@ -409,7 +409,7 @@ uint32 Mob::GetClassLevelFactor()
int32 Client::CalcBaseHP()
{
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int stats = GetSTA();
if (stats > 255) {
stats = (stats - 255) / 2;
@@ -1162,7 +1162,7 @@ int32 Client::CalcBaseMana()
switch (GetCasterClass()) {
case 'I':
WisInt = GetINT();
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if (WisInt > 201) {
@@ -1195,7 +1195,7 @@ int32 Client::CalcBaseMana()
break;
case 'W':
WisInt = GetWIS();
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (WisInt > 100) {
ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100);
if (WisInt > 201) {
@@ -1355,7 +1355,7 @@ uint32 Client::CalcCurrentWeight()
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
*/
// SoD+ client has no weight for coin
if (EQEmu::limits::CoinHasWeight(GetClientVersion())) {
if (EQEmu::limits::CoinHasWeight(EQEmu::versions::ConvertClientVersionToInventoryVersion(ClientVersion()))) {
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
}
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
@@ -2140,7 +2140,7 @@ void Client::CalcMaxEndurance()
int32 Client::CalcBaseEndurance()
{
int32 base_end = 0;
if (GetClientVersion() >= ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
double heroic_stats = (GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4.0f;
double stats = (GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4.0f;
if (stats > 201.0f) {
+30 -30
View File
@@ -510,7 +510,7 @@ void Client::CompleteConnect()
if (IsInAGuild()){
uint8 rank = GuildRank();
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
switch (rank) {
case 0: { rank = 5; break; } // GUILD_MEMBER 0
@@ -831,7 +831,7 @@ void Client::CompleteConnect()
if (zone->GetZoneID() == RuleI(World, GuildBankZoneID) && GuildBanks)
GuildBanks->SendGuildBank(this);
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
entity_list.SendFindableNPCList(this);
if (IsInAGuild()) {
@@ -846,7 +846,7 @@ void Client::CompleteConnect()
worldserver.SendPacket(pack);
delete pack;
if (IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater) {
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater) {
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
}
@@ -1044,7 +1044,7 @@ void Client::Handle_Connect_OP_ReqClientSpawn(const EQApplicationPacket *app)
outapp = new EQApplicationPacket(OP_SendExpZonein, 0);
FastQueuePacket(&outapp);
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
outapp = new EQApplicationPacket(OP_ClientReady, 0);
FastQueuePacket(&outapp);
@@ -1103,7 +1103,7 @@ void Client::Handle_Connect_OP_SendExpZonein(const EQApplicationPacket *app)
safe_delete(outapp);
// SoF+ Gets Zone-In packets after sending OP_WorldObjectsSent
if (GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
{
SendZoneInPackets();
}
@@ -1199,8 +1199,8 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
conn_state = ReceivedZoneEntry;
SetClientVersion(Connection()->GetClientVersion());
m_ClientVersionBit = ClientBitFromVersion(Connection()->GetClientVersion());
SetClientVersion(Connection()->ClientVersion());
m_ClientVersionBit = EQEmu::versions::ConvertClientVersionToClientVersionBit(Connection()->ClientVersion());
bool siv = m_inv.SetInventoryVersion(m_ClientVersion);
Log.Out(Logs::General, Logs::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), ClientVersionName(m_ClientVersion), m_ClientVersion);
@@ -1387,7 +1387,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
m_pp.guild_id = GuildID();
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
// FIXME: RoF guild rank
if (GetClientVersion() >= ClientVersion::RoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
switch (rank) {
case 0:
rank = 5;
@@ -1441,7 +1441,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
if (m_pp.ldon_points_available < 0 || m_pp.ldon_points_available > 2000000000){ m_pp.ldon_points_available = 0; }
if(RuleB(World, UseClientBasedExpansionSettings)) {
m_pp.expansions = ExpansionFromClientVersion(GetClientVersion());
m_pp.expansions = EQEmu::versions::ConvertClientVersionToExpansion(ClientVersion());
}
else {
m_pp.expansions = RuleI(World, ExpansionSettings);
@@ -1696,13 +1696,13 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
/* Task Packets */
LoadClientTaskState();
if (GetClientVersion() >= ClientVersion::RoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
outapp = new EQApplicationPacket(OP_ReqNewZone, 0);
Handle_Connect_OP_ReqNewZone(outapp);
safe_delete(outapp);
}
if (m_ClientVersionBit & BIT_UFAndLater) {
if (m_ClientVersionBit & EQEmu::versions::bit_UFAndLater) {
outapp = new EQApplicationPacket(OP_XTargetResponse, 8);
outapp->WriteUInt32(GetMaxXTargets());
outapp->WriteUInt32(0);
@@ -2926,7 +2926,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
AugmentItem_Struct* in_augment = (AugmentItem_Struct*)app->pBuffer;
bool deleteItems = false;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
ItemInst *itemOneToPush = nullptr, *itemTwoToPush = nullptr;
@@ -4252,7 +4252,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app)
QueuePacket(&end_trade2);
// RoF sends a 0 sized packet for closing objects
if (GetTradeskillObject() && GetClientVersion() >= ClientVersion::RoF)
if (GetTradeskillObject() && ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
GetTradeskillObject()->CastToObject()->Close();
return;
@@ -5141,7 +5141,7 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
int16 AlcoholTolerance = GetSkill(SkillAlcoholTolerance);
int16 IntoxicationIncrease;
if (GetClientVersion() < ClientVersion::SoD)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoD)
IntoxicationIncrease = (200 - AlcoholTolerance) * 30 / 200 + 10;
else
IntoxicationIncrease = (270 - AlcoholTolerance) * 0.111111108 + 10;
@@ -5453,7 +5453,7 @@ void Client::Handle_OP_EndLootRequest(const EQApplicationPacket *app)
Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer));
if (entity == 0) {
Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
Corpse::SendEndLootErrorPacket(this);
else
Corpse::SendLootReqErrorPacket(this);
@@ -7333,11 +7333,11 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
gc->guildeqid = GuildID();
// Convert Membership Level between RoF and previous clients.
if (client->GetClientVersion() < ClientVersion::RoF && GetClientVersion() >= ClientVersion::RoF)
if (client->ClientVersion() < EQEmu::versions::ClientVersion::RoF && ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
gc->officer = 0;
}
if (client->GetClientVersion() >= ClientVersion::RoF && GetClientVersion() < ClientVersion::RoF)
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::RoF && ClientVersion() < EQEmu::versions::ClientVersion::RoF)
{
gc->officer = 8;
}
@@ -7378,7 +7378,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
uint32 guildrank = gj->response;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
if (gj->response > 9)
{
@@ -7413,11 +7413,11 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
{
Client* client = inviter->CastToClient();
// Convert Membership Level between RoF and previous clients.
if (client->GetClientVersion() < ClientVersion::RoF && GetClientVersion() >= ClientVersion::RoF)
if (client->ClientVersion() < EQEmu::versions::ClientVersion::RoF && ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
guildrank = 0;
}
if (client->GetClientVersion() >= ClientVersion::RoF && GetClientVersion() < ClientVersion::RoF)
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::RoF && ClientVersion() < EQEmu::versions::ClientVersion::RoF)
{
guildrank = 8;
}
@@ -7454,7 +7454,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
guildrank = gj->response;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
if (gj->response == 8)
{
@@ -8060,7 +8060,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app)
Mob* tmp = entity_list.GetMob(ins->TargetID);
if (tmp != 0 && tmp->IsClient()) {
if (tmp->CastToClient()->GetClientVersion() < ClientVersion::SoF) { tmp->CastToClient()->QueuePacket(app); } // Send request to target
if (tmp->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) { tmp->CastToClient()->QueuePacket(app); } // Send request to target
// Inspecting an SoF or later client will make the server handle the request
else { ProcessInspectRequest(tmp->CastToClient(), this); }
}
@@ -8563,7 +8563,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
}
else
{
if (GetClientVersion() >= ClientVersion::SoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
{
if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol)
{
@@ -9391,14 +9391,14 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
return;
}
mercTypeCount = tar->GetNumMercTypes(static_cast<unsigned int>(GetClientVersion()));
mercCount = tar->GetNumMercs(static_cast<unsigned int>(GetClientVersion()));
mercTypeCount = tar->GetNumMercTypes(static_cast<unsigned int>(ClientVersion()));
mercCount = tar->GetNumMercs(static_cast<unsigned int>(ClientVersion()));
if (mercCount > MAX_MERC)
return;
std::list<MercType> mercTypeList = tar->GetMercTypesList(static_cast<unsigned int>(GetClientVersion()));
std::list<MercData> mercDataList = tar->GetMercsList(static_cast<unsigned int>(GetClientVersion()));
std::list<MercType> mercTypeList = tar->GetMercTypesList(static_cast<unsigned int>(ClientVersion()));
std::list<MercData> mercDataList = tar->GetMercsList(static_cast<unsigned int>(ClientVersion()));
int i = 0;
int StanceCount = 0;
@@ -11320,7 +11320,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app)
}
BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer;
ReadBook(book);
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
{
EQApplicationPacket EndOfBook(OP_FinishWindow, 0);
QueuePacket(&EndOfBook);
@@ -12669,7 +12669,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
{
if (!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
{
if (GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
{
char *hack_str = nullptr;
MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Invis: %i", sa->parameter);
@@ -13519,7 +13519,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
this->Trader_StartTrader();
// This refreshes the Trader window to display the End Trader button
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Trader, sizeof(TraderStatus_Struct));
TraderStatus_Struct* tss = (TraderStatus_Struct*)outapp->pBuffer;
+6 -6
View File
@@ -126,7 +126,7 @@ bool Client::Process() {
HandleRespawnFromHover(0);
}
if(IsTracking() && (GetClientVersion() >= ClientVersion::SoD) && TrackingTimer.Check())
if (IsTracking() && (ClientVersion() >= EQEmu::versions::ClientVersion::SoD) && TrackingTimer.Check())
DoTracking();
// SendHPUpdate calls hpupdate_timer.Start so it can delay this timer, so lets not reset with the check
@@ -800,7 +800,7 @@ void Client::BulkSendInventoryItems() {
}
// Power Source
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
const ItemInst* inst = m_inv[SlotPowerSource];
if(inst) {
std::string packet = inst->Serialize(SlotPowerSource);
@@ -890,7 +890,7 @@ void Client::BulkSendInventoryItems()
void Client::BulkSendMerchantInventory(int merchant_id, int npcid) {
const Item_Struct* handyitem = nullptr;
uint32 numItemSlots = 80; //The max number of items passed in the transaction.
if (m_ClientVersionBit & BIT_RoFAndLater) { // RoF+ can send 200 items
if (m_ClientVersionBit & EQEmu::versions::bit_RoFAndLater) { // RoF+ can send 200 items
numItemSlots = 200;
}
const Item_Struct *item;
@@ -1554,7 +1554,7 @@ void Client::OPGMTraining(const EQApplicationPacket *app)
}
}
if (GetClientVersion() < ClientVersion::RoF2 && GetClass() == BERSERKER) {
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF2 && GetClass() == BERSERKER) {
gmtrain->skills[Skill1HPiercing] = gmtrain->skills[Skill2HPiercing];
gmtrain->skills[Skill2HPiercing] = 0;
}
@@ -1734,7 +1734,7 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app)
}
}
if(GetClientVersion() >= ClientVersion::SoF) {
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
// The following packet decreases the skill points left in the Training Window and
// produces the 'You have increased your skill / learned the basics of' message.
//
@@ -2174,7 +2174,7 @@ void Client::ClearHover()
entity_list.QueueClients(this, outapp, false);
safe_delete(outapp);
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater)
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
+1 -1
View File
@@ -2562,7 +2562,7 @@ void command_peekinv(Client *c, const Seperator *sep)
indexMain, ((item_data == nullptr) ? 0 : item_data->ID), item_link.c_str(), ((inst_main == nullptr) ? 0 : inst_main->GetCharges()));
}
if ((scopeWhere & peekWorn) && (targetClient->GetClientVersion() >= ClientVersion::SoF)) {
if ((scopeWhere & peekWorn) && (targetClient->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)) {
inst_main = targetClient->GetInv().GetItem(SlotPowerSource);
item_data = (inst_main == nullptr) ? nullptr : inst_main->GetItem();
linker.SetItemInst(inst_main);
+5 -5
View File
@@ -313,7 +313,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
// cash
// Let's not move the cash when 'RespawnFromHover = true' && 'client->GetClientVersion() < EQClientSoF' since the client doesn't.
// (change to first client that supports 'death hover' mode, if not SoF.)
if (!RuleB(Character, RespawnFromHover) || client->GetClientVersion() < ClientVersion::SoF) {
if (!RuleB(Character, RespawnFromHover) || client->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
SetCash(pp->copper, pp->silver, pp->gold, pp->platinum);
pp->copper = 0;
pp->silver = 0;
@@ -329,7 +329,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
std::list<uint32> removed_list;
for(i = SLOT_BEGIN; i < EQEmu::constants::TYPE_POSSESSIONS_SIZE; ++i) {
if(i == SlotAmmo && client->GetClientVersion() >= ClientVersion::SoF) {
if (i == SlotAmmo && client->ClientVersion() >= EQEmu::versions::ClientVersion::SoF) {
item = client->GetInv().GetItem(SlotPowerSource);
if (item != nullptr) {
if (!client->IsBecomeNPC() || (client->IsBecomeNPC() && !item->GetItem()->NoRent))
@@ -1000,7 +1000,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, client->GetClientVersion());
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(client->ClientVersion()), TypeCorpse);
for(; cur != end; ++cur) {
ServerLootItem_Struct* item_data = *cur;
@@ -1060,7 +1060,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
// This is required for the 'Loot All' feature to work for SoD clients. I expect it is to tell the client that the
// server has now sent all the items on the corpse.
if(client->GetClientVersion() >= ClientVersion::SoD) { SendLootReqErrorPacket(client, 6); }
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) { SendLootReqErrorPacket(client, 6); }
}
void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
@@ -1294,7 +1294,7 @@ void Corpse::QueryLoot(Client* to) {
cur = itemlist.begin();
end = itemlist.end();
int corpselootlimit = EQEmu::limits::InventoryMapSize(TypeCorpse, to->GetClientVersion());
int corpselootlimit = EQEmu::limits::InventoryTypeSize(EQEmu::versions::ConvertClientVersionToInventoryVersion(to->ClientVersion()), TypeCorpse);
for(; cur != end; ++cur) {
ServerLootItem_Struct* sitem = *cur;
+3 -3
View File
@@ -867,7 +867,7 @@ bool EntityList::MakeDoorSpawnPacket(EQApplicationPacket *app, Client *client)
if (door_list.empty())
return false;
uint32 mask_test = client->GetClientVersionBit();
uint32 mask_test = client->ClientVersionBit();
int count = 0;
auto it = door_list.begin();
@@ -1474,7 +1474,7 @@ void EntityList::QueueClientsByTarget(Mob *sender, const EQApplicationPacket *ap
}
}
if (Send && (c->GetClientVersionBit() & ClientVersionBits))
if (Send && (c->ClientVersionBit() & ClientVersionBits))
c->QueuePacket(app, ackreq);
}
}
@@ -4406,7 +4406,7 @@ void EntityList::UpdateFindableNPCState(NPC *n, bool Remove)
auto it = client_list.begin();
while (it != client_list.end()) {
Client *c = it->second;
if (c && (c->GetClientVersion() >= ClientVersion::SoD))
if (c && (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoD))
c->QueuePacket(outapp);
++it;
+8 -8
View File
@@ -395,7 +395,7 @@ void Group::SendHPPacketsTo(Mob *member)
{
members[i]->CreateHPPacket(&hpapp);
member->CastToClient()->QueuePacket(&hpapp, false);
if(member->CastToClient()->GetClientVersion() >= ClientVersion::SoD)
if (member->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
@@ -426,7 +426,7 @@ void Group::SendHPPacketsFrom(Mob *member)
if(members[i] && members[i] != member && members[i]->IsClient())
{
members[i]->CastToClient()->QueuePacket(&hp_app);
if(members[i]->CastToClient()->GetClientVersion() >= ClientVersion::SoD)
if (members[i]->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
@@ -566,7 +566,7 @@ bool Group::DelMemberOOZ(const char *Name) {
if(GroupCount() < 3)
{
UnDelegateMarkNPC(NPCMarkerName.c_str());
if(GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->GetClientVersion() < ClientVersion::SoD) {
if (GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoD) {
UnDelegateMainAssist(MainAssistName.c_str());
}
ClearAllNPCMarks();
@@ -724,7 +724,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender)
if(GroupCount() < 3)
{
UnDelegateMarkNPC(NPCMarkerName.c_str());
if(GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->GetClientVersion() < ClientVersion::SoD) {
if (GetLeader() && GetLeader()->IsClient() && GetLeader()->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoD) {
UnDelegateMainAssist(MainAssistName.c_str());
}
ClearAllNPCMarks();
@@ -1604,7 +1604,7 @@ void Group::NotifyMainTank(Client *c, uint8 toggle)
if(!MainTankName.size())
return;
if(c->GetClientVersion() < ClientVersion::SoD)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
if(toggle)
c->Message(0, "%s is now Main Tank.", MainTankName.c_str());
@@ -1644,7 +1644,7 @@ void Group::NotifyMainAssist(Client *c, uint8 toggle)
if(!MainAssistName.size())
return;
if(c->GetClientVersion() < ClientVersion::SoD)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket *outapp = new EQApplicationPacket(OP_DelegateAbility, sizeof(DelegateAbility_Struct));
@@ -1699,7 +1699,7 @@ void Group::NotifyPuller(Client *c, uint8 toggle)
if(!PullerName.size())
return;
if(c->GetClientVersion() < ClientVersion::SoD)
if (c->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
if(toggle)
c->Message(0, "%s is now Puller.", PullerName.c_str());
@@ -2265,7 +2265,7 @@ void Group::ChangeLeader(Mob* newleader)
for (uint32 i = 0; i < MAX_GROUP_MEMBERS; i++) {
if (members[i] && members[i]->IsClient())
{
if(members[i]->CastToClient()->GetClientVersion() >= ClientVersion::SoD)
if (members[i]->CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
members[i]->CastToClient()->SendGroupLeaderChangePacket(newleader->GetName());
members[i]->CastToClient()->QueuePacket(outapp);
+5 -5
View File
@@ -63,7 +63,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
void Client::SendGuildURL()
{
if(GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
return;
if(IsInAGuild())
@@ -84,7 +84,7 @@ void Client::SendGuildURL()
void Client::SendGuildChannel()
{
if(GetClientVersion() < ClientVersion::SoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::SoF)
return;
if(IsInAGuild())
@@ -106,7 +106,7 @@ void Client::SendGuildChannel()
void Client::SendGuildRanks()
{
if(GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
return;
int permissions = 30 + 1; //Static number of permissions in all EQ clients as of May 2014
@@ -149,7 +149,7 @@ void Client::SendGuildSpawnAppearance() {
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
SendAppearancePacket(AT_GuildID, GuildID());
if(GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
switch (rank) {
case 0: { rank = 5; break; } // GUILD_MEMBER 0
@@ -249,7 +249,7 @@ void Client::RefreshGuildInfo()
if((guild_id != OldGuildID) && GuildBanks)
{
// Unsure about this for RoF+ ... But they don't have that action anymore so fuck it
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
ClearGuildBank();
if(guild_id != GUILD_NONE)
+2 -2
View File
@@ -322,7 +322,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) {
else if(c != nullptr && s->guild_id != GUILD_NONE) {
//char is in zone, and has changed into a new guild, send MOTD.
c->SendGuildMOTD();
if(c->GetClientVersion() >= ClientVersion::RoF)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
c->SendGuildRanks();
}
@@ -691,7 +691,7 @@ void GuildBankManager::SendGuildBank(Client *c)
auto &guild_bank = *Iterator;
// RoF+ uses a bulk list packet -- This is also how the Action 0 of older clients basically works
if (c->GetClientVersionBit() & BIT_RoFAndLater) {
if (c->ClientVersionBit() & EQEmu::versions::bit_RoFAndLater) {
auto outapp = new EQApplicationPacket(OP_GuildBankItemList, sizeof(GuildBankItemListEntry_Struct) * 240);
for (int i = 0; i < GUILD_BANK_DEPOSIT_AREA_SIZE; ++i) {
const Item_Struct *Item = database.GetItem(guild_bank->Items.DepositArea[i].ItemID);
+7 -7
View File
@@ -56,7 +56,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
x++;
}
if (GetClientVersion() >= ClientVersion::SoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
DeleteItemInInventory(SlotPowerSource, 0, true);
else
DeleteItemInInventory(SlotPowerSource, 0, false); // Prevents Titanium crash
@@ -685,7 +685,7 @@ void Client::SendCursorBuffer()
// Temporary work-around for the RoF+ Client Buffer
// Instead of dealing with client moving items in cursor buffer,
// we can just send the next item in the cursor buffer to the cursor.
if (GetClientVersion() < ClientVersion::RoF) { return; }
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF) { return; }
if (GetInv().CursorEmpty()) { return; }
auto test_inst = GetInv().GetCursorItem();
@@ -898,7 +898,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
// Subordinate items in cursor buffer must be sent via ItemPacketSummonItem or we just overwrite the visible cursor and desync the client
if (slot_id == SlotCursor && !cursor_empty) {
// RoF+ currently has a specialized cursor handler
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendItemPacket(slot_id, &inst, ItemPacketSummonItem);
}
else {
@@ -991,7 +991,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
for (int16 i = EQEmu::constants::EQUIPMENT_BEGIN; i < SlotPowerSource; i++) { // originally (i < 22)
if (i == EQEmu::constants::GENERAL_BEGIN) {
// added power source check for SoF+ clients
if (this->GetClientVersion() >= ClientVersion::SoF)
if (this->ClientVersion() >= EQEmu::versions::ClientVersion::SoF)
i = SlotPowerSource;
else
break;
@@ -1375,7 +1375,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if (move_in->from_slot == move_in->to_slot) { // Item summon, no further processing needed
if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit
if (GetClientVersion() >= ClientVersion::RoF) { return true; } // Can't do RoF+
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF) { return true; } // Can't do RoF+
if (move_in->to_slot == SlotCursor) {
auto test_inst = m_inv.GetItem(SlotCursor);
@@ -2358,7 +2358,7 @@ void Client::RemoveNoRent(bool client_update)
auto inst = m_inv[SlotPowerSource];
if (inst && !inst->GetItem()->NoRent) {
Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, SlotPowerSource);
DeleteItemInInventory(SlotPowerSource, 0, (GetClientVersion() >= ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
DeleteItemInInventory(SlotPowerSource, 0, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false); // Ti slot non-existent
}
}
@@ -2576,7 +2576,7 @@ void Client::MoveSlotNotAllowed(bool client_update)
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow);
Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, SlotPowerSource, free_slot_id);
PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= ClientVersion::SoF) ? client_update : false);
PutItemInInventory(free_slot_id, *inst, (ClientVersion() >= EQEmu::versions::ClientVersion::SoF) ? client_update : false);
database.SaveInventory(character_id, nullptr, SlotPowerSource);
safe_delete(inst);
}
+2 -2
View File
@@ -854,12 +854,12 @@ void Lua_Client::SetAATitle(const char *title) {
int Lua_Client::GetClientVersion() {
Lua_Safe_Call_Int();
return static_cast<unsigned int>(self->GetClientVersion());
return static_cast<unsigned int>(self->ClientVersion());
}
uint32 Lua_Client::GetClientVersionBit() {
Lua_Safe_Call_Int();
return self->GetClientVersionBit();
return self->ClientVersionBit();
}
void Lua_Client::SetTitleSuffix(const char *text) {
+8 -8
View File
@@ -1829,14 +1829,14 @@ luabind::scope lua_register_client_version() {
return luabind::class_<ClientVersions>("ClientVersion")
.enum_("constants")
[
luabind::value("Unknown", static_cast<int>(ClientVersion::Unknown)),
luabind::value("Titanium", static_cast<int>(ClientVersion::Titanium)),
luabind::value("SoF", static_cast<int>(ClientVersion::SoF)),
luabind::value("SoD", static_cast<int>(ClientVersion::SoD)),
luabind::value("Underfoot", static_cast<int>(ClientVersion::UF)), // deprecated
luabind::value("UF", static_cast<int>(ClientVersion::UF)),
luabind::value("RoF", static_cast<int>(ClientVersion::RoF)),
luabind::value("RoF2", static_cast<int>(ClientVersion::RoF2))
luabind::value("Unknown", static_cast<int>(EQEmu::versions::ClientVersion::Unknown)),
luabind::value("Titanium", static_cast<int>(EQEmu::versions::ClientVersion::Titanium)),
luabind::value("SoF", static_cast<int>(EQEmu::versions::ClientVersion::SoF)),
luabind::value("SoD", static_cast<int>(EQEmu::versions::ClientVersion::SoD)),
luabind::value("Underfoot", static_cast<int>(EQEmu::versions::ClientVersion::UF)), // deprecated
luabind::value("UF", static_cast<int>(EQEmu::versions::ClientVersion::UF)),
luabind::value("RoF", static_cast<int>(EQEmu::versions::ClientVersion::RoF)),
luabind::value("RoF2", static_cast<int>(EQEmu::versions::ClientVersion::RoF2))
];
}
+22 -22
View File
@@ -50,7 +50,7 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
_baseFR = d->FR;
_basePR = d->PR;
_baseCorrup = d->Corrup;
_OwnerClientVersion = static_cast<unsigned int>(ClientVersion::Titanium);
_OwnerClientVersion = static_cast<unsigned int>(EQEmu::versions::ClientVersion::Titanium);
RestRegenHP = 0;
RestRegenMana = 0;
RestRegenEndurance = 0;
@@ -1018,7 +1018,7 @@ int32 Merc::CalcBaseEndurance()
int32 sta_end = 0;
int Stats = 0;
if(GetClientVersion() >= static_cast<unsigned int>(ClientVersion::SoD) && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
if (GetClientVersion() >= static_cast<unsigned int>(EQEmu::versions::ClientVersion::SoD) && RuleB(Character, SoDClientUseSoDHPManaEnd)) {
int HeroicStats = 0;
Stats = ((GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4);
@@ -5127,109 +5127,109 @@ void Client::SendMercResponsePackets(uint32 ResponseType)
SendMercMerchantResponsePacket(6);
break;
case 7: //You must dismiss your suspended mercenary before purchasing a new one!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(7);
else
//You have the maximum number of mercenaries. You must dismiss one before purchasing a new one!
SendMercMerchantResponsePacket(6);
break;
case 8: //You can not purchase a mercenary because your group is full!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(8);
else
SendMercMerchantResponsePacket(7);
break;
case 9: //You can not purchase a mercenary because you are in combat!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//Mercenary failed to spawn!
SendMercMerchantResponsePacket(3);
else
SendMercMerchantResponsePacket(8);
break;
case 10: //You have recently dismissed a mercenary and must wait a few more seconds before you can purchase a new one!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//Mercenary failed to spawn!
SendMercMerchantResponsePacket(3);
else
SendMercMerchantResponsePacket(9);
break;
case 11: //An error occurred created your mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(9);
else
SendMercMerchantResponsePacket(10);
break;
case 12: //Upkeep Charge Message
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(10);
else
SendMercMerchantResponsePacket(11);
break;
case 13: // ???
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(11);
else
SendMercMerchantResponsePacket(12);
break;
case 14: //You ran out of funds to pay for your mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(12);
else
SendMercMerchantResponsePacket(13);
break;
case 15: // ???
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(13);
else
SendMercMerchantResponsePacket(14);
break;
case 16: //Your mercenary is about to be suspended due to insufficient funds!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(14);
else
SendMercMerchantResponsePacket(15);
break;
case 17: //There is no mercenary liaison nearby!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(15);
else
SendMercMerchantResponsePacket(16);
break;
case 18: //You are too far from the liaison!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(16);
else
SendMercMerchantResponsePacket(17);
break;
case 19: //You do not meet the requirements for that mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
SendMercMerchantResponsePacket(17);
else
SendMercMerchantResponsePacket(18);
break;
case 20: //You are unable to interact with the liaison!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You are too far from the liaison!
SendMercMerchantResponsePacket(16);
else
SendMercMerchantResponsePacket(19);
break;
case 21: //You do not have a high enough membership level to purchase this mercenary!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You do not meet the requirements for that mercenary!
SendMercMerchantResponsePacket(17);
else
SendMercMerchantResponsePacket(20);
break;
case 22: //Your purchase has failed because this mercenary requires a Gold membership!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You do not meet the requirements for that mercenary!
SendMercMerchantResponsePacket(17);
else
SendMercMerchantResponsePacket(21);
break;
case 23: //Your purchase has failed because this mercenary requires at least a Silver membership!
if (GetClientVersion() < ClientVersion::RoF)
if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
//You do not meet the requirements for that mercenary!
SendMercMerchantResponsePacket(17);
else
@@ -5380,7 +5380,7 @@ bool Client::CheckCanSpawnMerc(uint32 template_id) {
}
// Check client version
if(static_cast<unsigned int>(GetClientVersion()) < mercTemplate->ClientVersion)
if(static_cast<unsigned int>(ClientVersion()) < mercTemplate->ClientVersion)
{
SendMercResponsePackets(3);
return false;
@@ -6036,7 +6036,7 @@ void Client::SetMerc(Merc* newmerc) {
//Client* oldowner = entity_list.GetClientByID(newmerc->GetOwnerID());
newmerc->SetOwnerID(this->GetID());
newmerc->SetMercCharacterID(this->CharacterID());
newmerc->SetClientVersion((uint8)this->GetClientVersion());
newmerc->SetClientVersion((uint8)this->ClientVersion());
GetMercInfo().mercid = newmerc->GetMercID();
GetMercInfo().MercTemplateID = newmerc->GetMercTemplateID();
GetMercInfo().myTemplate = zone->GetMercTemplate(GetMercInfo().MercTemplateID);
@@ -6060,7 +6060,7 @@ void Client::UpdateMercLevel() {
void Client::SendMercMerchantResponsePacket(int32 response_type) {
// This response packet brings up the Mercenary Manager window
if(GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryHire, sizeof(MercenaryMerchantResponse_Struct));
MercenaryMerchantResponse_Struct* mmr = (MercenaryMerchantResponse_Struct*)outapp->pBuffer;
+2 -2
View File
@@ -1284,7 +1284,7 @@ void Mob::SendHPUpdate(bool skip_self)
CreateHPPacket(&hp_app);
// send to people who have us targeted
entity_list.QueueClientsByTarget(this, &hp_app, false, 0, false, true, BIT_AllClients);
entity_list.QueueClientsByTarget(this, &hp_app, false, 0, false, true, EQEmu::versions::bit_AllClients);
entity_list.QueueClientsByXTarget(this, &hp_app, false);
entity_list.QueueToGroupsForNPCHealthAA(this, &hp_app);
@@ -5031,7 +5031,7 @@ uint16 Mob::GetSkillByItemType(int ItemType)
case ItemType2HBlunt:
return Skill2HBlunt;
case ItemType2HPiercing:
if (IsClient() && CastToClient()->GetClientVersion() < ClientVersion::RoF2)
if (IsClient() && CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::RoF2)
return Skill1HPiercing;
else
return Skill2HPiercing;
+1 -1
View File
@@ -24,7 +24,7 @@
#include "../common/seperator.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/clientversions.h"
#include "../common/client_version.h" // inv2 watch
#include "../common/features.h"
#include "../common/item.h"
#include "../common/item_struct.h"
+2 -2
View File
@@ -117,7 +117,7 @@ Object::Object(Client* client, const ItemInst* inst)
m_data.heading = client->GetHeading();
m_data.x = client->GetX();
m_data.y = client->GetY();
if (client->GetClientVersion() >= ClientVersion::RoF2)
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::RoF2)
{
// RoF2 places items at player's Z, which is 0.625 of their height.
m_data.z = client->GetZ() - (client->GetSize() * 0.625f);
@@ -548,7 +548,7 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object)
else {
coa->open = 0x00;
if (sender->GetClientVersion() >= ClientVersion::RoF) {
if (sender->ClientVersion() >= EQEmu::versions::ClientVersion::RoF) {
coa->drop_id = 0xFFFFFFFF;
sender->Message(0, "Someone else is using that. Try again later.");
}
+2 -2
View File
@@ -3974,7 +3974,7 @@ XS(XS_Client_GetClientVersion)
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = static_cast<unsigned int>(THIS->GetClientVersion());
RETVAL = static_cast<unsigned int>(THIS->ClientVersion());
XSprePUSH; PUSHu((UV)RETVAL);
}
XSRETURN(1);
@@ -4000,7 +4000,7 @@ XS(XS_Client_GetClientVersionBit)
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetClientVersionBit();
RETVAL = THIS->ClientVersionBit();
XSprePUSH; PUSHu((UV)RETVAL);
}
XSRETURN(1);
+1 -1
View File
@@ -475,7 +475,7 @@ void Pet::SetTarget(Mob *mob)
return;
auto owner = GetOwner();
if (owner && owner->IsClient() && owner->CastToClient()->GetClientVersionBit() & BIT_UFAndLater) {
if (owner && owner->IsClient() && owner->CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater) {
auto app = new EQApplicationPacket(OP_PetHoTT, sizeof(ClientTarget_Struct));
auto ct = (ClientTarget_Struct *)app->pBuffer;
ct->new_target = mob ? mob->GetID() : 0;
+2 -2
View File
@@ -1529,7 +1529,7 @@ void Raid::SendHPPacketsTo(Client *c)
{
members[x].member->CreateHPPacket(&hpapp);
c->QueuePacket(&hpapp, false);
if(c->GetClientVersion() >= ClientVersion::SoD)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
@@ -1565,7 +1565,7 @@ void Raid::SendHPPacketsFrom(Mob *m)
if(!m->IsClient() || ((members[x].member != m->CastToClient()) && (members[x].GroupNumber == gid)))
{
members[x].member->QueuePacket(&hpapp, false);
if(members[x].member->GetClientVersion() >= ClientVersion::SoD)
if (members[x].member->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
outapp.SetOpcode(OP_MobManaUpdate);
MobManaUpdate_Struct *mmus = (MobManaUpdate_Struct *)outapp.pBuffer;
+1 -1
View File
@@ -182,7 +182,7 @@ void Client::OPCombatAbility(const EQApplicationPacket *app) {
pTimerType timer = pTimerCombatAbility;
// RoF2+ Tiger Claw is unlinked from other monk skills, if they ever do that for other classes there will need
// to be more checks here
if (GetClientVersion() >= ClientVersion::RoF2 && ca_atk->m_skill == SkillTigerClaw)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF2 && ca_atk->m_skill == SkillTigerClaw)
timer = pTimerCombatAbility2;
/* Check to see if actually have skill */
+10 -10
View File
@@ -135,7 +135,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (spells[spell_id].EndurUpkeep > 0)
SetEndurUpkeep(true);
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater)
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
@@ -818,7 +818,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
{
CastToClient()->SetSenseExemption(true);
if(CastToClient()->GetClientVersionBit() & BIT_SoDAndLater)
if (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater)
{
bodyType bt = BT_Undead;
@@ -1627,7 +1627,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#endif
// This is handled by the client prior to SoD.
//
if(IsClient() && (CastToClient()->GetClientVersionBit() & BIT_SoDAndLater))
if (IsClient() && (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater))
CastToClient()->LocateCorpse();
break;
@@ -3374,7 +3374,7 @@ void Mob::BuffProcess()
Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining);
}
}
else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater))
else if (IsClient() && !(CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoFAndLater))
{
buffs[buffs_i].UpdateClient = true;
}
@@ -3386,7 +3386,7 @@ void Mob::BuffProcess()
{
CastToClient()->SendBuffDurationPacket(buffs[buffs_i]);
// Hack to get UF to play nicer, RoF seems fine without it
if (CastToClient()->GetClientVersion() == ClientVersion::UF && buffs[buffs_i].numhits > 0)
if (CastToClient()->ClientVersion() == EQEmu::versions::ClientVersion::UF && buffs[buffs_i].numhits > 0)
CastToClient()->SendBuffNumHitPacket(buffs[buffs_i], buffs_i);
buffs[buffs_i].UpdateClient = false;
}
@@ -3649,7 +3649,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
case SE_LocateCorpse: {
// This is handled by the client prior to SoD.
if (IsClient() && (CastToClient()->GetClientVersionBit() & BIT_SoDAndLater))
if (IsClient() && (CastToClient()->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater))
CastToClient()->LocateCorpse();
}
case SE_TotalHP: {
@@ -4113,7 +4113,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
{
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater);
if(IsClient() && GetTarget() == this) {
CastToClient()->QueuePacket(outapp);
}
@@ -4123,11 +4123,11 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if (IsNPC()) {
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater, true);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater, true);
safe_delete(outapp);
}
if(IsClient() && CastToClient()->GetClientVersionBit() & BIT_UFAndLater)
if (IsClient() && CastToClient()->ClientVersionBit() & EQEmu::versions::bit_UFAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket(false);
CastToClient()->FastQueuePacket(&outapp);
@@ -6574,7 +6574,7 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed){
if (spells[spell_id].resisttype == RESIST_FIRE) {
if (IsClient()){
if (CastToClient()->GetClientVersionBit() <= 4) //Titanium needs alternate graphic.
if (CastToClient()->ClientVersionBit() <= 4) //Titanium needs alternate graphic.
ProjectileAnimation(spell_target,(RuleI(Spells, FRProjectileItem_Titanium)), false, speed);
else
ProjectileAnimation(spell_target,(RuleI(Spells, FRProjectileItem_SOF)), false, speed);
+8 -8
View File
@@ -259,7 +259,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
bitmask = bitmask << (CastToClient()->GetClass() - 1);
if( itm && itm->GetItem()->Classes != 65535 ) {
if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) {
if (CastToClient()->GetClientVersion() < ClientVersion::SoF) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are casting a spell from an item that requires equipping but shouldn't let them equip it
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!",
CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
@@ -271,14 +271,14 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
return(false);
}
if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) {
if (CastToClient()->GetClientVersion() < ClientVersion::SoF) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are casting a spell from an item that they don't meet the race/class requirements to cast
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!",
CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class");
}
else {
if (CastToClient()->GetClientVersion() >= ClientVersion::RoF)
if (CastToClient()->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Line 181 in eqstr_us.txt was changed in RoF+
Message(15, "Your race, class, or deity cannot use this item.");
@@ -292,7 +292,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
}
}
if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= SlotAmmo || item_slot == SlotPowerSource) ){
if (CastToClient()->GetClientVersion() < ClientVersion::SoF) {
if (CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoF) {
// They are attempting to cast a must equip clicky without having it equipped
Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID);
database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it");
@@ -3246,7 +3246,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
{
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater);
if(IsClient() && GetTarget() == this)
CastToClient()->QueuePacket(outapp);
@@ -3256,7 +3256,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
if (IsNPC()) {
EQApplicationPacket *outapp = MakeBuffsPacket();
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, BIT_SoDAndLater, true);
entity_list.QueueClientsByTarget(this, outapp, false, nullptr, true, false, EQEmu::versions::bit_SoDAndLater, true);
safe_delete(outapp);
}
@@ -5403,7 +5403,7 @@ void Client::SendBuffDurationPacket(Buffs_Struct &buff)
void Client::SendBuffNumHitPacket(Buffs_Struct &buff, int slot)
{
// UF+ use this packet
if (GetClientVersion() < ClientVersion::UF)
if (ClientVersion() < EQEmu::versions::ClientVersion::UF)
return;
EQApplicationPacket *outapp;
outapp = new EQApplicationPacket(OP_BuffCreate, sizeof(BuffIcon_Struct) + sizeof(BuffIconEntry_Struct));
@@ -5457,7 +5457,7 @@ void Mob::SendBuffsToClient(Client *c)
if(!c)
return;
if(c->GetClientVersionBit() & BIT_SoDAndLater)
if (c->ClientVersionBit() & EQEmu::versions::bit_SoDAndLater)
{
EQApplicationPacket *outapp = MakeBuffsPacket();
c->FastQueuePacket(&outapp);
+3 -3
View File
@@ -990,7 +990,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i
void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *TaskList) {
if (c->GetClientVersion() >= ClientVersion::RoF)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
SendTaskSelectorNew(c, mob, TaskCount, TaskList);
return;
@@ -2485,7 +2485,7 @@ void TaskManager::SendTaskActivityShort(Client *c, int TaskID, int ActivityID, i
TaskActivityShort_Struct* tass;
if(c->GetClientVersionBit() & BIT_RoFAndLater)
if (c->ClientVersionBit() & EQEmu::versions::bit_RoFAndLater)
{
EQApplicationPacket* outapp = new EQApplicationPacket(OP_TaskActivity, 25);
outapp->WriteUInt32(ClientTaskIndex);
@@ -2521,7 +2521,7 @@ void TaskManager::SendTaskActivityShort(Client *c, int TaskID, int ActivityID, i
void TaskManager::SendTaskActivityLong(Client *c, int TaskID, int ActivityID, int ClientTaskIndex, bool Optional, bool TaskComplete) {
if (c->GetClientVersion() >= ClientVersion::RoF)
if (c->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
SendTaskActivityNew(c, TaskID, ActivityID, ClientTaskIndex, Optional, TaskComplete);
return;
+12 -12
View File
@@ -1098,7 +1098,7 @@ void Client::Trader_EndTrader() {
for(int i = 0; i < 80; i++) {
if(gis->Items[i] != 0) {
if (Customer->GetClientVersion() >= ClientVersion::RoF)
if (Customer->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ use Item IDs for now
tdis->ItemID = gis->Items[i];
@@ -1351,7 +1351,7 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Cu
tdis->Unknown000 = 0;
tdis->TraderID = Customer->GetID();
if (Customer->GetClientVersion() >= ClientVersion::RoF)
if (Customer->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ use Item IDs for now
tdis->ItemID = itemid;
@@ -1487,7 +1487,7 @@ void Client::ReturnTraderReq(const EQApplicationPacket* app, int16 TraderItemCha
EQApplicationPacket* outapp = nullptr;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
outapp = new EQApplicationPacket(OP_TraderShop, sizeof(TraderBuy_Struct));
}
@@ -1499,7 +1499,7 @@ void Client::ReturnTraderReq(const EQApplicationPacket* app, int16 TraderItemCha
TraderBuy_Struct* outtbs = (TraderBuy_Struct*)outapp->pBuffer;
memcpy(outtbs, tbs, app->size);
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Convert Serial Number back to Item ID for RoF+
outtbs->ItemID = itemid;
@@ -1567,7 +1567,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
const ItemInst* BuyItem = nullptr;
uint32 ItemID = 0;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Convert Item ID to Serial Number for RoF+
ItemID = tbs->ItemID;
@@ -1629,7 +1629,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
// This cannot overflow assuming MAX_TRANSACTION_VALUE, checked above, is the default of 2000000000
uint32 TotalCost = tbs->Price * outtbs->Quantity;
if(Trader->GetClientVersion() >= ClientVersion::RoF)
if (Trader->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ uses individual item price where older clients use total price
outtbs->Price = tbs->Price;
@@ -1680,7 +1680,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs, Client* Trader, const EQApplic
Trader->FindAndNukeTraderItem(tbs->ItemID, outtbs->Quantity, this, 0);
if (ItemID > 0 && Trader->GetClientVersion() >= ClientVersion::RoF)
if (ItemID > 0 && Trader->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// Convert Serial Number back to ItemID for RoF+
outtbs->ItemID = ItemID;
@@ -1698,7 +1698,7 @@ void Client::SendBazaarWelcome()
auto row = results.begin();
EQApplicationPacket* outapp = nullptr;
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
outapp = new EQApplicationPacket(OP_TraderShop, sizeof(BazaarWelcome_Struct));
}
@@ -1716,7 +1716,7 @@ void Client::SendBazaarWelcome()
bws->Traders = atoi(row[0]);
bws->Items = atoi(row[1]);
if (GetClientVersion() >= ClientVersion::RoF)
if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
bws->Unknown012 = GetID();
}
@@ -2091,7 +2091,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St
for(int i = 0; i < 80; i++) {
if(gis->ItemID[i] == ItemID) {
if (Customer->GetClientVersion() >= ClientVersion::RoF)
if (Customer->ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
{
// RoF+ use Item IDs for now
tdis->ItemID = gis->ItemID[i];
@@ -2745,7 +2745,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity);
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity * Price);
if(GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); // Think this is the upper 32 bits of a 64 bit price
}
@@ -2769,7 +2769,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) {
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity);
VARSTRUCT_ENCODE_TYPE(uint32, Buf, Quantity * Price);
if(Buyer->GetClientVersion() >= ClientVersion::SoD)
if (Buyer->ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
{
VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); // Think this is the upper 32 bits of a 64 bit price
}
+1 -1
View File
@@ -864,7 +864,7 @@ void WorldServer::Process() {
database.SetGroupLeaderName(group->GetID(), Inviter->GetName());
group->UpdateGroupAAs();
if(Inviter->CastToClient()->GetClientVersion() < ClientVersion::SoD)
if (Inviter->CastToClient()->ClientVersion() < EQEmu::versions::ClientVersion::SoD)
{
EQApplicationPacket* outapp=new EQApplicationPacket(OP_GroupUpdate,sizeof(GroupJoin_Struct));
GroupJoin_Struct* outgj=(GroupJoin_Struct*)outapp->pBuffer;
+2 -2
View File
@@ -1566,7 +1566,7 @@ ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Clien
while(iterator.MoreElements())
{
ZonePoint* zp = iterator.GetData();
uint32 mask_test = client->GetClientVersionBit();
uint32 mask_test = client->ClientVersionBit();
if(!(zp->client_version_mask & mask_test))
{
iterator.Advance();
@@ -1620,7 +1620,7 @@ ZonePoint* Zone::GetClosestZonePointWithoutZone(float x, float y, float z, Clien
while(iterator.MoreElements())
{
ZonePoint* zp = iterator.GetData();
uint32 mask_test = client->GetClientVersionBit();
uint32 mask_test = client->ClientVersionBit();
if(!(zp->client_version_mask & mask_test))
{
+1 -1
View File
@@ -2823,7 +2823,7 @@ void ZoneDatabase::RefreshGroupFromDB(Client *client){
client->QueuePacket(outapp);
safe_delete(outapp);
if(client->GetClientVersion() >= ClientVersion::SoD) {
if (client->ClientVersion() >= EQEmu::versions::ClientVersion::SoD) {
group->NotifyMainTank(client, 1);
group->NotifyPuller(client, 1);
}
+2 -2
View File
@@ -562,7 +562,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
if (entity == 0)
{
Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
if (GetClientVersion() >= ClientVersion::SoD)
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
Corpse::SendEndLootErrorPacket(this);
else
Corpse::SendLootReqErrorPacket(this);
@@ -588,7 +588,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
// If we are SoF and later and are respawning from hover, we want the real zone ID, else zero to use the old hack.
//
if(zone->GetZoneID() == zoneID) {
if((GetClientVersionBit() & BIT_SoFAndLater) && (!RuleB(Character, RespawnFromHover) || !IsHoveringForRespawn()))
if ((ClientVersionBit() & EQEmu::versions::bit_SoFAndLater) && (!RuleB(Character, RespawnFromHover) || !IsHoveringForRespawn()))
gmg->bind_zone_id = 0;
else
gmg->bind_zone_id = zoneID;