mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. (#1954)
* 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' * updates * stun and mez bypass * Update spdat.cpp * Update spdat.cpp * Update spells.cpp * clean * requirement messages * update * pct * save work * Reform code 1_22_22 * updated * update id to pointer * Update spells.cpp * rework 2 * update 1_23_22 * Update spells.cpp * updates * msg string works * fix disc timers not be set * more optimization * update 1_23_22 PM moved stop casting out charm and harmony moved in * update 1_25_22 rework of functions * updates 1_26_22 * remove old checks * gm override added for some * update bard AA casting checks * updates * addbuff exception for bard * debugs * charm working * update * moved skill check here * cast from item while singing * lets not attack mounts * instant cast items click * aug clicks working * aug tests Bug? Cast time not display on aug clicks for bards * aug recast from items semi ok * added item timer function * unified setting item recast timer * clean up time * update * bard AA cast updates * debugs removed * debugs removed * clean up * clean up * better placement of bindsight and numhits fix * move and rename function * Update spells.cpp * add logs * delete old DoCastingChecks * Removed old bard pulse functions * remove AEBardPulse and GroupPulse * removed Raid::GroupBardPulse * Pulse Restriction: Divine Aura * Pulse Restrictions : Fear behavior * Update spells.cpp * Update spells.cpp * [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. bots... * [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. added recommended isvalidspell check * [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. merged * [Spells] Major update to Bard song pulsing, Bard item clicks while singing, and spell casting restriction logic. removed defines since we have them as constants
This commit is contained in:
+9
-91
@@ -821,22 +821,24 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
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);
|
||||
if (DoCastingChecksOnCaster(spell_id)) {
|
||||
if (SpellFinished(spell_id, entity_list.GetMob(target), EQ::spells::CastingSlot::Discipline, 0, -1, spells[spell_id].resist_difficulty, false, -1, (uint32)DiscTimer, reduced_recast, false)) {
|
||||
SendDisciplineTimer(spells[spell_id].timer_id, reduced_recast);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
CastSpell(spell_id, target, EQ::spells::CastingSlot::Discipline, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast);
|
||||
if (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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
if (DoCastingChecksOnCaster(spell_id)) {
|
||||
SpellFinished(spell_id, entity_list.GetMob(target), EQ::spells::CastingSlot::Discipline, 0, -1, spells[spell_id].resist_difficulty, false, -1, 0xFFFFFFFF, 0, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1194,90 +1196,6 @@ void EntityList::MassGroupBuff(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Causes caster to hit every mob within dist range of center with a bard pulse of spell_id
|
||||
* NPC spells will only affect other NPCs with compatible faction
|
||||
*
|
||||
* @param caster
|
||||
* @param center
|
||||
* @param spell_id
|
||||
* @param affect_caster
|
||||
*/
|
||||
void EntityList::AEBardPulse(
|
||||
Mob *caster,
|
||||
Mob *center,
|
||||
uint16 spell_id,
|
||||
bool affect_caster)
|
||||
{
|
||||
Mob *current_mob = nullptr;
|
||||
float distance = caster->GetAOERange(spell_id);
|
||||
float distance_squared = distance * distance;
|
||||
bool is_detrimental_spell = IsDetrimentalSpell(spell_id);
|
||||
bool is_npc = caster->IsNPC();
|
||||
|
||||
for (auto &it : entity_list.GetCloseMobList(caster, distance)) {
|
||||
current_mob = it.second;
|
||||
|
||||
/**
|
||||
* Skip self
|
||||
*/
|
||||
if (current_mob == center) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (current_mob == caster && !affect_caster) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (DistanceSquared(center->GetPosition(), current_mob->GetPosition()) > distance_squared) { //make sure they are in range
|
||||
continue;
|
||||
}
|
||||
|
||||
/**
|
||||
* check npc->npc casting
|
||||
*/
|
||||
if (is_npc && current_mob->IsNPC()) {
|
||||
FACTION_VALUE faction = current_mob->GetReverseFactionCon(caster);
|
||||
if (is_detrimental_spell) {
|
||||
//affect mobs that are on our hate list, or
|
||||
//which have bad faction with us
|
||||
if (!(caster->CheckAggro(current_mob) || faction == FACTION_THREATENINGLY || faction == FACTION_SCOWLS)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//only affect mobs we would assist.
|
||||
if (!(faction <= FACTION_AMIABLY)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* LOS
|
||||
*/
|
||||
if (is_detrimental_spell) {
|
||||
if (!center->CheckLosFN(current_mob)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else { // check to stop casting beneficial ae buffs (to wit: bard songs) on enemies...
|
||||
// See notes in AESpell() above for more info.
|
||||
if (caster->IsAttackAllowed(current_mob, true)) {
|
||||
continue;
|
||||
}
|
||||
if (caster->CheckAggro(current_mob)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
current_mob->BardPulse(spell_id, caster);
|
||||
}
|
||||
if (caster->IsClient()) {
|
||||
caster->CastToClient()->CheckSongSkillIncrease(spell_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rampage - Normal and Duration rampages
|
||||
* NPCs handle it differently in Mob::Rampage
|
||||
|
||||
Reference in New Issue
Block a user