Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-06-10 08:51:40 -06:00
committed by GitHub
21 changed files with 697 additions and 55 deletions

View File

@@ -24,6 +24,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "zulgurub.h"
enum Spells
@@ -110,7 +111,44 @@ public:
}
};
class spell_gahzranka_slam : public SpellScript
{
PrepareSpellScript(spell_gahzranka_slam);
void FilterTargets(std::list<WorldObject*>& targets)
{
if (Unit* caster = GetCaster())
{
_wipeThreat = targets.size() < caster->GetThreatMgr().getThreatList().size();
}
}
void HandleWipeThreat(SpellEffIndex /*effIndex*/)
{
if (_wipeThreat)
{
if (Unit* caster = GetCaster())
{
if (Unit* target = GetHitUnit())
{
caster->GetThreatMgr().modifyThreatPercent(target, -100);
}
}
}
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gahzranka_slam::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_gahzranka_slam::HandleWipeThreat, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
}
private:
bool _wipeThreat = false;
};
void AddSC_boss_gahzranka()
{
new boss_gahzranka();
RegisterSpellScript(spell_gahzranka_slam);
}

View File

@@ -24,7 +24,6 @@ go_sacred_fire_of_life
go_shrine_of_the_birds
go_southfury_moonstone
go_resonite_cask
go_tablet_of_madness
go_tablet_of_the_seven
go_tele_to_dalaran_crystal
go_tele_to_violet_stand
@@ -943,24 +942,6 @@ public:
}
};
/*######
## go_tablet_of_madness
######*/
class go_tablet_of_madness : public GameObjectScript
{
public:
go_tablet_of_madness() : GameObjectScript("go_tablet_of_madness") { }
bool OnGossipHello(Player* player, GameObject* /*go*/) override
{
if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
player->CastSpell(player, 24267, false);
return true;
}
};
/*######
## go_tablet_of_the_seven
######*/
@@ -1975,7 +1956,6 @@ void AddSC_go_scripts()
new go_gilded_brazier();
//new go_shrine_of_the_birds();
new go_southfury_moonstone();
new go_tablet_of_madness();
new go_tablet_of_the_seven();
new go_jump_a_tron();
new go_sacred_fire_of_life();