[Spells] Support for bards using Disciplines while casting or /melody. (#1936)

* test

* complete

* Update effects.cpp

* Update spells.cpp

* Update effects.cpp

* [Spells] Support for bards using Disciplines while casting or /melody.

Support for spell field 'cast not standing' not allow casting from divine aura

* [Spells] Support for bards using Disciplines while casting or /melody.

DA bypass logic for spells with field 'cast_not_standing'
This commit is contained in:
KayenEQ
2022-01-19 22:44:17 -05:00
committed by GitHub
parent 804f0681a9
commit e09a8f8f8f
3 changed files with 72 additions and 26 deletions
+33 -12
View File
@@ -727,6 +727,9 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
// Dont let client waste a reuse timer if they can't use the disc
if (IsStunned() || IsFeared() || IsMezzed() || IsAmnesiad() || IsPet())
{
if (IsAmnesiad()) {
MessageString(Chat::Red, MELEE_SILENCE);
}
return(false);
}
@@ -745,6 +748,10 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
return(false);
}
if (DivineAura() && !spells[spell_id].cast_not_standing) {
return false;
}
//can we use the spell?
const SPDat_Spell_Struct &spell = spells[spell_id];
uint8 level_to_use = spell.classes[GetClass() - 1];
@@ -789,8 +796,9 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
return false;
}
if(spell.recast_time > 0)
{
bool instant_recast = true;
if(spell.recast_time > 0) {
uint32 reduced_recast = spell.recast_time / 1000;
auto focus = GetFocusEffect(focusReduceRecastTime, spell_id);
// do stupid stuff because custom servers.
@@ -805,18 +813,31 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
reduced_recast -= focus;
}
if (reduced_recast > 0)
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast);
else{
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline);
return true;
if (reduced_recast > 0){
instant_recast = false;
if (GetClass() == BARD && IsCasting() && spells[spell_id].cast_time == 0) {
if (DoCastingChecks(spell_id, target)) {
SpellFinished(spell_id, entity_list.GetMob(target), EQ::spells::CastingSlot::Discipline, 0, -1, spells[spell_id].resist_difficulty, false, -1, (uint32)DiscTimer, reduced_recast);
}
}
else {
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast);
}
SendDisciplineTimer(spells[spell_id].timer_id, reduced_recast);
}
SendDisciplineTimer(spells[spell_id].timer_id, reduced_recast);
}
else
{
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline);
if (instant_recast) {
if (GetClass() == BARD && IsCasting() && spells[spell_id].cast_time == 0) {
if (DoCastingChecks(spell_id, target)) {
SpellFinished(spell_id, entity_list.GetMob(target), EQ::spells::CastingSlot::Discipline);
}
}
else {
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline);
}
}
return(true);
}