refactor(Core/Scripts): restyle scripts lib with astyle (#3467)

This commit is contained in:
Kargatum
2020-10-11 15:35:34 +07:00
committed by GitHub
parent 4cca286a4d
commit 5e20b46812
538 changed files with 92888 additions and 91297 deletions

View File

@@ -25,66 +25,66 @@ enum PriestSpells
class npc_pet_pri_lightwell : public CreatureScript
{
public:
npc_pet_pri_lightwell() : CreatureScript("npc_pet_pri_lightwell") { }
public:
npc_pet_pri_lightwell() : CreatureScript("npc_pet_pri_lightwell") { }
struct npc_pet_pri_lightwellAI : public TotemAI
struct npc_pet_pri_lightwellAI : public TotemAI
{
npc_pet_pri_lightwellAI(Creature* creature) : TotemAI(creature) { }
void InitializeAI()
{
npc_pet_pri_lightwellAI(Creature* creature) : TotemAI(creature) { }
void InitializeAI()
if (Unit* owner = me->ToTempSummon()->GetSummoner())
{
if (Unit* owner = me->ToTempSummon()->GetSummoner())
{
uint32 hp = uint32(owner->GetMaxHealth()*0.3f);
me->SetMaxHealth(hp);
me->SetHealth(hp);
me->SetLevel(owner->getLevel());
}
me->CastSpell(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false); // Spell for Lightwell Charges
TotemAI::InitializeAI();
uint32 hp = uint32(owner->GetMaxHealth() * 0.3f);
me->SetMaxHealth(hp);
me->SetHealth(hp);
me->SetLevel(owner->getLevel());
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_pet_pri_lightwellAI(creature);
me->CastSpell(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false); // Spell for Lightwell Charges
TotemAI::InitializeAI();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_pet_pri_lightwellAI(creature);
}
};
class npc_pet_pri_shadowfiend : public CreatureScript
{
public:
npc_pet_pri_shadowfiend() : CreatureScript("npc_pet_pri_shadowfiend") { }
public:
npc_pet_pri_shadowfiend() : CreatureScript("npc_pet_pri_shadowfiend") { }
struct npc_pet_pri_shadowfiendAI : public PetAI
struct npc_pet_pri_shadowfiendAI : public PetAI
{
npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { }
void Reset()
{
npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { }
PetAI::Reset();
if (!me->HasAura(SPELL_PRIEST_SHADOWFIEND_DODGE))
me->AddAura(SPELL_PRIEST_SHADOWFIEND_DODGE, me);
void Reset()
{
PetAI::Reset();
if (!me->HasAura(SPELL_PRIEST_SHADOWFIEND_DODGE))
me->AddAura(SPELL_PRIEST_SHADOWFIEND_DODGE, me);
if (Unit* target = me->SelectNearestTarget(15.0f))
AttackStart(target);
}
void JustDied(Unit* /*killer*/)
{
if (me->IsSummon())
if (Unit* owner = me->ToTempSummon()->GetSummoner())
if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_pet_pri_shadowfiendAI(creature);
if (Unit* target = me->SelectNearestTarget(15.0f))
AttackStart(target);
}
void JustDied(Unit* /*killer*/)
{
if (me->IsSummon())
if (Unit* owner = me->ToTempSummon()->GetSummoner())
if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_pet_pri_shadowfiendAI(creature);
}
};
void AddSC_priest_pet_scripts()