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

This commit is contained in:
Chris Miles
2022-05-01 09:22:09 -05:00
committed by GitHub
parent b02008ec53
commit 5b4aeaa457
47 changed files with 1033 additions and 1033 deletions
+32 -32
View File
@@ -771,7 +771,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
auto app = new EQApplicationPacket(OP_Charm, sizeof(Charm_Struct));
Charm_Struct *ps = (Charm_Struct*)app->pBuffer;
ps->owner_id = caster->GetID();
ps->pet_id = this->GetID();
ps->pet_id = GetID();
ps->command = 1;
entity_list.QueueClients(this, app);
safe_delete(app);
@@ -1104,7 +1104,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
caster->MessageString(Chat::SpellFailure, SPELL_NO_EFFECT, spells[spell_id].name);
break;
}
int chance = spells[spell_id].base_value[i];
int buff_count = GetMaxTotalSlots();
for(int slot = 0; slot < buff_count; slot++) {
@@ -1701,10 +1701,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
// can only summon corpses of clients
if(!IsNPC()) {
Client* TargetClient = nullptr;
if(this->GetTarget())
TargetClient = this->GetTarget()->CastToClient();
if(GetTarget())
TargetClient = GetTarget()->CastToClient();
else
TargetClient = this->CastToClient();
TargetClient = CastToClient();
// We now have a valid target for this spell. Either the caster himself or a targetted player. Lets see if the target is in the group.
Group* group = entity_list.GetGroupByClient(TargetClient);
@@ -1728,7 +1728,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
}
} else {
if(TargetClient != this->CastToClient()) {
if(TargetClient != CastToClient()) {
Message(Chat::Red, "Your target must be a group member for this spell.");
break;
}
@@ -1742,7 +1742,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
Corpse *corpse = entity_list.GetCorpseByOwner(TargetClient);
if(corpse) {
if(TargetClient == this->CastToClient())
if(TargetClient == CastToClient())
MessageString(Chat::LightBlue, SUMMONING_CORPSE, TargetClient->CastToMob()->GetCleanName());
else
MessageString(Chat::LightBlue, SUMMONING_CORPSE_OTHER, TargetClient->CastToMob()->GetCleanName());
@@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_SummonCorpseZone:
{
if (IsClient()) {
Client* client_target = this->CastToClient();
Client* client_target = CastToClient();
if (client_target->IsGrouped()) {
Group* group = client_target->GetGroup();
if (!group->IsGroupMember(caster)) {
@@ -2744,7 +2744,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
case SE_Taunt:
{
if (caster && IsNPC()){
caster->Taunt(this->CastToNPC(), false, spell.base_value[i], true, spell.limit_value[i]);
caster->Taunt(CastToNPC(), false, spell.base_value[i], true, spell.limit_value[i]);
}
break;
}
@@ -3362,14 +3362,14 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
/*
Calculate base effects modifier for casters who are not bards.
*/
//This is checked from Mob::SpellEffects and applied to instant spells and runes.
if (caster && caster->GetClass() != BARD && caster->HasBaseEffectFocus()) {
oval = effect_value;
int mod = caster->GetFocusEffect(focusFcBaseEffects, spell_id);
effect_value += effect_value * mod / 100;
LogSpells("Instant Effect value [{}] altered with base effects modifier of [{}] to yeild [{}]",
oval, mod, effect_value);
}
@@ -3385,7 +3385,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
oval, instrument_mod, effect_value);
}
}
effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effect_id[effect_id], caster, caster_id);
return effect_value;
@@ -3786,7 +3786,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
// doing it every time up here, since most buff effects dont need it
switch (effect) {
case SE_CurrentHP: {
case SE_CurrentHP: {
if (spells[buff.spellid].limit_value[i] && !PassCastRestriction(spells[buff.spellid].limit_value[i])) {
break;
}
@@ -4157,7 +4157,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
{
if(IsClient())
{
/*Mob* horse = entity_list.GetMob(this->CastToClient()->GetHorseId());
/*Mob* horse = entity_list.GetMob(CastToClient()->GetHorseId());
if (horse) horse->Depop();
CastToClient()->SetHasMount(false);*/
CastToClient()->SetHorseId(0);
@@ -4249,7 +4249,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
case SE_Mez:
{
SendAppearancePacket(AT_Anim, ANIM_STAND); // unfreeze
this->mezzed = false;
mezzed = false;
break;
}
@@ -4302,7 +4302,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
uint32 buff_count = GetMaxTotalSlots();
for (unsigned int j = 0; j < buff_count; j++) {
if (IsValidSpell(GetBuffs()[j].spellid )) {
auto spell = spells[this->GetBuffs()[j].spellid];
auto spell = spells[GetBuffs()[j].spellid];
if (spell.good_effect == 0 && IsEffectInSpell(spell.id, SE_CurrentHP)) {
BuffFadeBySpellID(spell.id);
}
@@ -4354,7 +4354,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if(IsClient())
{
InterruptSpell();
if (this->CastToClient()->IsLD())
if (CastToClient()->IsLD())
CastToClient()->AI_Start(CLIENT_LD_TIMEOUT);
else
{
@@ -4437,7 +4437,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
if (IsClient())
{
NPC* tmp_eye_of_zomm = entity_list.GetNPCByID(CastToClient()->GetControlledMobId());
//On live there is about a 6 second delay before it despawns once new one spawns.
//On live there is about a 6 second delay before it despawns once new one spawns.
if (tmp_eye_of_zomm) {
tmp_eye_of_zomm->GetSwarmInfo()->duration->Disable();
tmp_eye_of_zomm->GetSwarmInfo()->duration->Start(6000);
@@ -5312,11 +5312,11 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
uint32 Caston_spell_id = 0;
int index_id = -1;
uint32 focus_reuse_time = 0; //If this is set and all limits pass, start timer at end of script.
bool is_from_item_click = false;
bool try_apply_to_item_click = false;
bool has_item_limit_check = false;
if (casting_spell_inventory_slot && casting_spell_inventory_slot != -1) {
is_from_item_click = true;
}
@@ -5341,7 +5341,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
for (int i = 0; i < EFFECT_COUNT; i++) {
switch (focus_spell.effect_id[i]) {
case SE_Blank:
break;
@@ -6048,7 +6048,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo
return 0;
}
}
/*
For item click cast/recast focus modifiers. Only use if SPA 415 exists.
This is an item click but does not have SPA 415 limiter. Fail here.
@@ -6787,8 +6787,8 @@ void Mob::CheckNumHitsRemaining(NumHit type, int32 buff_slot, uint16 spell_id)
} else if (IsClient()) { // still have numhits and client, update
CastToClient()->SendBuffNumHitPacket(buffs[buff_slot], buff_slot);
}
}
}
}
}
else {
for (int d = 0; d < buff_max; d++) {
if (IsValidSpell(buffs[d].spellid) && buffs[d].hit_number > 0 &&
@@ -9625,7 +9625,7 @@ bool Mob::HarmonySpellLevelCheck(int32 spell_id, Mob *target)
}
bool Mob::PassCharmTargetRestriction(Mob *target) {
//Level restriction check should not go here.
if (!target) {
return false;
@@ -9680,7 +9680,7 @@ bool Mob::PassLimitToSkill(EQ::skills::SkillType skill, int32 spell_id, int proc
match_proc_type = true;
}
if (match_proc_type && spells[spell_id].effect_id[i] == SE_LimitToSkill && spells[spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) {
has_limit_check = true;
if (spells[spell_id].base_value[i] == skill) {
return true;
@@ -9921,7 +9921,7 @@ void Mob::SpreadVirusEffect(int32 spell_id, uint32 caster_id, int32 buff_tics_re
bool Mob::IsFocusProcLimitTimerActive(int32 focus_spell_id) {
/*
Used with SPA 511 SE_Ff_FocusTimerMin to limit how often a focus effect can be applied.
Used with SPA 511 SE_Ff_FocusTimerMin to limit how often a focus effect can be applied.
Ie. Can only have a spell trigger once every 15 seconds, or to be more creative can only
have the fire spells received a very high special focused once every 30 seconds.
Note, this stores timers for both spell, item and AA related focuses For AA the focus_spell_id
@@ -9975,7 +9975,7 @@ bool Mob::IsProcLimitTimerActive(int32 base_spell_id, uint32 proc_reuse_time, in
}
for (int i = 0; i < MAX_PROC_LIMIT_TIMERS; i++) {
if (proc_type == ProcType::MELEE_PROC) {
if (spell_proclimit_spellid[i] == base_spell_id) {
if (spell_proclimit_timer[i].Enabled()) {
@@ -10258,7 +10258,7 @@ void Mob::SetBuffDuration(int32 spell_id, int32 duration) {
int buff_count = GetMaxTotalSlots();
for (int slot = 0; slot < buff_count; slot++) {
if (!adjust_all_buffs) {
if (buffs[slot].spellid != SPELL_UNKNOWN && buffs[slot].spellid == spell_id) {
SpellOnTarget(buffs[slot].spellid, this, 0, false, 0, false, -1, duration, true);
@@ -10285,7 +10285,7 @@ void Mob::ApplySpellBuff(int32 spell_id, int32 duration)
if (!spells[spell_id].buff_duration) {
return;
}
if (duration < -1) {
duration = PERMANENT_BUFF_DURATION;
}
@@ -10302,7 +10302,7 @@ int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier)
if (!stat_identifier) {
return 0;
}
std::string id = str_tolower(stat_identifier);
int buff_count = GetMaxTotalSlots();
@@ -10314,7 +10314,7 @@ int Mob::GetBuffStatValueBySpell(int32 spell_id, const char* stat_identifier)
return 0;
}
int Mob::GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier)
int Mob::GetBuffStatValueBySlot(uint8 slot, const char* stat_identifier)
{
if (slot > GetMaxTotalSlots()) {
return 0;