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 Register ()=0
 
virtual bool Validate (SpellInfo const *)
 
virtual bool Load ()
 
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
 
virtual bool _Validate (SpellInfo const *entry)
 
- 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.

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

References prevItem.

◆ OnApply()

void spell_gen_clone_weapon_aura::OnApply ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
2231 {
2232 Unit* caster = GetCaster();
2233 Unit* target = GetTarget();
2234 if (!caster)
2235 return;
2236
2237 switch (GetSpellInfo()->Id)
2238 {
2242 {
2244
2245 if (Player* player = caster->ToPlayer())
2246 {
2247 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
2248 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
2249 }
2250 else
2252 break;
2253 }
2256 {
2258
2259 if (Player* player = caster->ToPlayer())
2260 {
2261 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
2262 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
2263 }
2264 else
2266 break;
2267 }
2269 {
2271
2272 if (Player* player = caster->ToPlayer())
2273 {
2274 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
2275 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
2276 }
2277 else
2279 break;
2280 }
2281 default:
2282 break;
2283 }
2284 }
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
@ EQUIPMENT_SLOT_MAINHAND
Definition: Player.h:691
@ EQUIPMENT_SLOT_OFFHAND
Definition: Player.h:692
@ EQUIPMENT_SLOT_RANGED
Definition: Player.h:693
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:671
@ SPELL_COPY_OFFHAND_2_AURA
Definition: spell_generic.cpp:2173
@ SPELL_COPY_WEAPON_3_AURA
Definition: spell_generic.cpp:2170
@ SPELL_COPY_OFFHAND_AURA
Definition: spell_generic.cpp:2172
@ SPELL_COPY_WEAPON_AURA
Definition: spell_generic.cpp:2168
@ SPELL_COPY_WEAPON_2_AURA
Definition: spell_generic.cpp:2169
@ SPELL_COPY_RANGED_AURA
Definition: spell_generic.cpp:2175
Definition: Item.h:214
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
Player * ToPlayer()
Definition: Object.h:195
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
Definition: Player.h:1056
Definition: Unit.h:1302
SpellInfo const * GetSpellInfo() const
Definition: SpellScript.cpp:1005
Unit * GetCaster() const
Definition: SpellScript.cpp:1020
Unit * GetTarget() const
Definition: SpellScript.cpp:1165

References EQUIPMENT_SLOT_MAINHAND, EQUIPMENT_SLOT_OFFHAND, EQUIPMENT_SLOT_RANGED, AuraScript::GetCaster(), AuraScript::GetSpellInfo(), AuraScript::GetTarget(), Object::GetUInt32Value(), INVENTORY_SLOT_BAG_0, prevItem, Object::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.

2310 {
2313 }
@ 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
@ EFFECT_0
Definition: SharedDefines.h:31
HookList< EffectApplyHandler > OnEffectRemove
Definition: SpellScript.h:749
HookList< EffectApplyHandler > OnEffectApply
Definition: SpellScript.h:738
void OnApply(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_generic.cpp:2230
void OnRemove(AuraEffect const *, AuraEffectHandleModes)
Definition: spell_generic.cpp:2286

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().