aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-08-13 12:03:43 +0200
committerGitHub <noreply@github.com>2017-08-13 12:03:43 +0200
commit1f8fc55ac9d5b12acc56fa72e4ae61f24b910b0d (patch)
tree6c264542125fa45a169df89d1c16651481fead37 /src/server/scripts
parentcb4dd92629149d94e5ded6c2e8b073173bbe042a (diff)
Core/Spells: Implementation of QAston proc system (#20131)
* Core/Spells: Implementation of QAston proc system - Move checks from Unit::IsTriggeredAtSpellProcEvent (old system) to Aura::IsProcTriggeredOnEvent (new system) - killed charge counter from SpellModifier and Player system for handling charges... no point in having 3 different systems doing the same thing - Automatically add default entries to spellProcMap, based on spellinfo (else auras won't proc without an entry) Based on old Unit::ProcDamageAndSpellFor - Old Unit::ProcDamageAndSpellFor renamed to Unit::ProcSkillsAndReactives and made private, will no longer handle auras. - Start making use of HealInfo::AbsorbHeal in unit calculations, add effective healing info to HealInfo struct - Changes in spell reflection system, emulates old behaviour, delaying aura drop - Removed old charge count hacks in SpellMgr::LoadSpellInfoCorrections - Removed bogus error log when procChance is 0: Some auras have initial 0 procChance but modified by SPELLMOD_CHANCE_OF_SUCCESS - Fixed TriggerAurasProcOnEvent logic that tried to trigger twice from actor. - Allow non damaging spells with DamageClass Melee or Ranged to proc character enchants. Ref issue #17034: * http://web.archive.org/web/20110309092008/http://elitistjerks.com/f47/t49865-paladin_retribution_pve/ * When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system). * 1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..) * 2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided. * Holy Vengeance is the "hidden strike" it has an apply aura effect and damage class melee. - Fixed Blood Tap interaction with Death Runes (btw, don't know what was going on with those MiscValueB, spell 45529 doesn't have any MiscValueB in SPELL_EFFECT_ACTIVATE_RUNE) - Ported some AuraEffect checks from old Unit.cpp function. added new AuraScript hook to check procs of an specific effect - Allow only AuraEffects that passed the check to proc, this won't block whole aura from proccing (and lose charges) if at least one of the effects procs, though - Changes in spell mod system (for SPELLMOD_CASTING_TIME). fixes #17558. - Added an exception for SPELLMOD_CRITICAL_CHANCE too, fixes #15193 (cherry picked from commit e641d0c7d71bdb21e443bf52bf508b1581e07839) # Conflicts: # sql/base/auth_database.sql # src/server/game/Entities/Player/Player.cpp # src/server/game/Entities/Player/Player.h # src/server/game/Entities/Unit/Unit.cpp # src/server/game/Entities/Unit/Unit.h # src/server/game/Spells/Auras/SpellAuraEffects.cpp # src/server/game/Spells/Auras/SpellAuras.cpp # src/server/game/Spells/Auras/SpellAuras.h # src/server/game/Spells/Spell.cpp # src/server/game/Spells/SpellEffects.cpp # src/server/game/Spells/SpellInfo.cpp # src/server/game/Spells/SpellMgr.cpp # src/server/game/Spells/SpellMgr.h # src/server/game/Spells/SpellScript.cpp
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp10
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp7
-rw-r--r--src/server/scripts/Spells/spell_item.cpp5
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp4
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp7
5 files changed, 11 insertions, 22 deletions
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index fa494b6d709..b657e9e56fe 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -149,7 +149,6 @@ public:
{ "spell_loot_template", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LOOT_TEMPLATE, true, &HandleReloadLootTemplatesSpellCommand, "" },
{ "spell_linked_spell", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_LINKED_SPELL, true, &HandleReloadSpellLinkedSpellCommand, "" },
{ "spell_pet_auras", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PET_AURAS, true, &HandleReloadSpellPetAurasCommand, "" },
- { "spell_proc_event", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC_EVENT, true, &HandleReloadSpellProcEventCommand, "" },
{ "spell_proc", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_PROC, true, &HandleReloadSpellProcsCommand, "" },
{ "spell_scripts", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_SCRIPTS, true, &HandleReloadSpellScriptsCommand, "" },
{ "spell_target_position", rbac::RBAC_PERM_COMMAND_RELOAD_SPELL_TARGET_POSITION, true, &HandleReloadSpellTargetPositionCommand, "" },
@@ -289,7 +288,6 @@ public:
HandleReloadSpellGroupsCommand(handler, "a");
HandleReloadSpellLearnSpellCommand(handler, "a");
HandleReloadSpellLinkedSpellCommand(handler, "a");
- HandleReloadSpellProcEventCommand(handler, "a");
HandleReloadSpellProcsCommand(handler, "a");
HandleReloadSpellTargetPositionCommand(handler, "a");
HandleReloadSpellThreatsCommand(handler, "a");
@@ -830,14 +828,6 @@ public:
return true;
}
- static bool HandleReloadSpellProcEventCommand(ChatHandler* handler, const char* /*args*/)
- {
- TC_LOG_INFO("misc", "Re-Loading Spell Proc Event conditions...");
- sSpellMgr->LoadSpellProcEvents();
- handler->SendGlobalGMSysMessage("DB table `spell_proc_event` (spell proc trigger requirements) reloaded.");
- return true;
- }
-
static bool HandleReloadSpellProcsCommand(ChatHandler* handler, const char* /*args*/)
{
TC_LOG_INFO("misc", "Re-Loading Spell Proc conditions and data...");
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index e28bd4a8236..362d477be7e 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -24,6 +24,7 @@
#include "ScriptMgr.h"
#include "Containers.h"
#include "Player.h"
+#include "Spell.h"
#include "SpellAuraEffects.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
@@ -908,12 +909,12 @@ class spell_dru_t3_8p_bonus : public SpellScriptLoader
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
- if (!spellInfo)
+ Spell const* spell = eventInfo.GetProcSpell();
+ if (!spell)
return;
Unit* caster = eventInfo.GetActor();
- std::vector<SpellPowerCost> costs = spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask());
+ std::vector<SpellPowerCost> const& costs = spell->GetPowerCost();
auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA; });
if (m == costs.end())
return;
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 1c229714dd5..018e527dc90 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -32,6 +32,7 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "SkillDiscovery.h"
+#include "Spell.h"
#include "SpellAuraEffects.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
@@ -1546,9 +1547,9 @@ class spell_item_pendant_of_the_violet_eye : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
- if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
+ if (Spell const* spell = eventInfo.GetProcSpell())
{
- std::vector<SpellPowerCost> costs = spellInfo->CalcPowerCost(GetTarget(), spellInfo->GetSchoolMask());
+ std::vector<SpellPowerCost> const& costs = spell->GetPowerCost();
auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA && cost.Amount > 0; });
if (m != costs.end())
return true;
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index ec456e2c42f..f4efe94d241 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -598,14 +598,14 @@ class spell_mage_master_of_elements : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
- return eventInfo.GetDamageInfo()->GetSpellInfo() != nullptr;
+ return eventInfo.GetProcSpell() != nullptr;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- std::vector<SpellPowerCost> costs = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask());
+ std::vector<SpellPowerCost> const& costs = eventInfo.GetProcSpell()->GetPowerCost();
auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA; });
if (m != costs.end())
{
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 5298c2bef57..bcce99a8dae 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -649,17 +649,14 @@ class spell_sha_item_mana_surge : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
- return eventInfo.GetSpellInfo() != nullptr;
+ return eventInfo.GetProcSpell() != nullptr;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
- if (!spellInfo)
- return;
- std::vector<SpellPowerCost> costs = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask());
+ std::vector<SpellPowerCost> const& costs = eventInfo.GetProcSpell()->GetPowerCost();
auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_MANA; });
if (m != costs.end())
{