mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-12 01:32:25 +00:00
[Spells] Fix for AA recast timers not resetting properly (#1989)
* revert completed Too many issues popping up that are difficult to track down. This was probably not best way to solve the problem. * fixed for real * Update aa.cpp * Update aa.cpp * Update aa.cpp * should work * remove spaces * [Spells] Fix for AA recast timers not resetting properly
This commit is contained in:
parent
e2484997dd
commit
99793cab8b
17
zone/aa.cpp
17
zone/aa.cpp
@ -1278,10 +1278,9 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//calculate cooldown
|
int timer_duration = rank->recast_time - GetAlternateAdvancementCooldownReduction(rank);
|
||||||
int cooldown = rank->recast_time - GetAlternateAdvancementCooldownReduction(rank);
|
if (timer_duration < 0) {
|
||||||
if (cooldown < 0) {
|
timer_duration = 0;
|
||||||
cooldown = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsCastWhileInvis(rank->spell))
|
if (!IsCastWhileInvis(rank->spell))
|
||||||
@ -1316,20 +1315,18 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
|
|||||||
if (!DoCastingChecksOnCaster(rank->spell)) {
|
if (!DoCastingChecksOnCaster(rank->spell)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!SpellFinished(rank->spell, entity_list.GetMob(target_id), EQ::spells::CastingSlot::AltAbility, spells[rank->spell].mana, -1, spells[rank->spell].resist_difficulty, false)) {
|
|
||||||
|
if (!SpellFinished(rank->spell, entity_list.GetMob(target_id), EQ::spells::CastingSlot::AltAbility, spells[rank->spell].mana, -1, spells[rank->spell].resist_difficulty, false, -1,
|
||||||
|
rank->spell_type + pTimerAAStart, timer_duration, false, rank->id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ExpendAlternateAdvancementCharge(ability->id);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!CastSpell(rank->spell, target_id, EQ::spells::CastingSlot::AltAbility, -1, -1, 0, -1, rank->spell_type + pTimerAAStart, cooldown, nullptr, rank->id)) {
|
if (!CastSpell(rank->spell, target_id, EQ::spells::CastingSlot::AltAbility, -1, -1, 0, -1, rank->spell_type + pTimerAAStart, timer_duration, nullptr, rank->id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CastToClient()->GetPTimers().Start(rank->spell_type + pTimerAAStart, cooldown);
|
|
||||||
SendAlternateAdvancementTimer(rank->spell_type, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Mob::GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in) {
|
int Mob::GetAlternateAdvancementCooldownReduction(AA::Rank *rank_in) {
|
||||||
|
|||||||
@ -326,7 +326,7 @@ public:
|
|||||||
void CastedSpellFinished(uint16 spell_id, uint32 target_id, EQ::spells::CastingSlot slot, uint16 mana_used,
|
void CastedSpellFinished(uint16 spell_id, uint32 target_id, EQ::spells::CastingSlot slot, uint16 mana_used,
|
||||||
uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0);
|
uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0);
|
||||||
bool SpellFinished(uint16 spell_id, Mob *target, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, uint16 mana_used = 0,
|
bool SpellFinished(uint16 spell_id, Mob *target, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, uint16 mana_used = 0,
|
||||||
uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0, bool isproc = false, int level_override = -1, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, bool from_casted_spell = false);
|
uint32 inventory_slot = 0xFFFFFFFF, int16 resist_adjust = 0, bool isproc = false, int level_override = -1, uint32 timer = 0xFFFFFFFF, uint32 timer_duration = 0, bool from_casted_spell = false, uint32 aa_id = 0);
|
||||||
void SendBeginCast(uint16 spell_id, uint32 casttime);
|
void SendBeginCast(uint16 spell_id, uint32 casttime);
|
||||||
virtual bool SpellOnTarget(uint16 spell_id, Mob* spelltar, int reflect_effectiveness = 0,
|
virtual bool SpellOnTarget(uint16 spell_id, Mob* spelltar, int reflect_effectiveness = 0,
|
||||||
bool use_resist_adjust = false, int16 resist_adjust = 0, bool isproc = false, int level_override = -1, int32 duration_override = 0);
|
bool use_resist_adjust = false, int16 resist_adjust = 0, bool isproc = false, int level_override = -1, int32 duration_override = 0);
|
||||||
|
|||||||
@ -2221,7 +2221,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce
|
|||||||
// if you need to abort the casting, return false
|
// if you need to abort the casting, return false
|
||||||
bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, uint16 mana_used,
|
bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, uint16 mana_used,
|
||||||
uint32 inventory_slot, int16 resist_adjust, bool isproc, int level_override,
|
uint32 inventory_slot, int16 resist_adjust, bool isproc, int level_override,
|
||||||
uint32 timer, uint32 timer_duration, bool from_casted_spell)
|
uint32 timer, uint32 timer_duration, bool from_casted_spell, uint32 aa_id)
|
||||||
{
|
{
|
||||||
Mob *ae_center = nullptr;
|
Mob *ae_center = nullptr;
|
||||||
|
|
||||||
@ -2600,22 +2600,33 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
|
|||||||
*/
|
*/
|
||||||
if(IsClient() && !isproc)
|
if(IsClient() && !isproc)
|
||||||
{
|
{
|
||||||
//Support for bards to get disc recast timers while singing
|
if (slot == CastingSlot::AltAbility) {
|
||||||
|
if (!aa_id) {
|
||||||
|
aa_id = casting_spell_aa_id;
|
||||||
|
}
|
||||||
|
if (aa_id) {
|
||||||
|
AA::Rank *rank = zone->GetAlternateAdvancementRank(aa_id);
|
||||||
|
//handle expendable AA's
|
||||||
|
if (rank && rank->base_ability) {
|
||||||
|
ExpendAlternateAdvancementCharge(rank->base_ability->id);
|
||||||
|
}
|
||||||
|
//set AA recast timer
|
||||||
|
CastToClient()->SendAlternateAdvancementTimer(rank->spell_type, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//handle bard AA and Discipline recast timers when singing
|
||||||
if (GetClass() == BARD && spell_id != casting_spell_id && timer != 0xFFFFFFFF) {
|
if (GetClass() == BARD && spell_id != casting_spell_id && timer != 0xFFFFFFFF) {
|
||||||
CastToClient()->GetPTimers().Start(timer, timer_duration);
|
CastToClient()->GetPTimers().Start(timer, timer_duration);
|
||||||
LogSpells("Spell [{}]: Setting bard disciple reuse timer from spell finished [{}] to [{}]", spell_id, timer, timer_duration);
|
LogSpells("Spell [{}]: Setting BARD custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration);
|
||||||
}
|
}
|
||||||
|
//handles AA and Discipline recast timers
|
||||||
if(casting_spell_aa_id) {
|
else if (spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF)
|
||||||
AA::Rank *rank = zone->GetAlternateAdvancementRank(casting_spell_aa_id);
|
{
|
||||||
|
CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration);
|
||||||
if(rank && rank->base_ability) {
|
LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration);
|
||||||
ExpendAlternateAdvancementCharge(rank->base_ability->id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF)
|
else if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF)
|
||||||
{
|
{
|
||||||
//aa new todo: aa expendable charges here
|
|
||||||
CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration);
|
CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration);
|
||||||
LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration);
|
LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user