AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript Class Reference
Inheritance diagram for spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript:
SpellScript _SpellScript

Private Member Functions

 PrepareSpellScript (spell_putricide_mutated_transformation_SpellScript)
 
void HandleSummon (SpellEffIndex effIndex)
 
void Register () override
 

Additional Inherited Members

- Public Member Functions inherited from SpellScript
bool _Validate (SpellInfo const *entry) override
 
bool _Load (Spell *spell)
 
void _InitHit ()
 
bool _IsEffectPrevented (SpellEffIndex effIndex)
 
bool _IsDefaultEffectPrevented (SpellEffIndex effIndex)
 
void _PrepareScriptCall (SpellScriptHookType hookType)
 
void _FinishScriptCall ()
 
bool IsInCheckCastHook () const
 
bool IsInTargetHook () const
 
bool IsInHitPhase () const
 
bool IsInEffectHook () const
 
UnitGetCaster ()
 
UnitGetOriginalCaster ()
 
SpellInfo const * GetSpellInfo ()
 
SpellValue const * GetSpellValue ()
 
WorldLocation const * GetExplTargetDest ()
 
void SetExplTargetDest (WorldLocation &loc)
 
WorldObjectGetExplTargetWorldObject ()
 
UnitGetExplTargetUnit ()
 
GameObjectGetExplTargetGObj ()
 
ItemGetExplTargetItem ()
 
UnitGetHitUnit ()
 
CreatureGetHitCreature ()
 
PlayerGetHitPlayer ()
 
ItemGetHitItem ()
 
GameObjectGetHitGObj ()
 
WorldLocationGetHitDest ()
 
int32 GetHitDamage ()
 
void SetHitDamage (int32 damage)
 
void PreventHitDamage ()
 
int32 GetHitHeal ()
 
void SetHitHeal (int32 heal)
 
void PreventHitHeal ()
 
SpellGetSpell ()
 
AuraGetHitAura ()
 
void PreventHitAura ()
 
void PreventHitEffect (SpellEffIndex effIndex)
 
void PreventHitDefaultEffect (SpellEffIndex effIndex)
 
int32 GetEffectValue () const
 
void SetEffectValue (int32 value)
 
ItemGetCastItem ()
 
void CreateItem (uint32 effIndex, uint32 itemId)
 
SpellInfo const * GetTriggeringSpell ()
 
void FinishCast (SpellCastResult result)
 
void Cancel ()
 
void SetCustomCastResultMessage (SpellCustomErrors result)
 
- 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 SpellScript
HookList< CastHandlerBeforeCast
 
HookList< CastHandlerOnCast
 
HookList< CastHandlerAfterCast
 
HookList< CheckCastHandlerOnCheckCast
 
HookList< EffectHandlerOnEffectLaunch
 
HookList< EffectHandlerOnEffectLaunchTarget
 
HookList< EffectHandlerOnEffectHit
 
HookList< EffectHandlerOnEffectHitTarget
 
HookList< BeforeHitHandlerBeforeHit
 
HookList< HitHandlerOnHit
 
HookList< HitHandlerAfterHit
 
HookList< ObjectAreaTargetSelectHandlerOnObjectAreaTargetSelect
 
HookList< ObjectTargetSelectHandlerOnObjectTargetSelect
 
HookList< DestinationTargetSelectHandlerOnDestinationTargetSelect
 
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

◆ HandleSummon()

void spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript::HandleSummon ( SpellEffIndex  effIndex)
inlineprivate
1515 {
1516 PreventHitDefaultEffect(effIndex);
1517 Unit* caster = GetOriginalCaster();
1518 if (!caster)
1519 return;
1520
1521 InstanceScript* instance = caster->GetInstanceScript();
1522 if (!instance)
1523 return;
1524
1526 if (!putricide)
1527 return;
1528
1529 if (putricide->AI()->GetData(DATA_ABOMINATION))
1530 {
1531 if (Player* player = caster->ToPlayer())
1533 return;
1534 }
1535
1536 if (!putricide->IsInCombat())
1537 putricide->SetInCombatWithZone();
1538
1539 uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue);
1540 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
1541 uint32 duration = uint32(GetSpellInfo()->GetDuration());
1542
1543 Position pos = caster->GetPosition();
1544 TempSummon* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id);
1545 if (!summon || !summon->IsVehicle())
1546 return;
1547
1548 summon->CastSpell(summon, SPELL_ABOMINATION_VEHICLE_POWER_DRAIN, true);
1549 summon->CastSpell(summon, SPELL_MUTATED_TRANSFORMATION_DAMAGE, true);
1550 caster->CastSpell(summon, SPELL_MUTATED_TRANSFORMATION_NAME, true);
1551
1552 //EnterVehicle(summon, 0); // VEHICLE_SPELL_RIDE_HARDCODED is used according to sniff, this is ok
1554 summon->SetCreatorGUID(caster->GetGUID());
1555 putricide->AI()->JustSummoned(summon);
1556
1557 summon->setPowerType(POWER_ENERGY);
1558 summon->SetMaxPower(POWER_ENERGY, 100);
1559 summon->SetPower(POWER_ENERGY, 0);
1562 }
std::uint32_t uint32
Definition: Define.h:108
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
@ UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
Definition: UpdateFields.h:113
@ UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
Definition: UpdateFields.h:112
@ VEHICLE_SPELL_RIDE_HARDCODED
Definition: VehicleDefines.h:53
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:114
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:148
@ SPELL_MUTATED_TRANSFORMATION_DAMAGE
Definition: boss_professor_putricide.cpp:107
@ SPELL_ABOMINATION_VEHICLE_POWER_DRAIN
Definition: boss_professor_putricide.cpp:105
@ SPELL_MUTATED_TRANSFORMATION_NAME
Definition: boss_professor_putricide.cpp:108
@ DATA_ABOMINATION
Definition: boss_professor_putricide.cpp:119
@ DATA_PROFESSOR_PUTRICIDE
Definition: icecrown_citadel.h:97
@ POWER_ENERGY
Definition: SharedDefines.h:244
@ SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS
Definition: SharedDefines.h:1202
@ SPELL_FAILED_CUSTOM_ERROR
Definition: SharedDefines.h:1093
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:202
virtual void JustSummoned(Creature *)
Definition: CreatureAI.h:128
Definition: Creature.h:46
void SetInCombatWithZone()
Definition: Creature.cpp:2705
CreatureAI * AI() const
Definition: Creature.h:134
Definition: TemporarySummon.h:40
Player * ToPlayer()
Definition: Object.h:195
void SetStatFloatValue(uint16 index, float value)
Definition: Object.cpp:790
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
Map * GetMap() const
Definition: Object.h:517
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
Definition: Position.h:28
void GetPosition(float &x, float &y) const
Definition: Position.h:122
Definition: Player.h:1046
Definition: Unit.h:1290
bool IsVehicle() const
Definition: Unit.h:1416
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1225
void SetMaxPower(Powers power, uint32 val)
Definition: Unit.cpp:15468
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
void SetCreatorGUID(ObjectGuid creator)
Definition: Unit.h:1815
void setPowerType(Powers power)
Definition: Unit.cpp:9940
bool IsInCombat() const
Definition: Unit.h:1686
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:15423
Definition: InstanceScript.h:140
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0)
Definition: Object.cpp:2118
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4619
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetOriginalCaster()
Definition: SpellScript.cpp:406
Definition: DBCStructure.h:1871

References Creature::AI(), Unit::CastCustomSpell(), Unit::CastSpell(), DATA_ABOMINATION, DATA_PROFESSOR_PUTRICIDE, ObjectAccessor::GetCreature(), UnitAI::GetData(), Object::GetGUID(), InstanceScript::GetGuidData(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), SpellScript::GetOriginalCaster(), Position::GetPosition(), SpellScript::GetSpellInfo(), Unit::IsInCombat(), Unit::IsVehicle(), CreatureAI::JustSummoned(), POWER_ENERGY, SpellScript::PreventHitDefaultEffect(), Spell::SendCastResult(), Unit::SetCreatorGUID(), Creature::SetInCombatWithZone(), Unit::SetMaxPower(), Unit::SetPower(), Unit::setPowerType(), Object::SetStatFloatValue(), SPELL_ABOMINATION_VEHICLE_POWER_DRAIN, SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS, SPELL_FAILED_CUSTOM_ERROR, SPELL_MUTATED_TRANSFORMATION_DAMAGE, SPELL_MUTATED_TRANSFORMATION_NAME, SPELLVALUE_BASE_POINT0, sSummonPropertiesStore, Map::SummonCreature(), Object::ToPlayer(), TRIGGERED_FULL_MASK, UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, and VEHICLE_SPELL_RIDE_HARDCODED.

Referenced by Register().

◆ PrepareSpellScript()

spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript::PrepareSpellScript ( spell_putricide_mutated_transformation_SpellScript  )
private

◆ Register()

void spell_putricide_mutated_transformation::spell_putricide_mutated_transformation_SpellScript::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1565 {
1567 }
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
@ EFFECT_0
Definition: SharedDefines.h:30
@ SPELL_EFFECT_SUMMON
Definition: SharedDefines.h:778
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void HandleSummon(SpellEffIndex effIndex)
Definition: boss_professor_putricide.cpp:1514

References EFFECT_0, HandleSummon(), SpellScript::OnEffectHit, SPELL_EFFECT_SUMMON, and SpellEffectFn.