Info
This script resets a players health and cooldowns when they accept a duel.
How to apply
To apply this script to your core
1. go to C:\Trinitycore\src\server\game\Server\Protocol\Handlers\
2. find a script called DuelHandler.cpp and open it
3. find the line that says
Code:
pl->SendDuelCountdown(3000);
plTarget->SendDuelCountdown(3000);
4. right under that line copy and paste this into the script
Code:
pl->RemoveAllSpellCooldown();
plTarget->RemoveAllSpellCooldown();
pl->SetHealth(pl->GetMaxHealth());
pl->SetPower(POWER_MANA, pl->GetMaxPower(POWER_MANA));
plTarget->SetHealth(plTarget->GetMaxHealth());
plTarget->SetPower(POWER_MANA, plTarget->GetMaxPower(POWER_MANA));
4. now your it should look like this
Code:
pl->SendDuelCountdown(3000);
plTarget->SendDuelCountdown(3000);
pl->RemoveAllSpellCooldown();
plTarget->RemoveAllSpellCooldown();
pl->SetHealth(pl->GetMaxHealth());
pl->SetPower(POWER_MANA, pl->GetMaxPower(POWER_MANA));
plTarget->SetHealth(plTarget->GetMaxHealth());
plTarget->SetPower(POWER_MANA, plTarget->GetMaxPower(POWER_MANA));
You could replace
Code:
RemoveAllSpellCooldown
with
Code:
RemoveAllArenaSpellCooldown
If you want only arena cooldowns reset (nothing above 10min)
5. save the script and recompile your core
6. your done!
You can also add
Code:
pl->RemoveAura(ID);
plTarget->RemoveAura(ID);
to remove certain buffs/debuffs before the duel starts
This is what I currently have
Code:
pl->RemoveAllSpellCooldown();
plTarget->RemoveAllSpellCooldown();
pl->RemoveAura(41425); // Remove Hypothermia Debuff
plTarget->RemoveAura(41425);
pl->RemoveAura(25771); // Remove Forbearance Debuff
plTarget->RemoveAura(25771);
pl->RemoveAura(57724); // Remove Sated Debuff
plTarget->RemoveAura(57724);
pl->RemoveAura(57723); // Remove Exhaustion Debuff
plTarget->RemoveAura(57723);
pl->RemoveAura(66233); // Remove Ardent Defender Debuff
plTarget->RemoveAura(66233);
pl->RemoveAura(11196); // Remove Recently Bandaged Debuff
plTarget->RemoveAura(11196);
pl->SetHealth(pl->GetMaxHealth());
pl->SetPower(POWER_MANA, pl->GetMaxPower(POWER_MANA));
plTarget->SetHealth(plTarget->GetMaxHealth());
plTarget->SetPower(POWER_MANA, plTarget->GetMaxPower(POWER_MANA));