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.

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

References prevItem.

◆ OnApply()

void spell_gen_clone_weapon_aura::OnApply ( AuraEffect const *  ,
AuraEffectHandleModes   
)
inlineprivate
2232 {
2233 Unit* caster = GetCaster();
2234 Unit* target = GetTarget();
2235 if (!caster)
2236 return;
2237
2238 switch (GetSpellInfo()->Id)
2239 {
2243 {
2245
2246 if (Player* player = caster->ToPlayer())
2247 {
2248 if (Item* mainItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND))
2249 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, mainItem->GetEntry());
2250 }
2251 else
2253 break;
2254 }
2257 {
2259
2260 if (Player* player = caster->ToPlayer())
2261 {
2262 if (Item* offItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
2263 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, offItem->GetEntry());
2264 }
2265 else
2267 break;
2268 }
2270 {
2272
2273 if (Player* player = caster->ToPlayer())
2274 {
2275 if (Item* rangedItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED))
2276 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, rangedItem->GetEntry());
2277 }
2278 else
2280 break;
2281 }
2282 default:
2283 break;
2284 }
2285 }
@ SPELL_COPY_OFFHAND_2_AURA
Definition: spell_generic.cpp:2174
@ SPELL_COPY_WEAPON_3_AURA
Definition: spell_generic.cpp:2171
@ SPELL_COPY_OFFHAND_AURA
Definition: spell_generic.cpp:2173
@ SPELL_COPY_WEAPON_AURA
Definition: spell_generic.cpp:2169
@ SPELL_COPY_WEAPON_2_AURA
Definition: spell_generic.cpp:2170
@ SPELL_COPY_RANGED_AURA
Definition: spell_generic.cpp:2176
@ EQUIPMENT_SLOT_MAINHAND
Definition: Player.h:695
@ EQUIPMENT_SLOT_OFFHAND
Definition: Player.h:696
@ EQUIPMENT_SLOT_RANGED
Definition: Player.h:697
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:675
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition: UpdateFields.h:116
Definition: Item.h:220
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:305
Player * ToPlayer()
Definition: Object.h:201
Definition: Player.h:1081
Definition: Unit.h:630
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21316
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, 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.

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

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