Scripts: Reorder file names in Commands/CMakeList file and cosmetic changes in all scripts

This commit is contained in:
Spp-
2011-06-30 14:24:56 +02:00
parent d12bb4a657
commit 6fd41ae50e
372 changed files with 1974 additions and 1968 deletions
@@ -102,7 +102,7 @@ public:
struct npc_unworthy_initiateAI : public ScriptedAI
{
npc_unworthy_initiateAI(Creature *c) : ScriptedAI(c)
npc_unworthy_initiateAI(Creature* c) : ScriptedAI(c)
{
me->SetReactState(REACT_PASSIVE);
if (!me->GetEquipmentId())
@@ -155,7 +155,7 @@ public:
}
}
void EventStart(Creature* anchor, Player *pTarget)
void EventStart(Creature* anchor, Player* pTarget)
{
wait_timer = 5000;
phase = PHASE_TO_EQUIP;
@@ -178,7 +178,7 @@ public:
case PHASE_CHAINED:
if (!anchorGUID)
{
if (Creature *anchor = me->FindNearestCreature(29521, 30))
if (Creature* anchor = me->FindNearestCreature(29521, 30))
{
anchor->AI()->SetGUID(me->GetGUID());
anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true);
@@ -188,7 +188,7 @@ public:
sLog->outError("npc_unworthy_initiateAI: unable to find anchor!");
float dist = 99.0f;
GameObject *prison = NULL;
GameObject* prison = NULL;
for (uint8 i = 0; i < 12; ++i)
{
@@ -233,7 +233,7 @@ public:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
phase = PHASE_ATTACKING;
if (Player *pTarget = Unit::GetPlayer(*me, playerGUID))
if (Player* pTarget = Unit::GetPlayer(*me, playerGUID))
me->AI()->AttackStart(pTarget);
wait_timer = 0;
}
@@ -293,7 +293,7 @@ public:
struct npc_unworthy_initiate_anchorAI : public PassiveAI
{
npc_unworthy_initiate_anchorAI(Creature *c) : PassiveAI(c), prisonerGUID(0) {}
npc_unworthy_initiate_anchorAI(Creature* c) : PassiveAI(c), prisonerGUID(0) {}
uint64 prisonerGUID;
@@ -315,7 +315,7 @@ public:
bool OnGossipHello(Player* pPlayer, GameObject* pGo)
{
if (Creature *anchor = pGo->FindNearestCreature(29521, 15))
if (Creature* anchor = pGo->FindNearestCreature(29521, 15))
if (uint64 prisonerGUID = anchor->AI()->GetGUID())
if (Creature* prisoner = Creature::GetCreature(*pPlayer, prisonerGUID))
CAST_AI(npc_unworthy_initiate::npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, pPlayer);
@@ -531,7 +531,7 @@ public:
struct npc_dark_rider_of_acherusAI : public ScriptedAI
{
npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {}
npc_dark_rider_of_acherusAI(Creature* c) : ScriptedAI(c) {}
uint32 PhaseTimer;
uint32 Phase;
@@ -561,7 +561,7 @@ public:
Phase = 1;
break;
case 1:
if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID))
if (Unit* pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
@@ -581,7 +581,7 @@ public:
}
void InitDespawnHorse(Unit *who)
void InitDespawnHorse(Unit* who)
{
if (!who)
return;
@@ -623,15 +623,15 @@ public:
struct npc_salanar_the_horsemanAI : public ScriptedAI
{
npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {}
npc_salanar_the_horsemanAI(Creature* c) : ScriptedAI(c) {}
void SpellHit(Unit *caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellEntry *spell)
{
if (spell->Id == DELIVER_STOLEN_HORSE)
{
if (caster->GetTypeId() == TYPEID_UNIT && caster->IsVehicle())
{
if (Unit *charmer = caster->GetCharmer())
if (Unit* charmer = caster->GetCharmer())
{
if (charmer->HasAura(EFFECT_STOLEN_HORSE))
{
@@ -647,13 +647,13 @@ public:
}
}
void MoveInLineOfSight(Unit *who)
void MoveInLineOfSight(Unit* who)
{
ScriptedAI::MoveInLineOfSight(who);
if (who->GetTypeId() == TYPEID_UNIT && who->IsVehicle() && me->IsWithinDistInMap(who, 5.0f))
{
if (Unit *charmer = who->GetCharmer())
if (Unit* charmer = who->GetCharmer())
{
if (charmer->GetTypeId() == TYPEID_PLAYER)
{
@@ -692,7 +692,7 @@ public:
struct npc_ros_dark_riderAI : public ScriptedAI
{
npc_ros_dark_riderAI(Creature *c) : ScriptedAI(c) {}
npc_ros_dark_riderAI(Creature* c) : ScriptedAI(c) {}
void EnterCombat(Unit* /*who*/)
{
@@ -743,15 +743,15 @@ public:
struct npc_dkc1_gothikAI : public ScriptedAI
{
npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {}
npc_dkc1_gothikAI(Creature* c) : ScriptedAI(c) {}
void MoveInLineOfSight(Unit *who)
void MoveInLineOfSight(Unit* who)
{
ScriptedAI::MoveInLineOfSight(who);
if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f))
{
if (Unit *owner = who->GetOwner())
if (Unit* owner = who->GetOwner())
{
if (owner->GetTypeId() == TYPEID_PLAYER)
{
@@ -785,7 +785,7 @@ public:
struct npc_scarlet_ghoulAI : public ScriptedAI
{
npc_scarlet_ghoulAI(Creature *c) : ScriptedAI(c)
npc_scarlet_ghoulAI(Creature* c) : ScriptedAI(c)
{
// Ghouls should display their Birth Animation
// Crawling out of the ground
@@ -794,7 +794,7 @@ public:
me->SetReactState(REACT_DEFENSIVE);
}
void FindMinions(Unit *owner)
void FindMinions(Unit* owner)
{
std::list<Creature*> MinionList;
owner->GetAllMinionsByEntry(MinionList, GHOULS);
@@ -818,7 +818,7 @@ public:
{
if (!me->isInCombat())
{
if (Unit *owner = me->GetOwner())
if (Unit* owner = me->GetOwner())
{
if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat())
{
@@ -868,14 +868,14 @@ class npc_scarlet_miner_cart : public CreatureScript
public:
npc_scarlet_miner_cart() : CreatureScript("npc_scarlet_miner_cart") { }
CreatureAI* GetAI(Creature *_Creature) const
CreatureAI* GetAI(Creature* _Creature) const
{
return new npc_scarlet_miner_cartAI(_Creature);
}
struct npc_scarlet_miner_cartAI : public PassiveAI
{
npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0)
npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse.
@@ -890,7 +890,7 @@ public:
void DoAction(const int32 /*param*/)
{
if (Creature *miner = Unit::GetCreature(*me, minerGUID))
if (Creature* miner = Unit::GetCreature(*me, minerGUID))
{
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
@@ -905,7 +905,7 @@ public:
void PassengerBoarded(Unit* /*who*/, int8 /*seatId*/, bool apply)
{
if (!apply)
if (Creature *miner = Unit::GetCreature(*me, minerGUID))
if (Creature* miner = Unit::GetCreature(*me, minerGUID))
miner->DisappearAndDie();
}
};
@@ -924,14 +924,14 @@ class npc_scarlet_miner : public CreatureScript
public:
npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { }
CreatureAI* GetAI(Creature *_Creature) const
CreatureAI* GetAI(Creature* _Creature) const
{
return new npc_scarlet_minerAI(_Creature);
}
struct npc_scarlet_minerAI : public npc_escortAI
{
npc_scarlet_minerAI(Creature *c) : npc_escortAI(c)
npc_scarlet_minerAI(Creature* c) : npc_escortAI(c)
{
me->SetReactState(REACT_PASSIVE);
}
@@ -980,7 +980,7 @@ public:
}
}
void InitCartQuest(Player *who)
void InitCartQuest(Player* who)
{
carGUID = who->GetVehicleBase()->GetGUID();
InitWaypoint();
@@ -993,7 +993,7 @@ public:
switch (i)
{
case 1:
if (Unit *car = Unit::GetCreature(*me, carGUID))
if (Unit* car = Unit::GetCreature(*me, carGUID))
{
me->SetInFront(car);
me->SendMovementFlagUpdate();
@@ -1004,7 +1004,7 @@ public:
IntroPhase = 1;
break;
case 17:
if (Unit *car = Unit::GetCreature(*me, carGUID))
if (Unit* car = Unit::GetCreature(*me, carGUID))
{
me->SetInFront(car);
me->SendMovementFlagUpdate();
@@ -1027,14 +1027,14 @@ public:
{
if (IntroPhase == 1)
{
if (Creature *car = Unit::GetCreature(*me, carGUID))
if (Creature* car = Unit::GetCreature(*me, carGUID))
DoCast(car, SPELL_CART_DRAG);
IntroTimer = 800;
IntroPhase = 2;
}
else
{
if (Creature *car = Unit::GetCreature(*me, carGUID))
if (Creature* car = Unit::GetCreature(*me, carGUID))
car->AI()->DoAction(0);
IntroPhase = 0;
}
@@ -1062,10 +1062,10 @@ public:
if (pPlayer->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE)
{
// Hack Why Trinity Dont Support Custom Summon Location
if (Creature *miner = pPlayer->SummonCreature(28841, 2383.869629f, -5900.312500f, 107.996086f, pPlayer->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1))
if (Creature* miner = pPlayer->SummonCreature(28841, 2383.869629f, -5900.312500f, 107.996086f, pPlayer->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 1))
{
pPlayer->CastSpell(pPlayer, SPELL_CART_SUMM, true);
if (Creature *car = pPlayer->GetVehicleCreatureBase())
if (Creature* car = pPlayer->GetVehicleCreatureBase())
{
if (car->GetEntry() == 28817)
{
@@ -56,7 +56,7 @@ public:
struct npc_crusade_persuadedAI : public ScriptedAI
{
npc_crusade_persuadedAI(Creature *pCreature) : ScriptedAI(pCreature) {}
npc_crusade_persuadedAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint32 uiSpeech_timer;
uint32 uiSpeech_counter;
@@ -71,7 +71,7 @@ public:
me->RestoreFaction();
}
void SpellHit(Unit *caster, const SpellEntry *spell)
void SpellHit(Unit* caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter)
{
@@ -196,7 +196,7 @@ public:
struct npc_koltira_deathweaverAI : public npc_escortAI
{
npc_koltira_deathweaverAI(Creature *pCreature) : npc_escortAI(pCreature)
npc_koltira_deathweaverAI(Creature* pCreature) : npc_escortAI(pCreature)
{
me->SetReactState(REACT_DEFENSIVE);
}
@@ -363,7 +363,7 @@ public:
struct mob_scarlet_courierAI : public ScriptedAI
{
mob_scarlet_courierAI(Creature *pCreature) : ScriptedAI(pCreature) {}
mob_scarlet_courierAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint32 uiStage;
uint32 uiStage_timer;
@@ -411,7 +411,7 @@ public:
break;
case 2:
if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f))
if (Unit *unit = tree->GetOwner())
if (Unit* unit = tree->GetOwner())
AttackStart(unit);
break;
}
@@ -457,7 +457,7 @@ public:
struct mob_high_inquisitor_valrothAI : public ScriptedAI
{
mob_high_inquisitor_valrothAI(Creature *pCreature) : ScriptedAI(pCreature) {}
mob_high_inquisitor_valrothAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint32 uiRenew_timer;
uint32 uiInquisitor_Penance_timer;
@@ -593,7 +593,7 @@ public:
struct npc_a_special_surpriseAI : public ScriptedAI
{
npc_a_special_surpriseAI(Creature *pCreature) : ScriptedAI(pCreature) {}
npc_a_special_surpriseAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint32 ExecuteSpeech_Timer;
uint32 ExecuteSpeech_Counter;
@@ -321,7 +321,7 @@ public:
struct npc_highlord_darion_mograineAI : public npc_escortAI
{
npc_highlord_darion_mograineAI(Creature *pCreature) : npc_escortAI(pCreature)
npc_highlord_darion_mograineAI(Creature* pCreature) : npc_escortAI(pCreature)
{
Reset();
}
@@ -35,7 +35,7 @@ public:
struct npc_valkyr_battle_maidenAI : public PassiveAI
{
npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {}
npc_valkyr_battle_maidenAI(Creature* c) : PassiveAI(c) {}
uint32 FlyBackTimer;
float x, y, z;
@@ -60,9 +60,9 @@ public:
{
if (FlyBackTimer <= diff)
{
Player *plr = NULL;
Player* plr = NULL;
if (me->isSummon())
if (Unit *summoner = me->ToTempSummon()->GetSummoner())
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
if (summoner->GetTypeId() == TYPEID_PLAYER)
plr = CAST_PLR(summoner);