• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[Core Edit] How to Add Or Change Aura Timer.

callmephil

Respected Member
Hey guys so i was working few days ago and i discovered few things. One of this things was Buff timer ! alot of people are doing that by using dbc edit and this is totaly UGLY !

Note 1 : If you are using a repack THIS is not for you.
Note 2 : This is CORE EDIT it's really simple if you follow the step correctly nothing BAD will happen to the core.

Well let's start :
Step 1 :

Open the folder : SpellAuras.cpp || Sources\src\server\game\Spells\Auras\SpellAuras.cpp || Folder name Src > Server > Game > Spells > Auras > SpellAuras.cpp

Step 2 :

Search for : int32 Aura::CalcMaxDuration(Unit* caster) const Or // IsPermanent() checks max duration (which we are supposed to calculate here)

Step 3 :

Add BEFORE return maxDuration; this thoses lines :

Code:
// Custom
if (m_spellInfo->Id == 7302) // Change 
maxDuration = -1;

should now be something like

Code:
// IsPermanent() checks max duration (which we are supposed to calculate here)
    if (maxDuration != -1 && modOwner)
        modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration);
		
	// Custom
	if (m_spellInfo->Id == 7302)
	maxDuration = -1;
		
    return maxDuration;

So 7302 is the SPELL ID you can change or add more spells by doing something like this
Code:
 if (m_spellInfo->id == 7302 || m_spellInfo->id == XXXX || m_spellInfo->id == XX)
ETC
maxDuration = -1; Is the Timer of the buff -1 is infinit also the timer is in Milliseconds so for 1 min = 60000 Milliseconds, 3600000 = 1 h because 1 second is 1000 Miliseconds || ((60000*X) for the people who should not be alive anymore .:rain:)
so if i want a buff who disapear after 2 minutes what should i do ?
Change
maxDuration = -1;
To
maxDuration = 120000;

---- TIPS ----
if you want to add different timer for different Aura the code should be something like this

Code:
        // Custom 1
	if (m_spellInfo->Id == 7302)
	maxDuration = -1;

        // Custom 2
	if (m_spellInfo->Id == 5303 || m_spellInfo->Id == 5432)
	maxDuration = 120000;

Well i think i'm done Enjoy. if you have any question please comment on this post.

Last Note : This is not for Basic Spell timer - Only Buff & Aura.
 
Last edited:
Top