Core/Script: Code style.

Signed-off-by: Gyx <[email protected]>
This commit is contained in:
Gyx
2012-03-16 19:40:57 +08:00
parent ddc0f5d7d6
commit bef1b0c402
55 changed files with 220 additions and 137 deletions
+1 -1
View File
@@ -382,7 +382,7 @@ public:
// Let set addon state only for lesser (strong) security level
// or to self account
if (handler->GetSession() && handler->GetSession()->GetAccountId () != accountId &&
if (handler->GetSession() && handler->GetSession()->GetAccountId() != accountId &&
handler->HasLowerSecurityAccount(NULL, accountId, true))
return false;
+5 -3
View File
@@ -360,7 +360,9 @@ public:
//Edit Player Spell
static bool HandleModifySpellCommand(ChatHandler* handler, const char* args)
{
if (!*args) return false;
if (!*args)
return false;
char* pspellflatid = strtok((char*)args, " ");
if (!pspellflatid)
return false;
@@ -1141,10 +1143,10 @@ public:
static bool HandleModifyRepCommand(ChatHandler* handler, const char* args)
{
if (!*args) return false;
if (!*args)
return false;
Player* target = handler->getSelectedPlayer();
if (!target)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+9 -8
View File
@@ -108,6 +108,7 @@ public:
{
if (!*args)
return false;
char* charID = handler->extractKeyFromLink((char*)args, "Hcreature_entry");
if (!charID)
return false;
@@ -135,7 +136,7 @@ public:
return true;
}
Creature* creature = new Creature;
Creature* creature = new Creature();
if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o))
{
delete creature;
@@ -1036,7 +1037,7 @@ public:
}
if (/*creature->GetMotionMaster()->empty() ||*/
creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != FOLLOW_MOTION_TYPE)
creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE)
{
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName());
handler->SetSentErrorMessage(true);
@@ -1131,17 +1132,17 @@ public:
//npc tame handling
static bool HandleNpcTameCommand(ChatHandler* handler, const char* /*args*/)
{
Creature* creatureTarget = handler->getSelectedCreature ();
if (!creatureTarget || creatureTarget->isPet ())
Creature* creatureTarget = handler->getSelectedCreature();
if (!creatureTarget || creatureTarget->isPet())
{
handler->PSendSysMessage (LANG_SELECT_CREATURE);
handler->SetSentErrorMessage (true);
return false;
}
Player* player = handler->GetSession()->GetPlayer ();
Player* player = handler->GetSession()->GetPlayer();
if (player->GetPetGUID ())
if (player->GetPetGUID())
{
handler->SendSysMessage (LANG_YOU_ALREADY_HAVE_PET);
handler->SetSentErrorMessage (true);
@@ -1168,8 +1169,8 @@ public:
// place pet before player
float x, y, z;
player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize (), CONTACT_DISTANCE);
pet->Relocate (x, y, z, M_PI-player->GetOrientation ());
player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize(), CONTACT_DISTANCE);
pet->Relocate(x, y, z, M_PI-player->GetOrientation());
// set pet to defensive mode by default (some classes can't control controlled pets in fact).
pet->SetReactState(REACT_DEFENSIVE);
+2 -1
View File
@@ -277,7 +277,8 @@ public:
std::string show = show_str;
// Check
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid")) return false;
if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid"))
return false;
char* arg_id = strtok(NULL, " ");
uint32 id = 0;
@@ -303,9 +303,11 @@ public:
prisonerGUID = guid;
}
uint64 GetGUID(int32 /*id*/) { return prisonerGUID; }
uint64 GetGUID(int32 /*id*/)
{
return prisonerGUID;
}
};
};
class go_acherus_soul_prison : public GameObjectScript
@@ -702,7 +704,9 @@ public:
void Reset()
{
Creature* deathcharger = me->FindNearestCreature(28782, 30);
if (!deathcharger) return;
if (!deathcharger)
return;
deathcharger->RestoreFaction();
deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -713,7 +717,9 @@ public:
void JustDied(Unit* killer)
{
Creature* deathcharger = me->FindNearestCreature(28782, 30);
if (!deathcharger) return;
if (!deathcharger)
return;
if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle())
{
deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
@@ -319,7 +319,8 @@ public:
if (wait <= diff)
{
wait = 1000;
if (!me->getVictim()) return;
if (!me->getVictim())
return;
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveFleeing(me->getVictim());
}
@@ -803,11 +804,15 @@ public:
void Despawn()
{
if (!debuffGUID) return;
if (!debuffGUID)
return;
Unit* debuff = Unit::GetUnit((*me), debuffGUID);
if (debuff)
{
debuff->SetVisible(false);
debuffGUID = 0;
}
}
void JustDied(Unit* /*killer*/) { if (!sprouted) Despawn(); }
@@ -676,7 +676,9 @@ public:
void TeleportAllPlayersBack()
{
Map* map = me->GetMap();
if (!map->IsDungeon()) return;
if (!map->IsDungeon())
return;
Map::PlayerList const &PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
@@ -153,7 +153,7 @@ class boss_archaedas : public CreatureScript
// wake a wall minion
if (uiWallMinionTimer <= uiDiff)
{
instance->SetData (DATA_MINIONS, IN_PROGRESS);
instance->SetData(DATA_MINIONS, IN_PROGRESS);
uiWallMinionTimer = 10000;
} else uiWallMinionTimer -= uiDiff;
@@ -184,8 +184,8 @@ class instance_uldaman : public InstanceMapScript
return; // only want the first one we find
}
// if we get this far than all four are dead so open the door
SetData (DATA_ALTAR_DOORS, DONE);
SetDoor (uiArchaedasTempleDoor, true); //open next the door too
SetData(DATA_ALTAR_DOORS, DONE);
SetDoor(uiArchaedasTempleDoor, true); //open next the door too
}
void ActivateWallMinions()
@@ -320,7 +320,7 @@ class instance_uldaman : public InstanceMapScript
uiIronayaSealDoorTimer -= diff;
}
void SetData (uint32 type, uint32 data)
void SetData(uint32 type, uint32 data)
{
switch (type)
{
@@ -386,7 +386,7 @@ class instance_uldaman : public InstanceMapScript
}
}
void SetData64 (uint32 type, uint64 data)
void SetData64(uint32 type, uint64 data)
{
// Archaedas
if (type == 0)
@@ -425,7 +425,8 @@ class instance_uldaman : public InstanceMapScript
void OnCreatureCreate(Creature* creature)
{
switch (creature->GetEntry()) {
switch (creature->GetEntry())
{
case 4857: // Stone Keeper
SetFrozenState (creature);
vStoneKeeper.push_back(creature->GetGUID());
@@ -458,10 +459,10 @@ class instance_uldaman : public InstanceMapScript
uiArchaedasGUID = creature->GetGUID();
break;
} // end switch
} // end OnCreatureCreate
}
}
uint64 GetData64 (uint32 identifier)
uint64 GetData64(uint32 identifier)
{
if (identifier == 0) return uiWhoWokeuiArchaedasGUID;
if (identifier == 1) return vVaultWalker[0]; // VaultWalker1
@@ -374,7 +374,9 @@ class boss_janalai : public CreatureScript
//Teleport every Player into the middle
Map* map = me->GetMap();
if (!map->IsDungeon()) return;
if (!map->IsDungeon())
return;
Map::PlayerList const &PlayerList = map->GetPlayers();
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
@@ -109,7 +109,8 @@ class instance_zulaman : public InstanceMapScript
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -188,7 +189,9 @@ class instance_zulaman : public InstanceMapScript
void Load(const char* load)
{
if (!load) return;
if (!load)
return;
std::istringstream ss(load);
//sLog->outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str());
char dataHead; // S
@@ -68,7 +68,6 @@ public:
{
instance = creature->GetInstanceScript();
go = false;
pos = 0;
}
uint32 SwarmTimer;
@@ -76,7 +75,6 @@ public:
uint32 AuraTimer;
uint32 InfernoTimer;
bool go;
uint32 pos;
void Reset()
{
@@ -119,7 +117,6 @@ public:
void WaypointReached(uint32 i)
{
pos = i;
if (i == 7 && instance)
{
Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE));
@@ -110,7 +110,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -607,7 +607,8 @@ public:
if (WisperTimer <= diff)
{
Map* map = me->GetMap();
if (!map->IsDungeon()) return;
if (!map->IsDungeon())
return;
//Play random sound to the zone
Map::PlayerList const &PlayerList = map->GetPlayers();
@@ -117,7 +117,7 @@ public:
return 0;
}
uint64 GetData64 (uint32 identifier)
uint64 GetData64(uint32 identifier)
{
switch (identifier)
{
@@ -199,18 +199,6 @@ public:
+## go_troll_cage
+######*/
void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z)
{
if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry)))
{
crew->SetReactState(REACT_AGGRESSIVE);
crew->SetWalk(true);
crew->SetHomePosition(x, y, z, 0);
crew->GetMotionMaster()->MovePoint(1, x, y, z);
crew->setFaction(FACTION_FREED);
}
}
class go_troll_cage : public GameObjectScript
{
public:
@@ -231,6 +219,18 @@ public:
return false;
}
private:
void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z)
{
if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry)))
{
crew->SetReactState(REACT_AGGRESSIVE);
crew->SetWalk(true);
crew->SetHomePosition(x, y, z, 0);
crew->GetMotionMaster()->MovePoint(1, x, y, z);
crew->setFaction(FACTION_FREED);
}
}
};
/*######
+1 -1
View File
@@ -55,7 +55,7 @@ public:
uint32 m_uiRebuffTimer;
bool work;
void Reset ()
void Reset()
{
uiPlayerGUID = 0;
m_uiRebuffTimer = 0;
+6 -3
View File
@@ -385,7 +385,8 @@ public:
void MoveInLineOfSight(Unit* who)
{
if (!who || (!who->isAlive())) return;
if (!who || (!who->isAlive()))
return;
if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
{
@@ -433,8 +434,10 @@ public:
if (BigWill)
{
Creature* creature = Unit::GetCreature((*me), BigWill);
if (creature) {
if (creature->isAlive()) {
if (creature)
{
if (creature->isAlive())
{
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
creature->setDeathState(JUST_DIED);
@@ -87,7 +87,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -236,7 +237,8 @@ public:
for (std::set<uint64>::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr)
{
Creature* cr = instance->GetCreature(*itr);
if (!cr || (cr && cr->isAlive())) return 0;
if (!cr || (cr && cr->isAlive()))
return 0;
}
return 1;
case DATA_JEDOGA_TRIGGER_SWITCH: return switchtrigger;
@@ -136,7 +136,8 @@ public:
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
// Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge!
CheckDistance(fMaxDistance, diff);
@@ -64,7 +64,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (auiEncounter[i] == IN_PROGRESS) return true;
if (auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -408,7 +408,8 @@ struct boss_faction_championsAI : public ScriptedAI
void AttackStart(Unit* who)
{
if (!who) return;
if (!who)
return;
if (me->Attack(who, true))
{
@@ -494,7 +495,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiNatureGraspTimer <= uiDiff)
{
@@ -588,7 +590,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiHeroismOrBloodlustTimer <= uiDiff)
{
@@ -687,7 +690,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiBubbleTimer <= uiDiff)
{
@@ -786,7 +790,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiPsychicScreamTimer <= uiDiff)
{
@@ -879,7 +884,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiPsychicScreamTimer <= uiDiff)
{
@@ -990,7 +996,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiFearTimer <= uiDiff)
{
@@ -1093,7 +1100,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiCounterspellTimer <= uiDiff)
{
@@ -1204,7 +1212,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiDisengageTimer <= uiDiff)
{
@@ -1312,7 +1321,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiBarkskinTimer <= uiDiff)
{
@@ -1424,7 +1434,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiBladestormTimer <= uiDiff)
{
@@ -1534,7 +1545,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiIceboundFortitudeTimer <= uiDiff)
{
@@ -1636,7 +1648,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiFanOfKnivesTimer <= uiDiff)
{
@@ -1773,7 +1786,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiHeroismOrBloodlustTimer <= uiDiff)
{
@@ -1873,7 +1887,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiRepeteanceTimer <= uiDiff)
{
@@ -1951,7 +1966,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiDevourMagicTimer <= uiDiff)
{
@@ -2000,7 +2016,8 @@ public:
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (m_uiClawTimer <= uiDiff)
{
@@ -2011,11 +2028,8 @@ public:
boss_faction_championsAI::UpdateAI(uiDiff);
}
};
};
/*========================================================*/
void AddSC_boss_faction_champions()
{
new boss_toc_champion_controller();
@@ -454,7 +454,8 @@ struct boss_jormungarAI : public ScriptedAI
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL && !enraged)
{
@@ -199,7 +199,8 @@ struct boss_twin_baseAI : public ScriptedAI
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE) return;
if (uiType != POINT_MOTION_TYPE)
return;
switch (uiId)
{
@@ -585,7 +586,8 @@ struct mob_unleashed_ballAI : public ScriptedAI
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE) return;
if (uiType != POINT_MOTION_TYPE)
return;
switch (uiId)
{
@@ -388,7 +388,8 @@ class npc_fizzlebang_toc : public CreatureScript
void MovementInform(uint32 uiType, uint32 uiId)
{
if (uiType != POINT_MOTION_TYPE) return;
if (uiType != POINT_MOTION_TYPE)
return;
switch (uiId)
{
@@ -411,9 +412,11 @@ class npc_fizzlebang_toc : public CreatureScript
void UpdateAI(const uint32 uiDiff)
{
if (!instance) return;
if (!instance)
return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG)
return;
m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER);
if (m_uiUpdateTimer <= uiDiff)
@@ -537,8 +540,11 @@ class npc_tirion_toc : public CreatureScript
void UpdateAI(const uint32 uiDiff)
{
if (!instance) return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return;
if (!instance)
return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION)
return;
m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER);
if (m_uiUpdateTimer <= uiDiff)
@@ -833,8 +839,11 @@ class npc_garrosh_toc : public CreatureScript
void UpdateAI(const uint32 uiDiff)
{
if (!instance) return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return;
if (!instance)
return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH)
return;
m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER);
if (m_uiUpdateTimer <= uiDiff)
@@ -911,8 +920,11 @@ class npc_varian_toc : public CreatureScript
void UpdateAI(const uint32 uiDiff)
{
if (!instance) return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return;
if (!instance)
return;
if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN)
return;
m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER);
if (m_uiUpdateTimer <= uiDiff)
@@ -83,7 +83,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -131,7 +131,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -643,7 +643,7 @@ class boss_flame_leviathan_defense_cannon : public CreatureScript
uint32 NapalmTimer;
void Reset ()
void Reset()
{
NapalmTimer = 5*IN_MILLISECONDS;
DoCast(me, AURA_STEALTH_DETECTION);
@@ -100,7 +100,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -97,7 +97,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -221,7 +221,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -477,7 +477,7 @@ public:
uint32 DespawnTimer;
void Reset ()
void Reset()
{
DespawnTimer = 5000;
uiPlayerGUID = 0;
@@ -71,7 +71,7 @@ public:
npc_Apothecary_HanesAI(Creature* creature) : npc_escortAI(creature){}
uint32 PotTimer;
void Reset ()
void Reset()
{
SetDespawnAtFar(false);
PotTimer = 10000; //10 sec cooldown on potion
@@ -75,7 +75,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -566,7 +566,9 @@ public:
void KilledUnit(Unit* victim)
{
if (victim == me) return;
if (victim == me)
return;
// TODO: Find better way to handle emote
switch (urand(0, 1))
{
@@ -747,7 +749,8 @@ public:
final.y = 2 * final.y - initial.y;
Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000);
if (!Trigger) return;
if (!Trigger)
return;
Trigger->SetSpeed(MOVE_WALK, 3);
Trigger->SetWalk(true);
@@ -2137,9 +2140,11 @@ public:
void UpdateAI(const uint32 /*diff*/)
{
if (!UpdateVictim()) return;
if (!UpdateVictim())
return;
if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
if (me->getVictim()->GetTypeId() != TYPEID_PLAYER)
return; // Only cast the below on players.
if (!me->getVictim()->HasAura(SPELL_PARALYZE))
{
@@ -197,8 +197,11 @@ public:
uint32 random = rand()%6;
float x = Coords[random].x;
float y = Coords[random].y;
Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0);
if (!Soul) return false;
if (!Soul)
return false;
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
CAST_AI(npc_enslaved_soul::npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID();
@@ -320,7 +320,8 @@ public:
void AttackStart(Unit* who)
{
if (!who || IsBanished) return;
if (!who || IsBanished)
return;
if (who->isTargetableForAttack() && who != me)
DoStartMovement(who);
@@ -316,7 +316,8 @@ public:
void SetThreatList(Creature* Blossom)
{
if (!Blossom) return;
if (!Blossom)
return;
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
@@ -130,7 +130,9 @@ public:
bool RemoveImpalingSpine()
{
if (!SpineTargetGUID) return false;
if (!SpineTargetGUID)
return false;
Unit* target = Unit::GetUnit(*me, SpineTargetGUID);
if (target && target->HasAura(SPELL_IMPALING_SPINE))
target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
@@ -313,7 +313,8 @@ public:
void UpdateAI(const uint32 diff)
{
if (!EventBegun) return;
if (!EventBegun)
return;
if (EndEventTimer)
{
@@ -118,7 +118,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -112,7 +112,8 @@ public:
void EnterCombat(Unit* /*who*/)
{
if (!victimGUID) return;
if (!victimGUID)
return;
}
void UpdateAI(const uint32 diff)
@@ -383,12 +383,11 @@ public:
void MoveInLineOfSight(Unit* who)
{
if (!who || me->getVictim()) return;
if (!who || me->getVictim())
return;
if (who->isInAccessiblePlaceFor(me) && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 45))
{
AttackStart(who);
}
}
void UpdateAI(const uint32 diff)
@@ -77,7 +77,8 @@ public:
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -158,7 +158,9 @@ class boss_kelidan_the_breaker : public CreatureScript
uint64 GetChanneled(Creature* channeler1)
{
SummonChannelers();
if (!channeler1) return 0;
if (!channeler1)
return 0;
uint8 i;
for (i=0; i<5; ++i)
{
@@ -80,7 +80,9 @@ class instance_magtheridons_lair : public InstanceMapScript
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -78,7 +78,8 @@ class instance_the_eye : public InstanceMapScript
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -66,7 +66,7 @@ class instance_mechanar : public InstanceMapScript
return false;
}
uint64 GetData64 (uint32 /*identifier*/)
uint64 GetData64(uint32 /*identifier*/)
{
return 0;
}
@@ -93,7 +93,8 @@ class instance_arcatraz : public InstanceMapScript
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
if (m_auiEncounter[i] == IN_PROGRESS)
return true;
return false;
}
@@ -492,7 +492,8 @@ public:
void MoveInLineOfSight(Unit* who)
{
if (!who || (!who->isAlive())) return;
if (!who || (!who->isAlive()))
return;
if (me->IsWithinDistInMap(who, 50.0f))
{
@@ -18,7 +18,7 @@
#include "ScriptPCH.h"
enum Yells
enum Texts
{
SAY_INTRO = 0,
SAY_AGGRO = 1,
@@ -18,7 +18,7 @@
#include "ScriptPCH.h"
enum Yells
enum Texts
{
SAY_AGGRO = 0,
SAY_EARTHQUAKE = 1,
+1 -1
View File
@@ -394,7 +394,7 @@ public:
struct npc_commander_dawnforgeAI : public ScriptedAI
{
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset (); }
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); }
uint64 PlayerGUID;
uint64 ardonisGUID;
@@ -1727,7 +1727,7 @@ public:
{
npc_enraged_spiritAI(Creature* creature) : ScriptedAI(creature) {}
void Reset() { }
void Reset() { }
void EnterCombat(Unit* /*who*/){}
@@ -1739,7 +1739,8 @@ public:
uint32 entry = 0;
uint32 credit = 0;
switch (me->GetEntry()) {
switch (me->GetEntry())
{
case ENTRY_ENRAGED_FIRE_SPIRIT:
entry = ENTRY_FIERY_SOUL;
//credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT;
+8 -12
View File
@@ -148,9 +148,8 @@ public:
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086))
{
player->CastSpell(player, 26095, false);
}
return true;
}
};
@@ -167,9 +166,8 @@ public:
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 300 && !player->HasSpell(22704))
{
player->CastSpell(player, 22864, false);
}
return true;
}
};
@@ -232,9 +230,8 @@ public:
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266))
{
player->CastSpell(player, 24267, false);
}
return true;
}
};
@@ -273,7 +270,7 @@ public:
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE)
player->CastSpell(player, 33382, true);
player->CastSpell(player, 33382, true);
return true;
}
@@ -492,6 +489,7 @@ enum eDalaranCrystal
};
#define GO_TELE_TO_DALARAN_CRYSTAL_FAILED "This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once."
class go_tele_to_dalaran_crystal : public GameObjectScript
{
public:
@@ -500,11 +498,9 @@ public:
bool OnGossipHello(Player* player, GameObject* /*go*/)
{
if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
{
return false;
}
else
player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
return true;
}
@@ -577,7 +573,7 @@ public:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF + 2:
case GOSSIP_ACTION_INFO_DEF + 2:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID());