Jump to content

[BUG] [ONE] Arcane Blast debuff waits full cast time after spell hit


Tiaquenes

Recommended Posts

Mangos Version: master from github

Custom Patches: only pulled into master

SD2 Version: master from github

Database Name and Version : TBCDB fork https://github.com/iorlas/MODB

How it SHOULD work: Debuff must be applied instantly(proof at 1:20 - http://www.dailymotion.com/video/x3scyt_terrestian_music)

How it DOES work: Debuff waits full cast time(2.5 sec)

Arcane Blast start casting, casts, hits and need 2.5 sec more to Arcane Blast debuff activate.

I know why it works like this and i can fix it...

In void Spell::prepare(...):

m_casttime = GetSpellCastTime(m_spellInfo, this);

It returns cast time by spellCastTimeId from DBC, it equals 2500 = 2.5 sec(you can see spell 36032 in spell.dbc, it has 19 spellCastId, which equals to 2500 by SpellCastTimes.dbc).

Next line -

ReSetTimer();

It sets m_timer to m_casttime or 0, if it's <0.

So, at the end of function we have m_timer = 2500.

Next:

if (!m_IsTriggeredSpell)
{ ... }
else if(m_timer == 0)
  ...

36062 is triggered spell, but m_timer = 2500... It means Arcane Blast debuff casts in... so, we have comment at the end of function:

// else triggered with cast time will execute execute at next tick or later

// without adding to cast type slot

// will not show cast bar but will show effects at casting time etc

So, i can just add something like "|| m_spellInfo->Id == 36062" to "else if(m_timer == 0)" or make a switch... but i'm not sure if it right way.

Maybe cast time must be ignored in some spells not by id.

I know, it works on "oregoncore", but i cant test it, either i cant test it on mangos/mangos.

Link to comment
Share on other sites

Fixed by

else if(m_timer == 0 || m_IsTriggeredSpell)

This idea taken from "oregoncore", which has this code:

   if (m_IsTriggeredSpell)
       cast(true);
   else
   {
       // stealth must be removed at cast starting (at show channel bar)
       // skip triggered spell (item equip spell casting and other not explicit character casts/item uses)
       if (isSpellBreakStealth(m_spellInfo))
           m_caster->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CAST);

       m_caster->SetCurrentCastedSpell(this);
       SendSpellStart();

       if (m_caster->GetTypeId() == TYPEID_PLAYER)
           m_caster->ToPlayer()->AddGlobalCooldown(m_spellInfo,this);

       if (!m_casttime && !m_spellInfo->StartRecoveryTime
           && !m_castItemGUID     //item: first cast may destroy item and second cast causes crash
           && GetCurrentContainer() == CURRENT_GENERIC_SPELL)
           cast(true);
   }

See commit https://github.com/iorlas/one/commit/411b0696887cb6df8b8c1140e6c5aa77be32488e

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use