Core/Spells: ported PROC_FLAG_ENTER_COMBAT implementation from master branch and handle the Worgen transformation via its proc aura
This commit is contained in:
1 parent
f27c4609fc
commit
3506dae653
7 files changed
+46
-16
No files matched your search
@@ -0,0 +1,15 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_gen_enable_worgen_altered_form';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(94293, 'spell_gen_enable_worgen_altered_form');
|
||||
|
||||
DELETE FROM `spell_dbc` WHERE `Id`= 97681;
|
||||
INSERT INTO `spell_dbc` (`Id`, `Attributes`, `CastingTimeIndex`, `DurationIndex`, `RangeIndex`, `SchoolMask`, `SpellName`) VALUES
|
||||
(97681, 0x000000C0, 1, 0, 1, 1, '(Serverside/Non-DB2) Altered Form');
|
||||
|
||||
DELETE FROM `spelleffect_dbc` WHERE `Id`= 160112;
|
||||
INSERT INTO `spelleffect_dbc` (`Id`, `Effect`, `EffectAura`, `EffectImplicitTargetA`, `EffectImplicitTargetB`, `EffectTriggerSpell`, `SpellID`, `EffectIndex`, `Comment`) VALUES
|
||||
(160112, 6, 42, 1, 0, 97709, 97681, 0, '(Serverside/Non-DB2) Altered Form');
|
||||
|
||||
DELETE FROM `spell_proc` WHERE `SpellId`= 97681;
|
||||
INSERT INTO `spell_proc` (`SpellId`, `ProcFlags`, `Chance`) VALUES
|
||||
(97681, 0x8000000, 100);
|
||||
@@ -25117,19 +25117,6 @@ void Player::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidDat
|
||||
|
||||
}
|
||||
|
||||
void Player::AtEngage(Unit* target)
|
||||
{
|
||||
Unit::AtEngage(target);
|
||||
|
||||
// Worgen do turn into their altered form when engaged
|
||||
if (getRace() != RACE_WORGEN || HasAuraType(SPELL_AURA_WORGEN_ALTERED_FORM))
|
||||
return;
|
||||
|
||||
// Only transform at engage when the player has access to the racial Two Forms ability (obtained while progressing through the Gilneas starting area)
|
||||
if (HasSpell(SPELL_TWO_FORMS_RACIAL))
|
||||
CastSpell(nullptr, SPELL_ALTERED_FORM_RACIAL, true);
|
||||
}
|
||||
|
||||
void Player::AtExitCombat()
|
||||
{
|
||||
Unit::AtExitCombat();
|
||||
|
||||
@@ -1860,8 +1860,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override;
|
||||
bool UpdatePosition(Position const& pos, bool teleport = false) override { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
|
||||
void ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData> const& liquidData) override;
|
||||
|
||||
void AtEngage(Unit* target) override;
|
||||
void AtExitCombat() override;
|
||||
|
||||
void SendMessageToSet(WorldPacket const* data, bool self) const override { SendMessageToSetInRange(data, GetVisibilityRange(), self); }
|
||||
|
||||
@@ -9211,6 +9211,7 @@ void Unit::AtEnterCombat()
|
||||
InterruptNonMeleeSpells(false);
|
||||
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::EnteringCombat);
|
||||
ProcSkillsAndAuras(nullptr, PROC_FLAG_ENTER_COMBAT, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
void Unit::AtExitCombat()
|
||||
|
||||
@@ -427,7 +427,7 @@ enum AuraType : uint32
|
||||
SPELL_AURA_MOD_CURRENCY_GAIN = 349,
|
||||
SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT = 350, // NYI
|
||||
SPELL_AURA_MOD_CURRENCY_CATEGORY_GAIN_PCT = 351,
|
||||
SPELL_AURA_352 = 352,
|
||||
SPELL_AURA_ENABLE_ALTERED_FORM = 352,
|
||||
SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI
|
||||
SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH = 354, // Restoration Shaman mastery - mod healing based on target's health (less = more healing)
|
||||
SPELL_AURA_355 = 355,
|
||||
|
||||
@@ -150,6 +150,10 @@ enum ProcFlags
|
||||
|
||||
PROC_FLAG_JUMP = 0x02000000, // 25 Jumped
|
||||
|
||||
PROC_FLAG_CLONE_SPELL = 0x04000000, // Proc Clone Spell
|
||||
|
||||
PROC_FLAG_ENTER_COMBAT = 0x08000000, // Enter Combat
|
||||
|
||||
// flag masks
|
||||
AUTO_ATTACK_PROC_FLAG_MASK = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
|
||||
| PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK,
|
||||
|
||||
@@ -3009,6 +3009,30 @@ class spell_gen_darkflight : public SpellScriptLoader
|
||||
return new spell_gen_darkflight_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum AlteredForm
|
||||
{
|
||||
SPELL_ALTERED_FORM_PROC_AURA = 97681 // Serverside spell
|
||||
};
|
||||
|
||||
class spell_gen_enable_worgen_altered_form : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_ALTERED_FORM_PROC_AURA });
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->CastSpell(nullptr, SPELL_ALTERED_FORM_PROC_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply.Register(&spell_gen_enable_worgen_altered_form::HandleApply, EFFECT_0, SPELL_AURA_ENABLE_ALTERED_FORM, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
enum SeaforiumSpells
|
||||
{
|
||||
SPELL_PLANT_CHARGES_CREDIT_ACHIEVEMENT = 60937
|
||||
@@ -5450,6 +5474,7 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_running_wild();
|
||||
new spell_gen_two_forms();
|
||||
new spell_gen_darkflight();
|
||||
RegisterSpellScript(spell_gen_enable_worgen_altered_form);
|
||||
/* */
|
||||
new spell_gen_seaforium_blast();
|
||||
new spell_gen_spectator_cheer_trigger();
|
||||
|
||||
Reference in new issue
Block a user