Merge branch 'master' of github.com:joschiwald/TrinityCore into spellscripts
Conflicts: src/server/game/Entities/Unit/Unit.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/Spell.cpp src/server/game/Spells/SpellEffects.cpp src/server/scripts/Spells/spell_paladin.cpp
This commit is contained in:
commit
cd7ab6f3a5
385 files changed
+3728
-1813
No files matched your search
@@ -761,6 +761,23 @@ class spell_dk_death_coil : public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target) && !caster->isInFront(target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
|
||||
if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_dk_death_coil_SpellScript::CheckCast);
|
||||
|
||||
@@ -1513,7 +1513,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
|
||||
if (group->isLFGGroup())
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
|
||||
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
|
||||
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty()))
|
||||
if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM)
|
||||
return; // in correct dungeon
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader
|
||||
spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT;
|
||||
basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount());
|
||||
ApplyPctN(basePoint, TickCount * 40);
|
||||
basePoint = unitTarget->SpellDamageBonusTaken(aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
|
||||
basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
|
||||
}
|
||||
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
|
||||
else if (familyFlag[1] & 0x00000080)
|
||||
|
||||
@@ -1095,7 +1095,7 @@ class spell_item_shimmering_vessel : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (Creature* target = GetHitCreature())
|
||||
target->setDeathState(JUST_ALIVED);
|
||||
target->setDeathState(JUST_RESPAWNED);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -1535,7 +1535,7 @@ class spell_item_impale_leviroth : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (Unit* target = GetHitCreature())
|
||||
if (target->GetEntry() == NPC_LEVIROTH && target->HealthBelowPct(95))
|
||||
if (target->GetEntry() == NPC_LEVIROTH && !target->HealthBelowPct(95))
|
||||
target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true);
|
||||
}
|
||||
|
||||
@@ -1748,8 +1748,16 @@ class spell_item_rocket_boots : public SpellScriptLoader
|
||||
caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL);
|
||||
}
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
if (GetCaster()->IsInWater())
|
||||
return SPELL_FAILED_ONLY_ABOVEWATER;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_item_rocket_boots_SpellScript::CheckCast);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_rocket_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
@@ -2036,7 +2044,7 @@ public:
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (GetHitUnit())
|
||||
GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,13 +297,15 @@ class spell_pal_holy_shock : public SpellScriptLoader
|
||||
{
|
||||
if (!caster->IsFriendlyTo(target))
|
||||
{
|
||||
if (!caster->HasInArc(static_cast<float>(M_PI), target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
|
||||
if (!caster->IsValidAttackTarget(target))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
if (!caster->isInFront(target))
|
||||
return SPELL_FAILED_UNIT_NOT_INFRONT;
|
||||
}
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1105,6 +1105,63 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum LeaveNothingToChance
|
||||
{
|
||||
NPC_UPPER_MINE_SHAFT = 27436,
|
||||
NPC_LOWER_MINE_SHAFT = 27437,
|
||||
|
||||
SPELL_UPPER_MINE_SHAFT_CREDIT = 48744,
|
||||
SPELL_LOWER_MINE_SHAFT_CREDIT = 48745,
|
||||
};
|
||||
|
||||
class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q12277_wintergarde_mine_explosion() : SpellScriptLoader("spell_q12277_wintergarde_mine_explosion") { }
|
||||
|
||||
class spell_q12277_wintergarde_mine_explosion_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q12277_wintergarde_mine_explosion_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Creature* unitTarget = GetHitCreature())
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (caster->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (Unit* owner = caster->GetOwner())
|
||||
{
|
||||
switch (unitTarget->GetEntry())
|
||||
{
|
||||
case NPC_UPPER_MINE_SHAFT:
|
||||
caster->CastSpell(owner, SPELL_UPPER_MINE_SHAFT_CREDIT, true);
|
||||
break;
|
||||
case NPC_LOWER_MINE_SHAFT:
|
||||
caster->CastSpell(owner, SPELL_LOWER_MINE_SHAFT_CREDIT, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q12277_wintergarde_mine_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q12277_wintergarde_mine_explosion_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_quest_spell_scripts()
|
||||
{
|
||||
new spell_q55_sacred_cleansing();
|
||||
@@ -1131,4 +1188,5 @@ void AddSC_quest_spell_scripts()
|
||||
new spell_q14112_14145_chum_the_water();
|
||||
new spell_q9452_cast_net();
|
||||
new spell_q12987_read_pronouncement();
|
||||
new spell_q12277_wintergarde_mine_explosion();
|
||||
}
|
||||
@@ -217,7 +217,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (!GetCaster())
|
||||
return;
|
||||
@@ -502,7 +502,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
|
||||
if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0))
|
||||
AddPctN(damage, aurEff->GetAmount());
|
||||
|
||||
damage = int32(target->SpellHealingBonusTaken(triggeringSpell, damage, HEAL));
|
||||
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
|
||||
}
|
||||
caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
|
||||
}
|
||||
|
||||
@@ -177,27 +177,27 @@ class spell_warr_deep_wounds : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
int32 damage = GetEffectValue();
|
||||
Unit* caster = GetCaster();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
// apply percent damage mods
|
||||
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
{
|
||||
// apply percent damage mods
|
||||
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
|
||||
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
|
||||
|
||||
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
|
||||
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
|
||||
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
|
||||
// Add remaining ticks to damage done
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
|
||||
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
|
||||
|
||||
// Add remaining ticks to damage done
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID()))
|
||||
damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber());
|
||||
damage = damage / ticks;
|
||||
|
||||
damage = damage / ticks;
|
||||
|
||||
damage = target->SpellDamageBonusTaken(GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
|
||||
|
||||
caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
|
||||
}
|
||||
caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
|
||||
Reference in new issue
Block a user