Merge branch 'master' into 4.3.4

Conflicts:
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/SpellEffects.cpp
	src/server/scripts/Kalimdor/zone_darkshore.cpp
	src/server/scripts/Kalimdor/zone_feralas.cpp
	src/server/scripts/Spells/spell_dk.cpp
	src/server/scripts/Spells/spell_generic.cpp
This commit is contained in:
DDuarte
2014-07-24 17:10:21 +01:00
24 changed files with 350 additions and 236 deletions

View File

@@ -40,6 +40,7 @@ enum DeathKnightSpells
SPELL_DK_BLOOD_SHIELD_ABSORB = 77535,
SPELL_DK_BUTCHERY = 50163,
SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999,
SPELL_DK_DEATH_AND_DECAY_DAMAGE = 52212,
SPELL_DK_DEATH_COIL_DAMAGE = 47632,
SPELL_DK_DEATH_COIL_HEAL = 47633,
SPELL_DK_DEATH_STRIKE_HEAL = 45470,
@@ -349,7 +350,33 @@ class spell_dk_butchery : public SpellScriptLoader
}
};
// 47541, 52375, 59134, -62900 - Death Coil
class spell_dk_death_and_decay : public SpellScriptLoader
{
public:
spell_dk_death_and_decay() : SpellScriptLoader("spell_dk_death_and_decay") { }
class spell_dk_death_and_decay_AuraScript : public AuraScript
{
PrepareAuraScript(spell_dk_death_and_decay_AuraScript);
void HandleDummyTick(AuraEffect const* aurEff)
{
if (Unit* caster = GetCaster())
caster->CastCustomSpell(SPELL_DK_DEATH_AND_DECAY_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dk_death_and_decay_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_dk_death_and_decay_AuraScript();
}
};
class spell_dk_death_coil : public SpellScriptLoader
{
public:
@@ -1490,6 +1517,7 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_blood_boil();
new spell_dk_blood_gorged();
new spell_dk_butchery();
new spell_dk_death_and_decay();
new spell_dk_death_coil();
new spell_dk_death_gate();
new spell_dk_death_grip();

View File

@@ -1657,40 +1657,6 @@ class spell_gen_gnomish_transporter : public SpellScriptLoader
}
};
class spell_gen_gunship_portal : public SpellScriptLoader
{
public:
spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { }
class spell_gen_gunship_portal_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_gunship_portal_SpellScript);
bool Load() override
{
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
if (Battleground* bg = caster->GetBattleground())
if (bg->GetTypeID(true) == BATTLEGROUND_IC)
bg->DoAction(1, caster->GetGUID());
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_gunship_portal_SpellScript();
}
};
enum Interrupt
{
@@ -1733,58 +1699,6 @@ class spell_gen_interrupt : public SpellScriptLoader
}
};
enum Launch
{
SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251
};
class spell_gen_launch : public SpellScriptLoader
{
public:
spell_gen_launch() : SpellScriptLoader("spell_gen_launch") { }
class spell_gen_launch_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_launch_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Player* player = GetHitPlayer())
player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
}
void Launch()
{
WorldLocation const* const position = GetExplTargetDest();
if (Player* player = GetHitPlayer())
{
player->ExitVehicle();
// A better research is needed
// There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds
float speedZ = 10.0f;
float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
float speedXY = dist;
player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
AfterHit += SpellHitFn(spell_gen_launch_SpellScript::Launch);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_launch_SpellScript();
}
};
class spell_gen_increase_stats_buff : public SpellScriptLoader
{
public:
@@ -2616,39 +2530,6 @@ class spell_gen_parachute : public SpellScriptLoader
}
};
enum ParachuteIC
{
SPELL_PARACHUTE_IC = 66657
};
class spell_gen_parachute_ic : public SpellScriptLoader
{
public:
spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { }
class spell_gen_parachute_ic_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_parachute_ic_AuraScript);
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
{
if (Player* target = GetTarget()->ToPlayer())
if (target->m_movementInfo.jump.fallTime > 2000)
target->CastSpell(target, SPELL_PARACHUTE_IC, true);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_parachute_ic_AuraScript();
}
};
enum PetSummoned
{
NPC_DOOMGUARD = 11859,
@@ -3753,7 +3634,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_gadgetzan_transporter_backfire();
new spell_gen_gift_of_naaru();
new spell_gen_gnomish_transporter();
new spell_gen_gunship_portal();
new spell_gen_increase_stats_buff("spell_pal_blessing_of_kings");
new spell_gen_increase_stats_buff("spell_pal_blessing_of_might");
new spell_gen_increase_stats_buff("spell_dru_mark_of_the_wild");
@@ -3762,7 +3642,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance");
new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance");
new spell_gen_interrupt();
new spell_gen_launch();
new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL);
@@ -3775,7 +3654,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_oracle_wolvar_reputation();
new spell_gen_orc_disguise();
new spell_gen_parachute();
new spell_gen_parachute_ic();
new spell_gen_pet_summoned();
new spell_gen_profession_research();
new spell_gen_remove_flight_auras();

View File

@@ -506,7 +506,7 @@ class spell_warr_overpower : public SpellScriptLoader
return;
if (Player* target = GetHitPlayer())
if (target->HasUnitState(UNIT_STATE_CASTING))
if (target->IsNonMeleeSpellCast(false, false, true)) // UNIT_STATE_CASTING should not be used here, it's present during a tick for instant casts
target->CastSpell(target, spellId, true);
}