mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
clang-tidy modernize-use-auto
This commit is contained in:
+61
-42
@@ -2150,7 +2150,8 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
||||
|
||||
std::list<MercSpell> buffSpellList = GetMercSpellsBySpellType(this, SpellType_Buff);
|
||||
|
||||
for(std::list<MercSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); ++itr) {
|
||||
for (auto itr = buffSpellList.begin();
|
||||
itr != buffSpellList.end(); ++itr) {
|
||||
MercSpell selectedMercSpell = *itr;
|
||||
|
||||
if(!((spells[selectedMercSpell.spellid].targettype == ST_Target || spells[selectedMercSpell.spellid].targettype == ST_Pet ||
|
||||
@@ -2309,7 +2310,8 @@ bool Merc::AICastSpell(int8 iChance, int32 iSpellTypes) {
|
||||
std::list<MercSpell> buffSpellList = GetMercSpellsBySpellType(this, SpellType_InCombatBuff);
|
||||
Mob* tar = this;
|
||||
|
||||
for(std::list<MercSpell>::iterator itr = buffSpellList.begin(); itr != buffSpellList.end(); ++itr) {
|
||||
for (auto itr = buffSpellList.begin();
|
||||
itr != buffSpellList.end(); ++itr) {
|
||||
MercSpell selectedMercSpell = *itr;
|
||||
|
||||
if(!(spells[selectedMercSpell.spellid].targettype == ST_Self)) {
|
||||
@@ -2454,7 +2456,7 @@ void Merc::CheckHateList() {
|
||||
std::list<NPC*> npc_list;
|
||||
entity_list.GetNPCList(npc_list);
|
||||
|
||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
for (auto itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
NPC* npc = *itr;
|
||||
float dist = DistanceSquaredNoZ(m_Position, npc->GetPosition());
|
||||
int radius = RuleI(Mercs, AggroRadius);
|
||||
@@ -2507,7 +2509,7 @@ bool Merc::CheckAENuke(Merc* caster, Mob* tar, uint16 spell_id, uint8 &numTarget
|
||||
std::list<NPC*> npc_list;
|
||||
entity_list.GetNPCList(npc_list);
|
||||
|
||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
for (auto itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
NPC* npc = *itr;
|
||||
|
||||
if(DistanceSquaredNoZ(npc->GetPosition(), tar->GetPosition()) <= spells[spell_id].aoerange * spells[spell_id].aoerange) {
|
||||
@@ -3066,7 +3068,8 @@ MercSpell Merc::GetBestMercSpellForVeryFastHeal(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsVeryFastHealSpell(mercSpellListItr->spellid)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3098,7 +3101,8 @@ MercSpell Merc::GetBestMercSpellForFastHeal(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsFastHealSpell(mercSpellListItr->spellid)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3130,7 +3134,8 @@ MercSpell Merc::GetBestMercSpellForHealOverTime(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercHoTSpellList = GetMercSpellsForSpellEffect(caster, SE_HealOverTime);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsHealOverTimeSpell(mercSpellListItr->spellid)) {
|
||||
|
||||
@@ -3170,7 +3175,8 @@ MercSpell Merc::GetBestMercSpellForPercentageHeal(Merc* caster) {
|
||||
if(caster && caster->AI_HasSpells()) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsCompleteHealSpell(mercSpellListItr->spellid)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3202,7 +3208,8 @@ MercSpell Merc::GetBestMercSpellForRegularSingleTargetHeal(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsRegularSingleTargetHealSpell(mercSpellListItr->spellid)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3234,7 +3241,8 @@ MercSpell Merc::GetFirstMercSpellForSingleTargetHeal(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if((IsRegularSingleTargetHealSpell(mercSpellListItr->spellid)
|
||||
|| IsFastHealSpell(mercSpellListItr->spellid))
|
||||
@@ -3267,7 +3275,8 @@ MercSpell Merc::GetBestMercSpellForGroupHeal(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CurrentHP);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsRegularGroupHealSpell(mercSpellListItr->spellid)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3299,7 +3308,8 @@ MercSpell Merc::GetBestMercSpellForGroupHealOverTime(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercHoTSpellList = GetMercSpellsForSpellEffect(caster, SE_HealOverTime);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercHoTSpellList.begin(); mercSpellListItr != mercHoTSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsGroupHealOverTimeSpell(mercSpellListItr->spellid)) {
|
||||
|
||||
@@ -3339,7 +3349,8 @@ MercSpell Merc::GetBestMercSpellForGroupCompleteHeal(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_CompleteHeal);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsGroupCompleteHealSpell(mercSpellListItr->spellid)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3371,7 +3382,8 @@ MercSpell Merc::GetBestMercSpellForAETaunt(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Taunt);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if((spells[mercSpellListItr->spellid].targettype == ST_AECaster
|
||||
|| spells[mercSpellListItr->spellid].targettype == ST_AETarget
|
||||
@@ -3405,7 +3417,8 @@ MercSpell Merc::GetBestMercSpellForTaunt(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Taunt);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if((spells[mercSpellListItr->spellid].targettype == ST_Target)
|
||||
&& CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3437,7 +3450,8 @@ MercSpell Merc::GetBestMercSpellForHate(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_InstantHate);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
result.spellid = mercSpellListItr->spellid;
|
||||
@@ -3493,7 +3507,7 @@ MercSpell Merc::GetBestMercSpellForCure(Merc* caster, Mob *tar) {
|
||||
|
||||
//Check for group cure first
|
||||
if(countNeedsCured > 2) {
|
||||
for(std::list<MercSpell>::iterator itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||
for (auto itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||
MercSpell selectedMercSpell = *itr;
|
||||
|
||||
if(IsGroupSpell(itr->spellid) && CheckSpellRecastTimers(caster, itr->spellid)) {
|
||||
@@ -3533,7 +3547,7 @@ MercSpell Merc::GetBestMercSpellForCure(Merc* caster, Mob *tar) {
|
||||
|
||||
//no group cure for target- try to find single target spell
|
||||
if(!spellSelected) {
|
||||
for(std::list<MercSpell>::iterator itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||
for (auto itr = cureList.begin(); itr != cureList.end(); ++itr) {
|
||||
MercSpell selectedMercSpell = *itr;
|
||||
|
||||
if(CheckSpellRecastTimers(caster, itr->spellid)) {
|
||||
@@ -3589,7 +3603,8 @@ MercSpell Merc::GetBestMercSpellForStun(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsForSpellEffect(caster, SE_Stun);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
result.spellid = mercSpellListItr->spellid;
|
||||
@@ -3684,7 +3699,8 @@ MercSpell Merc::GetBestMercSpellForTargetedAENuke(Merc* caster, Mob* tar) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsAENukeSpell(mercSpellListItr->spellid) && !IsAERainNukeSpell(mercSpellListItr->spellid)
|
||||
&& !IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3735,7 +3751,8 @@ MercSpell Merc::GetBestMercSpellForPBAENuke(Merc* caster, Mob* tar) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsPBAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
uint8 numTargets = 0;
|
||||
@@ -3785,7 +3802,8 @@ MercSpell Merc::GetBestMercSpellForAERainNuke(Merc* caster, Mob* tar) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsAERainNukeSpell(mercSpellListItr->spellid) && zone->random.Roll(castChance) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
uint8 numTargets = 0;
|
||||
@@ -3823,7 +3841,8 @@ MercSpell Merc::GetBestMercSpellForNuke(Merc* caster) {
|
||||
if(caster) {
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid)
|
||||
&& zone->random.Roll(castChance) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -3866,7 +3885,8 @@ MercSpell Merc::GetBestMercSpellForNukeByTargetResists(Merc* caster, Mob* target
|
||||
|
||||
std::list<MercSpell> mercSpellList = GetMercSpellsBySpellType(caster, SpellType_Nuke);
|
||||
|
||||
for(std::list<MercSpell>::iterator mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end(); ++mercSpellListItr) {
|
||||
for (auto mercSpellListItr = mercSpellList.begin(); mercSpellListItr != mercSpellList.end();
|
||||
++mercSpellListItr) {
|
||||
// Assuming all the spells have been loaded into this list by level and in descending order
|
||||
|
||||
if(IsPureNukeSpell(mercSpellListItr->spellid) && !IsAENukeSpell(mercSpellListItr->spellid) && CheckSpellRecastTimers(caster, mercSpellListItr->spellid)) {
|
||||
@@ -4105,7 +4125,7 @@ bool Merc::CheckAETaunt() {
|
||||
std::list<NPC*> npc_list;
|
||||
entity_list.GetNPCList(npc_list);
|
||||
|
||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
for (auto itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
NPC* npc = *itr;
|
||||
float dist = DistanceSquaredNoZ(m_Position, npc->GetPosition());
|
||||
int range = GetActSpellRange(mercSpell.spellid, spells[mercSpell.spellid].range);
|
||||
@@ -4168,7 +4188,7 @@ bool Merc::TryHide() {
|
||||
return false;
|
||||
}
|
||||
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||
SpawnAppearance_Struct* sa_out = (SpawnAppearance_Struct*)outapp->pBuffer;
|
||||
sa_out->spawn_id = GetID();
|
||||
sa_out->type = 0x03;
|
||||
@@ -4190,7 +4210,7 @@ bool Merc::CheckConfidence() {
|
||||
std::list<NPC*> npc_list;
|
||||
entity_list.GetNPCList(npc_list);
|
||||
|
||||
for(std::list<NPC*>::iterator itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
for (auto itr = npc_list.begin(); itr != npc_list.end(); ++itr) {
|
||||
NPC* mob = *itr;
|
||||
float ConRating = 1.0;
|
||||
int CurrentCon = 0;
|
||||
@@ -4667,7 +4687,7 @@ bool Merc::LoadMercSpells() {
|
||||
int16 attack_proc_spell = -1;
|
||||
int8 proc_chance = 0;
|
||||
|
||||
for (std::list<MercSpellEntry>::iterator mercSpellEntryItr = spellList.begin(); mercSpellEntryItr != spellList.end(); ++mercSpellEntryItr) {
|
||||
for (auto mercSpellEntryItr = spellList.begin(); mercSpellEntryItr != spellList.end(); ++mercSpellEntryItr) {
|
||||
if (proficiency_id == mercSpellEntryItr->proficiencyid && GetLevel() >= mercSpellEntryItr->minlevel && GetLevel() <= mercSpellEntryItr->maxlevel && mercSpellEntryItr->spellid > 0) {
|
||||
MercSpell mercSpell;
|
||||
|
||||
@@ -4725,7 +4745,7 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id,
|
||||
if(npc_type_to_copy != nullptr)
|
||||
{
|
||||
//This is actually a very terrible method of assigning stats, and should be changed at some point. See the comment in merc's deconstructor.
|
||||
NPCType* npc_type = new NPCType;
|
||||
auto npc_type = new NPCType;
|
||||
memset(npc_type, 0, sizeof(NPCType));
|
||||
memcpy(npc_type, npc_type_to_copy, sizeof(NPCType));
|
||||
if(c && !updateFromDB)
|
||||
@@ -4771,7 +4791,7 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id,
|
||||
npc_type->maxlevel = 0; //We should hard-set this to override scalerate's functionality in the NPC class when it is constructed.
|
||||
npc_type->no_target_hotkey = 1;
|
||||
|
||||
Merc* merc = new Merc(npc_type, c->GetX(), c->GetY(), c->GetZ(), 0);
|
||||
auto merc = new Merc(npc_type, c->GetX(), c->GetY(), c->GetZ(), 0);
|
||||
merc->GiveNPCTypeData(npc_type); // for clean up, works a bit like pets
|
||||
|
||||
if(merc)
|
||||
@@ -6063,7 +6083,7 @@ void Client::SendMercMerchantResponsePacket(int32 response_type) {
|
||||
// This response packet brings up the Mercenary Manager window
|
||||
if (ClientVersion() >= EQEmu::versions::ClientVersion::SoD)
|
||||
{
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryHire, sizeof(MercenaryMerchantResponse_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryHire, sizeof(MercenaryMerchantResponse_Struct));
|
||||
MercenaryMerchantResponse_Struct* mmr = (MercenaryMerchantResponse_Struct*)outapp->pBuffer;
|
||||
mmr->ResponseType = response_type; // send specified response type
|
||||
FastQueuePacket(&outapp);
|
||||
@@ -6073,7 +6093,7 @@ void Client::SendMercMerchantResponsePacket(int32 response_type) {
|
||||
|
||||
void Client::SendMercenaryUnknownPacket(uint8 type) {
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryUnknown1, 1);
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryUnknown1, 1);
|
||||
outapp->WriteUInt8(type);
|
||||
FastQueuePacket(&outapp);
|
||||
Log.Out(Logs::Moderate, Logs::Mercenaries, "Sent SendMercenaryUnknownPacket Type: %i, Client: %s.", type, GetName());
|
||||
@@ -6082,7 +6102,7 @@ void Client::SendMercenaryUnknownPacket(uint8 type) {
|
||||
|
||||
void Client::SendMercenaryUnsuspendPacket(uint8 type) {
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryUnsuspendResponse, 1);
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryUnsuspendResponse, 1);
|
||||
outapp->WriteUInt8(type);
|
||||
FastQueuePacket(&outapp);
|
||||
Log.Out(Logs::Moderate, Logs::Mercenaries, "Sent SendMercenaryUnsuspendPacket Type: %i, Client: %s.", type, GetName());
|
||||
@@ -6091,7 +6111,7 @@ void Client::SendMercenaryUnsuspendPacket(uint8 type) {
|
||||
|
||||
void Client::SendMercSuspendResponsePacket(uint32 suspended_time) {
|
||||
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenarySuspendResponse, sizeof(SuspendMercenaryResponse_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_MercenarySuspendResponse, sizeof(SuspendMercenaryResponse_Struct));
|
||||
SuspendMercenaryResponse_Struct* smr = (SuspendMercenaryResponse_Struct*)outapp->pBuffer;
|
||||
smr->SuspendTime = suspended_time; // Seen 0 (not suspended) or c9 c2 64 4f (suspended on Sat Mar 17 11:58:49 2012) - Unix Timestamp
|
||||
FastQueuePacket(&outapp);
|
||||
@@ -6102,7 +6122,7 @@ void Client::SendMercSuspendResponsePacket(uint32 suspended_time) {
|
||||
void Client::SendMercTimerPacket(int32 entity_id, int32 merc_state, int32 suspended_time, int32 update_interval, int32 unk01) {
|
||||
|
||||
// Send Mercenary Status/Timer packet
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryTimer, sizeof(MercenaryStatus_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryTimer, sizeof(MercenaryStatus_Struct));
|
||||
MercenaryStatus_Struct* mss = (MercenaryStatus_Struct*)outapp->pBuffer;
|
||||
mss->MercEntityID = entity_id; // Seen 0 (no merc spawned) or unknown value when merc is spawned
|
||||
mss->MercState = merc_state; // Seen 5 (normal) or 1 (suspended)
|
||||
@@ -6115,7 +6135,7 @@ void Client::SendMercTimerPacket(int32 entity_id, int32 merc_state, int32 suspen
|
||||
}
|
||||
|
||||
void Client::SendMercAssignPacket(uint32 entityID, uint32 unk01, uint32 unk02) {
|
||||
EQApplicationPacket *outapp = new EQApplicationPacket(OP_MercenaryAssign, sizeof(MercenaryAssign_Struct));
|
||||
auto outapp = new EQApplicationPacket(OP_MercenaryAssign, sizeof(MercenaryAssign_Struct));
|
||||
MercenaryAssign_Struct* mas = (MercenaryAssign_Struct*)outapp->pBuffer;
|
||||
mas->MercEntityID = entityID;
|
||||
mas->MercUnk01 = unk01;
|
||||
@@ -6194,7 +6214,7 @@ int NPC::GetNumMercTypes(uint32 clientVersion) {
|
||||
int count = 0;
|
||||
std::list<MercType> mercTypeList = GetMercTypesList();
|
||||
|
||||
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); ++mercTypeListItr) {
|
||||
for (auto mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); ++mercTypeListItr) {
|
||||
if(mercTypeListItr->ClientVersion <= clientVersion)
|
||||
count++;
|
||||
}
|
||||
@@ -6207,7 +6227,7 @@ int NPC::GetNumMercs(uint32 clientVersion) {
|
||||
int count = 0;
|
||||
std::list<MercData> mercDataList = GetMercsList();
|
||||
|
||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr) {
|
||||
for (auto mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr) {
|
||||
if(mercListItr->ClientVersion <= clientVersion)
|
||||
count++;
|
||||
}
|
||||
@@ -6221,8 +6241,8 @@ std::list<MercType> NPC::GetMercTypesList(uint32 clientVersion) {
|
||||
|
||||
if(GetNumMercTypes() > 0)
|
||||
{
|
||||
for(std::list<MercType>::iterator mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end(); ++mercTypeListItr)
|
||||
{
|
||||
for (auto mercTypeListItr = mercTypeList.begin(); mercTypeListItr != mercTypeList.end();
|
||||
++mercTypeListItr) {
|
||||
if(mercTypeListItr->ClientVersion <= clientVersion)
|
||||
{
|
||||
MercType mercType;
|
||||
@@ -6242,8 +6262,7 @@ std::list<MercData> NPC::GetMercsList(uint32 clientVersion) {
|
||||
|
||||
if(GetNumMercs() > 0)
|
||||
{
|
||||
for(std::list<MercData>::iterator mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr)
|
||||
{
|
||||
for (auto mercListItr = mercDataList.begin(); mercListItr != mercDataList.end(); ++mercListItr) {
|
||||
if(mercListItr->ClientVersion <= clientVersion)
|
||||
{
|
||||
MercTemplate *merc_template = zone->GetMercTemplate(mercListItr->MercTemplateID);
|
||||
|
||||
Reference in New Issue
Block a user