aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-02-17 01:01:44 +0100
committerShauren <shauren.trinity@gmail.com>2015-02-17 01:01:44 +0100
commit56186319bdd41dd26b6cc14f84e6e41eef5d953b (patch)
tree7b531cdf71b59170f9fa65120c09935ce51f3307 /src/server/scripts/Commands
parent7829412416c9709991fd686030ab77908c27922b (diff)
Core/Spells: Cooldown updates
* Refactored cooldown handling to separate class shared by creatures and players * Updated and enabled cooldown packets * Implemented creature school lockouts * Implemented spell charges * Fixed AuraUpdate structure * Fixed aura flag AFLAG_NOCASTER handling * Implemented spell charge related auras
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 889b24480e6..65b2d20c9d2 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -36,6 +36,7 @@
#include "GroupMgr.h"
#include "MMapFactory.h"
#include "DisableMgr.h"
+#include "SpellHistory.h"
class misc_commandscript : public CommandScript
{
@@ -713,7 +714,8 @@ public:
if (!*args)
{
- target->RemoveAllSpellCooldown();
+ target->GetSpellHistory()->ResetAllCooldowns();
+ target->GetSpellHistory()->ResetAllCharges();
handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str());
}
else
@@ -723,14 +725,16 @@ public:
if (!spellIid)
return false;
- if (!sSpellMgr->GetSpellInfo(spellIid))
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellIid);
+ if (!spellInfo)
{
handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
handler->SetSentErrorMessage(true);
return false;
}
- target->RemoveSpellCooldown(spellIid, true);
+ target->GetSpellHistory()->ResetCooldown(spellIid, true);
+ target->GetSpellHistory()->ResetCharges(spellInfo->ChargeCategoryEntry);
handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str());
}
return true;