Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts: src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
This commit is contained in:
commit
e09591b8a7
24 files changed
+326
-51
No files matched your search
@@ -3077,6 +3077,96 @@ class spell_gen_mount : public SpellScriptLoader
|
||||
uint32 _mount310;
|
||||
};
|
||||
|
||||
enum FoamSword
|
||||
{
|
||||
ITEM_FOAM_SWORD_GREEN = 45061,
|
||||
ITEM_FOAM_SWORD_PINK = 45176,
|
||||
ITEM_FOAM_SWORD_BLUE = 45177,
|
||||
ITEM_FOAM_SWORD_RED = 45178,
|
||||
ITEM_FOAM_SWORD_YELLOW = 45179,
|
||||
|
||||
SPELL_BONKED = 62991,
|
||||
SPELL_FOAM_SWORD_DEFEAT = 62994,
|
||||
SPELL_ON_GUARD = 62972,
|
||||
};
|
||||
|
||||
class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_upper_deck_create_foam_sword() : SpellScriptLoader("spell_gen_upper_deck_create_foam_sword") { }
|
||||
|
||||
class spell_gen_upper_deck_create_foam_sword_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_upper_deck_create_foam_sword_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
{
|
||||
static uint32 const itemId[5] = { ITEM_FOAM_SWORD_GREEN, ITEM_FOAM_SWORD_PINK, ITEM_FOAM_SWORD_BLUE, ITEM_FOAM_SWORD_RED, ITEM_FOAM_SWORD_YELLOW };
|
||||
// player can only have one of these items
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
if (player->HasItemCount(itemId[i], 1, true))
|
||||
return;
|
||||
}
|
||||
|
||||
CreateItem(effIndex, itemId[urand(0, 4)]);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_upper_deck_create_foam_sword_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_upper_deck_create_foam_sword_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gen_bonked : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_bonked() : SpellScriptLoader("spell_gen_bonked") { }
|
||||
|
||||
class spell_gen_bonked_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_bonked_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
Aura const* aura = GetHitAura();
|
||||
if (!(aura && aura->GetStackAmount() == 3))
|
||||
return;
|
||||
|
||||
target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_BONKED);
|
||||
|
||||
if (Aura const* aura = target->GetAura(SPELL_ON_GUARD))
|
||||
{
|
||||
if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID()))
|
||||
target->DestroyItemCount(item->GetEntry(), 1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_bonked_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gen_bonked_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_spell_scripts()
|
||||
{
|
||||
new spell_gen_absorb0_hitlimit1();
|
||||
@@ -3149,4 +3239,6 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280);
|
||||
new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310);
|
||||
new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
|
||||
new spell_gen_upper_deck_create_foam_sword();
|
||||
new spell_gen_bonked();
|
||||
}
|
||||
Reference in new issue
Block a user