mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
Minor code and compiler warning fixes.
This commit is contained in:
parent
c9073b10a1
commit
d754e24a02
@ -1902,7 +1902,7 @@ void ZoneDatabase::FillAAEffects(SendAA_Struct* aa_struct){
|
|||||||
|
|
||||||
auto it = aa_effects.find(aa_struct->id);
|
auto it = aa_effects.find(aa_struct->id);
|
||||||
if (it != aa_effects.end()) {
|
if (it != aa_effects.end()) {
|
||||||
for (int slot = 0; slot < aa_struct->total_abilities; slot++) {
|
for (uint32 slot = 0; slot < aa_struct->total_abilities; slot++) {
|
||||||
// aa_effects is a map of a map, so the slot reference does not start at 0
|
// aa_effects is a map of a map, so the slot reference does not start at 0
|
||||||
aa_struct->abilities[slot].skill_id = it->second[slot + 1].skill_id;
|
aa_struct->abilities[slot].skill_id = it->second[slot + 1].skill_id;
|
||||||
aa_struct->abilities[slot].base1 = it->second[slot + 1].base1;
|
aa_struct->abilities[slot].base1 = it->second[slot + 1].base1;
|
||||||
|
|||||||
@ -881,7 +881,7 @@ bool Mob::CombatRange(Mob* other)
|
|||||||
float max_dist = static_cast<float>(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 0));
|
float max_dist = static_cast<float>(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 0));
|
||||||
float min_dist = static_cast<float>(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 1));
|
float min_dist = static_cast<float>(GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 1));
|
||||||
|
|
||||||
if (GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 2));
|
if (GetSpecialAbilityParam(NPC_CHASE_DISTANCE, 2))
|
||||||
DoLoSCheck = false; //Ignore line of sight check
|
DoLoSCheck = false; //Ignore line of sight check
|
||||||
|
|
||||||
if (max_dist == 1)
|
if (max_dist == 1)
|
||||||
|
|||||||
@ -1392,7 +1392,7 @@ void Mob::CalcSpellBonuses(StatBonuses* newbon)
|
|||||||
newbon->AggroRange = -1;
|
newbon->AggroRange = -1;
|
||||||
newbon->AssistRange = -1;
|
newbon->AssistRange = -1;
|
||||||
|
|
||||||
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_UNKNOWN){
|
if(buffs[i].spellid != SPELL_UNKNOWN){
|
||||||
ApplySpellsBonuses(buffs[i].spellid, buffs[i].casterlevel, newbon, buffs[i].casterid, false, buffs[i].ticsremaining,i);
|
ApplySpellsBonuses(buffs[i].spellid, buffs[i].casterlevel, newbon, buffs[i].casterid, false, buffs[i].ticsremaining,i);
|
||||||
@ -1477,7 +1477,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
|
|||||||
// redundant to have level check here
|
// redundant to have level check here
|
||||||
if(newbon->AggroRange == -1 || effect_value < newbon->AggroRange)
|
if(newbon->AggroRange == -1 || effect_value < newbon->AggroRange)
|
||||||
{
|
{
|
||||||
newbon->AggroRange = effect_value;
|
newbon->AggroRange = static_cast<float>(effect_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1489,7 +1489,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
|
|||||||
// take the one with less range in any case
|
// take the one with less range in any case
|
||||||
if(newbon->AssistRange == -1 || effect_value < newbon->AssistRange)
|
if(newbon->AssistRange == -1 || effect_value < newbon->AssistRange)
|
||||||
{
|
{
|
||||||
newbon->AssistRange = effect_value;
|
newbon->AssistRange = static_cast<float>(effect_value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2808,7 +2808,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
|
|||||||
|| ((effect_value < 0) && (newbon->AlterNPCLevel > effect_value))
|
|| ((effect_value < 0) && (newbon->AlterNPCLevel > effect_value))
|
||||||
|| ((effect_value > 0) && (newbon->AlterNPCLevel < effect_value))) {
|
|| ((effect_value > 0) && (newbon->AlterNPCLevel < effect_value))) {
|
||||||
|
|
||||||
int16 tmp_lv = GetOrigLevel() + effect_value;
|
int tmp_lv = GetOrigLevel() + effect_value;
|
||||||
if (tmp_lv < 1)
|
if (tmp_lv < 1)
|
||||||
tmp_lv = 1;
|
tmp_lv = 1;
|
||||||
else if (tmp_lv > 255)
|
else if (tmp_lv > 255)
|
||||||
@ -3092,7 +3092,7 @@ void Client::CalcItemScale() {
|
|||||||
bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
|
||||||
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
|
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
int i;
|
uint32 i;
|
||||||
for (i = slot_x; i <= slot_y; i++) {
|
for (i = slot_x; i <= slot_y; i++) {
|
||||||
if (i == MainAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
if (i == MainAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||||
continue;
|
continue;
|
||||||
@ -3186,7 +3186,7 @@ void Client::DoItemEnterZone() {
|
|||||||
bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
|
||||||
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
|
// behavior change: 'slot_y' is now [RANGE]_END and not [RANGE]_END + 1
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
for(int i = slot_x; i <= slot_y; i++) {
|
for(uint32 i = slot_x; i <= slot_y; i++) {
|
||||||
if (i == MainAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
if (i == MainAmmo) // moved here from calling procedure to facilitate future range changes where MainAmmo may not be the last slot
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -3380,15 +3380,15 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_ChangeFrenzyRad:
|
case SE_ChangeFrenzyRad:
|
||||||
spellbonuses.AggroRange = effect_value;
|
spellbonuses.AggroRange = static_cast<float>(effect_value);
|
||||||
aabonuses.AggroRange = effect_value;
|
aabonuses.AggroRange = static_cast<float>(effect_value);
|
||||||
itembonuses.AggroRange = effect_value;
|
itembonuses.AggroRange = static_cast<float>(effect_value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_Harmony:
|
case SE_Harmony:
|
||||||
spellbonuses.AssistRange = effect_value;
|
spellbonuses.AssistRange = static_cast<float>(effect_value);
|
||||||
aabonuses.AssistRange = effect_value;
|
aabonuses.AssistRange = static_cast<float>(effect_value);
|
||||||
itembonuses.AssistRange = effect_value;
|
itembonuses.AssistRange = static_cast<float>(effect_value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_AttackSpeed:
|
case SE_AttackSpeed:
|
||||||
@ -4347,11 +4347,11 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_TriggerMeleeThreshold:
|
case SE_TriggerMeleeThreshold:
|
||||||
spellbonuses.TriggerMeleeThreshold = effect_value;
|
spellbonuses.TriggerMeleeThreshold = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_TriggerSpellThreshold:
|
case SE_TriggerSpellThreshold:
|
||||||
spellbonuses.TriggerSpellThreshold = effect_value;
|
spellbonuses.TriggerSpellThreshold = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_DivineAura:
|
case SE_DivineAura:
|
||||||
@ -4377,7 +4377,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_DistanceRemoval:
|
case SE_DistanceRemoval:
|
||||||
spellbonuses.DistanceRemoval = effect_value;
|
spellbonuses.DistanceRemoval = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_ImprovedTaunt:
|
case SE_ImprovedTaunt:
|
||||||
@ -4480,7 +4480,7 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_Sanctuary:
|
case SE_Sanctuary:
|
||||||
spellbonuses.Sanctuary = effect_value;
|
spellbonuses.Sanctuary = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_FactionModPct:
|
case SE_FactionModPct:
|
||||||
@ -4496,10 +4496,28 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_IllusionPersistence:
|
case SE_IllusionPersistence:
|
||||||
spellbonuses.IllusionPersistence = effect_value;
|
spellbonuses.IllusionPersistence = false;
|
||||||
itembonuses.IllusionPersistence = effect_value;
|
itembonuses.IllusionPersistence = false;
|
||||||
aabonuses.IllusionPersistence = effect_value;
|
aabonuses.IllusionPersistence = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SE_SkillProcSuccess:{
|
||||||
|
for(int e = 0; e < MAX_SKILL_PROCS; e++)
|
||||||
|
{
|
||||||
|
spellbonuses.SkillProcSuccess[e] = effect_value;
|
||||||
|
itembonuses.SkillProcSuccess[e] = effect_value;
|
||||||
|
aabonuses.SkillProcSuccess[e] = effect_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case SE_SkillProc:{
|
||||||
|
for(int e = 0; e < MAX_SKILL_PROCS; e++)
|
||||||
|
{
|
||||||
|
spellbonuses.SkillProc[e] = effect_value;
|
||||||
|
itembonuses.SkillProc[e] = effect_value;
|
||||||
|
aabonuses.SkillProc[e] = effect_value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -260,7 +260,7 @@ int32 Mob::GetExtraSpellAmt(uint16 spell_id, int32 extra_spell_amt, int32 base_s
|
|||||||
if (total_cast_time > 0 && total_cast_time <= 2500)
|
if (total_cast_time > 0 && total_cast_time <= 2500)
|
||||||
extra_spell_amt = extra_spell_amt*25/100;
|
extra_spell_amt = extra_spell_amt*25/100;
|
||||||
else if (total_cast_time > 2500 && total_cast_time < 7000)
|
else if (total_cast_time > 2500 && total_cast_time < 7000)
|
||||||
extra_spell_amt = extra_spell_amt*(0.167*((total_cast_time - 1000)/1000));
|
extra_spell_amt = extra_spell_amt*(167*((total_cast_time - 1000)/1000)) / 1000;
|
||||||
else
|
else
|
||||||
extra_spell_amt = extra_spell_amt * total_cast_time / 7000;
|
extra_spell_amt = extra_spell_amt * total_cast_time / 7000;
|
||||||
|
|
||||||
@ -408,11 +408,11 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bonus += 0.05 * GetAA(aaAdvancedSpellCastingMastery);
|
bonus += 0.05f * GetAA(aaAdvancedSpellCastingMastery);
|
||||||
|
|
||||||
if(SuccessChance <= (SpecializeSkill * 0.3 * bonus))
|
if(SuccessChance <= (SpecializeSkill * 0.3 * bonus))
|
||||||
{
|
{
|
||||||
PercentManaReduction = 1 + 0.05 * SpecializeSkill;
|
PercentManaReduction = 1 + 0.05f * SpecializeSkill;
|
||||||
switch(GetAA(aaSpellCastingMastery))
|
switch(GetAA(aaSpellCastingMastery))
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -451,7 +451,7 @@ int32 Client::GetActSpellCost(uint16 spell_id, int32 cost)
|
|||||||
|
|
||||||
// Gift of Mana - reduces spell cost to 1 mana
|
// Gift of Mana - reduces spell cost to 1 mana
|
||||||
if(focus_redux >= 100) {
|
if(focus_redux >= 100) {
|
||||||
uint32 buff_max = GetMaxTotalSlots();
|
int buff_max = GetMaxTotalSlots();
|
||||||
for (int buffSlot = 0; buffSlot < buff_max; buffSlot++) {
|
for (int buffSlot = 0; buffSlot < buff_max; buffSlot++) {
|
||||||
if (buffs[buffSlot].spellid == 0 || buffs[buffSlot].spellid >= SPDAT_RECORDS)
|
if (buffs[buffSlot].spellid == 0 || buffs[buffSlot].spellid >= SPDAT_RECORDS)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -801,7 +801,7 @@ public:
|
|||||||
void SetGrouped(bool v);
|
void SetGrouped(bool v);
|
||||||
inline bool IsRaidGrouped() const { return israidgrouped; }
|
inline bool IsRaidGrouped() const { return israidgrouped; }
|
||||||
void SetRaidGrouped(bool v);
|
void SetRaidGrouped(bool v);
|
||||||
inline bool IsLooting() const { return entity_id_being_looted; }
|
inline uint16 IsLooting() const { return entity_id_being_looted; }
|
||||||
void SetLooting(uint16 val) { entity_id_being_looted = val; }
|
void SetLooting(uint16 val) { entity_id_being_looted = val; }
|
||||||
|
|
||||||
bool CheckWillAggro(Mob *mob);
|
bool CheckWillAggro(Mob *mob);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user