TrinityCore
Loading...
Searching...
No Matches
spell_rogue.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Scripts for spells with SPELLFAMILY_ROGUE and SPELLFAMILY_GENERIC spells used by rogue players.
20 * Ordered alphabetically using scriptname.
21 * Scriptnames of files in this file should be prefixed with "spell_rog_".
22 */
23
24#include "ScriptMgr.h"
25#include "Containers.h"
26#include "DBCStores.h"
27#include "Item.h"
28#include "Log.h"
29#include "ObjectAccessor.h"
30#include "Player.h"
31#include "SpellAuraEffects.h"
32#include "SpellHistory.h"
33#include "SpellMgr.h"
34#include "SpellScript.h"
35
63
64// 13877, 33735, (check 51211, 65956) - Blade Flurry
66{
68
69 bool Validate(SpellInfo const* /*spellInfo*/) override
70 {
72 }
73
74 bool CheckProc(ProcEventInfo& eventInfo)
75 {
76 _procTarget = eventInfo.GetActor()->SelectNearbyTarget(eventInfo.GetActionTarget());
77 return _procTarget != nullptr;
78 }
79
80 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
81 {
83 if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
84 {
85 CastSpellExtraArgs args(aurEff);
86 args.AddSpellBP0(damageInfo->GetDamage());
88 }
89 }
90
96
97 Unit* _procTarget = nullptr;
98};
99
100// -31228 - Cheat Death
102{
104
106
107 bool Validate(SpellInfo const* /*spellInfo*/) override
108 {
110 }
111
112 bool Load() override
113 {
115 return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
116 }
117
118 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
119 {
120 // Set absorbtion amount to unlimited
121 amount = -1;
122 }
123
124 void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
125 {
126 Player* target = GetTarget()->ToPlayer();
128 return;
129
130 target->CastSpell(target, SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, true);
131 target->GetSpellHistory()->AddCooldown(SPELL_ROGUE_CHEAT_DEATH_COOLDOWN, 0, std::chrono::minutes(1));
132
133 uint32 health10 = target->CountPctFromMaxHealth(10);
134
135 // hp > 10% - absorb hp till 10%
136 if (target->GetHealth() > health10)
137 absorbAmount = dmgInfo.GetDamage() - target->GetHealth() + health10;
138 // hp lower than 10% - absorb everything
139 else
140 absorbAmount = dmgInfo.GetDamage();
141 }
142
148};
149
150// 31231 - Cheat Death
170
171// -51664 - Cut to the Chase
173{
175
176 void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
177 {
179
180 // "refresh your Slice and Dice duration to its 5 combo point maximum"
181 Unit* caster = eventInfo.GetActor();
182 // lookup Slice and Dice
183 if (AuraEffect const* snd = caster->GetAuraEffect(SPELL_AURA_MOD_MELEE_HASTE, SPELLFAMILY_ROGUE, 0x00040000, 0x00000000, 0x00000000, caster->GetGUID()))
184 {
185 // Max 5 cp duration
186 uint32 countMax = snd->GetSpellInfo()->GetMaxDuration();
187
188 snd->GetBase()->SetDuration(countMax, true);
189 snd->GetBase()->SetMaxDuration(snd->GetBase()->GetDuration());
190 }
191 }
192
197};
198
199// -51625 - Deadly Brew
201{
203
204 bool Validate(SpellInfo const* /*spellInfo*/) override
205 {
207 }
208
209 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
210 {
212 eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget(), SPELL_ROGUE_CRIPPLING_POISON, aurEff);
213 }
214
219};
220
221// -2818 - Deadly Poison
223{
225
226 bool Load() override
227 {
228 // at this point CastItem must already be initialized
229 return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
230 }
231
233 {
234 if (missInfo != SPELL_MISS_NONE)
235 return;
236
237 if (Unit* target = GetHitUnit())
238 // Deadly Poison
239 if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID()))
240 _stackAmount = aurEff->GetBase()->GetStackAmount();
241 }
242
244 {
245 if (_stackAmount < 5)
246 return;
247
248 Player* player = GetCaster()->ToPlayer();
249
250 if (Unit* target = GetHitUnit())
251 {
252
254
255 if (item == GetCastItem())
257
258 if (!item)
259 return;
260
261 // item combat enchantments
262 for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot)
263 {
265 if (!enchant)
266 continue;
267
268 for (uint8 s = 0; s < 3; ++s)
269 {
271 continue;
272
273 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->EffectArg[s]);
274 if (!spellInfo)
275 {
276 TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant {}, player (Name: {}, {}) cast unknown spell {}", enchant->ID, player->GetName(), player->GetGUID().ToString(), enchant->EffectArg[s]);
277 continue;
278 }
279
280 // Proc only rogue poisons
281 if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE || spellInfo->Dispel != DISPEL_POISON)
282 continue;
283
284 // Do not reproc deadly
285 if (spellInfo->SpellFamilyFlags == flag96(0x10000, 0x80000, 0))
286 continue;
287
288 if (spellInfo->IsPositive())
289 player->CastSpell(player, enchant->EffectArg[s], item);
290 else
291 player->CastSpell(target, enchant->EffectArg[s], item);
292 }
293 }
294 }
295 }
296
302
304};
305
306// 51690 - Killing Spree
308{
309 public:
310 static char constexpr const ScriptName[] = "spell_rog_killing_spree";
311
313
337
338 SpellScript* GetSpellScript() const override
339 {
341 }
342
344 {
346
347 bool Validate(SpellInfo const* /*spellInfo*/) override
348 {
349 return ValidateSpellInfo(
350 {
354 });
355 }
356
357 void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
358 {
360 }
361
362 void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
363 {
364 while (!_targets.empty())
365 {
367 if (Unit* target = ObjectAccessor::GetUnit(*GetTarget(), guid))
368 {
371 break;
372 }
373 else
374 _targets.remove(guid);
375 }
376 }
377
382
389
390 public:
391 void AddTarget(Unit* target)
392 {
393 _targets.push_back(target->GetGUID());
394 }
395
396 private:
398 };
399
400 AuraScript* GetAuraScript() const override
401 {
403 }
404};
405char constexpr const spell_rog_killing_spree::ScriptName[];
406
407// -31130 - Nerves of Steel
409{
411
412public:
414 {
415 absorbPct = 0;
416 }
417
418private:
420
421 bool Load() override
422 {
424 return true;
425 }
426
427 void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
428 {
429 // Set absorbtion amount to unlimited
430 amount = -1;
431 }
432
433 void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
434 {
435 // reduces all damage taken while stun or fear
436 if (GetTarget()->HasUnitFlag(UNIT_FLAG_FLEEING) || (GetTarget()->HasUnitFlag(UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
437 absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct);
438 }
439
445};
446
447// 31666 - Master of Subtlety
448// 58428 - Overkill - aura remove spell (SERVERSIDE)
449template <uint32 RemoveSpellId>
451{
453
454 bool Validate(SpellInfo const* /*spellInfo*/) override
455 {
456 return ValidateSpellInfo({ RemoveSpellId });
457 }
458
459 void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
460 {
461 if (Aura* visualAura = GetTarget()->GetAura(RemoveSpellId))
462 {
463 int32 duration = aurEff->GetBase()->GetDuration();
464 visualAura->SetDuration(duration);
465 visualAura->SetMaxDuration(duration);
466 }
467 }
468
469 void PeriodicTick(AuraEffect const* /*aurEff*/)
470 {
471 GetTarget()->RemoveAurasDueToSpell(RemoveSpellId);
472 }
473
479};
480
481// 14185 - Preparation
483{
485
486 bool Load() override
487 {
488 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
489 }
490
491 bool Validate(SpellInfo const* /*spellInfo*/) override
492 {
494 }
495
496 void HandleDummy(SpellEffIndex /*effIndex*/)
497 {
498 Unit* caster = GetCaster();
499 caster->GetSpellHistory()->ResetCooldowns([caster](SpellHistory::CooldownStorageType::iterator itr) -> bool
500 {
501 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(itr->first);
502 if (spellInfo->SpellFamilyName != SPELLFAMILY_ROGUE)
503 return false;
504
505 return (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP || // Cold Blood, Shadowstep
506 spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT) || // Vanish, Evasion, Sprint
508 (spellInfo->SpellFamilyFlags[1] & SPELLFAMILYFLAG1_ROGUE_DISMANTLE || // Dismantle
509 spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_KICK || // Kick
510 (spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY && // Blade Flurry
512 }, true);
513 }
514
519};
520
521// -51685 - Prey on the Weak
523{
525
526 bool Validate(SpellInfo const* /*spellInfo*/) override
527 {
529 }
530
532 {
533 Unit* target = GetTarget();
534 Unit* victim = target->GetVictim();
535 if (victim && (target->GetHealthPct() > victim->GetHealthPct()))
536 {
538 {
540 args.AddSpellBP0(aurEff->GetSpellEffectInfo().CalcValue());
541 target->CastSpell(target, SPELL_ROGUE_PREY_ON_THE_WEAK, args);
542 }
543 }
544 else
546 }
547
552};
553
554// -31244 - Quick Recovery
556{
558
559 bool Validate(SpellInfo const* /*spellInfo*/) override
560 {
562 }
563
564 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
565 {
567 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
568 if (!spellInfo)
569 return;
570
571 Unit* caster = eventInfo.GetActor();
572 int32 amount = CalculatePct(spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask()), aurEff->GetAmount());
573 CastSpellExtraArgs args(aurEff);
574 args.AddSpellBP0(amount);
575 caster->CastSpell(nullptr, SPELL_ROGUE_QUICK_RECOVERY_ENERGY, args);
576 }
577
582};
583
584// -1943 - Rupture
586{
587 public:
588 static char constexpr const ScriptName[] = "spell_rog_rupture";
589
591
593 {
595
596 bool Load() override
597 {
598 Unit* caster = GetCaster();
599 BonusDuration = 0;
600 return caster && caster->GetTypeId() == TYPEID_PLAYER;
601 }
602
603 void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
604 {
605 if (Unit* caster = GetCaster())
606 {
607 canBeRecalculated = false;
608
609 float const attackpowerPerCombo[6] =
610 {
611 0.0f,
612 0.015f, // 1 point: ${($m1 + $b1*1 + 0.015 * $AP) * 4} damage over 8 secs
613 0.024f, // 2 points: ${($m1 + $b1*2 + 0.024 * $AP) * 5} damage over 10 secs
614 0.03f, // 3 points: ${($m1 + $b1*3 + 0.03 * $AP) * 6} damage over 12 secs
615 0.03428571f, // 4 points: ${($m1 + $b1*4 + 0.03428571 * $AP) * 7} damage over 14 secs
616 0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs
617 };
618
619 uint8 cp = caster->ToPlayer()->GetComboPoints();
620 if (cp > 5)
621 cp = 5;
622
623 amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * attackpowerPerCombo[cp]);
624 }
625 }
626
627 void ResetDuration(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
628 {
629 BonusDuration = 0;
630 }
631
637
638 public:
639 // For Glyph of Backstab use
641 };
642
643 AuraScript* GetAuraScript() const override
644 {
645 return new spell_rog_rupture_AuraScript();
646 }
647};
648char constexpr const spell_rog_rupture::ScriptName[];
649
650// 56800 - Glyph of Backstab (dummy)
671
672// 63975 - Glyph of Backstab (triggered - serverside)
674{
675 public:
676 spell_rog_glyph_of_backstab_triggered() : SpellScriptLoader("spell_rog_glyph_of_backstab_triggered") { }
677
679 {
681
683
685 {
686 PreventHitDefaultEffect(effIndex);
687
688 Unit* caster = GetCaster();
689 // search our Rupture aura on target
690 if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00100000, 0, 0, caster->GetGUID()))
691 {
692 RuptureAuraScript* ruptureAuraScript = aurEff->GetBase()->GetScript<RuptureAuraScript>(spell_rog_rupture::ScriptName);
693 if (!ruptureAuraScript)
694 return;
695
696 uint32& bonusDuration = ruptureAuraScript->BonusDuration;
697
698 // already includes duration mod from Glyph of Rupture
699 uint32 countMin = aurEff->GetBase()->GetMaxDuration();
700 uint32 countMax = countMin - bonusDuration;
701
702 // this glyph
703 countMax += 6000;
704
705 if (countMin < countMax)
706 {
707 bonusDuration += 2000;
708
709 aurEff->GetBase()->SetDuration(aurEff->GetBase()->GetDuration() + 2000);
710 aurEff->GetBase()->SetMaxDuration(countMin + 2000);
711 }
712
713 }
714 }
715
720 };
721
722 SpellScript* GetSpellScript() const override
723 {
725 }
726};
727
728// -13983 - Setup
730{
732
733 bool CheckProc(ProcEventInfo& eventInfo)
734 {
735 if (Player* target = GetTarget()->ToPlayer())
736 if (eventInfo.GetActor() == target->GetSelectedUnit())
737 return true;
738
739 return false;
740 }
741
746};
747
748// 5938 - Shiv
750{
752
753 bool Load() override
754 {
755 return GetCaster()->GetTypeId() == TYPEID_PLAYER;
756 }
757
758 bool Validate(SpellInfo const* /*spellInfo*/) override
759 {
761 }
762
763 void HandleDummy(SpellEffIndex /*effIndex*/)
764 {
765 Unit* caster = GetCaster();
766 if (Unit* unitTarget = GetHitUnit())
767 caster->CastSpell(unitTarget, SPELL_ROGUE_SHIV_TRIGGERED, true);
768 }
769
774};
775
776// 57934 - Tricks of the Trade
778{
780
781 bool Validate(SpellInfo const* /*spellInfo*/) override
782 {
783 return ValidateSpellInfo(
784 {
787 });
788 }
789
795
796 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
797 {
799
800 Unit* rogue = GetTarget();
802 if (target)
803 {
805 rogue->CastSpell(rogue, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC, aurEff);
806 }
808 }
809
815
817public:
818 void SetRedirectTarget(ObjectGuid const& guid) { _redirectTarget = guid; }
819};
820
821// 57934 - Tricks of the Trade
823{
825
827 {
828 if (Aura* aura = GetHitAura())
829 if (auto* script = aura->GetScript<spell_rog_tricks_of_the_trade_aura>("spell_rog_tricks_of_the_trade"))
830 {
831 if (Unit* explTarget = GetExplTargetUnit())
832 script->SetRedirectTarget(explTarget->GetGUID());
833 else
834 script->SetRedirectTarget(ObjectGuid::Empty);
835 }
836 }
837
842};
843
844// 59628 - Tricks of the Trade (Proc)
859
860// -51698, 51700, 51701 - Honor Among Thieves
862{
864
865 bool Validate(SpellInfo const* spellInfo) override
866 {
867 return ValidateSpellInfo(
868 {
870 spellInfo->GetEffect(EFFECT_0).TriggerSpell
871 });
872 }
873
874 bool CheckProc(ProcEventInfo& /*eventInfo*/)
875 {
876 Unit* caster = GetCaster();
877 if (!caster || caster->HasAura(SPELL_ROGUE_HONOR_AMONG_THIEVES_2))
878 return false;
879
880 return true;
881 }
882
883 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
884 {
886
887 Unit* caster = GetCaster();
888 if (!caster)
889 return;
890
891 Unit* target = GetTarget();
892 target->CastSpell(target, aurEff->GetSpellEffectInfo().TriggerSpell, { aurEff, caster->GetGUID() });
893 }
894
900};
901
902// 52916 - Honor Among Thieves (Proc)
904{
906
907 bool Validate(SpellInfo const* /*spellInfo*/) override
908 {
910 }
911
912 void FilterTargets(std::list<WorldObject*>& targets)
913 {
914 targets.clear();
915
916 Unit* target = GetOriginalCaster();
917 if (!target)
918 return;
919
920 targets.push_back(target);
921 }
922
927};
928
948
949// 51662 - Hunger For Blood
969
970// -51627 - Turn the Tables
972{
974
975 bool Validate(SpellInfo const* spellInfo) override
976 {
977 return ValidateSpellInfo({ spellInfo->GetEffect(EFFECT_0).TriggerSpell });
978 }
979
980 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
981 {
983
984 Unit* caster = GetCaster();
985 if (!caster)
986 return;
987
988 caster->CastSpell(nullptr, aurEff->GetSpellEffectInfo().TriggerSpell, aurEff);
989 }
990
995};
996
997// -11327 - Vanish
999{
1001
1002 bool Validate(SpellInfo const* /*spellInfo*/) override
1003 {
1005 }
1006
1007 void ApplyStealth(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
1008 {
1009 Unit* unitTarget = GetTarget();
1011
1012 // See if we already are stealthed. If so, we're done.
1013 if (unitTarget->HasAura(SPELL_ROGUE_STEALTH))
1014 return;
1015
1016 // Reset cooldown on stealth if needed
1019
1020 unitTarget->CastSpell(nullptr, SPELL_ROGUE_STEALTH, true);
1021 }
1022
1027};
1028
1030{
1044 new spell_rog_rupture();
1056}
@ ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL
Definition DBCEnums.h:356
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
EnchantmentSlot
@ MAX_ENCHANTMENT_SLOT
#define TC_LOG_ERROR(filterType__,...)
Definition Log.h:165
std::list< ObjectGuid > GuidList
Definition ObjectGuid.h:261
@ TYPEID_PLAYER
Definition ObjectGuid.h:39
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:567
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:568
#define INVENTORY_SLOT_BAG_0
Definition Player.h:547
bool roll_chance_i(int chance)
Definition Random.h:59
#define RegisterSpellAndAuraScriptPair(script_1, script_2)
Definition ScriptMgr.h:1130
#define RegisterSpellScript(spell_script)
Definition ScriptMgr.h:1128
#define RegisterSpellScriptWithArgs(spell_script, script_name,...)
Definition ScriptMgr.h:1127
SpellEffIndex
@ EFFECT_1
@ EFFECT_0
@ SPELL_EFFECT_DUMMY
@ SPELL_EFFECT_SCRIPT_EFFECT
@ TARGET_UNIT_CASTER_AREA_PARTY
@ TARGET_UNIT_DEST_AREA_ENEMY
@ BASE_ATTACK
@ MECHANIC_STUN
@ SPELLFAMILY_ROGUE
SpellMissInfo
@ SPELL_MISS_NONE
@ DISPEL_POISON
@ SPELL_FAILED_OUT_OF_RANGE
@ AURA_REMOVE_BY_DEFAULT
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_REAPPLY
@ AURA_EFFECT_HANDLE_REAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_MELEE_HASTE
@ SPELL_AURA_MOD_STALKED
@ SPELL_AURA_DUMMY
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_STEALTH
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ SPELLFAMILYFLAG_ROGUE_VAN_EVAS_SPRINT
Definition SpellMgr.h:60
@ SPELLFAMILYFLAG_ROGUE_KICK
Definition SpellMgr.h:62
@ SPELLFAMILYFLAG1_ROGUE_DISMANTLE
Definition SpellMgr.h:63
@ SPELLFAMILYFLAG1_ROGUE_COLDB_SHADOWSTEP
Definition SpellMgr.h:61
@ SPELLFAMILYFLAG_ROGUE_BLADE_FLURRY
Definition SpellMgr.h:64
@ SPELLFAMILYFLAG1_ROGUE_BLADE_FLURRY
Definition SpellMgr.h:65
#define sSpellMgr
Definition SpellMgr.h:738
#define BeforeSpellHitFn(F)
#define AuraEffectProcFn(F, I, N)
#define SpellEffectFn(F, I, N)
#define AuraEffectCalcAmountFn(F, I, N)
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define AuraEffectPeriodicFn(F, I, N)
#define AuraEffectAbsorbFn(F, I)
#define AuraEffectApplyFn(F, I, N, M)
#define AuraCheckProcFn(F)
#define SpellHitFn(F)
#define AuraEffectRemoveFn(F, I, N, M)
@ UNIT_FLAG_STUNNED
@ UNIT_FLAG_FLEEING
T CalculatePct(T base, U pct)
Definition Util.h:71
SpellEffectInfo const & GetSpellEffectInfo() const
Aura * GetBase() const
int32 GetAmount() const
void PreventDefaultAction()
AuraApplication const * GetTargetApplication() const
HookList< EffectApplyHandler > AfterEffectRemove
HookList< EffectPeriodicHandler > OnEffectPeriodic
HookList< EffectApplyHandler > AfterEffectApply
HookList< EffectCalcAmountHandler > DoEffectCalcAmount
Unit * GetCaster() const
SpellEffectInfo const & GetEffectInfo(SpellEffIndex effIndex) const
HookList< EffectAbsorbHandler > OnEffectAbsorb
Aura * GetAura() const
Unit * GetTarget() const
HookList< CheckProcHandler > DoCheckProc
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
HookList< EffectProcHandler > OnEffectProc
Unit * GetUnitOwner() const
int32 GetDuration() const
Definition SpellAuras.h:148
uint32 GetDamage() const
Definition Unit.h:464
Definition Item.h:62
uint32 GetEnchantmentId(EnchantmentSlot slot) const
Definition Item.h:148
static ObjectGuid const Empty
Definition ObjectGuid.h:140
std::string ToString() const
TypeID GetTypeId() const
Definition Object.h:93
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
static Player * ToPlayer(Object *o)
Definition Object.h:180
Item * GetItemByPos(uint16 pos) const
Definition Player.cpp:9552
Unit * GetActionTarget() const
Definition Unit.h:509
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:268
Unit * GetActor()
Definition Unit.h:508
DamageInfo * GetDamageInfo() const
Definition Unit.h:519
uint32 TriggerSpell
Definition SpellInfo.h:228
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
void ResetCooldown(uint32 spellId, bool update=false)
void AddCooldown(uint32 spellId, uint32 itemId, std::chrono::duration< Type, Period > cooldownDuration)
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
void ResetCooldowns(Predicate predicate, bool update=false)
flag96 SpellFamilyFlags
Definition SpellInfo.h:357
uint32 Dispel
Definition SpellInfo.h:291
SpellSchoolMask GetSchoolMask() const
int32 CalcPowerCost(WorldObject const *caster, SpellSchoolMask schoolMask, Spell *spell=nullptr) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
Definition SpellInfo.h:483
bool IsPositive() const
uint32 SpellFamilyName
Definition SpellInfo.h:356
Unit * GetCaster() const
HookList< HitHandler > AfterHit
HookList< EffectHandler > OnEffectHit
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Unit * GetHitUnit() const
HookList< EffectHandler > OnEffectHitTarget
Item * GetCastItem() const
Aura * GetHitAura(bool dynObjAura=false) const
HookList< BeforeHitHandler > BeforeHit
Unit * GetExplTargetUnit() const
void FinishCast(SpellCastResult result, uint32 *param1=nullptr, uint32 *param2=nullptr)
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
Unit * GetOriginalCaster() const
void UnregisterRedirectThreat(uint32 spellId)
Definition Unit.h:769
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3765
float GetHealthPct() const
Definition Unit.h:921
ThreatManager & GetThreatManager()
Definition Unit.h:1155
Unit * SelectNearbyTarget(Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
Definition Unit.cpp:10591
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4359
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
uint32 GetHealth() const
Definition Unit.h:913
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3784
Unit * GetVictim() const
Definition Unit.h:859
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:922
SpellHistory * GetSpellHistory()
Definition Unit.h:1484
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2832
std::string const & GetName() const
Definition Object.h:382
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
Definition Util.h:412
PrepareAuraScript(spell_rog_blade_flurry)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
bool Validate(SpellInfo const *) override
PrepareSpellScript(spell_rog_cheat_death_cooldown)
void HandleDummy(SpellEffIndex)
PrepareAuraScript(spell_rog_cheat_death)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
bool Validate(SpellInfo const *) override
bool Load() override
void Register() override
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
void HandleProc(AuraEffect const *, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_rog_cut_to_the_chase)
PrepareAuraScript(spell_rog_deadly_brew)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void Register() override
void Register() override
PrepareSpellScript(spell_rog_deadly_poison)
void HandleBeforeHit(SpellMissInfo missInfo)
SpellScript * GetSpellScript() const override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_rog_glyph_of_backstab)
bool Validate(SpellInfo const *) override
void HandleEffectApply(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_rog_honor_among_thieves_proc_aura)
bool Validate(SpellInfo const *) override
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_rog_honor_among_thieves_proc)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
bool CheckProc(ProcEventInfo &)
bool Validate(SpellInfo const *spellInfo) override
PrepareAuraScript(spell_rog_honor_among_thieves)
bool Validate(SpellInfo const *) override
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_rog_hunger_for_blood)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareAuraScript(spell_rog_killing_spree_AuraScript)
void HandleApply(AuraEffect const *, AuraEffectHandleModes)
void FilterTargets(std::list< WorldObject * > &targets)
PrepareSpellScript(spell_rog_killing_spree_SpellScript)
SpellScript * GetSpellScript() const override
static char constexpr const ScriptName[]
AuraScript * GetAuraScript() const override
void Absorb(AuraEffect *, DamageInfo &dmgInfo, uint32 &absorbAmount)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &)
PrepareAuraScript(spell_rog_nerves_of_steel)
void Register() override
void PeriodicTick(AuraEffect const *)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_rog_overkill_mos)
void AfterApply(AuraEffect const *aurEff, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void Register() override
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_rog_preparation)
bool Load() override
void HandleEffectPeriodic(AuraEffect const *aurEff)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_rog_prey_on_the_weak)
PrepareAuraScript(spell_rog_quick_recovery)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_rog_rupture_AuraScript)
void CalculateAmount(AuraEffect const *, int32 &amount, bool &canBeRecalculated)
void ResetDuration(AuraEffect const *, AuraEffectHandleModes)
AuraScript * GetAuraScript() const override
static char constexpr const ScriptName[]
PrepareAuraScript(spell_rog_setup)
void Register() override
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool Load() override
void Register() override
void HandleDummy(SpellEffIndex)
PrepareSpellScript(spell_rog_shiv)
PrepareAuraScript(spell_rog_tricks_of_the_trade_aura)
void SetRedirectTarget(ObjectGuid const &guid)
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
PrepareAuraScript(spell_rog_tricks_of_the_trade_proc)
void HandleRemove(AuraEffect const *, AuraEffectHandleModes)
PrepareSpellScript(spell_rog_tricks_of_the_trade)
PrepareAuraScript(spell_rog_turn_the_tables)
bool Validate(SpellInfo const *spellInfo) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &)
bool Validate(SpellInfo const *) override
void Register() override
PrepareAuraScript(spell_rog_vanish)
void ApplyStealth(AuraEffect const *, AuraEffectHandleModes)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition Containers.h:108
void AddSC_rogue_spell_scripts()
@ SPELL_ROGUE_PREY_ON_THE_WEAK
@ SPELL_ROGUE_HUNGER_FOR_BLOOD
@ SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC
@ SPELL_ROGUE_T10_2P_BONUS
@ SPELL_ROGUE_HONOR_AMONG_THIEVES
@ SPELL_ROGUE_QUICK_RECOVERY_ENERGY
@ SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST
@ SPELL_ROGUE_KILLING_SPREE_WEAPON_DMG
@ SPELL_ROGUE_CHEATING_DEATH
@ SPELL_ROGUE_MASTER_OF_SUBTLETY_BUFF
@ SPELL_ROGUE_CRIPPLING_POISON
@ SPELL_ROGUE_TRICKS_OF_THE_TRADE
@ SPELL_ROGUE_GLYPH_OF_PREPARATION
@ SPELL_ROGUE_CHEAT_DEATH_COOLDOWN
@ SPELL_ROGUE_KILLING_SPREE
@ SPELL_ROGUE_HONOR_AMONG_THIEVES_2
@ SPELL_ROGUE_OVERKILL_BUFF
@ SPELL_ROGUE_KILLING_SPREE_DMG_BUFF
@ SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER
@ SPELL_ROGUE_HONOR_AMONG_THIEVES_PROC
@ SPELL_ROGUE_SHIV_TRIGGERED
@ SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK
@ SPELL_ROGUE_KILLING_SPREE_TELEPORT
@ SPELL_ROGUE_STEALTH
CastSpellExtraArgs & AddSpellBP0(int32 val)
uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]
uint32 EffectArg[MAX_ITEM_ENCHANTMENT_EFFECTS]