mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 05:21:29 +00:00
SE_Root and SE_RootBreakChance updates
This commit is contained in:
parent
d22c8832f7
commit
55f5d4affa
@ -4565,31 +4565,30 @@ bool Mob::TryRootFadeByDamage(int buffslot)
|
||||
the time couldn't imagine DOT damage getting that high.
|
||||
*/
|
||||
|
||||
int BreakChance = RuleI(Spells, RootBreakFromSpells);
|
||||
/* General Mechanics
|
||||
- Check buffslot to make sure damage from a root does not cancel the root
|
||||
- If multiple roots on target, always and only checks first root slot and if broken only removes that slots root.
|
||||
- Only roots on determental spells can be broken by damage.
|
||||
*/
|
||||
|
||||
BreakChance -= BreakChance*rooted_mod/100;
|
||||
if (!spellbonuses.Root[0] || spellbonuses.Root[1] < 0)
|
||||
return false;
|
||||
|
||||
if (BreakChance < 1)
|
||||
BreakChance = 1;
|
||||
if (IsDetrimentalSpell(spellbonuses.Root[1]) && spellbonuses.Root[1] != buffslot){
|
||||
|
||||
if (MakeRandomInt(0, 99) < BreakChance) {
|
||||
int BreakChance = RuleI(Spells, RootBreakFromSpells);
|
||||
|
||||
/*
|
||||
- Check buffslot to make sure damage from a root does not cancel the root
|
||||
- If multiple roots on target, always and only checks first root slot and if broken only removes that slots root.
|
||||
- Only roots on determental spells can be broken by damage.
|
||||
*/
|
||||
BreakChance -= BreakChance*buffs[spellbonuses.Root[1]].RootBreakChance/100;
|
||||
|
||||
uint32 buff_count = GetMaxTotalSlots();
|
||||
for(int i = 0; i < buff_count; i++)
|
||||
{
|
||||
if(IsValidSpell(buffs[i].spellid) &&
|
||||
(IsEffectInSpell(buffs[i].spellid, SE_Root) && IsDetrimentalSpell(buffs[i].spellid) && i != buffslot)){
|
||||
if (!TryFadeEffect(i)) {
|
||||
BuffFadeBySlot(i);
|
||||
mlog(COMBAT__HITS, "Spell broke root! BreakChance percent chance");
|
||||
return true;
|
||||
}
|
||||
if (BreakChance < 1)
|
||||
BreakChance = 1;
|
||||
|
||||
if (MakeRandomInt(0, 99) < BreakChance) {
|
||||
|
||||
if (!TryFadeEffect(spellbonuses.Root[1])) {
|
||||
BuffFadeBySlot(spellbonuses.Root[1]);
|
||||
mlog(COMBAT__HITS, "Spell broke root! BreakChance percent chance");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2533,6 +2533,16 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
|
||||
newbon->FrenziedDevastation += spells[spell_id].base2[i];
|
||||
break;
|
||||
|
||||
case SE_Root:
|
||||
if (newbon->Root[0] && (newbon->Root[1] > buffslot)){
|
||||
newbon->Root[0] = 1;
|
||||
newbon->Root[1] = buffslot;
|
||||
}
|
||||
else {
|
||||
newbon->Root[0] = 1;
|
||||
newbon->Root[1] = buffslot;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,7 +162,8 @@ struct Buffs_Struct {
|
||||
int32 caston_x;
|
||||
int32 caston_y;
|
||||
int32 caston_z;
|
||||
int32 ExtraDIChance;
|
||||
int32 ExtraDIChance;
|
||||
int16 RootBreakChance; //Not saved to dbase
|
||||
bool persistant_buff;
|
||||
bool client; //True if the caster is a client
|
||||
bool UpdateClient;
|
||||
@ -339,6 +340,7 @@ struct StatBonuses {
|
||||
bool DivineAura; // invulnerability
|
||||
bool DistanceRemoval; // Check if Cancle if Moved effect is present
|
||||
int16 ImprovedTaunt[3]; // 0 = Max Level 1 = Aggro modifier 2 = buffid
|
||||
int8 Root[2]; // The lowest buff slot a root can be found. [0] = Bool if has root [1] = buff slot
|
||||
int16 FrenziedDevastation; // base1= AArank(used) base2= chance increase spell criticals + all DD spells 2x mana.
|
||||
//bool AbsorbMagicAtt; // Magic Rune *Need to be implemented for NegateEffect
|
||||
//bool MeleeRune; // Melee Rune *Need to be implemented for NegateEffect
|
||||
|
||||
@ -1085,7 +1085,6 @@ protected:
|
||||
bool inWater; // Set to true or false by Water Detection code if enabled by rules
|
||||
bool has_virus; // whether this mob has a viral spell on them
|
||||
uint16 viral_spells[MAX_SPELL_TRIGGER*2]; // Stores the spell ids of the viruses on target and caster ids
|
||||
int16 rooted_mod; //Modifier to root break chance, defined when root is cast on a target.
|
||||
bool offhand;
|
||||
bool has_shieldequiped;
|
||||
bool has_numhits;
|
||||
|
||||
@ -1631,12 +1631,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
||||
snprintf(effect_desc, _EDLEN, "Root: %+i", effect_value);
|
||||
#endif
|
||||
rooted = true;
|
||||
rooted_mod = 0;
|
||||
|
||||
if (caster){
|
||||
rooted_mod = caster->aabonuses.RootBreakChance +
|
||||
caster->itembonuses.RootBreakChance +
|
||||
caster->spellbonuses.RootBreakChance;
|
||||
buffs[buffslot].RootBreakChance = caster->aabonuses.RootBreakChance +
|
||||
caster->itembonuses.RootBreakChance +
|
||||
caster->spellbonuses.RootBreakChance;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -3709,7 +3708,6 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
|
||||
case SE_Root:
|
||||
{
|
||||
rooted = false;
|
||||
rooted_mod = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -2951,6 +2951,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
|
||||
buffs[emptyslot].caston_z = 0;
|
||||
buffs[emptyslot].dot_rune = 0;
|
||||
buffs[emptyslot].ExtraDIChance = 0;
|
||||
buffs[emptyslot].RootBreakChance = 0;
|
||||
|
||||
if (level_override > 0) {
|
||||
buffs[emptyslot].UpdateClient = true;
|
||||
|
||||
@ -2654,6 +2654,7 @@ void ZoneDatabase::LoadBuffs(Client *c) {
|
||||
buffs[slot_id].caston_y = caston_y;
|
||||
buffs[slot_id].caston_z = caston_z;
|
||||
buffs[slot_id].ExtraDIChance = ExtraDIChance;
|
||||
buffs[slot_id].RootBreakChance = 0;
|
||||
buffs[slot_id].UpdateClient = false;
|
||||
if(IsRuneSpell(spell_id)) {
|
||||
c->SetHasRune(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user