mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-27 06:22:26 +00:00
bug fix (#2001)
This commit is contained in:
parent
cc9196bd65
commit
51c8771bd2
@ -5095,7 +5095,6 @@ void Mob::ApplyDamageTable(DamageHitInfo &hit)
|
|||||||
|
|
||||||
void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, bool Success, uint16 hand, bool IsDefensive)
|
void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, bool Success, uint16 hand, bool IsDefensive)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!on) {
|
if (!on) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
LogError("A null Mob object was passed to Mob::TrySkillProc for evaluation!");
|
LogError("A null Mob object was passed to Mob::TrySkillProc for evaluation!");
|
||||||
@ -5122,10 +5121,12 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b
|
|||||||
float ProcMod = 0;
|
float ProcMod = 0;
|
||||||
float chance = 0;
|
float chance = 0;
|
||||||
|
|
||||||
if (IsDefensive)
|
if (IsDefensive) {
|
||||||
chance = on->GetSkillProcChances(ReuseTime, hand);
|
chance = on->GetSkillProcChances(ReuseTime, hand);
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
chance = GetSkillProcChances(ReuseTime, hand);
|
chance = GetSkillProcChances(ReuseTime, hand);
|
||||||
|
}
|
||||||
|
|
||||||
if (spellbonuses.LimitToSkill[skill]) {
|
if (spellbonuses.LimitToSkill[skill]) {
|
||||||
|
|
||||||
@ -5152,7 +5153,6 @@ void Mob::TrySkillProc(Mob *on, EQ::skills::SkillType skill, uint16 ReuseTime, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) {
|
else if (spells[base_spell_id].effect_id[i] == SE_LimitToSkill && spells[base_spell_id].base_value[i] <= EQ::skills::HIGHEST_SKILL) {
|
||||||
|
|
||||||
if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) {
|
if (CanProc && spells[base_spell_id].base_value[i] == skill && IsValidSpell(proc_spell_id)) {
|
||||||
float final_chance = chance * (ProcMod / 100.0f);
|
float final_chance = chance * (ProcMod / 100.0f);
|
||||||
if (zone->random.Roll(final_chance)) {
|
if (zone->random.Roll(final_chance)) {
|
||||||
|
|||||||
@ -1476,7 +1476,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
|
|||||||
}
|
}
|
||||||
if (base_value <= EQ::skills::HIGHEST_SKILL) {
|
if (base_value <= EQ::skills::HIGHEST_SKILL) {
|
||||||
newbon->LimitToSkill[base_value] = true;
|
newbon->LimitToSkill[base_value] = true;
|
||||||
newbon->LimitToSkill[EQ::skills::HIGHEST_SKILL + 3] = true; //Used as a general exists check
|
newbon->LimitToSkill[EQ::skills::HIGHEST_SKILL + 2] = true; //Used as a general exists check
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3553,15 +3553,15 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
new_bonus->IllusionPersistence = effect_value;
|
new_bonus->IllusionPersistence = effect_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SE_LimitToSkill:{
|
case SE_LimitToSkill: {
|
||||||
// Bad data or unsupported new skill
|
// Bad data or unsupported new skill
|
||||||
if (effect_value > EQ::skills::HIGHEST_SKILL) {
|
if (effect_value > EQ::skills::HIGHEST_SKILL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (effect_value <= EQ::skills::HIGHEST_SKILL){
|
if (effect_value <= EQ::skills::HIGHEST_SKILL){
|
||||||
new_bonus->LimitToSkill[effect_value] = true;
|
new_bonus->LimitToSkill[effect_value] = true;
|
||||||
new_bonus->LimitToSkill[EQ::skills::HIGHEST_SKILL + 3] = true; //Used as a general exists check
|
new_bonus->LimitToSkill[EQ::skills::HIGHEST_SKILL + 2] = true; //Used as a general exists check
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3569,11 +3569,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
|
|||||||
|
|
||||||
for(int e = 0; e < MAX_SKILL_PROCS; e++)
|
for(int e = 0; e < MAX_SKILL_PROCS; e++)
|
||||||
{
|
{
|
||||||
if(new_bonus->SkillProc[e] && new_bonus->SkillProc[e] == spell_id)
|
if (new_bonus->SkillProc[e] && new_bonus->SkillProc[e] == spell_id) {
|
||||||
break; //Do not use the same spell id more than once.
|
break; //Do not use the same spell id more than once.
|
||||||
|
}
|
||||||
else if(!new_bonus->SkillProc[e]){
|
else if(!new_bonus->SkillProc[e]){
|
||||||
new_bonus->SkillProc[e] = spell_id;
|
new_bonus->SkillProc[e] = spell_id;
|
||||||
|
HasSkillProcs();//This returns it correctly as debug
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5568,6 +5569,7 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id)
|
|||||||
case SE_SkillProcAttempt: {
|
case SE_SkillProcAttempt: {
|
||||||
for (int e = 0; e < MAX_SKILL_PROCS; e++)
|
for (int e = 0; e < MAX_SKILL_PROCS; e++)
|
||||||
{
|
{
|
||||||
|
Shout("Fail NEGATE");
|
||||||
if (negate_spellbonus) { spellbonuses.SkillProc[e] = effect_value; }
|
if (negate_spellbonus) { spellbonuses.SkillProc[e] = effect_value; }
|
||||||
if (negate_itembonus) { itembonuses.SkillProc[e] = effect_value; }
|
if (negate_itembonus) { itembonuses.SkillProc[e] = effect_value; }
|
||||||
if (negate_aabonus) { aabonuses.SkillProc[e] = effect_value; }
|
if (negate_aabonus) { aabonuses.SkillProc[e] = effect_value; }
|
||||||
|
|||||||
@ -535,8 +535,8 @@ struct StatBonuses {
|
|||||||
bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others.
|
bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others.
|
||||||
int32 FactionModPct; // Modifies amount of faction gained.
|
int32 FactionModPct; // Modifies amount of faction gained.
|
||||||
bool LimitToSkill[EQ::skills::HIGHEST_SKILL + 3]; // Determines if we need to search for a skill proc.
|
bool LimitToSkill[EQ::skills::HIGHEST_SKILL + 3]; // Determines if we need to search for a skill proc.
|
||||||
uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs.
|
int32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs.
|
||||||
uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success.
|
int32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success.
|
||||||
int32 SpellProc[MAX_AA_PROCS]; // Max number of spells containing melee spell procs.
|
int32 SpellProc[MAX_AA_PROCS]; // Max number of spells containing melee spell procs.
|
||||||
int32 RangedProc[MAX_AA_PROCS]; // Max number of spells containing ranged spell procs.
|
int32 RangedProc[MAX_AA_PROCS]; // Max number of spells containing ranged spell procs.
|
||||||
int32 DefensiveProc[MAX_AA_PROCS]; // Max number of spells containing defensive spell procs.
|
int32 DefensiveProc[MAX_AA_PROCS]; // Max number of spells containing defensive spell procs.
|
||||||
|
|||||||
@ -4261,7 +4261,7 @@ void Mob::TriggerDefensiveProcs(Mob *on, uint16 hand, bool FromSkillProc, int da
|
|||||||
|
|
||||||
TryCastOnSkillUse(on, skillinuse);
|
TryCastOnSkillUse(on, skillinuse);
|
||||||
|
|
||||||
if (on->HasSkillProcs()) {
|
if (on && on->HasSkillProcs()) {
|
||||||
on->TrySkillProc(this, skillinuse, 0, false, hand, true);
|
on->TrySkillProc(this, skillinuse, 0, false, hand, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9702,7 +9702,7 @@ bool Mob::PassLimitToSkill(EQ::skills::SkillType skill, int32 spell_id, int proc
|
|||||||
bool match_proc_type = false;
|
bool match_proc_type = false;
|
||||||
bool has_limit_check = false;
|
bool has_limit_check = false;
|
||||||
|
|
||||||
if (!aa_id && spellbonuses.LimitToSkill[EQ::skills::HIGHEST_SKILL + 3]) {
|
if (!aa_id && spellbonuses.LimitToSkill[EQ::skills::HIGHEST_SKILL + 2]) {
|
||||||
|
|
||||||
if (spell_id == SPELL_UNKNOWN) {
|
if (spell_id == SPELL_UNKNOWN) {
|
||||||
return false;
|
return false;
|
||||||
@ -9721,7 +9721,7 @@ bool Mob::PassLimitToSkill(EQ::skills::SkillType skill, int32 spell_id, int proc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (aabonuses.LimitToSkill[EQ::skills::HIGHEST_SKILL + 3]) {
|
else if (aabonuses.LimitToSkill[EQ::skills::HIGHEST_SKILL + 2]) {
|
||||||
|
|
||||||
int rank_id = 1;
|
int rank_id = 1;
|
||||||
AA::Rank *rank = zone->GetAlternateAdvancementRank(aa_id);
|
AA::Rank *rank = zone->GetAlternateAdvancementRank(aa_id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user