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

Private Member Functions

 PrepareSpellScript (spell_putricide_mutated_transformation)
 
bool Validate (SpellInfo const *) override
 
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::HandleSummon ( SpellEffIndex  effIndex)
inlineprivate
1375 {
1376 PreventHitDefaultEffect(effIndex);
1377 Unit* caster = GetOriginalCaster();
1378 if (!caster)
1379 return;
1380
1381 InstanceScript* instance = caster->GetInstanceScript();
1382 if (!instance)
1383 return;
1384
1386 if (!putricide)
1387 return;
1388
1389 if (putricide->AI()->GetData(DATA_ABOMINATION))
1390 {
1391 if (Player* player = caster->ToPlayer())
1393 return;
1394 }
1395
1396 if (!putricide->IsInCombat())
1397 putricide->SetInCombatWithZone();
1398
1399 uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue);
1400 SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB));
1401 uint32 duration = uint32(GetSpellInfo()->GetDuration());
1402
1403 Position pos = caster->GetPosition();
1404 TempSummon* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id);
1405 if (!summon || !summon->IsVehicle())
1406 return;
1407
1408 summon->CastSpell(summon, SPELL_ABOMINATION_VEHICLE_POWER_DRAIN, true);
1409 summon->CastSpell(summon, SPELL_MUTATED_TRANSFORMATION_DAMAGE, true);
1410 caster->CastSpell(summon, SPELL_MUTATED_TRANSFORMATION_NAME, true);
1411
1412 //EnterVehicle(summon, 0); // VEHICLE_SPELL_RIDE_HARDCODED is used according to sniff, this is ok
1414 summon->SetCreatorGUID(caster->GetGUID());
1415 putricide->AI()->JustSummoned(summon);
1416
1417 summon->setPowerType(POWER_ENERGY);
1418 summon->SetMaxPower(POWER_ENERGY, 100);
1419 summon->SetPower(POWER_ENERGY, 0);
1422 }
std::uint32_t uint32
Definition: Define.h:107
@ DATA_PROFESSOR_PUTRICIDE
Definition: icecrown_citadel.h:92
@ SPELL_MUTATED_TRANSFORMATION_DAMAGE
Definition: boss_professor_putricide.cpp:108
@ SPELL_ABOMINATION_VEHICLE_POWER_DRAIN
Definition: boss_professor_putricide.cpp:106
@ SPELL_MUTATED_TRANSFORMATION_NAME
Definition: boss_professor_putricide.cpp:109
@ DATA_ABOMINATION
Definition: boss_professor_putricide.cpp:120
@ POWER_ENERGY
Definition: SharedDefines.h:272
@ SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS
Definition: SharedDefines.h:1230
@ SPELL_FAILED_CUSTOM_ERROR
Definition: SharedDefines.h:1121
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:113
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:150
@ VEHICLE_SPELL_RIDE_HARDCODED
Definition: VehicleDefines.h:52
@ UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER
Definition: UpdateFields.h:113
@ UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER
Definition: UpdateFields.h:112
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
virtual void JustSummoned(Creature *)
Definition: CreatureAI.h:134
Definition: Creature.h:43
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
CreatureAI * AI() const
Definition: Creature.h:140
Definition: TemporarySummon.h:40
Player * ToPlayer()
Definition: Object.h:201
void SetStatFloatValue(uint16 index, float value)
Definition: Object.cpp:790
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Map * GetMap() const
Definition: Object.h:536
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
Definition: Position.h:27
void GetPosition(float &x, float &y) const
Definition: Position.h:121
Definition: Player.h:1081
Definition: Unit.h:630
bool IsVehicle() const
Definition: Unit.h:757
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15566
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:1224
void SetMaxPower(Powers power, uint32 val)
Definition: Unit.cpp:15631
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:1167
void SetCreatorGUID(ObjectGuid creator)
Definition: Unit.h:681
void setPowerType(Powers power)
Definition: Unit.cpp:9979
bool IsInCombat() const
Definition: Unit.h:884
Definition: InstanceScript.h:142
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2174
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE)
Definition: Spell.cpp:4674
SpellInfo const * GetSpellInfo()
Definition: SpellScript.cpp:411
void PreventHitDefaultEffect(SpellEffIndex effIndex)
Definition: SpellScript.cpp:590
Unit * GetOriginalCaster()
Definition: SpellScript.cpp:406
Definition: DBCStructure.h:1908

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::PrepareSpellScript ( spell_putricide_mutated_transformation  )
private

◆ Register()

void spell_putricide_mutated_transformation::Register ( )
inlineoverrideprivatevirtual

Implements _SpellScript.

1425 {
1427 }
@ EFFECT_0
Definition: SharedDefines.h:31
@ SPELL_EFFECT_SUMMON
Definition: SharedDefines.h:806
#define SpellEffectFn(F, I, N)
Definition: SpellScript.h:337
HookList< EffectHandler > OnEffectHit
Definition: SpellScript.h:335
void HandleSummon(SpellEffIndex effIndex)
Definition: boss_professor_putricide.cpp:1374

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

◆ Validate()

bool spell_putricide_mutated_transformation::Validate ( SpellInfo const *  )
inlineoverrideprivatevirtual