mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
Fixed most of the compiler warnings and cleaned up some code in spells_effects.cpp
This commit is contained in:
parent
441ddf233a
commit
7b0045290d
@ -1082,7 +1082,7 @@ void Client::LeaveGroup() {
|
|||||||
isgrouped = false;
|
isgrouped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::HealGroup(uint32 heal_amt, Mob* caster, int32 range)
|
void Group::HealGroup(uint32 heal_amt, Mob* caster, float range)
|
||||||
{
|
{
|
||||||
if (!caster)
|
if (!caster)
|
||||||
return;
|
return;
|
||||||
@ -1120,7 +1120,7 @@ void Group::HealGroup(uint32 heal_amt, Mob* caster, int32 range)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Group::BalanceHP(int32 penalty, int32 range, Mob* caster, int32 limit)
|
void Group::BalanceHP(int32 penalty, float range, Mob* caster, int32 limit)
|
||||||
{
|
{
|
||||||
if (!caster)
|
if (!caster)
|
||||||
return;
|
return;
|
||||||
@ -1170,7 +1170,7 @@ void Group::BalanceHP(int32 penalty, int32 range, Mob* caster, int32 limit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::BalanceMana(int32 penalty, int32 range, Mob* caster, int32 limit)
|
void Group::BalanceMana(int32 penalty, float range, Mob* caster, int32 limit)
|
||||||
{
|
{
|
||||||
if (!caster)
|
if (!caster)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -86,9 +86,9 @@ public:
|
|||||||
uint16 GetAvgLevel();
|
uint16 GetAvgLevel();
|
||||||
bool LearnMembers();
|
bool LearnMembers();
|
||||||
void VerifyGroup();
|
void VerifyGroup();
|
||||||
void BalanceHP(int32 penalty, int32 range = 0, Mob* caster = nullptr, int32 limit = 0);
|
void BalanceHP(int32 penalty, float range = 0, Mob* caster = nullptr, int32 limit = 0);
|
||||||
void BalanceMana(int32 penalty, int32 range = 0, Mob* caster = nullptr, int32 limit = 0);
|
void BalanceMana(int32 penalty, float range = 0, Mob* caster = nullptr, int32 limit = 0);
|
||||||
void HealGroup(uint32 heal_amt, Mob* caster, int32 range = 0);
|
void HealGroup(uint32 heal_amt, Mob* caster, float range = 0);
|
||||||
inline void SetGroupAAs(GroupLeadershipAA_Struct *From) { memcpy(&LeaderAbilities, From, sizeof(GroupLeadershipAA_Struct)); }
|
inline void SetGroupAAs(GroupLeadershipAA_Struct *From) { memcpy(&LeaderAbilities, From, sizeof(GroupLeadershipAA_Struct)); }
|
||||||
inline void GetGroupAAs(GroupLeadershipAA_Struct *Into) { memcpy(Into, &LeaderAbilities, sizeof(GroupLeadershipAA_Struct)); }
|
inline void GetGroupAAs(GroupLeadershipAA_Struct *Into) { memcpy(Into, &LeaderAbilities, sizeof(GroupLeadershipAA_Struct)); }
|
||||||
void UpdateGroupAAs();
|
void UpdateGroupAAs();
|
||||||
|
|||||||
@ -1054,7 +1054,7 @@ protected:
|
|||||||
Timer ranged_timer;
|
Timer ranged_timer;
|
||||||
float attack_speed; //% increase/decrease in attack speed (not haste)
|
float attack_speed; //% increase/decrease in attack speed (not haste)
|
||||||
int8 attack_delay; //delay between attacks in 10ths of seconds
|
int8 attack_delay; //delay between attacks in 10ths of seconds
|
||||||
float slow_mitigation; // Allows for a slow mitigation (100 = 100%, 50% = 50%)
|
int16 slow_mitigation; // Allows for a slow mitigation (100 = 100%, 50% = 50%)
|
||||||
Timer tic_timer;
|
Timer tic_timer;
|
||||||
Timer mana_timer;
|
Timer mana_timer;
|
||||||
|
|
||||||
|
|||||||
@ -511,7 +511,7 @@ uint32 Raid::GetTotalRaidDamage(Mob* other)
|
|||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Raid::HealGroup(uint32 heal_amt, Mob* caster, uint32 gid, int32 range)
|
void Raid::HealGroup(uint32 heal_amt, Mob* caster, uint32 gid, float range)
|
||||||
{
|
{
|
||||||
if (!caster)
|
if (!caster)
|
||||||
return;
|
return;
|
||||||
@ -554,7 +554,7 @@ void Raid::HealGroup(uint32 heal_amt, Mob* caster, uint32 gid, int32 range)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Raid::BalanceHP(int32 penalty, uint32 gid, int32 range, Mob* caster, int32 limit)
|
void Raid::BalanceHP(int32 penalty, uint32 gid, float range, Mob* caster, int32 limit)
|
||||||
{
|
{
|
||||||
if (!caster)
|
if (!caster)
|
||||||
return;
|
return;
|
||||||
@ -610,7 +610,7 @@ void Raid::BalanceHP(int32 penalty, uint32 gid, int32 range, Mob* caster, int32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Raid::BalanceMana(int32 penalty, uint32 gid, int32 range, Mob* caster, int32 limit)
|
void Raid::BalanceMana(int32 penalty, uint32 gid, float range, Mob* caster, int32 limit)
|
||||||
{
|
{
|
||||||
if (!caster)
|
if (!caster)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -157,9 +157,9 @@ public:
|
|||||||
void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid);
|
void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid);
|
||||||
void SplitExp(uint32 exp, Mob* other);
|
void SplitExp(uint32 exp, Mob* other);
|
||||||
uint32 GetTotalRaidDamage(Mob* other);
|
uint32 GetTotalRaidDamage(Mob* other);
|
||||||
void BalanceHP(int32 penalty, uint32 gid, int32 range = 0, Mob* caster = nullptr, int32 limit = 0);
|
void BalanceHP(int32 penalty, uint32 gid, float range = 0, Mob* caster = nullptr, int32 limit = 0);
|
||||||
void BalanceMana(int32 penalty, uint32 gid, int32 range = 0, Mob* caster = nullptr, int32 limit = 0);
|
void BalanceMana(int32 penalty, uint32 gid, float range = 0, Mob* caster = nullptr, int32 limit = 0);
|
||||||
void HealGroup(uint32 heal_amt, Mob* caster, uint32 gid, int32 range = 0);
|
void HealGroup(uint32 heal_amt, Mob* caster, uint32 gid, float range = 0);
|
||||||
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr);
|
void SplitMoney(uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Client *splitter = nullptr);
|
||||||
void GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid);
|
void GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid);
|
||||||
|
|
||||||
|
|||||||
@ -336,7 +336,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
bool inuse = false;
|
bool inuse = false;
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for(i = 0; i < buff_count; i++) {
|
for(i = 0; i < buff_count; i++) {
|
||||||
if(buffs[i].spellid == spell_id && i != buffslot) {
|
if(buffs[i].spellid == spell_id && i != buffslot) {
|
||||||
Message(0, "You must wait before you can be affected by this spell again.");
|
Message(0, "You must wait before you can be affected by this spell again.");
|
||||||
@ -428,10 +428,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
float x, y, z, heading;
|
float x, y, z, heading;
|
||||||
const char *target_zone;
|
const char *target_zone;
|
||||||
|
|
||||||
x = spell.base[1];
|
x = static_cast<float>(spell.base[1]);
|
||||||
y = spell.base[0];
|
y = static_cast<float>(spell.base[0]);
|
||||||
z = spell.base[2];
|
z = static_cast<float>(spell.base[2]);
|
||||||
heading = spell.base[3];
|
heading = static_cast<float>(spell.base[3]);
|
||||||
|
|
||||||
if(!strcmp(spell.teleport_zone, "same"))
|
if(!strcmp(spell.teleport_zone, "same"))
|
||||||
{
|
{
|
||||||
@ -500,10 +500,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
float x, y, z, heading;
|
float x, y, z, heading;
|
||||||
const char *target_zone;
|
const char *target_zone;
|
||||||
|
|
||||||
x = spell.base[1];
|
x = static_cast<float>(spell.base[1]);
|
||||||
y = spell.base[0];
|
y = static_cast<float>(spell.base[0]);
|
||||||
z = spell.base[2];
|
z = static_cast<float>(spell.base[2]);
|
||||||
heading = spell.base[3];
|
heading = static_cast<float>(spell.base[3]);
|
||||||
|
|
||||||
if(!strcmp(spell.teleport_zone, "same"))
|
if(!strcmp(spell.teleport_zone, "same"))
|
||||||
{
|
{
|
||||||
@ -801,7 +801,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
if (!bBreak)
|
if (!bBreak)
|
||||||
{
|
{
|
||||||
int resistMod = partial + (GetCHA()/25);
|
int resistMod = static_cast<int>(partial) + (GetCHA()/25);
|
||||||
resistMod = resistMod > 100 ? 100 : resistMod;
|
resistMod = resistMod > 100 ? 100 : resistMod;
|
||||||
buffs[buffslot].ticsremaining = resistMod * buffs[buffslot].ticsremaining / 100;
|
buffs[buffslot].ticsremaining = resistMod * buffs[buffslot].ticsremaining / 100;
|
||||||
}
|
}
|
||||||
@ -877,7 +877,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if(IsClient())
|
if(IsClient())
|
||||||
{
|
{
|
||||||
AI_Start();
|
AI_Start();
|
||||||
animation = GetRunspeed() * 21; //set our animation to match our speed about
|
animation = static_cast<uint16>(GetRunspeed() * 21.0f); //set our animation to match our speed about
|
||||||
}
|
}
|
||||||
|
|
||||||
CalculateNewFearpoint();
|
CalculateNewFearpoint();
|
||||||
@ -911,7 +911,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
action->source = caster ? caster->GetID() : GetID();
|
action->source = caster ? caster->GetID() : GetID();
|
||||||
action->level = 65;
|
action->level = 65;
|
||||||
action->instrument_mod = 10;
|
action->instrument_mod = 10;
|
||||||
action->sequence = (GetHeading() * 12345 / 2);
|
action->sequence = static_cast<uint32>((GetHeading() * 12345 / 2));
|
||||||
action->type = 231;
|
action->type = 231;
|
||||||
action->spell = spell_id;
|
action->spell = spell_id;
|
||||||
action->buff_unknown = 4;
|
action->buff_unknown = 4;
|
||||||
@ -960,7 +960,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
action->source = caster ? caster->GetID() : GetID();
|
action->source = caster ? caster->GetID() : GetID();
|
||||||
action->level = 65;
|
action->level = 65;
|
||||||
action->instrument_mod = 10;
|
action->instrument_mod = 10;
|
||||||
action->sequence = (GetHeading() * 12345 / 2);
|
action->sequence = static_cast<uint32>((GetHeading() * 12345 / 2));
|
||||||
action->type = 231;
|
action->type = 231;
|
||||||
action->spell = spell_id;
|
action->spell = spell_id;
|
||||||
action->buff_unknown = 4;
|
action->buff_unknown = 4;
|
||||||
@ -996,7 +996,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
action->source = caster ? caster->GetID() : GetID();
|
action->source = caster ? caster->GetID() : GetID();
|
||||||
action->level = 65;
|
action->level = 65;
|
||||||
action->instrument_mod = 10;
|
action->instrument_mod = 10;
|
||||||
action->sequence = (GetHeading() * 12345 / 2);
|
action->sequence = static_cast<uint32>((GetHeading() * 12345 / 2));
|
||||||
action->type = 231;
|
action->type = 231;
|
||||||
action->spell = spell_id;
|
action->spell = spell_id;
|
||||||
action->buff_unknown = 4;
|
action->buff_unknown = 4;
|
||||||
@ -1050,7 +1050,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for(int slot = 0; slot < buff_count; slot++) {
|
for(int slot = 0; slot < buff_count; slot++) {
|
||||||
if( buffs[slot].spellid != SPELL_UNKNOWN &&
|
if( buffs[slot].spellid != SPELL_UNKNOWN &&
|
||||||
spells[buffs[slot].spellid].dispel_flag == 0 &&
|
spells[buffs[slot].spellid].dispel_flag == 0 &&
|
||||||
@ -1075,7 +1075,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for(int slot = 0; slot < buff_count; slot++) {
|
for(int slot = 0; slot < buff_count; slot++) {
|
||||||
if (buffs[slot].spellid != SPELL_UNKNOWN &&
|
if (buffs[slot].spellid != SPELL_UNKNOWN &&
|
||||||
IsDetrimentalSpell(buffs[slot].spellid) &&
|
IsDetrimentalSpell(buffs[slot].spellid) &&
|
||||||
@ -1100,7 +1100,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for(int slot = 0; slot < buff_count; slot++) {
|
for(int slot = 0; slot < buff_count; slot++) {
|
||||||
if (buffs[slot].spellid != SPELL_UNKNOWN &&
|
if (buffs[slot].spellid != SPELL_UNKNOWN &&
|
||||||
IsBeneficialSpell(buffs[slot].spellid) &&
|
IsBeneficialSpell(buffs[slot].spellid) &&
|
||||||
@ -1118,7 +1118,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
case SE_Purify:
|
case SE_Purify:
|
||||||
{
|
{
|
||||||
//Attempt to remove all Deterimental buffs.
|
//Attempt to remove all Deterimental buffs.
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for(int slot = 0; slot < buff_count; slot++) {
|
for(int slot = 0; slot < buff_count; slot++) {
|
||||||
if (buffs[slot].spellid != SPELL_UNKNOWN &&
|
if (buffs[slot].spellid != SPELL_UNKNOWN &&
|
||||||
IsDetrimentalSpell(buffs[slot].spellid))
|
IsDetrimentalSpell(buffs[slot].spellid))
|
||||||
@ -1460,7 +1460,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
caster->GetTarget()->GetGender(),
|
caster->GetTarget()->GetGender(),
|
||||||
caster->GetTarget()->GetTexture()
|
caster->GetTarget()->GetTexture()
|
||||||
);
|
);
|
||||||
caster->SendAppearancePacket(AT_Size, caster->GetTarget()->GetSize());
|
caster->SendAppearancePacket(AT_Size, static_cast<uint32>(caster->GetTarget()->GetSize()));
|
||||||
|
|
||||||
for(int x = EmuConstants::MATERIAL_BEGIN; x <= EmuConstants::MATERIAL_TINT_END; x++)
|
for(int x = EmuConstants::MATERIAL_BEGIN; x <= EmuConstants::MATERIAL_TINT_END; x++)
|
||||||
caster->SendWearChange(x);
|
caster->SendWearChange(x);
|
||||||
@ -1662,7 +1662,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
#ifdef SPELL_EFFECT_SPAM
|
#ifdef SPELL_EFFECT_SPAM
|
||||||
snprintf(effect_desc, _EDLEN, "Model Size: %d%%", effect_value);
|
snprintf(effect_desc, _EDLEN, "Model Size: %d%%", effect_value);
|
||||||
#endif
|
#endif
|
||||||
ChangeSize(GetSize() * (effect_value / 100.0));
|
ChangeSize(GetSize() * (static_cast<float>(effect_value) / 100.0f));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1881,13 +1881,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if (effect_value < 0)
|
if (effect_value < 0)
|
||||||
{
|
{
|
||||||
effect_value = 0 - effect_value;
|
effect_value = 0 - effect_value;
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for (int j=0; j < buff_count; j++) {
|
for (int j=0; j < buff_count; j++) {
|
||||||
if (buffs[j].spellid >= (uint16)SPDAT_RECORDS)
|
if (!IsValidSpell(buffs[j].spellid))
|
||||||
continue;
|
continue;
|
||||||
if (CalculatePoisonCounters(buffs[j].spellid) == 0)
|
if (CalculatePoisonCounters(buffs[j].spellid) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (effect_value >= buffs[j].counters) {
|
if (effect_value >= static_cast<int>(buffs[j].counters)) {
|
||||||
if (caster)
|
if (caster)
|
||||||
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
||||||
caster->CastOnCurer(buffs[j].spellid);
|
caster->CastOnCurer(buffs[j].spellid);
|
||||||
@ -1913,13 +1913,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if (effect_value < 0)
|
if (effect_value < 0)
|
||||||
{
|
{
|
||||||
effect_value = 0 - effect_value;
|
effect_value = 0 - effect_value;
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for (int j=0; j < buff_count; j++) {
|
for (int j=0; j < buff_count; j++) {
|
||||||
if (buffs[j].spellid >= (uint16)SPDAT_RECORDS)
|
if (!IsValidSpell(buffs[j].spellid))
|
||||||
continue;
|
continue;
|
||||||
if (CalculateDiseaseCounters(buffs[j].spellid) == 0)
|
if (CalculateDiseaseCounters(buffs[j].spellid) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (effect_value >= buffs[j].counters)
|
if (effect_value >= static_cast<int>(buffs[j].counters))
|
||||||
{
|
{
|
||||||
if (caster)
|
if (caster)
|
||||||
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
||||||
@ -1948,13 +1948,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if (effect_value < 0)
|
if (effect_value < 0)
|
||||||
{
|
{
|
||||||
effect_value = 0 - effect_value;
|
effect_value = 0 - effect_value;
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for (int j=0; j < buff_count; j++) {
|
for (int j=0; j < buff_count; j++) {
|
||||||
if (buffs[j].spellid >= (uint16)SPDAT_RECORDS)
|
if (!IsValidSpell(buffs[j].spellid))
|
||||||
continue;
|
continue;
|
||||||
if (CalculateCurseCounters(buffs[j].spellid) == 0)
|
if (CalculateCurseCounters(buffs[j].spellid) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (effect_value >= buffs[j].counters)
|
if (effect_value >= static_cast<int>(buffs[j].counters))
|
||||||
{
|
{
|
||||||
if (caster)
|
if (caster)
|
||||||
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
||||||
@ -1983,13 +1983,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if (effect_value < 0)
|
if (effect_value < 0)
|
||||||
{
|
{
|
||||||
effect_value = -effect_value;
|
effect_value = -effect_value;
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for (int j=0; j < buff_count; j++) {
|
for (int j=0; j < buff_count; j++) {
|
||||||
if (buffs[j].spellid >= (uint16)SPDAT_RECORDS)
|
if (!IsValidSpell(buffs[j].spellid))
|
||||||
continue;
|
continue;
|
||||||
if (CalculateCorruptionCounters(buffs[j].spellid) == 0)
|
if (CalculateCorruptionCounters(buffs[j].spellid) == 0)
|
||||||
continue;
|
continue;
|
||||||
if (effect_value >= buffs[j].counters) {
|
if (effect_value >= static_cast<int>(buffs[j].counters)) {
|
||||||
if (caster)
|
if (caster)
|
||||||
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
caster->Message(MT_Spells,"You have cured your target of %s!",spells[buffs[j].spellid].name);
|
||||||
caster->CastOnCurer(buffs[j].spellid);
|
caster->CastOnCurer(buffs[j].spellid);
|
||||||
@ -2032,7 +2032,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
if(IsNPC())
|
if(IsNPC())
|
||||||
{
|
{
|
||||||
Stun(toss_amt);
|
Stun(static_cast<int>(toss_amt));
|
||||||
}
|
}
|
||||||
toss_amt = sqrt(toss_amt)-2.0;
|
toss_amt = sqrt(toss_amt)-2.0;
|
||||||
|
|
||||||
@ -2261,15 +2261,15 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
switch(spells[spell_id].skill)
|
switch(spells[spell_id].skill)
|
||||||
{
|
{
|
||||||
case SkillThrowing:
|
case SkillThrowing:
|
||||||
caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i], focus, ReuseTime);
|
caster->DoThrowingAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i], focus, ReuseTime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SkillArchery:
|
case SkillArchery:
|
||||||
caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i],focus,ReuseTime);
|
caster->DoArcheryAttackDmg(this, nullptr, nullptr, spells[spell_id].base[i],spells[spell_id].base2[i],focus, ReuseTime);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base[i], spells[spell_id].skill, spells[spell_id].base2[i], focus, ReuseTime);
|
caster->DoMeleeSkillAttackDmg(this, spells[spell_id].base[i], spells[spell_id].skill, spells[spell_id].base2[i], focus, false, ReuseTime);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2485,7 +2485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
if(!caster->IsClient())
|
if(!caster->IsClient())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
uint32 max_mana = spell.base[i];
|
int32 max_mana = spell.base[i];
|
||||||
int ratio = spell.base2[i];
|
int ratio = spell.base2[i];
|
||||||
uint32 heal_amt = 0;
|
uint32 heal_amt = 0;
|
||||||
|
|
||||||
@ -2617,7 +2617,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
|||||||
|
|
||||||
case SE_ManaBurn:
|
case SE_ManaBurn:
|
||||||
{
|
{
|
||||||
uint32 max_mana = spell.base[i];
|
int32 max_mana = spell.base[i];
|
||||||
int ratio = spell.base2[i];
|
int ratio = spell.base2[i];
|
||||||
int32 dmg = 0;
|
int32 dmg = 0;
|
||||||
|
|
||||||
@ -3257,7 +3257,7 @@ snare has both of them negative, yet their range should work the same:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 137: // used in berserker AA desperation
|
case 137: // used in berserker AA desperation
|
||||||
result = ubase - (ubase * (GetHPRatio() / 100.0f));
|
result = ubase - static_cast<int>((ubase * (GetHPRatio() / 100.0f)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 138: { // unused on live?
|
case 138: { // unused on live?
|
||||||
@ -3347,7 +3347,7 @@ snare has both of them negative, yet their range should work the same:
|
|||||||
|
|
||||||
void Mob::BuffProcess()
|
void Mob::BuffProcess()
|
||||||
{
|
{
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
|
|
||||||
for (int buffs_i = 0; buffs_i < buff_count; ++buffs_i)
|
for (int buffs_i = 0; buffs_i < buff_count; ++buffs_i)
|
||||||
{
|
{
|
||||||
@ -4343,12 +4343,12 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_LimitCastTimeMin:
|
case SE_LimitCastTimeMin:
|
||||||
if (spell.cast_time < base1)
|
if (static_cast<int32>(spell.cast_time) < base1)
|
||||||
LimitFailure = true;
|
LimitFailure = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_LimitCastTimeMax:
|
case SE_LimitCastTimeMax:
|
||||||
if (spell.cast_time > base1)
|
if (static_cast<int32>(spell.cast_time) > base1)
|
||||||
LimitFailure = true;
|
LimitFailure = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -4447,24 +4447,24 @@ int16 Client::CalcAAFocus(focusType type, uint32 aa_ID, uint16 spell_id)
|
|||||||
|
|
||||||
case SE_LimitSpellClass:
|
case SE_LimitSpellClass:
|
||||||
if(base1 < 0) { //Exclude
|
if(base1 < 0) { //Exclude
|
||||||
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass));
|
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass))
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LimitInclude[12] = true;
|
LimitInclude[12] = true;
|
||||||
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)); //Include
|
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellClass)) //Include
|
||||||
LimitInclude[13] = true;
|
LimitInclude[13] = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_LimitSpellSubclass:
|
case SE_LimitSpellSubclass:
|
||||||
if(base1 < 0) { //Exclude
|
if(base1 < 0) { //Exclude
|
||||||
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass));
|
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass))
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LimitInclude[14] = true;
|
LimitInclude[14] = true;
|
||||||
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)); //Include
|
if (CheckSpellCategory(spell_id, base1, SE_LimitSpellSubclass)) //Include
|
||||||
LimitInclude[15] = true;
|
LimitInclude[15] = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5248,7 +5248,7 @@ int16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
if (spellbonuses.FocusEffects[type]){
|
if (spellbonuses.FocusEffects[type]){
|
||||||
int buff_slot = 0;
|
int buff_slot = 0;
|
||||||
uint16 focusspellid = 0;
|
uint16 focusspellid = 0;
|
||||||
uint32 buff_max = GetMaxTotalSlots();
|
int buff_max = GetMaxTotalSlots();
|
||||||
for (buff_slot = 0; buff_slot < buff_max; buff_slot++) {
|
for (buff_slot = 0; buff_slot < buff_max; buff_slot++) {
|
||||||
|
|
||||||
if (SympatheticProcList.size() > MAX_SYMPATHETIC)
|
if (SympatheticProcList.size() > MAX_SYMPATHETIC)
|
||||||
@ -5466,7 +5466,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) {
|
|||||||
int buff_slot = 0;
|
int buff_slot = 0;
|
||||||
uint16 focusspellid = 0;
|
uint16 focusspellid = 0;
|
||||||
uint16 focusspell_tracker = 0;
|
uint16 focusspell_tracker = 0;
|
||||||
uint32 buff_max = GetMaxTotalSlots();
|
int buff_max = GetMaxTotalSlots();
|
||||||
for (buff_slot = 0; buff_slot < buff_max; buff_slot++) {
|
for (buff_slot = 0; buff_slot < buff_max; buff_slot++) {
|
||||||
focusspellid = buffs[buff_slot].spellid;
|
focusspellid = buffs[buff_slot].spellid;
|
||||||
if (focusspellid == 0 || focusspellid >= SPDAT_RECORDS)
|
if (focusspellid == 0 || focusspellid >= SPDAT_RECORDS)
|
||||||
@ -5565,11 +5565,11 @@ void Mob::CheckNumHitsRemaining(uint8 type, uint32 buff_slot, uint16 spell_id)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool bDepleted = false;
|
bool bDepleted = false;
|
||||||
uint32 buff_max = GetMaxTotalSlots();
|
int buff_max = GetMaxTotalSlots();
|
||||||
|
|
||||||
//Spell specific procs [Type 7,10,11]
|
//Spell specific procs [Type 7,10,11]
|
||||||
if (IsValidSpell(spell_id)) {
|
if (IsValidSpell(spell_id)) {
|
||||||
for (uint32 d = 0; d < buff_max; d++) {
|
for (int d = 0; d < buff_max; d++) {
|
||||||
if (buffs[d].spellid == spell_id && buffs[d].numhits > 0 &&
|
if (buffs[d].spellid == spell_id && buffs[d].numhits > 0 &&
|
||||||
spells[buffs[d].spellid].numhitstype == type) {
|
spells[buffs[d].spellid].numhitstype == type) {
|
||||||
if (--buffs[d].numhits == 0) {
|
if (--buffs[d].numhits == 0) {
|
||||||
@ -5608,7 +5608,7 @@ void Mob::CheckNumHitsRemaining(uint8 type, uint32 buff_slot, uint16 spell_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (uint32 d = 0; d < buff_max; d++) {
|
for (int d = 0; d < buff_max; d++) {
|
||||||
if (IsValidSpell(buffs[d].spellid) && buffs[d].numhits > 0 &&
|
if (IsValidSpell(buffs[d].spellid) && buffs[d].numhits > 0 &&
|
||||||
spells[buffs[d].spellid].numhitstype == type) {
|
spells[buffs[d].spellid].numhitstype == type) {
|
||||||
if (--buffs[d].numhits == 0) {
|
if (--buffs[d].numhits == 0) {
|
||||||
@ -5708,7 +5708,7 @@ bool Mob::TryDeathSave() {
|
|||||||
int SuccessChance = 0;
|
int SuccessChance = 0;
|
||||||
int buffSlot = spellbonuses.DeathSave[1];
|
int buffSlot = spellbonuses.DeathSave[1];
|
||||||
int16 UD_HealMod = 0;
|
int16 UD_HealMod = 0;
|
||||||
uint32 HealAmt = 300; //Death Pact max Heal
|
int HealAmt = 300; //Death Pact max Heal
|
||||||
|
|
||||||
if(buffSlot >= 0){
|
if(buffSlot >= 0){
|
||||||
|
|
||||||
@ -5813,7 +5813,7 @@ float Mob::GetSympatheticProcChances(uint16 spell_id, int16 ProcRateMod, int32 I
|
|||||||
if (total_cast_time > 0 && total_cast_time <= 2500)
|
if (total_cast_time > 0 && total_cast_time <= 2500)
|
||||||
cast_time_mod = 0.25f;
|
cast_time_mod = 0.25f;
|
||||||
else if (total_cast_time > 2500 && total_cast_time < 7000)
|
else if (total_cast_time > 2500 && total_cast_time < 7000)
|
||||||
cast_time_mod = 0.167*((static_cast<float>(total_cast_time) - 1000.0f)/1000.0f);
|
cast_time_mod = 0.167f*((static_cast<float>(total_cast_time) - 1000.0f)/1000.0f);
|
||||||
else
|
else
|
||||||
cast_time_mod = static_cast<float>(total_cast_time) / 7000.0f;
|
cast_time_mod = static_cast<float>(total_cast_time) / 7000.0f;
|
||||||
|
|
||||||
@ -5848,7 +5848,7 @@ int32 Mob::GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (spellbonuses.FocusEffects[focusFcDamageAmtIncoming]){
|
if (spellbonuses.FocusEffects[focusFcDamageAmtIncoming]){
|
||||||
uint32 buff_count = GetMaxTotalSlots();
|
int buff_count = GetMaxTotalSlots();
|
||||||
for(int i = 0; i < buff_count; i++){
|
for(int i = 0; i < buff_count; i++){
|
||||||
|
|
||||||
if( (IsValidSpell(buffs[i].spellid) && (IsEffectInSpell(buffs[i].spellid, SE_FcDamageAmtIncoming))) ){
|
if( (IsValidSpell(buffs[i].spellid) && (IsEffectInSpell(buffs[i].spellid, SE_FcDamageAmtIncoming))) ){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user