mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 03:11:28 +00:00
Old school apply poison was allowing multiple poisons at once.
This commit is contained in:
parent
2e98de3923
commit
c62d9040cb
@ -22,6 +22,7 @@
|
|||||||
#include "skills.h"
|
#include "skills.h"
|
||||||
|
|
||||||
#define SPELL_UNKNOWN 0xFFFF
|
#define SPELL_UNKNOWN 0xFFFF
|
||||||
|
#define POISON_PROC 0xFFFE
|
||||||
#define SPELLBOOK_UNKNOWN 0xFFFFFFFF //player profile spells are 32 bit
|
#define SPELLBOOK_UNKNOWN 0xFFFFFFFF //player profile spells are 32 bit
|
||||||
|
|
||||||
//some spell IDs which will prolly change, but are needed
|
//some spell IDs which will prolly change, but are needed
|
||||||
|
|||||||
@ -2856,7 +2856,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
if (ChanceRoll < (.75 + poison_skill / 1000)) {
|
if (ChanceRoll < (.75 + poison_skill / 1000)) {
|
||||||
ApplyPoisonSuccessResult = 1;
|
ApplyPoisonSuccessResult = 1;
|
||||||
AddProcToWeapon(poison->Proc.Effect, false, (GetDEX() / 100) + 103);
|
AddProcToWeapon(poison->Proc.Effect, false, (GetDEX() / 100) + 103, POISON_PROC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -5360,13 +5360,31 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b
|
|||||||
}
|
}
|
||||||
Log(Logs::Detail, Logs::Spells, "Too many perma procs for %s", GetName());
|
Log(Logs::Detail, Logs::Spells, "Too many perma procs for %s", GetName());
|
||||||
} else {
|
} 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++) {
|
||||||
|
// If we already have a poison proc active replace it and return
|
||||||
|
if (SpellProcs[i].base_spellID == POISON_PROC) {
|
||||||
|
SpellProcs[i].spellID = spell_id;
|
||||||
|
SpellProcs[i].chance = iChance;
|
||||||
|
SpellProcs[i].level_override = level_override;
|
||||||
|
Log(Logs::Detail, Logs::Spells, "Replaced poison-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we get here it either wasn't poison (which can only use 1 slot)
|
||||||
|
// 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 < MAX_PROCS; i++) {
|
||||||
if (SpellProcs[i].spellID == SPELL_UNKNOWN) {
|
if (SpellProcs[i].spellID == SPELL_UNKNOWN) {
|
||||||
SpellProcs[i].spellID = spell_id;
|
SpellProcs[i].spellID = spell_id;
|
||||||
SpellProcs[i].chance = iChance;
|
SpellProcs[i].chance = iChance;
|
||||||
SpellProcs[i].base_spellID = base_spell_id;;
|
SpellProcs[i].base_spellID = base_spell_id;;
|
||||||
SpellProcs[i].level_override = level_override;
|
SpellProcs[i].level_override = level_override;
|
||||||
Log(Logs::Detail, Logs::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i);
|
Log(Logs::Detail, Logs::Spells, "Added %s-granted proc spell %d with chance %d to slot %d", (base_spell_id == POISON_PROC) ? "poison" : "spell", spell_id, iChance, i);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user