[Rules] Add rule to configure max number of procs per round Combat:MaxProcs (#3640)

This commit is contained in:
Chris Miles
2023-10-20 13:57:50 -05:00
committed by GitHub
parent 605480f1c4
commit adc64005f1
5 changed files with 24 additions and 16 deletions
+9 -9
View File
@@ -6017,7 +6017,7 @@ bool Mob::IsCombatProc(uint16 spell_id) {
/*
Procs that originate from casted spells are still limited by SPA 311 (~Kayen confirmed on live 2/4/22)
*/
for (int i = 0; i < MAX_PROCS; i++) {
for (int i = 0; i < m_max_procs; i++) {
if (PermaProcs[i].spellID == spell_id ||
SpellProcs[i].spellID == spell_id ||
RangedProcs[i].spellID == spell_id ||
@@ -6044,7 +6044,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b
int i;
if (bPerma) {
for (i = 0; i < MAX_PROCS; i++) {
for (i = 0; i < m_max_procs; i++) {
if (!IsValidSpell(PermaProcs[i].spellID)) {
PermaProcs[i].spellID = spell_id;
PermaProcs[i].chance = iChance;
@@ -6059,7 +6059,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b
} else {
// If its a poison proc, replace any existing one if present.
if (base_spell_id == POISON_PROC) {
for (i = 0; i < MAX_PROCS; i++) {
for (i = 0; i < m_max_procs; i++) {
// If we already have a poison proc active replace it and return
if (SpellProcs[i].base_spellID == POISON_PROC) {
SpellProcs[i].spellID = spell_id;
@@ -6076,7 +6076,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b
// or it is poison and no poison procs are currently present.
// Find a slot and use it as normal.
for (i = 0; i < MAX_PROCS; i++) {
for (i = 0; i < m_max_procs; i++) {
if (!IsValidSpell(SpellProcs[i].spellID)) {
SpellProcs[i].spellID = spell_id;
SpellProcs[i].chance = iChance;
@@ -6093,7 +6093,7 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b
}
bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) {
for (int i = 0; i < MAX_PROCS; i++) {
for (int i = 0; i < m_max_procs; i++) {
if (bAll || SpellProcs[i].spellID == spell_id) {
SpellProcs[i].spellID = SPELL_UNKNOWN;
SpellProcs[i].chance = 0;
@@ -6112,7 +6112,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id
return(false);
int i;
for (i = 0; i < MAX_PROCS; i++) {
for (i = 0; i < m_max_procs; i++) {
if (!IsValidSpell(DefensiveProcs[i].spellID)) {
DefensiveProcs[i].spellID = spell_id;
DefensiveProcs[i].chance = iChance;
@@ -6128,7 +6128,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id
bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll)
{
for (int i = 0; i < MAX_PROCS; i++) {
for (int i = 0; i < m_max_procs; i++) {
if (bAll || DefensiveProcs[i].spellID == spell_id) {
DefensiveProcs[i].spellID = SPELL_UNKNOWN;
DefensiveProcs[i].chance = 0;
@@ -6146,7 +6146,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id, u
return(false);
int i;
for (i = 0; i < MAX_PROCS; i++) {
for (i = 0; i < m_max_procs; i++) {
if (!IsValidSpell(RangedProcs[i].spellID)) {
RangedProcs[i].spellID = spell_id;
RangedProcs[i].chance = iChance;
@@ -6162,7 +6162,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id, u
bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll)
{
for (int i = 0; i < MAX_PROCS; i++) {
for (int i = 0; i < m_max_procs; i++) {
if (bAll || RangedProcs[i].spellID == spell_id) {
RangedProcs[i].spellID = SPELL_UNKNOWN;
RangedProcs[i].chance = 0;