AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_gen_clone_weapon_aura Class Reference
Inheritance diagram for spell_gen_clone_weapon_aura:
AuraScript _SpellScript

Private Member Functions

 PrepareAuraScript (spell_gen_clone_weapon_aura)
 
bool Validate (SpellInfo const *) override
 
bool Load () override
 
void OnApply (AuraEffect const *, AuraEffectHandleModes)
 
void OnRemove (AuraEffect const *, AuraEffectHandleModes)
 
void Register () override
 

Private Attributes

uint32 prevItem
 

Additional Inherited Members

- Public Member Functions inherited from AuraScript
 AuraScript ()
 
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Aura *aura)
 
void _PrepareScriptCall (AuraScriptHookType hookType, AuraApplication const *aurApp=nullptr)
 
void _FinishScriptCall ()
 
bool _IsDefaultActionPrevented ()
 
void PreventDefaultAction ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCasterGUID () const
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
void Remove (uint32 removeMode=0)
 
AuraGetAura () const
 
AuraObjectType GetType () const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration ()
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int8 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool HasEffect (uint8 effIndex) const
 
AuraEffectGetEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
UnitGetTarget () const
 
AuraApplication const * GetTargetApplication () const
 
- Public Member Functions inherited from _SpellScript
 _SpellScript ()
 
virtual ~_SpellScript ()
 
virtual void _Register ()
 
virtual void _Unload ()
 
virtual void _Init (std::string const *scriptname, uint32 spellId)
 
std::string const * _GetScriptName () const
 
virtual void Unload ()
 
- Static Public Member Functions inherited from _SpellScript
static bool ValidateSpellInfo (std::initializer_list< uint32 > spellIds)
 
template<class T >
static bool ValidateSpellInfo (T const &spellIds)
 
- Public Attributes inherited from AuraScript
HookList< CheckAreaTargetHandlerDoCheckAreaTarget
 
HookList< AuraDispelHandlerOnDispel
 
HookList< AuraDispelHandlerAfterDispel
 
HookList< EffectApplyHandlerOnEffectApply
 
HookList< EffectApplyHandlerAfterEffectApply
 
HookList< EffectApplyHandlerOnEffectRemove
 
HookList< EffectApplyHandlerAfterEffectRemove
 
HookList< EffectPeriodicHandlerOnEffectPeriodic
 
HookList< EffectUpdatePeriodicHandlerOnEffectUpdatePeriodic
 
HookList< EffectCalcAmountHandlerDoEffectCalcAmount
 
HookList< EffectCalcPeriodicHandlerDoEffectCalcPeriodic
 
HookList< EffectCalcSpellModHandlerDoEffectCalcSpellMod
 
HookList< EffectAbsorbHandlerOnEffectAbsorb
 
HookList< EffectAbsorbHandlerAfterEffectAbsorb
 
HookList< EffectManaShieldHandlerOnEffectManaShield
 
HookList< EffectManaShieldHandlerAfterEffectManaShield
 
HookList< EffectSplitHandlerOnEffectSplit
 
HookList< CheckProcHandlerDoCheckProc
 
HookList< AfterCheckProcHandlerDoAfterCheckProc
 
HookList< AuraProcHandlerDoPrepareProc
 
HookList< AuraProcHandlerOnProc
 
HookList< AuraProcHandlerAfterProc
 
HookList< EffectProcHandlerOnEffectProc
 
HookList< EffectProcHandlerAfterEffectProc
 
- Protected Attributes inherited from _SpellScript
uint8 m_currentScriptState
 
std::string const * m_scriptName
 
uint32 m_scriptSpellId
 

Detailed Description

Member Function Documentation

◆ Load()

bool spell_gen_clone_weapon_aura::Load ( )
inlineoverrideprivatevirtual

Reimplemented from _SpellScript.

2224 {
2225 prevItem = 0;
2226 return true;
2227 }
uint32 prevItem
Definition spell_generic.cpp:2315

References prevItem.

◆ OnApply()

void spell_gen_clone_weapon_aura::OnApply ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
2230 {
2231 Unit* caster = GetCaster();
2232 Unit* target = GetTarget();
2233 if (!caster)
2234 return;
2235
2236 switch (GetSpellInfo()->Id)
2237 {
2241 {
2243
2244 if (Player* player = caster->ToPlayer())
2245 {
2246 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
2247 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
2248 }
2249 else
2251 break;
2252 }
2255 {
2257
2258 if (Player* player = caster->ToPlayer())
2259 {
2260 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
2261 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
2262 }
2263 else
2265 break;
2266 }
2268 {
2270
2271 if (Player* player = caster->ToPlayer())
2272 {
2273 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
2274 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
2275 }
2276 else
2278 break;
2279 }
2280 default:
2281 break;
2282 }
2283 }
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:685
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:686
@ EQUIPMENT_SLOT_RANGED
Definition Player.h:687
#define INVENTORY_SLOT_BAG_0
Definition Player.h:665
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition UpdateFields.h:116
SpellInfo const * GetSpellInfo() const
Definition SpellScript.cpp:1005
Unit * GetCaster() const
Definition SpellScript.cpp:1020
Unit * GetTarget() const
Definition SpellScript.cpp:1165
Definition Item.h:220
uint32 GetUInt32Value(uint16 index) const
Definition Object.cpp:294
Player * ToPlayer()
Definition Object.h:201
Definition Player.h:1071
Definition Unit.h:655
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21414
@ SPELL_COPY_OFFHAND_2_AURA
Definition spell_generic.cpp:2172
@ SPELL_COPY_WEAPON_3_AURA
Definition spell_generic.cpp:2169
@ SPELL_COPY_OFFHAND_AURA
Definition spell_generic.cpp:2171
@ SPELL_COPY_WEAPON_AURA
Definition spell_generic.cpp:2167
@ SPELL_COPY_WEAPON_2_AURA
Definition spell_generic.cpp:2168
@ SPELL_COPY_RANGED_AURA
Definition spell_generic.cpp:2174

References EQUIPMENT_SLOT_MAINHAND, EQUIPMENT_SLOT_OFFHAND, EQUIPMENT_SLOT_RANGED, AuraScript::GetCaster(), AuraScript::GetSpellInfo(), AuraScript::GetTarget(), Object::GetUInt32Value(), INVENTORY_SLOT_BAG_0, prevItem, Unit::SetUInt32Value(), SPELL_COPY_OFFHAND_2_AURA, SPELL_COPY_OFFHAND_AURA, SPELL_COPY_RANGED_AURA, SPELL_COPY_WEAPON_2_AURA, SPELL_COPY_WEAPON_3_AURA, SPELL_COPY_WEAPON_AURA, Object::ToPlayer(), and UNIT_VIRTUAL_ITEM_SLOT_ID.

Referenced by Register().

◆ OnRemove()

void spell_gen_clone_weapon_aura::OnRemove ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate

◆ PrepareAuraScript()

spell_gen_clone_weapon_aura::PrepareAuraScript ( spell_gen_clone_weapon_aura  )
private

◆ Register()

void spell_gen_clone_weapon_aura::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

2309 {
2312 }
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
Definition SpellAuraDefines.h:51
#define AuraEffectApplyFn(F, I, N, M)
Definition SpellScript.h:743
#define AuraEffectRemoveFn(F, I, N, M)
Definition SpellScript.h:754
HookList< EffectApplyHandler > OnEffectRemove
Definition SpellScript.h:749
HookList< EffectApplyHandler > OnEffectApply
Definition SpellScript.h:738
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition spell_generic.cpp:2229
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition spell_generic.cpp:2285

References AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK, AuraEffectApplyFn, AuraEffectRemoveFn, EFFECT_0, OnApply(), AuraScript::OnEffectApply, AuraScript::OnEffectRemove, OnRemove(), and SPELL_AURA_PERIODIC_DUMMY.

◆ Validate()

bool spell_gen_clone_weapon_aura::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual

Member Data Documentation

◆ prevItem

uint32 spell_gen_clone_weapon_aura::prevItem
private

Referenced by Load(), OnApply(), and OnRemove().


The documentation for this class was generated from the following file: