Sourcefile sleanups -> tabs to spaces, remove whitespace - also update the cleanupscripts very slightly

--HG--
branch : trunk
This commit is contained in:
click
2010-08-08 19:45:53 +02:00
parent 31160bcfce
commit 1f80c7b3c0
174 changed files with 1066 additions and 1066 deletions
+2 -2
View File
@@ -207,7 +207,7 @@ extern int main(int argc, char **argv)
sLog.SetLogDBLater(sConfig.GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished.
sLog.SetLogDB(false);
sLog.SetRealmID(0); // ensure we've set realm to 0 (realmd realmid)
///- Get the list of realms for the server
sRealmList->Initialize(sConfig.GetIntDefault("RealmsStateUpdateDelay", 20));
if (sRealmList->size() == 0)
@@ -347,7 +347,7 @@ bool StartDB()
return false;
}
LoginDatabase.ThreadStart();
uint32 count = 0;
sPreparedStatement.LoadAuthserver(&LoginDatabase, count);
sLog.outString("Loaded %u prepared MySQL statements for auth DB.", count);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 134 KiB

@@ -34,7 +34,7 @@
#define MAX_STACK_SIZE 64
#ifdef _MSC_VER
#define isnan(x) _isnan(x)
#define isnan(x) _isnan(x)
#endif
using G3D::Vector3;
+1 -1
View File
@@ -154,7 +154,7 @@ namespace VMAP
iTree.intersectRay(pRay, intersectionCallBack, distance, pStopAtFirstHit);
if (intersectionCallBack.didHit())
pMaxDist = distance;
return intersectionCallBack.didHit();
return intersectionCallBack.didHit();
}
//=========================================================
+1 -1
View File
@@ -304,7 +304,7 @@ VehicleAI::VehicleAI(Creature *c) : CreatureAI(c), m_vehicle(c->GetVehicleKit())
void VehicleAI::UpdateAI(const uint32 diff)
{
CheckConditions(diff);
if (m_DoDismiss)
{
if (m_DismissTimer < diff)
+1 -1
View File
@@ -479,6 +479,6 @@ bool PetAI::_CheckTargetCC(Unit *target)
{
if (me->GetOwnerGUID() && target->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE, me->GetOwnerGUID()))
return true;
return false;
}
@@ -1332,10 +1332,10 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
return;
Condition cond;
cond.mConditionType = ConditionType((*itr).Event.receive_emote.condition);
cond.mConditionType = ConditionType((*itr).Event.receive_emote.condition);
cond.mConditionValue1 = (*itr).Event.receive_emote.conditionValue1;
cond.mConditionValue2 = (*itr).Event.receive_emote.conditionValue2;
if (cond.Meets(pPlayer))
{
sLog.outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing");
@@ -360,7 +360,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (temp.receive_emote.condition)
{
Condition cond;
cond.mConditionType = ConditionType(temp.receive_emote.condition);
cond.mConditionType = ConditionType(temp.receive_emote.condition);
cond.mConditionValue1 = temp.receive_emote.conditionValue1;
cond.mConditionValue2 = temp.receive_emote.conditionValue2;
if (!sConditionMgr.isConditionTypeValid(&cond))
@@ -886,7 +886,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
}
ProgressType progressType;
if (!progress)
if (!progress)
// 1st time. Start count.
progressType = PROGRESS_SET;
else if (progress->date < (nextDailyResetTime - 2 * DAY))
@@ -487,9 +487,9 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry *auction, uint32 item_templa
sScriptMgr.OnAuctionRemove(this, auction);
// we need to delete the entry, it is not referenced any more
delete auction;
return wasInMap;
// we need to delete the entry, it is not referenced any more
delete auction;
return wasInMap;
}
void AuctionHouseObject::Update()
@@ -120,7 +120,7 @@ class AuctionHouseMgr
friend class ACE_Singleton<AuctionHouseMgr, ACE_Null_Mutex>;
AuctionHouseMgr();
~AuctionHouseMgr();
public:
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
@@ -818,7 +818,7 @@ void Battleground::EndBattleground(uint32 winner)
{
if (IsRandom() || BattlegroundMgr::IsBGWeekend(GetTypeID()))
UpdatePlayerScore(plr, SCORE_BONUS_HONOR, GetBonusHonorFromKill(loos_kills));
}
}
plr->SetHealth(plr->GetMaxHealth());
@@ -1657,7 +1657,7 @@ void Battleground::SendWarningToAll(int32 entry, ...)
data << (uint64)0;
data << (uint32)0; // 2.1.0
data << (uint32)1;
data << (uint8)0;
data << (uint8)0;
data << (uint64)0;
data << (uint32)(strlen(msg.c_str())+1);
data << msg.c_str();
@@ -1754,7 +1754,7 @@ void Battleground::HandleKillPlayer(Player *player, Player *killer)
}
// to be able to remove insignia -- ONLY IN Battlegrounds
// give xp only in Battlegrounds
// give xp only in Battlegrounds
if (!isArena())
{
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
@@ -1909,7 +1909,7 @@ void Battleground::RewardXPAtKill(Player* plr, Player* victim)
if (victim->getLevel() > gray_level && (!not_gray_member_with_max_level
|| not_gray_member_with_max_level->getLevel() < member->getLevel()))
not_gray_member_with_max_level = member;
}
}
if (member_with_max_level)
{
@@ -1964,5 +1964,5 @@ void Battleground::RewardXPAtKill(Player* plr, Player* victim)
if (Pet* pet = plr->GetPet())
pet->GivePetXP(xp);
}
}
}
+1 -1
View File
@@ -264,7 +264,7 @@ enum BG_OBJECT_DMG_HIT_TYPE
BG_OBJECT_DMG_HIT_TYPE_DAMAGED = 1,
BG_OBJECT_DMG_HIT_TYPE_JUST_HIGH_DAMAGED = 2,
BG_OBJECT_DMG_HIT_TYPE_HIGH_DAMAGED = 3,
BG_OBJECT_DMG_HIT_TYPE_JUST_DESTROYED = 4
BG_OBJECT_DMG_HIT_TYPE_JUST_DESTROYED = 4
};
enum GroupJoinBattlegroundResult
@@ -40,7 +40,7 @@ class BattlegroundMgr
/* Construction */
friend class ACE_Singleton<BattlegroundMgr, ACE_Null_Mutex>;
BattlegroundMgr();
public:
~BattlegroundMgr();
void Update(uint32 diff);
@@ -402,7 +402,7 @@ void BattlegroundAB::_NodeDeOccupied(uint8 node)
if (node >= BG_AB_DYNAMIC_NODES_COUNT)
return;
//remove bonus honor aura trigger creature when node is lost
//remove bonus honor aura trigger creature when node is lost
if(node < BG_AB_DYNAMIC_NODES_COUNT)//only dynamic nodes, no start points
DelCreature(node+7);//NULL checks are in DelCreature! 0-6 spirit guides
@@ -319,7 +319,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
triggerSpawnID = AV_CPLACE_TRIGGER17;
newFaction = 84;
}
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
else if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0])
{
triggerSpawnID = AV_CPLACE_TRIGGER18;
newFaction = 83;
@@ -335,7 +335,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
{
trigger->setFaction(newFaction);
trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
}
}
}
return creature;
@@ -790,7 +790,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
if (!IsTower(node) && m_BgCreatures[node])
DelCreature(node);
//remove bonus honor aura trigger creature when node is lost
//remove bonus honor aura trigger creature when node is lost
if(node < BG_AV_NODES_MAX)//fail safe
DelCreature(node + 302);//NULL checks are in DelCreature! 0-302 spirit guides
}
@@ -612,7 +612,7 @@ enum BG_AV_CreaturePlace
AV_CPLACE_TRIGGER13 = 314,
AV_CPLACE_TRIGGER14 = 315,
AV_CPLACE_TRIGGER15 = 316,
//boss,captain triggers
AV_CPLACE_TRIGGER16 = 317,
AV_CPLACE_TRIGGER17 = 318,
@@ -696,7 +696,7 @@ void BattlegroundEY::EventTeamLostPoint(Player *Source, uint32 Point)
UpdatePointsIcons(Team, Point);
UpdatePointsCount(Team);
//remove bonus honor aura trigger creature when node is lost
//remove bonus honor aura trigger creature when node is lost
if (Point < EY_POINTS_MAX)
DelCreature(Point + 6);//NULL checks are in DelCreature! 0-5 spirit guides
}
@@ -155,7 +155,7 @@ bool BattlegroundSA::ResetObjs()
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF);
}
for (uint8 i = BG_SA_PORTAL_DEFFENDER_BLUE; i < BG_SA_BOMB; i++)
for (uint8 i = BG_SA_PORTAL_DEFFENDER_BLUE; i < BG_SA_BOMB; i++)
{
AddObject(i, BG_SA_ObjEntries[i],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
@@ -260,7 +260,7 @@ void BattlegroundSA::Update(uint32 diff)
InitSecondRound = false;
SendMessageToAll(LANG_BG_SA_ROUND_TWO_ONE_MINUTE, CHAT_MSG_BG_SYSTEM_NEUTRAL);
}
}else
}else
{
UpdateWaitTimer -= diff;
return;
@@ -277,7 +277,7 @@ void BattlegroundSA::Update(uint32 diff)
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
status = BG_SA_ROUND_ONE;
status = BG_SA_ROUND_ONE;
}
if (TotalTime >= BG_SA_BOAT_START)
StartShips();
@@ -287,7 +287,7 @@ void BattlegroundSA::Update(uint32 diff)
{
if (RoundScores[0].time<BG_SA_ROUNDLENGTH)
BG_SA_ENDROUNDTIME = RoundScores[0].time;
else
else
BG_SA_ENDROUNDTIME = BG_SA_ROUNDLENGTH;
if (TotalTime >= 60000)
@@ -319,7 +319,7 @@ void BattlegroundSA::Update(uint32 diff)
RoundScores[0].time = BG_SA_ROUNDLENGTH;
TotalTime = 0;
status = BG_SA_SECOND_WARMUP;
attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
attackers = (attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
@@ -511,7 +511,7 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint8 hit
GateStatus[i] = BG_SA_GATE_DAMAGED;
uint32 uws = GetWorldStateFromGateID(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
UpdateWorldState(uws, GateStatus[i]);
break;
}
case BG_OBJECT_DMG_HIT_TYPE_HIGH_DAMAGED:
@@ -586,7 +586,7 @@ void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroye
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws = GetWorldStateFromGateID(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
UpdateWorldState(uws, GateStatus[i]);
bool rewardHonor = true;
switch(i)
{
+1 -1
View File
@@ -711,7 +711,7 @@ void Channel::Invite(uint64 p, const char *newname)
SendToOne(&data, p);
return;
}
Player *plr = sObjectMgr.GetPlayer(p);
if (!plr)
return;
+2 -2
View File
@@ -274,7 +274,7 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args)
{
if (!*args)
return false;
uint32 entry = (uint32) atoi((char*)args);
QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT difficulty_entry_1,difficulty_entry_2,difficulty_entry_3,KillCredit1,KillCredit2,modelid1,modelid2,modelid3,modelid4,name,subname,IconName,gossip_menu_id,minlevel,maxlevel,exp,faction_A,faction_H,npcflag,speed_walk,speed_run,scale,rank,mindmg,maxdmg,dmgschool,attackpower,dmg_multiplier,baseattacktime,rangeattacktime,unit_class,unit_flags,dynamicflags,family,trainer_type,trainer_spell,trainer_class,trainer_race,minrangedmg,maxrangedmg,rangedattackpower,type,type_flags,lootid,pickpocketloot,skinloot,resistance1,resistance2,resistance3,resistance4,resistance5,resistance6,spell1,spell2,spell3,spell4,spell5,spell6,spell7,spell8,PetSpellDataId,VehicleId,mingold,maxgold,AIName,MovementType,InhabitType,Health_mod,Mana_mod,Armor_mod,RacialLeader,questItem1,questItem2,questItem3,questItem4,questItem5,questItem6,movementId,RegenHealth,equipment_id,mechanic_immune_mask,flags_extra,ScriptName FROM creature_template WHERE entry = %u", entry);
if (!result)
@@ -283,7 +283,7 @@ bool ChatHandler::HandleReloadCreatureTemplateCommand(const char* args)
SetSentErrorMessage(true);
return false;
}
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry);
if (!cInfo)
{
+1 -1
View File
@@ -256,7 +256,7 @@ void ThreatContainer::modifyThreatPercent(Unit *pVictim, int32 iPercent)
void ThreatContainer::update()
{
if (iDirty && iThreatList.size() >1)
{
{
iThreatList.sort(Trinity::ThreatOrderPred());
}
iDirty = false;
+2 -2
View File
@@ -268,8 +268,8 @@ namespace Trinity
public:
ThreatOrderPred(bool ascending = false) : m_ascending(ascending) {}
bool operator() (const HostileReference *a, const HostileReference *b) const
{
return m_ascending ? a->getThreat() < b->getThreat() : a->getThreat() > b->getThreat();
{
return m_ascending ? a->getThreat() < b->getThreat() : a->getThreat() > b->getThreat();
}
private:
const bool m_ascending;
+1 -1
View File
@@ -127,7 +127,7 @@ class ConditionMgr
friend class ACE_Singleton<ConditionMgr, ACE_Null_Mutex>;
ConditionMgr();
~ConditionMgr();
public:
void LoadConditions(bool isReload = false);
+1 -1
View File
@@ -1105,7 +1105,7 @@ struct LFGDungeonEntry
//char* name[16]; // 1-17 Name lang
uint32 minlevel; // 18
uint32 maxlevel; // 19
uint32 reclevel; // 20
uint32 reclevel; // 20
uint32 recminlevel; // 21
uint32 recmaxlevel; // 22
int32 map; // 23
@@ -1265,7 +1265,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
}
uint32 curhealth;
if (!m_regenHealth)
{
curhealth = data->curhealth;
@@ -1609,7 +1609,7 @@ void Creature::Respawn(bool force)
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<Creature>(GetDBTableGUIDLow()) : 0;
if (poolid)
sPoolMgr.UpdatePool<Creature>(poolid, GetDBTableGUIDLow());
//Re-initialize reactstate that could be altered by movementgenerators
InitializeReactState();
}
+1 -1
View File
@@ -427,7 +427,7 @@ class Creature : public Unit, public GridObject<Creature>
bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; }
bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; }
//bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; }
void SetReactState(ReactStates st) { m_reactState = st; }
ReactStates GetReactState() { return m_reactState; }
bool HasReactState(ReactStates state) const { return (m_reactState == state); }
+1 -1
View File
@@ -1071,7 +1071,7 @@ bool Item::IsBindedNotWith(Player const* player) const
// BOA item case
if (IsBoundAccountWide())
return false;
return true;
}
@@ -93,8 +93,8 @@ uint32 GetItemEnchantMod(int32 entry)
if (entry == -1)
return 0;
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
if (tab == RandomItemEnch.end())
{
sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry);
+3 -3
View File
@@ -418,11 +418,11 @@ struct Position
Position::PositionXYZStreamer PositionXYZStream()
{
return Position::PositionXYZStreamer(*this);
return Position::PositionXYZStreamer(*this);
}
Position::PositionXYZOStreamer PositionXYZOStream()
{
return Position::PositionXYZOStreamer(*this);
return Position::PositionXYZOStreamer(*this);
}
bool IsPositionValid() const;
@@ -808,7 +808,7 @@ namespace Trinity
_list.erase(itr);
}
}
// Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
class ObjectDistanceOrderPred
{
+4 -4
View File
@@ -4361,7 +4361,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
uint32 charDelete_method = sWorld.getConfig(CONFIG_CHARDELETE_METHOD);
uint32 charDelete_minLvl = sWorld.getConfig(CONFIG_CHARDELETE_MIN_LEVEL);
// if we want to finally delete the character or the character does not meet the level requirement,
// if we want to finally delete the character or the character does not meet the level requirement,
// we set it to mode CHAR_DELETE_REMOVE
if (deleteFinally || Player::GetLevelFromDB(playerguid) < charDelete_minLvl)
charDelete_method = CHAR_DELETE_REMOVE;
@@ -4530,7 +4530,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
sLog.outError("Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
}
if (updateRealmChars)
if (updateRealmChars)
sWorld.UpdateRealmCharCount(accountId);
}
@@ -7877,7 +7877,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32
// Apply spell mods
ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance);
// Shiv has 100% chance to apply the poison
if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT)
chance = 100.0f;
@@ -12207,7 +12207,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
{
// change item amount before check (for unique max count check)
pSrcItem->SetCount(pSrcItem->GetCount() - count);
ItemPosCountVec dest;
uint8 msg = CanStoreItem(dstbag, dstslot, dest, pNewItem, false);
if (msg != EQUIP_ERR_OK)
+1 -1
View File
@@ -840,7 +840,7 @@ struct AccessRequirement
enum CharDeleteMethod
{
CHAR_DELETE_REMOVE = 0, // Completely remove from the database
CHAR_DELETE_UNLINK = 1 // The character gets unlinked from the account,
CHAR_DELETE_UNLINK = 1 // The character gets unlinked from the account,
// the name gets freed up and appears as deleted ingame
};
@@ -250,7 +250,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
return false;
TaxiPathNodeList const& path = sTaxiPathNodesByPath[pathid];
std::vector<keyFrame> keyFrames;
int mapChange = 0;
mapids.clear();
@@ -516,7 +516,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
UpdateForMap(oldMap);
UpdateForMap(newMap);
}
for (std::set<TransportCreatureProto *>::const_iterator i = sMapMgr.m_TransportNPCMap[GetEntry()].begin(); i != sMapMgr.m_TransportNPCMap[GetEntry()].end(); ++i)
{
TransportCreatureProto *proto = (*i);
@@ -660,7 +660,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y,
pCreature->Relocate(
GetPositionX() + (x * cos(GetOrientation()) + y * sin(GetOrientation() + M_PI)),
GetPositionY() + (y * cos(GetOrientation()) + x * sin(GetOrientation())),
z + GetPositionZ() ,
z + GetPositionZ() ,
o + GetOrientation());
if(!pCreature->IsPositionValid())
@@ -64,7 +64,7 @@ class Transport : public GameObject
struct WayPoint
{
WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false), id(0) {}
WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, uint32 _id = 0,
WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, uint32 _id = 0,
uint32 _arrivalEventID = 0, uint32 _departureEventID = 0)
: mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), id(_id),
arrivalEventID(_arrivalEventID), departureEventID(_departureEventID)
+6 -6
View File
@@ -3617,7 +3617,7 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster)
{
AuraEffect *existingEff = foundAura->GetEffect(i);
AuraEffect *newEff = aura->GetEffect(i);
if (!existingEff || !newEff)
if (!existingEff || !newEff)
continue;
newEff->SetPeriodicTimer(existingEff->GetPeriodicTimer());
}
@@ -4427,7 +4427,7 @@ void Unit::RemoveAllAuras()
AuraApplicationMap::iterator aurAppIter;
for (aurAppIter = m_appliedAuras.begin(); aurAppIter != m_appliedAuras.end();)
_UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
AuraMap::iterator aurIter;
for (aurIter = m_ownedAuras.begin(); aurIter != m_ownedAuras.end();)
RemoveOwnedAura(aurIter);
@@ -7738,7 +7738,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
}
default:
break;
}
}
// if not handled by custom case, get triggered spell from dummySpell proto
if (!triggered_spell_id)
@@ -7914,7 +7914,7 @@ bool Unit::HandleAuraProc(Unit * pVictim, uint32 damage, Aura * triggeredByAura,
int32 bp0 = (damage/12) * SpellMgr::CalculateSpellEffectAmount(dummySpell, 2)/100;
CastCustomSpell(pVictim, 66922, &bp0, NULL, NULL, true);
return true;
}
}
}
// but should not proc on non-critical Holy Shocks
else if ((procSpell->SpellFamilyFlags[0] & 0x200000 || procSpell->SpellFamilyFlags[1] & 0x10000) && !(procEx & PROC_EX_CRITICAL_HIT))
@@ -9803,7 +9803,7 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro
// calculate heal absorb and reduce healing
CalcHealAbsorb(pVictim, spellProto, addhealth, absorb);
int32 gain = 0;
if (addhealth)
gain = pVictim->ModifyHealth(int32(addhealth));
@@ -10572,7 +10572,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
// Mobs can't crit with spells.
if (IS_CREATURE_GUID(GetGUID()))
return false;
// not critting spell
if ((spellProto->AttributesEx2 & SPELL_ATTR_EX2_CANT_CRIT))
return false;
+7 -7
View File
@@ -691,7 +691,7 @@ enum MovementFlags2
MOVEMENTFLAG2_UNK8 = 0x00000080,
MOVEMENTFLAG2_UNK9 = 0x00000100,
MOVEMENTFLAG2_UNK10 = 0x00000200,
MOVEMENTFLAG2_INTERPOLATED_MOVEMENT = 0x00000400,
MOVEMENTFLAG2_INTERPOLATED_MOVEMENT = 0x00000400,
MOVEMENTFLAG2_INTERPOLATED_TURNING = 0x00000800,
MOVEMENTFLAG2_INTERPOLATED_PITCHING = 0x00001000,
MOVEMENTFLAG2_UNK14 = 0x00002000,
@@ -699,7 +699,7 @@ enum MovementFlags2
MOVEMENTFLAG2_UNK16 = 0x00008000,
// player only?
MOVEMENTFLAG2_INTERPOLATED =
MOVEMENTFLAG2_INTERPOLATED =
MOVEMENTFLAG2_INTERPOLATED_MOVEMENT |
MOVEMENTFLAG2_INTERPOLATED_TURNING |
MOVEMENTFLAG2_INTERPOLATED_PITCHING
@@ -2108,7 +2108,7 @@ namespace Trinity
public:
PowerPctOrderPred(Powers power, bool ascending = true) : m_power(power), m_ascending(ascending) {}
bool operator() (const Unit *a, const Unit *b) const
{
{
float rA = a->GetMaxPower(m_power) ? float(a->GetPower(m_power)) / float(a->GetMaxPower(m_power)) : 0.0f;
float rB = b->GetMaxPower(m_power) ? float(b->GetPower(m_power)) / float(b->GetMaxPower(m_power)) : 0.0f;
return m_ascending ? rA < rB : rA > rB;
@@ -2117,14 +2117,14 @@ namespace Trinity
const Powers m_power;
const bool m_ascending;
};
// Binary predicate for sorting Units based on percent value of health
class HealthPctOrderPred
{
public:
HealthPctOrderPred(bool ascending = true) : m_ascending(ascending) {}
bool operator() (const Unit *a, const Unit *b) const
{
{
float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
return m_ascending ? rA < rB : rA > rB;
@@ -2150,14 +2150,14 @@ inline void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 star
data << uint32(((GetUnitMovementFlags() & MOVEMENTFLAG_LEVITATING) || isInFlight()) ? (SPLINEFLAG_FLYING|SPLINEFLAG_WALKING) : SPLINEFLAG_WALKING);
data << uint32(traveltime);
data << uint32(pathSize);
for (uint32 i = start; i < end; ++i)
{
data << float(path[i].x);
data << float(path[i].y);
data << float(path[i].z);
}
SendMessageToSet(&data, true);
}
#endif
+1 -1
View File
@@ -39,7 +39,7 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI
++m_usableSeatNum;
}
}
// HACKY WAY, We must found a more generic way to handle this
// Set inmunities since db ones are rewritten with player's ones
switch (GetVehicleInfo()->m_ID)
+7 -7
View File
@@ -526,7 +526,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo)
ok2 = false;
if (difficultyEntries[diff2].find(cInfo->Entry) != difficultyEntries[diff2].end())
{
sLog.outErrorDb("Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
sLog.outErrorDb("Creature (Entry: %u) is listed as `difficulty_entry_%u` of another creature, but itself lists %u in `difficulty_entry_%u`.",
cInfo->Entry, diff2 + 1, cInfo->DifficultyEntry[diff], diff + 1);
continue;
}
@@ -2284,12 +2284,12 @@ void ObjectMgr::LoadItemPrototypes()
// To be implemented later
if (proto->RandomProperty == -1)
const_cast<ItemPrototype*>(proto)->RandomProperty = 0;
else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty)))
{
sLog.outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty);
const_cast<ItemPrototype*>(proto)->RandomProperty = 0;
}
}
}
if (proto->RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(proto->RandomSuffix)))
@@ -2716,7 +2716,7 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
if (!found)
sLog.outErrorDb("Item %u specified to be removed from original create info not found in dbc!", itemId);
if (!doneOne)
doneOne = true;
else
@@ -3585,7 +3585,7 @@ void ObjectMgr::LoadGroups()
{
bar2.step();
fields = result->Fetch();
if (groupLowGuid != fields[0].GetUInt32())
{
groupLowGuid = fields[0].GetUInt32();
@@ -4761,7 +4761,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
tablename, tmp.datalong2, tmp.id);
continue;
}
break;
break;
}
}
@@ -8439,7 +8439,7 @@ void ObjectMgr::LoadGossipMenu()
GossipMenus gMenu;
gMenu.entry = fields[0].GetUInt32();
gMenu.text_id = fields[1].GetUInt32();
gMenu.text_id = fields[1].GetUInt32();
if (!GetGossipText(gMenu.text_id))
{
+1 -1
View File
@@ -360,7 +360,7 @@ class ObjectMgr
friend class ACE_Singleton<ObjectMgr, ACE_Null_Mutex>;
ObjectMgr();
~ObjectMgr();
public:
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
@@ -1203,7 +1203,7 @@ namespace Trinity
class GameObjectInRangeCheck
{
public:
GameObjectInRangeCheck(float _x, float _y, float _z, float _range, uint32 _entry = 0) :
GameObjectInRangeCheck(float _x, float _y, float _z, float _range, uint32 _entry = 0) :
x(_x), y(_y), z(_z), range(_range), entry(_entry) {}
bool operator() (GameObject* go)
{
+4 -4
View File
@@ -1461,7 +1461,7 @@ void Group::ChangeMembersGroup(Player *player, const uint8 &group)
{
if (!player || !isRaidGroup())
return;
uint8 prevSubGroup = player->GetSubGroup();
if (prevSubGroup == group)
return;
@@ -1773,12 +1773,12 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
{
if (!mapEntry)
return NULL;
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
// some instances only have one difficulty
MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapEntry->MapID,difficulty);
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID);
if (itr != m_boundInstances[difficulty].end())
return &itr->second;
+3 -3
View File
@@ -122,9 +122,9 @@ class InstanceSaveManager
friend class ACE_Singleton<InstanceSaveManager, ACE_Null_Mutex>;
friend class InstanceSave;
public:
InstanceSaveManager() : lock_instLists(false) {};
InstanceSaveManager() : lock_instLists(false) {};
~InstanceSaveManager();
typedef UNORDERED_MAP<uint32 /*InstanceId*/, InstanceSave*> InstanceSaveHashMap;
typedef UNORDERED_MAP<uint32 /*mapId*/, InstanceSaveHashMap> InstanceSaveMapMap;
@@ -177,7 +177,7 @@ class InstanceSaveManager
uint32 GetNumBoundGroupsTotal();
private:
void _ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, uint32 timeleft);
void _ResetInstance(uint32 mapid, uint32 instanceId);
void _ResetSave(InstanceSaveHashMap::iterator &itr);
+4 -4
View File
@@ -326,9 +326,9 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const
// Constructor, copies most fields from LootStoreItem and generates random count
LootItem::LootItem(LootStoreItem const& li)
{
itemid = li.itemid;
itemid = li.itemid;
conditions = li.conditions;
ItemPrototype const* proto = sObjectMgr.GetItemPrototype(itemid);
freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_PARTY_LOOT);
@@ -392,7 +392,7 @@ void Loot::AddItem(LootStoreItem const & item)
{
if (quest_items.size() < MAX_NR_QUEST_ITEMS)
quest_items.push_back(LootItem(item));
}
}
else if (items.size() < MAX_NR_LOOT_ITEMS) // Non-quest drop
{
items.push_back(LootItem(item));
@@ -1342,7 +1342,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
{
if ((*i).itemid == cond->mSourceEntry)
{
(*i).conditions.push_back(cond);
(*i).conditions.push_back(cond);
return true;
}
}
+15 -15
View File
@@ -2749,9 +2749,9 @@ inline Player* Map::_GetScriptPlayerSourceOrTarget(Object* source, Object* targe
pPlayer = source->ToPlayer();
if (!pPlayer)
sLog.outError("%s (script id: %u) neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
sLog.outError("%s (script id: %u) neither source nor target object is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
sCommandName, unScriptID,
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
}
return pPlayer;
@@ -2782,9 +2782,9 @@ inline Creature* Map::_GetScriptCreatureSourceOrTarget(Object* source, Object* t
}
if (!pCreature)
sLog.outError("%s (script id: %u) neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
sLog.outError("%s (script id: %u) neither source nor target are creatures (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
sCommandName, unScriptID,
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
}
return pCreature;
@@ -2868,13 +2868,13 @@ inline void Map::_ScriptProcessDoor(Object* source, Object* target, bool bOpen,
if (!wSource)
sLog.outError("%s (script id: %u) source object could not be casted to world object (TypeId: %u, Entry: %u, GUID: %u), skipping.",
sCommandName, unScriptID, source->GetTypeId(), source->GetEntry(), source->GetGUIDLow());
else
else
{
GameObject *pDoor = _FindGameObject(wSource, guid);
if (!pDoor)
sLog.outError("%s (script id: %u) gameobject was not found (guid: %u).", sCommandName, unScriptID, guid);
else if (pDoor->GetGoType() != GAMEOBJECT_TYPE_DOOR)
sLog.outError("%s (script id: %u) gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
sLog.outError("%s (script id: %u) gameobject is not a door (GoType: %u, Entry: %u, GUID: %u).",
sCommandName, unScriptID, pDoor->GetGoType(), pDoor->GetEntry(), pDoor->GetGUIDLow());
else if (bOpen == (pDoor->GetGoState() == GO_STATE_READY))
{
@@ -3120,7 +3120,7 @@ void Map::ScriptsProcess()
cSource->NearTeleportTo(step.script->x, step.script->y, step.script->z, step.script->o);
break;
default:
sLog.outError("SCRIPT_COMMAND_TELEPORT_TO (script id: %u) unknown datalong2 flag (%u), skipping.",
sLog.outError("SCRIPT_COMMAND_TELEPORT_TO (script id: %u) unknown datalong2 flag (%u), skipping.",
step.script->id, step.script->datalong2);
}
break;
@@ -3142,7 +3142,7 @@ void Map::ScriptsProcess()
if (WorldObject* pSummoner = _GetScriptWorldObject(source, true, step.script->id, "SCRIPT_COMMAND_TEMP_SUMMON_CREATURE"))
{
if (!step.script->datalong)
sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (script id: %u) creature entry (datalong) is not specified.",
sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON_CREATURE (script id: %u) creature entry (datalong) is not specified.",
step.script->id);
else
{
@@ -3152,7 +3152,7 @@ void Map::ScriptsProcess()
float o = step.script->o;
if (pSummoner->SummonCreature(step.script->datalong, x, y, z, o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, step.script->datalong2))
sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON (script id: %u) creature was not spawned (entry: %u).",
sLog.outError("SCRIPT_COMMAND_TEMP_SUMMON (script id: %u) creature was not spawned (entry: %u).",
step.script->id, step.script->datalong);
}
}
@@ -3172,7 +3172,7 @@ void Map::ScriptsProcess()
GameObject *pGO = _FindGameObject(pSummoner, step.script->datalong);
if (!pGO)
{
sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id: %u) gameobject was not found (guid: %u).",
sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id: %u) gameobject was not found (guid: %u).",
step.script->id, step.script->datalong);
break;
}
@@ -3182,7 +3182,7 @@ void Map::ScriptsProcess()
pGO->GetGoType() == GAMEOBJECT_TYPE_BUTTON ||
pGO->GetGoType() == GAMEOBJECT_TYPE_TRAP)
{
sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id: %u) can not be used with gameobject of type %u (guid: %u).",
sLog.outError("SCRIPT_COMMAND_RESPAWN_GAMEOBJECT (script id: %u) can not be used with gameobject of type %u (guid: %u).",
step.script->id, uint32(pGO->GetGoType()), step.script->datalong);
break;
}
@@ -3245,15 +3245,15 @@ void Map::ScriptsProcess()
}
else
{
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) neither source nor target is player (source: TypeId: %u, Entry: %u, GUID: %u; target: TypeId: %u, Entry: %u, GUID: %u), skipping.",
step.script->id,
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
source ? source->GetTypeId() : 0, source ? source->GetEntry() : 0, source ? source->GetGUIDLow() : 0,
target ? target->GetTypeId() : 0, target ? target->GetEntry() : 0, target ? target->GetGUIDLow() : 0);
break;
}
// quest id and flags checked at script loading
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
(step.script->datalong2 == 0 || worldObject->IsWithinDistInMap(pTarget, float(step.script->datalong2))))
pTarget->AreaExploredOrEventHappens(step.script->datalong);
else
@@ -3479,7 +3479,7 @@ void Map::ScriptsProcess()
if (Creature *cSource = _GetScriptCreatureSourceOrTarget(source, target, step.script->id, "SCRIPT_COMMAND_KILL"))
{
if (cSource->isDead())
sLog.outError("SCRIPT_COMMAND_KILL (script id: %u) creature is already dead (Entry: %u, GUID: %u)",
sLog.outError("SCRIPT_COMMAND_KILL (script id: %u) creature is already dead (Entry: %u, GUID: %u)",
step.script->id, cSource->GetEntry(), cSource->GetGUIDLow());
else
{
+1 -1
View File
@@ -35,7 +35,7 @@ namespace Trinity
sScriptMgr.OnHonorCalculation(honor, level, count);
return honor;
}
inline uint32 hk_honor_at_level(uint8 level, uint32 count = 1)
{
uint32 honor = ceil(hk_honor_at_level_f(level, count));
@@ -53,7 +53,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
float wanderY = y + wander_distance*rand_norm() - wander_distance/2;
Trinity::NormalizeMapCoord(wanderX);
Trinity::NormalizeMapCoord(wanderY);
float new_z = map->GetHeight(wanderX, wanderY, z, true);
if (new_z > INVALID_HEIGHT && unit.IsWithinLOS(wanderX, wanderY, new_z))
{
@@ -68,7 +68,7 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
i_waypoints[idx][2] = idx > 0 ? i_waypoints[idx-1][2] : z;
continue;
}
// Taken from FleeingMovementGenerator
if (!(new_z - z) || wander_distance / fabs(new_z - z) > 1.0f)
{
@@ -292,7 +292,7 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff)
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, (*i_path)[i_currentNode].x, (*i_path)[i_currentNode].y, (*i_path)[i_currentNode].z, false);
}
// check if it's time to preload the flightmaster grid at path end
if (i_currentNode == m_preloadTargetNode)
PreloadEndGrid();
@@ -54,7 +54,7 @@ class PathMovementBase
void LoadPath(T &);
void ReloadPath(T &);
uint32 GetCurrentNode() const { return i_currentNode; }
bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; }
bool GetPosition(float& x, float& y, float& z) const { i_destinationHolder.GetLocationNowNoMicroMovement(x,y,z); return true; }
+2 -2
View File
@@ -53,7 +53,7 @@ class Path
}
return len;
}
float GetTotalLength() const { return GetTotalLength(0,size()); }
float GetPassedLength(uint32 curnode, float x, float y, float z)
@@ -74,7 +74,7 @@ class Path
PathNode& operator[](size_t idx) { return i_nodes[idx]; }
PathNode const& operator[](size_t idx) const { return i_nodes[idx]; }
void set(size_t idx, PathElem elem) { i_nodes[idx] = elem; }
protected:
+1 -1
View File
@@ -141,7 +141,7 @@ enum __QuestFlags
QUEST_FLAGS_AUTOCOMPLETE = 0x00010000, // auto complete
QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with ReqItemId and SrcItemId
QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text
QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future.
QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future.
// Trinity flags for set SpecialFlags in DB if required but used only at server
QUEST_TRINITY_FLAGS_REPEATABLE = 0x00100000, // Set by 1 in SpecialFlags from DB
+1 -1
View File
@@ -149,7 +149,7 @@ void ReputationMgr::SendState(FactionState const* faction) const
size_t p_count = data.wpos();
data << (uint32) count; // placeholder
data << (uint32) faction->ReputationListID;
data << (uint32) faction->Standing;
+14 -14
View File
@@ -479,7 +479,7 @@ class CreatureScript : public ScriptObject, public UpdatableScript<Creature>
public:
bool IsDatabaseBound() const { return true; }
// Called when a dummy spell effect is triggered on the creature.
virtual bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, Creature* target) { return false; }
@@ -524,25 +524,25 @@ class GameObjectScript : public ScriptObject, public UpdatableScript<GameObject>
public:
bool IsDatabaseBound() const { return true; }
// Called when a dummy spell effect is triggered on the gameobject.
virtual bool OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex, GameObject* target) { return false; }
// Called when a player opens a gossip dialog with the gameobject.
virtual bool OnGossipHello(Player* player, GameObject* go) { return false; }
// Called when a player selects a gossip item in the gameobject's gossip menu.
virtual bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action) { return false; }
// Called when a player selects a gossip with a code in the gameobject's gossip menu.
virtual bool OnGossipSelectCode(Player* player, GameObject* go, uint32 sender, uint32 action, const char* code) { return false; }
// Called when a player accepts a quest from the gameobject.
virtual bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest) { return false; }
// Called when a player selects a quest reward.
virtual bool OnQuestReward(Player* player, GameObject* go, Quest const* quest, uint32 opt) { return false; }
// Called when the dialog status between a player and the gameobject is requested.
virtual uint32 GetDialogStatus(Player* player, GameObject* go) { return 0; }
@@ -953,26 +953,26 @@ class ScriptMgr
{
// Counter used for code-only scripts.
static uint32 _scriptIdCounter;
public:
typedef std::map<uint32, TScript*> ScriptMap;
typedef typename ScriptMap::iterator ScriptMapIterator;
// The actual list of scripts. This will be accessed concurrently, so it must not be modified
// after server startup.
static ScriptMap ScriptPointerList;
// Gets a script by its ID (assigned by ObjectMgr).
static TScript* GetScriptById(uint32 id)
{
ScriptMapIterator it = ScriptPointerList.find(id);
if (it != ScriptPointerList.end())
return it->second;
return NULL;
}
// Attempts to add a new script to the list.
static void AddScript(TScript* const script);
};
@@ -31,7 +31,7 @@ class AddonHandler
/* Construction */
friend class ACE_Singleton<AddonHandler, ACE_Null_Mutex>;
AddonHandler();
public:
~AddonHandler();
//build addon packet
@@ -146,7 +146,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
_player->GetSession()->SendPacket(&data);
return;
}
if (_player->InBattlegroundQueue() && bgTypeId == BATTLEGROUND_RB)
{
//player is already in queue, can't start random queue
@@ -471,7 +471,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
LoginDatabase.PExecute("INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (%u, %u, %u)", charcount, GetAccountId(), realmID);
pNewChar->CleanupsBeforeDelete();
data << (uint8)CHAR_CREATE_SUCCESS;
SendPacket(&data);
@@ -546,7 +546,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
uint8 groupNr;
recv_data >> name;
recv_data >> groupNr;
if (groupNr >= MAX_RAID_SUBGROUPS)
return;
@@ -561,7 +561,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
Player *movedPlayer = sObjectMgr.GetPlayer(name.c_str());
if (movedPlayer)
{
{
//Do not allow leader to change group of player in combat
if (movedPlayer->isInCombat())
return;
@@ -38,7 +38,7 @@
#include "Guild.h"
#include "ScriptMgr.h"
enum StableResultCode
enum StableResultCode
{
STABLE_ERR_MONEY = 0x01, // "you don't have enough money"
STABLE_ERR_STABLE = 0x06, // currently used in most fail cases
@@ -416,7 +416,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
if (guid == GetPlayer()->GetGUID())
{
if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
{
{
DEBUG_LOG("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
return false;
}
+4 -4
View File
@@ -174,12 +174,12 @@ bool WorldSession::Update(uint32 diff)
{
/// Update Timeout timer.
UpdateTimeOutTime(diff);
///- Before we process anything:
///- Before we process anything:
/// If necessary, kick the player from the character select screen
if (IsConnectionIdle())
m_Socket->CloseSocket();
///- Retrieve packets from the receive queue and call the appropriate handlers
/// not proccess packets if socket already closed
WorldPacket* packet;
@@ -261,7 +261,7 @@ bool WorldSession::Update(uint32 diff)
// and before other STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes.
if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL)
m_playerRecentlyLogout = false;
sScriptMgr.OnPacketReceive(m_Socket, WorldPacket(*packet));
(this->*opHandle.handler)(*packet);
if (sLog.IsOutDebug() && packet->rpos() < packet->wpos())
+7 -7
View File
@@ -114,7 +114,7 @@ m_OverSpeedPings(0),
m_LastPingTime(ACE_Time_Value::zero)
{
reference_counting_policy().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
msg_queue()->high_water_mark(8*1024*1024);
msg_queue()->low_water_mark(8*1024*1024);
}
@@ -265,7 +265,7 @@ int WorldSocket::open (void *a)
}
m_Address = remote_addr.get_host_addr();
// Send startup packet.
WorldPacket packet (SMSG_AUTH_CHALLENGE, 24);
packet << uint32(1); // 1...31
@@ -281,14 +281,14 @@ int WorldSocket::open (void *a)
if (SendPacket(packet) == -1)
return -1;
// Register with ACE Reactor
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
{
sLog.outError ("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
return -1;
}
// reactor takes care of the socket from now on
remove_reference();
@@ -721,7 +721,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
sLog.outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again");
return -1;
}
sScriptMgr.OnPacketReceive(this, WorldPacket(*new_pct));
return HandleAuthSession (*new_pct);
case CMSG_KEEP_ALIVE:
@@ -737,7 +737,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct)
// Our Idle timer will reset on any non PING opcodes.
// Catches people idling on the login screen and any lingering ingame connections.
m_Session->ResetTimeOutTime();
// OK ,give the packet to WorldSession
aptr.release();
// WARNINIG here we call it with locks held.
@@ -997,7 +997,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
m_Session->LoadTutorialsData();
m_Session->ReadAddonsInfo(recvPacket);
// Sleep this Network thread for
// Sleep this Network thread for
uint32 sleepTime = sWorld.getConfig(CONFIG_SESSION_ADD_DELAY);
ACE_OS::sleep (ACE_Time_Value (0, sleepTime));
+1 -1
View File
@@ -157,7 +157,7 @@ class WorldSocket : protected WorldHandler
/// @param g the guard is for m_OutBufferLock, the function will release it
int cancel_wakeup_output (GuardType& g);
int schedule_wakeup_output (GuardType& g);
/// Drain the queue if its not empty.
int handle_output_queue (GuardType& g);
+1 -1
View File
@@ -250,7 +250,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
m_NetThreads = new ReactorRunnable[m_NetThreadsCount];
sLog.outBasic ("Max allowed socket connections %d", ACE::max_handles());
// -1 means use default
m_SockOutKBuff = sConfig.GetIntDefault ("Network.OutKBuff", -1);
+1 -1
View File
@@ -53,7 +53,7 @@ public:
/// Make this class singleton .
static WorldSocketMgr* Instance();
private:
int OnSocketOpen(WorldSocket* sock);
@@ -1498,7 +1498,7 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
float maxval = target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
if (maxval)
TakenTotalMod *= (100.0f + maxval) / 100.0f;
// Healing over time taken percent
float minval_hot = target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
if (minval_hot)
@@ -6287,5 +6287,5 @@ void AuraEffect::HandleAuraOpenStable(AuraApplication const * aurApp, uint8 mode
if (apply)
target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
// client auto close stable dialog at !apply aura
// client auto close stable dialog at !apply aura
}
+2 -2
View File
@@ -482,8 +482,8 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
for (std::map<Unit *, uint8>::iterator itr = targets.begin(); itr!= targets.end();)
{
bool addUnit = true;
// check target immunities
if (itr->first->IsImmunedToSpell(GetSpellProto())
// check target immunities
if (itr->first->IsImmunedToSpell(GetSpellProto())
|| !CanBeAppliedOn(itr->first))
addUnit = false;
+4 -4
View File
@@ -819,7 +819,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect const * /*triggeredByAura*/)
}
break;
}
case SPELLFAMILY_WARLOCK:
case SPELLFAMILY_WARLOCK:
{
// For Hellfire Effect / Rain of Fire - trigger as DOT
if (m_spellInfo->SpellFamilyFlags[0] & 0x60)
@@ -1740,7 +1740,7 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNo
{
if (TargetType == SPELL_TARGETS_GO)
return;
Position *pos;
switch(type)
{
@@ -2658,7 +2658,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
}
}
}
// Other special target selection goes here
if (uint32 maxTargets = m_spellValue->MaxAffectedTargets)
{
@@ -5273,7 +5273,7 @@ SpellCastResult Spell::CheckCast(bool strict)
(!pTempItem || !pTempItem->GetProto()->LockID || !pTempItem->IsLocked()))
return SPELL_FAILED_BAD_TARGETS;
if (m_spellInfo->Id != 1842 || m_targets.getGOTarget() &&
if (m_spellInfo->Id != 1842 || m_targets.getGOTarget() &&
m_targets.getGOTarget()->GetGOInfo()->type != GAMEOBJECT_TYPE_TRAP)
if (m_caster->ToPlayer()->InBattleground() && // In Battleground players can use only flags and banners
!m_caster->ToPlayer()->CanUseBattlegroundObject())
+17 -17
View File
@@ -219,7 +219,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
&Spell::EffectTriggerRitualOfSummoning, //151 SPELL_EFFECT_TRIGGER_SPELL_2
&Spell::EffectNULL, //152 SPELL_EFFECT_152 summon Refer-a-Friend
&Spell::EffectCreateTamedPet, //153 SPELL_EFFECT_CREATE_TAMED_PET misc value is creature entry
&Spell::EffectDiscoverTaxi, //154 SPELL_EFFECT_DISCOVER_TAXI
&Spell::EffectDiscoverTaxi, //154 SPELL_EFFECT_DISCOVER_TAXI
&Spell::EffectTitanGrip, //155 SPELL_EFFECT_TITAN_GRIP Allows you to equip two-handed axes, maces and swords in one hand, but you attack $49152s1% slower than normal.
&Spell::EffectEnchantItemPrismatic, //156 SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
&Spell::EffectCreateItem2, //157 SPELL_EFFECT_CREATE_ITEM_2 create item or create item template and replace by some randon spell loot item
@@ -431,7 +431,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage = (m_caster->getLevel() - 60) * 4 + 60;
break;
}
// Loken Pulsing Shockwave
case 59837:
case 52942:
@@ -439,7 +439,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
// don't damage self and only players
if(unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0]));
if (!radius)
return;
@@ -929,15 +929,15 @@ void Spell::EffectDummy(uint32 i)
return;
}
case 14537: // Six Demon Bag
{
if( !unitTarget || !unitTarget->isAlive()) return;
{
if( !unitTarget || !unitTarget->isAlive()) return;
uint32 ClearSpellId[6] =
{
15662, // Fireball
11538, // Frostball
21179, // Chain Lightning
14621, // Polymorph
uint32 ClearSpellId[6] =
{
15662, // Fireball
11538, // Frostball
21179, // Chain Lightning
14621, // Polymorph
25189, // Enveloping Winds
14642 // Summon Felhund minion
};
@@ -956,7 +956,7 @@ void Spell::EffectDummy(uint32 i)
effect = ClearSpellId[3];
if (urand(0, 100) <= 30) // 30% chance to self-cast
unitTarget = m_caster;
}
}
else if (rand >=80 && rand < 95) // Enveloping Winds (15% chance)
effect = ClearSpellId[4];
else // Summon Felhund minion (5% chance)
@@ -966,7 +966,7 @@ void Spell::EffectDummy(uint32 i)
}
m_caster->CastSpell(unitTarget, effect, true);
return;
return;
}
case 16589: // Noggenfogger Elixir
{
@@ -1553,7 +1553,7 @@ void Spell::EffectDummy(uint32 i)
switch (m_spellInfo->Id)
{
case 11689: spFactor = 0.2; break;
case 27222:
case 27222:
case 57946: spFactor = 0.5; break;
default: spFactor = 0; break;
}
@@ -2297,7 +2297,7 @@ void Spell::EffectTeleportUnits(uint32 /*i*/)
case 60321: // Scroll of Recal III
if (!uiMaxSafeLevel)
uiMaxSafeLevel = 80;
if (unitTarget->getLevel() > uiMaxSafeLevel)
{
unitTarget->AddAura(60444,unitTarget); //Apply Lost! Aura
@@ -6714,7 +6714,7 @@ void Spell::EffectKnockBack(uint32 i)
else //if (m_spellInfo->Effect[i] == SPELL_EFFECT_KNOCK_BACK)
{
m_caster->GetPosition(x, y);
}
}
unitTarget->KnockbackFrom(x, y, speedxy, speedz);
}
@@ -6742,7 +6742,7 @@ void Spell::EffectQuestClear(uint32 i)
pPlayer = m_caster->ToPlayer();
else if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER)
pPlayer = unitTarget->ToPlayer();
if (!pPlayer)
return;
+2 -2
View File
@@ -171,7 +171,7 @@ Unit * SpellScript::GetCaster()
Unit * SpellScript::GetOriginalCaster()
{
return m_spell->GetOriginalCaster();
return m_spell->GetOriginalCaster();
}
SpellEntry const * SpellScript::GetSpellInfo()
@@ -188,7 +188,7 @@ WorldLocation * SpellScript::GetDest()
Unit * SpellScript::GetHitUnit()
{
return m_spell->unitTarget;
return m_spell->unitTarget;
}
Creature * SpellScript::GetHitCreature()
+5 -5
View File
@@ -78,7 +78,7 @@ class _SpellScript
//
// SpellScript/AuraScript interface base
// these functions are safe to override, see notes below for usage instructions
//
//
// Function in which handler functions are registered, must be implemented in script
virtual void Register() = 0;
// Function called on server startup, if returns false script won't be used in core
@@ -116,7 +116,7 @@ class SpellScript : public _SpellScript
//
// SpellScript interface
// hooks to which you can attach your functions
//
//
// List of functions registered by EffectHandlerFn
// allows more than one hook
// example EffectHandlers += EffectHandlerFn(class::function, EffectIndexSpecifier, EffectNameSpecifier);
@@ -135,9 +135,9 @@ class SpellScript : public _SpellScript
WorldLocation * GetDest();
// methods useable only during spell hit on target phase:
// returns: target of current effect if it was Unit otherwise NULL
Unit * GetHitUnit();
Unit * GetHitUnit();
// returns: target of current effect if it was Creature otherwise NULL
Creature * GetHitCreature();
// returns: target of current effect if it was Player otherwise NULL
@@ -174,7 +174,7 @@ class SpellScript : public _SpellScript
// EFFECT_1 - second effect matches
// EFFECT_2 - third effect matches
// EFFECT_FIRST_FOUND - first effect matching other conditions matches
// EFFECT_ALL - all effects of spell match
// EFFECT_ALL - all effects of spell match
//
// EffectNameSpecifier - specifies conditions for spell effect names
// SPELL_EFFECT_ANY - any effect but not 0 matches condition
@@ -49,7 +49,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
CharacterDatabase.Query("UPDATE worldstates SET value = 0 WHERE entry=20004");
}
void CharacterDatabaseCleaner::CheckUnique(const char* column, const
void CharacterDatabaseCleaner::CheckUnique(const char* column, const
char* table, bool (*check)(uint32))
{
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
+2 -2
View File
@@ -468,7 +468,7 @@ struct CliCommandHolder
{
typedef void Print(void*, const char*);
typedef void CommandFinished(void*, bool success);
void* m_callbackArg;
char *m_command;
Print* m_print;
@@ -482,7 +482,7 @@ struct CliCommandHolder
m_command = new char[len];
memcpy(m_command, command, len);
}
~CliCommandHolder() { delete[] m_command; }
};
@@ -164,7 +164,7 @@ public:
void Cleanup()
{
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
if (pMalchezaar && pMalchezaar->isAlive())
CAST_AI(boss_malchezaar::boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point);
} //below ...
@@ -1171,26 +1171,26 @@ public:
{
if (damage < me->GetHealth())
return;
//anything below only used if incoming damage will kill
if (Phase == PHASE_ROMULO)
{
DoScriptText(SAY_ROMULO_DEATH, me);
PretendToDie(me);
IsFakingDeath = true;
Phase = PHASE_BOTH;
if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
CAST_AI(boss_julianne::boss_julianneAI, Julianne->AI())->RomuloDead = true;
CAST_AI(boss_julianne::boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000;
}
damage = 0;
return;
}
if (Phase == PHASE_BOTH)
{
if (JulianneDead)
@@ -1206,7 +1206,7 @@ public:
}
return;
}
if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
PretendToDie(me);
@@ -1217,7 +1217,7 @@ public:
return;
}
}
sLog.outError("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen.");
}
@@ -1267,7 +1267,7 @@ public:
{
if (!UpdateVictim() || IsFakingDeath)
return;
if (JulianneDead)
{
if (ResurrectTimer <= diff)
@@ -1283,7 +1283,7 @@ public:
}
} else ResurrectTimer -= diff;
}
if (BackwardLungeTimer <= diff)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
@@ -1293,26 +1293,26 @@ public:
BackwardLungeTimer = urand(15000,30000);
}
} else BackwardLungeTimer -= diff;
if (DaringTimer <= diff)
{
DoCast(me, SPELL_DARING);
DaringTimer = urand(20000,40000);
} else DaringTimer -= diff;
if (DeadlySwatheTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_DEADLY_SWATHE);
DeadlySwatheTimer = urand(15000,25000);
} else DeadlySwatheTimer -= diff;
if (PoisonThrustTimer <= diff)
{
DoCast(me->getVictim(), SPELL_POISON_THRUST);
PoisonThrustTimer = urand(10000,20000);
} else PoisonThrustTimer -= diff;
DoMeleeAttackIfReady();
}
};
@@ -185,10 +185,10 @@ public:
}
else
sLog.outError("npc_unworthy_initiateAI: unable to find anchor!");
float dist = 99.0f;
GameObject *prison = NULL;
for (uint8 i = 0; i < 12; ++i)
{
if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i],30))
@@ -200,7 +200,7 @@ public:
}
}
}
if (prison)
prison->ResetDoorOrButton();
else
@@ -231,7 +231,7 @@ public:
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
phase = PHASE_ATTACKING;
if (Player *pTarget = Unit::GetPlayer(*me, playerGUID))
me->AI()->AttackStart(pTarget);
wait_timer = 0;
@@ -241,9 +241,9 @@ public:
case PHASE_ATTACKING:
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
@@ -270,7 +270,7 @@ public:
break;
}
}
DoMeleeAttackIfReady();
}
}
@@ -291,7 +291,7 @@ public:
case 2:
{
Unit *pTarget = pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!pTarget)
if (!pTarget)
pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (!pTarget)
@@ -312,13 +312,13 @@ public:
events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000);
break;
}
case 3:
case 3:
{
DespawnSummons(MOB_VAPOR_TRAIL);
//DoCast(me, SPELL_VAPOR_SELECT); need core support
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!pTarget)
if (!pTarget)
pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (!pTarget)
@@ -348,7 +348,7 @@ public:
case 5:
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true);
if (!pTarget)
if (!pTarget)
pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0);
if (!pTarget)
@@ -386,7 +386,7 @@ public:
me->RemoveAurasDueToSpell(SPELL_FOG_BREATH);
++uiBreathCount;
events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1);
if (uiBreathCount < 3)
if (uiBreathCount < 3)
uiFlightCount = 4;
break;
case 9:
@@ -170,10 +170,10 @@ enum Phase
};
//Timers
enum KilJaedenTimers
enum KilJaedenTimers
{
TIMER_SPEECH = 0,
//Phase 2 Timer
TIMER_SOUL_FLAY = 1,
TIMER_LEGION_LIGHTNING = 2,
@@ -222,11 +222,11 @@ static Speech Speeches[]=
//Kil Phase 2 -> Phase 3
{SAY_KALECGOS_AWAKEN, DATA_KALECGOS_KJ, 10000},
{SAY_ANVEENA_IMPRISONED, DATA_ANVEENA, 5000},
{SAY_KJ_PHASE3, DATA_KILJAEDEN, 5000},
{SAY_KJ_PHASE3, DATA_KILJAEDEN, 5000},
//Kil Phase 3 -> Phase 4
{SAY_KALECGOS_LETGO, DATA_KALECGOS_KJ, 10000},
{SAY_ANVEENA_LOST, DATA_ANVEENA, 8000},
{SAY_KJ_PHASE4, DATA_KILJAEDEN, 7000},
{SAY_KJ_PHASE4, DATA_KILJAEDEN, 7000},
//Kil Phase 4 -> Phase 5
{SAY_KALECGOS_FOCUS, DATA_KALECGOS_KJ, 4000},
{SAY_ANVEENA_KALEC, DATA_ANVEENA, 11000},
@@ -235,7 +235,7 @@ static Speech Speeches[]=
{SAY_KJ_PHASE5, DATA_KILJAEDEN, 5500},
// use in End sequence?
{SAY_KALECGOS_GOODBYE, DATA_KALECGOS_KJ, 12000},
{SAY_KALECGOS_GOODBYE, DATA_KALECGOS_KJ, 12000},
};
//AI for Kalecgos class boss_kalecgos_kj : public CreatureScript
@@ -268,7 +268,7 @@ public:
me->setActive(true);
for (uint8 i = 0; i < 4; ++i)
if (GameObject* pOrb = GetOrb(i))
if (GameObject* pOrb = GetOrb(i))
pOrb->SetGoType(GAMEOBJECT_TYPE_BUTTON);
}
@@ -296,7 +296,7 @@ public:
{
me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
for (uint8 i = 0; i < 4; ++i)
if (GameObject* pOrb = GetOrb(i))
if (GameObject* pOrb = GetOrb(i))
pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 0);
}
@@ -378,7 +378,7 @@ public:
{
InstanceScript* pInstance = pGo->GetInstanceScript();
pPlayer->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);
pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false);
pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0);
if (Creature* pKalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ)))
@@ -697,7 +697,7 @@ public:
{
switch(t)
{
case TIMER_SPEECH:
case TIMER_SPEECH:
if (SpeechBegins)
{
SpeechBegins=false;
@@ -735,7 +735,7 @@ public:
case TIMER_SOUL_FLAY:
if (!me->IsNonMeleeSpellCasted(false))
{
DoCast(me->getVictim(), SPELL_SOUL_FLAY_SLOW, false);
DoCast(me->getVictim(), SPELL_SOUL_FLAY_SLOW, false);
DoCast(me->getVictim(), SPELL_SOUL_FLAY, false);
Timer[TIMER_SOUL_FLAY] = 3500;
}
@@ -749,7 +749,7 @@ public:
for (uint8 z = 0; z < 6; ++z)
{
pRandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pRandomPlayer || !pRandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))
if (!pRandomPlayer || !pRandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))
break;
}
@@ -757,7 +757,7 @@ public:
DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false);
else
sLog.outError("try to cast SPELL_LEGION_LIGHTNING on invalid target");
Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE
Timer[TIMER_SOUL_FLAY] = 2500;
}
@@ -786,7 +786,7 @@ public:
if (!me->IsNonMeleeSpellCasted(false))
{
CastSinisterReflection();
DoCastAOE(SPELL_SHADOW_SPIKE, false);
DoCastAOE(SPELL_SHADOW_SPIKE, false);
ChangeTimers(true, 30000);
Timer[TIMER_SHADOW_SPIKE] = 0;
TimerIsDeactivated[TIMER_SPEECH] = false;
@@ -978,8 +978,8 @@ public:
{
DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
ShadowBoltVolleyTimer = 12000;
}
else
}
else
ShadowBoltVolleyTimer -= diff;
// Felfire Portal - Creatres a portal, that spawns Volatile Felfire Fiends, which do suicide bombing.
@@ -1021,7 +1021,7 @@ public:
uint32 uiSpawnFiendTimer;
void Reset()
void Reset()
{
uiSpawnFiendTimer = 5000;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
@@ -1227,7 +1227,7 @@ public:
{
DoTeleportTo(x,y,SHIELD_ORB_Z);
bPointReached = true;
}
}
else uiCheckTimer -= diff;
}
@@ -289,7 +289,7 @@ class instance_uldaman : public InstanceMapScript
return 0;
} // end GetData64
};
InstanceScript* OnGetInstanceData(InstanceMap* pMap)
{
return new instance_uldaman_InstanceMapScript(pMap);
@@ -265,7 +265,7 @@ class boss_arlokk : public CreatureScript
class go_gong_of_bethekk : public GameObjectScript
{
public:
go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk")
go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk")
{
}
@@ -38,7 +38,7 @@ class boss_grilek : public CreatureScript
{
}
struct boss_grilekAI : public ScriptedAI
struct boss_grilekAI : public ScriptedAI
{
boss_grilekAI(Creature *c) : ScriptedAI(c) {}
@@ -244,7 +244,7 @@ class boss_hakkar : public CreatureScript
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_hakkarAI(creature);
@@ -216,7 +216,7 @@ class boss_jeklik : public CreatureScript
DoMeleeAttackIfReady();
}
}
};
};
CreatureAI* GetAI(Creature* creature) const
{
@@ -289,7 +289,7 @@ class mob_batrider : public CreatureScript
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI(Creature* creature) const
{
@@ -167,7 +167,7 @@ class boss_jindo : public CreatureScript
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI(Creature* creature) const
{
@@ -411,7 +411,7 @@ class mob_zealot_lorkhan : public CreatureScript
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI(Creature* creature) const
{
@@ -429,7 +429,7 @@ class mob_zealot_zath : public CreatureScript
{
}
struct mob_zealot_zathAI : public ScriptedAI
struct mob_zealot_zathAI : public ScriptedAI
{
mob_zealot_zathAI(Creature *c) : ScriptedAI(c)
{
@@ -192,7 +192,7 @@ class boss_venoxis : public CreatureScript
}
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI(Creature* creature) const
{
@@ -456,11 +456,11 @@ public:
if (questPhase > 0)
{
++paladinPhase;
if (paladinPhase < 4)
questPhase = 2;
else
Reset(); // Quest Complete, QuestComplete handler is
Reset(); // Quest Complete, QuestComplete handler is
}
}
@@ -272,16 +272,16 @@ enum eTruuen
{
NPC_GHOST_UTHER = 17233,
NPC_THEL_DANIS = 1854,
NPC_GHOUL = 1791, //ambush
NPC_GHOUL = 1791, //ambush
QUEST_TOMB_LIGHTBRINGER = 9446,
SAY_WP_0 = -1999981, //Beware! We are attacked!
SAY_WP_0 = -1999981, //Beware! We are attacked!
SAY_WP_1 = -1999982, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed!
SAY_WP_2 = -1999983, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now...
SAY_WP_3 = -1999984, //Be welcome, friends!
SAY_WP_4 = -1999985, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart.
SAY_WP_5 = -1999986, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire.
SAY_WP_4 = -1999985, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart.
SAY_WP_5 = -1999986, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire.
SAY_WP_6 = -1999987 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here.
};
class npc_anchorite_truuen : public CreatureScript
@@ -293,8 +293,8 @@ public:
{
npc_escortAI* pEscortAI = CAST_AI(npc_anchorite_truuen::npc_anchorite_truuenAI, pCreature->AI());
if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER)
pEscortAI->Start(true, true, pPlayer->GetGUID());
if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER)
pEscortAI->Start(true, true, pPlayer->GetGUID());
return false;
}
@@ -316,7 +316,7 @@ public:
Creature* Theldanis;
void Reset()
{
{
m_uiChatTimer = 7000;
}
@@ -325,7 +325,7 @@ public:
if (pSummoned->GetEntry() == NPC_GHOUL)
pSummoned->AI()->AttackStart(me);
}
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
@@ -339,7 +339,7 @@ public:
case 9:
DoScriptText(SAY_WP_1, me);
break;
case 14:
case 14:
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+10.0f, me->GetPositionY()+10.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
@@ -347,14 +347,14 @@ public:
break;
case 15:
DoScriptText(SAY_WP_2, me);
case 21:
case 21:
Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150);
DoScriptText(SAY_WP_3, Theldanis);
break;
case 22:
break;
break;
case 23:
Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86,-1825.42 ,81.99 , 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86,-1825.42 ,81.99 , 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
Ughost->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
DoScriptText(SAY_WP_4, Ughost, me);
m_uiChatTimer = 4000;
@@ -369,8 +369,8 @@ public:
break;
case 26:
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me);
break;
pPlayer->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me);
break;
}
}
@@ -380,7 +380,7 @@ public:
{
Player* pPlayer = GetPlayerForEscort();
if (pPlayer)
pPlayer->FailQuest(QUEST_TOMB_LIGHTBRINGER);
pPlayer->FailQuest(QUEST_TOMB_LIGHTBRINGER);
}
void UpdateAI(const uint32 uiDiff)
@@ -52,9 +52,9 @@ class spell_ex_49375 : public SpellHandlerScript
EffectHandlers += EffectHandlerFn(spell_ex_49375SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
// this will prompt an error on startup because effect 0 of spell 49375 is set to SPELL_EFFECT_DUMMY, not SPELL_EFFECT_APPLY_AURA
//EffectHandlers += EffectHandlerFn(spell_gen_49375SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
// this will make HandleDummy function to be called on first != 0 effect of spell 49375
// this will make HandleDummy function to be called on first != 0 effect of spell 49375
//EffectHandlers += EffectHandlerFn(spell_gen_49375SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_ANY);
// this will make HandleDummy function to be called on all != 0 effect of spell 49375
// this will make HandleDummy function to be called on all != 0 effect of spell 49375
//EffectHandlers += EffectHandlerFn(spell_gen_49375SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY);
};
@@ -78,7 +78,7 @@ class spell_ex_49375 : public SpellHandlerScript
// script will be immediately removed from the spell
// for example - we don't want this script to be executed on a creature
// if (GetCaster()->GetTypeID() != TYPEID_PLAYER)
// return false;
// return false;
}
// function called just before script delete
@@ -98,7 +98,7 @@ class spell_ex_49375 : public SpellHandlerScript
/* empty script for copypasting
class spell_ex : public SpellHandlerScript
{
public:
public:
spell_ex() : SpellHandlerScript("spell_ex") { }
class spell_ex_SpellScript : public SpellScript
@@ -18,10 +18,10 @@
/* ScriptData
SDName: Boss_Onyxia
SD%Complete: 95
SDComment: <Known bugs>
Ground visual for Deep Breath effect;
Wing Buffet not ignoring armor;
Not summoning whelps on phase 3 (lacks info)
SDComment: <Known bugs>
Ground visual for Deep Breath effect;
Wing Buffet not ignoring armor;
Not summoning whelps on phase 3 (lacks info)
</Known bugs>
SDCategory: Onyxia's Lair
EndScriptData */
@@ -110,7 +110,7 @@ public:
struct boss_onyxiaAI : public ScriptedAI
{
boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me)
boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me)
{
m_pInstance = pCreature->GetInstanceScript();
Reset();
@@ -140,7 +140,7 @@ public:
uint8 m_uiSummonWhelpCount;
uint8 m_uiSummonLairGuardCount;
bool m_bIsMoving;
void Reset()
{
if (!IsCombatMovement())
@@ -168,7 +168,7 @@ public:
m_uiSummonWhelpCount = 0;
m_uiSummonLairGuardCount = 0;
m_bIsMoving = false;
if (m_pInstance)
{
m_pInstance->SetData(DATA_ONYXIA, NOT_STARTED);
@@ -181,7 +181,7 @@ public:
{
DoScriptText(SAY_AGGRO, me);
me->SetInCombatWithZone();
if (m_pInstance)
{
m_pInstance->SetData(DATA_ONYXIA, IN_PROGRESS);
@@ -203,7 +203,7 @@ public:
pSummoned->SetInCombatWithZone();
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
pSummoned->AI()->AttackStart(pTarget);
switch (pSummoned->GetEntry())
{
case NPC_WHELP:
@@ -217,7 +217,7 @@ public:
Summons.Summon(pSummoned);
}
void SummonedCreatureDespawn(Creature *summon)
void SummonedCreatureDespawn(Creature *summon)
{
Summons.Despawn(summon);
}
@@ -265,14 +265,14 @@ public:
default:
m_bIsMoving = false;
break;
}
}
}
}
void SpellHitTarget(Unit* target, const SpellEntry* pSpell)
void SpellHitTarget(Unit* target, const SpellEntry* pSpell)
{
//Workaround - Couldn't find a way to group this spells (All Eruption)
if (((pSpell->Id >= 17086 && pSpell->Id <= 17095) ||
if (((pSpell->Id >= 17086 && pSpell->Id <= 17095) ||
(pSpell->Id == 17097) ||
(pSpell->Id >= 18351 && pSpell->Id <= 18361) ||
(pSpell->Id >= 18564 && pSpell->Id <= 18576) ||
@@ -331,7 +331,7 @@ public:
if (me->GetHealth()*100 / me->GetMaxHealth() < 60)
{
m_uiPhase = PHASE_BREATH;
if (m_pInstance)
m_pInstance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
@@ -419,7 +419,7 @@ public:
if (m_uiDeepBreathTimer <= uiDiff)
{
if (!m_bIsMoving)
if (!m_bIsMoving)
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
@@ -434,7 +434,7 @@ public:
if (m_uiMovementTimer <= uiDiff)
{
if (!m_bIsMoving)
if (!m_bIsMoving)
{
SetNextRandomPoint();
m_pPointData = GetMoveData();
@@ -463,7 +463,7 @@ public:
else
m_uiFireballTimer -= uiDiff;
if (m_uiLairGuardTimer <= uiDiff)
if (m_uiLairGuardTimer <= uiDiff)
{
me->SummonCreature(NPC_LAIRGUARD, aSpawnLocations[2].GetPositionX(), aSpawnLocations[2].GetPositionY(), aSpawnLocations[2].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
if (m_uiSummonLairGuardCount >= RAID_MODE(1,2))
@@ -484,8 +484,8 @@ public:
if (m_uiSummonWhelpCount >= RAID_MODE(20,40))
{
m_uiSummonWhelpCount = 0;
m_uiWhelpTimer = 90000;
}
m_uiWhelpTimer = 90000;
}
else
m_uiWhelpTimer = 500;
}
@@ -18,7 +18,7 @@
/* ScriptData
SDName: Instance_Onyxias_Lair
SD%Complete: 100
SDComment:
SDComment:
SDCategory: Onyxia's Lair
EndScriptData */
@@ -40,9 +40,9 @@ public:
//Eruption is a BFS graph problem
//One map to remember all floor, one map to keep floor that still need to erupt and one queue to know what needs to be removed
std::map<uint64,uint32> FloorEruptionGUID[2];
std::queue<uint64> FloorEruptionGUIDQueue;
std::map<uint64,uint32> FloorEruptionGUID[2];
std::queue<uint64> FloorEruptionGUIDQueue;
uint64 m_uiOnyxiasGUID;
uint32 m_uiOnyxiaLiftoffTimer;
uint32 m_uiManyWhelpsCounter;
@@ -110,7 +110,7 @@ public:
pFloorEruption->SendCustomAnim();
pFloorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId
//Get all immediatly nearby floors
//Get all immediatly nearby floors
std::list<GameObject*> nearFloorList;
Trinity::GameObjectInRangeCheck check(pFloorEruption->GetPositionX(), pFloorEruption->GetPositionY(), pFloorEruption->GetPositionZ(), 15);
Trinity::GameObjectListSearcher<Trinity::GameObjectInRangeCheck> searcher(pFloorEruption, nearFloorList, check);
@@ -211,12 +211,12 @@ public:
} else m_uiOnyxiaLiftoffTimer -= uiDiff;
}
if (!FloorEruptionGUIDQueue.empty())
if (!FloorEruptionGUIDQueue.empty())
{
if (m_uiEruptTimer <= uiDiff)
{
uint32 treeHeight = 0;
do
do
{
treeHeight = (*FloorEruptionGUID[1].find(FloorEruptionGUIDQueue.front())).second;
FloorEruption(FloorEruptionGUIDQueue.front());
@@ -79,7 +79,7 @@ float pyramidSpawns [pyramidSpawnTotal][4] = {
{3,7788,1889.94,1212.21},
{3,7275,1889.23,1207.72},
{3,7796,1879.77,1207.96}
};
};
float Spawnsway[2][3] =
{
@@ -205,7 +205,7 @@ public:
PyramidPhase=data;
break;
};
}
}
virtual void Update(uint32 diff)
{
@@ -254,14 +254,14 @@ public:
SpawnPyramidWave(3);
SetData(EVENT_PYRAMID,PYRAMID_PRE_WAVE_3);
major_wave_Timer = 5000; //give NPCs time to return to their home spots
}
else
}
else
if (minor_wave_Timer<diff)
{
SendAddsUpStairs(addGroupSize++);
minor_wave_Timer=10000;
}
else
}
else
minor_wave_Timer -= diff;
break;
case PYRAMID_PRE_WAVE_3:
@@ -274,8 +274,8 @@ public:
MoveNPCIfAlive(ENTRY_RAVEN,1883.68,1227.95,9.543,4.78);
MoveNPCIfAlive(ENTRY_WEEGLI,1878.02,1227.65,9.485,4.78);
SetData(EVENT_PYRAMID,PYRAMID_WAVE_3);
}
else
}
else
major_wave_Timer -= diff;
break;
case PYRAMID_WAVE_3:
+8 -8
View File
@@ -28,7 +28,7 @@ npc_aged_dying_ancient_kodo
EndContentData */
#include "ScriptPCH.h"
#include "ScriptedEscortAI.h"
#include "ScriptedEscortAI.h"
enum eDyingKodo
{
@@ -200,7 +200,7 @@ public:
bool OnQuestAccept(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
{
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, pCreature->AI()))
{
pEscortAI->Start(true, false, pPlayer->GetGUID());
@@ -217,8 +217,8 @@ public:
struct npc_dalindaAI : public npc_escortAI
{
npc_dalindaAI(Creature* pCreature) : npc_escortAI(pCreature) { }
npc_dalindaAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
@@ -226,11 +226,11 @@ public:
{
case 1:
me->IsStandState();
break;
case 15:
break;
case 15:
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
break;
break;
}
}
@@ -247,7 +247,7 @@ public:
}
void UpdateAI(const uint32 uiDiff)
{
{
npc_escortAI::UpdateAI(uiDiff);
if (!UpdateVictim())
return;
@@ -65,7 +65,7 @@ enum
ACHIEV_TIMED_START_EVENT = 20381,
};
enum Phases
enum Phases
{
PHASE_MELEE = 0,
PHASE_UNDERGROUND = 1,
@@ -81,7 +81,7 @@ const Position SpawnPoint[2] =
};
const Position SpawnPointGuardian[2] =
{
{
{ 550.348633, 316.006805, 234.2947 },
{ 550.188660, 324.264557, 237.7412 },
};
@@ -113,11 +113,11 @@ public:
uint32 uiUndergroundTimer;
uint32 uiVenomancerTimer;
uint32 uiDatterTimer;
uint32 uiImpaleTimer;
uint32 uiImpalePhase;
uint64 uiImpaleTarget;
SummonList lSummons;
void Reset()
@@ -136,7 +136,7 @@ public:
me->RemoveAura(SPELL_SUBMERGE);
lSummons.DespawnAll();
if (pInstance)
{
pInstance->SetData(DATA_ANUBARAK_EVENT, NOT_STARTED);
@@ -177,14 +177,14 @@ public:
return;
switch (uiPhase)
{
{
case PHASE_UNDERGROUND:
if (uiImpaleTimer <= diff)
{
switch(uiImpalePhase)
{
{
case IMPALE_PHASE_TARGET:
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
if (Creature *pImpaleTarget = DoSummonImpaleTarget(target))
pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true);
@@ -288,7 +288,7 @@ public:
DoCast(me, SPELL_SUBMERGE, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
uiPhase = PHASE_UNDERGROUND;
++uiUndergroundPhase;
}
@@ -305,7 +305,7 @@ public:
DoCastVictim(SPELL_CARRION_BEETLES);
uiCarrionBeetlesTimer = 25*IN_MILLISECONDS;
} else uiCarrionBeetlesTimer -= diff;
if (uiLeechingSwarmTimer <= diff)
{
DoCast(me, SPELL_LEECHING_SWARM, true);
@@ -326,7 +326,7 @@ public:
break;
}
}
void JustDied(Unit * /*pKiller*/)
{
DoScriptText(SAY_DEATH, me);
@@ -136,7 +136,7 @@ public:
if (data == IN_PROGRESS)
for (uint8 i = 0; i < 3; ++i)
HandleGameObject(uiAnubarakDoor[i], false);
else if (data == NOT_STARTED || data == DONE)
else if (data == NOT_STARTED || data == DONE)
for (uint8 i = 0; i < 3; ++i)
HandleGameObject(uiAnubarakDoor[i], true);
break;
@@ -33,7 +33,7 @@ enum Spells
SPELL_QUIVERING_STRIKE = 72422,
SPELL_IMPENDING_DESPAIR = 72426,
SPELL_DEFILING_HORROR = 72435,
SPELL_HOPELESSNESS = 72395,
SPELL_HOPELESSNESS = 72395,
H_SPELL_HOPELESSNESS = 72390, // TODO: not in dbc. Add in DB.
};
@@ -71,7 +71,7 @@ enum Yells
enum Events
{
EVENT_NONE,
EVENT_START_INTRO,
EVENT_SKIP_INTRO,
@@ -133,7 +133,7 @@ enum eEnum
QUEST_DELIVRANCE_FROM_THE_PIT_H2 = 24712,
QUEST_WRATH_OF_THE_LICH_KING_A2 = 24500,
QUEST_WRATH_OF_THE_LICH_KING_H2 = 24802,
};
};
static Position HallsofReflectionLocs[]=
{
@@ -201,7 +201,7 @@ public:
// AI of Part1: handle the intro till start of gauntlet event.
struct npc_jaina_or_sylvanas_horAI : public ScriptedAI
{
npc_jaina_or_sylvanas_horAI(Creature *pCreature) : ScriptedAI(pCreature)
npc_jaina_or_sylvanas_horAI(Creature *pCreature) : ScriptedAI(pCreature)
{
pInstance = me->GetInstanceScript();
}
@@ -224,7 +224,7 @@ public:
me->SetVisibility(VISIBILITY_ON);
}
void DoAction(const int32 actionId)
void DoAction(const int32 actionId)
{
switch(actionId)
{
@@ -276,7 +276,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_5, 2000);
break;
case EVENT_INTRO_A2_5:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_1, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_6, 3000);
break;
@@ -285,7 +285,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_7, 6000);
break;
case EVENT_INTRO_A2_7:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_2, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_8, 6500);
break;
@@ -294,7 +294,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_9, 2000);
break;
case EVENT_INTRO_A2_9:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_3, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_10, 9000);
break;
@@ -303,7 +303,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_11, 5000);
break;
case EVENT_INTRO_A2_11:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_4, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_12, 11000);
break;
@@ -312,7 +312,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_13, 4000);
break;
case EVENT_INTRO_A2_13:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_5, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_14, 12500);
break;
@@ -321,12 +321,12 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_15, 10000);
break;
case EVENT_INTRO_A2_15:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_6, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_16, 22000);
break;
case EVENT_INTRO_A2_16:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_A2_7, pUther);
events.ScheduleEvent(EVENT_INTRO_A2_17, 4000);
break;
@@ -335,7 +335,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_A2_18, 2000);
break;
case EVENT_INTRO_A2_18:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
{
pUther->HandleEmoteCommand(EMOTE_ONESHOT_NO);
DoScriptText(SAY_UTHER_INTRO_A2_8, pUther);
@@ -372,7 +372,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_H2_5, 2000);
break;
case EVENT_INTRO_H2_5:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_H2_1, pUther);
events.ScheduleEvent(EVENT_INTRO_H2_6, 11000);
break;
@@ -381,7 +381,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_H2_7, 3000);
break;
case EVENT_INTRO_H2_7:
if (Creature* pUther = me->GetCreature(*me, uiUther))
if (Creature* pUther = me->GetCreature(*me, uiUther))
DoScriptText(SAY_UTHER_INTRO_H2_2, pUther);
events.ScheduleEvent(EVENT_INTRO_H2_8, 6000);
break;
@@ -424,7 +424,7 @@ public:
DoScriptText(SAY_SYLVANAS_INTRO_8, me);
events.ScheduleEvent(EVENT_INTRO_LK_1, 2000);
break;
// Remaining Intro Events common for both faction
case EVENT_INTRO_LK_1:
// Spawn LK in front of door, and make him move to the sword.
@@ -451,40 +451,40 @@ public:
break;
case EVENT_INTRO_LK_3:
// The Lich King banishes Uther to the abyss.
// The Lich King banishes Uther to the abyss.
if (Creature* pUther = me->GetCreature(*me, uiUther))
{
pUther->DisappearAndDie();
uiUther = 0;
}
// He steps forward and removes the runeblade from the heap of skulls.
// He steps forward and removes the runeblade from the heap of skulls.
events.ScheduleEvent(EVENT_INTRO_LK_4, 4000);
break;
case EVENT_INTRO_LK_4:
if (Creature* pLichKing = me->GetCreature(*me, uiLichKing))
DoScriptText(SAY_LK_INTRO_2, pLichKing);
events.ScheduleEvent(EVENT_INTRO_LK_5, 10000);
break;
case EVENT_INTRO_LK_5:
// summon Falric and Marwyn. then go back to the door
if (Creature* pFalric = me->GetCreature(*me, pInstance->GetData64(DATA_FALRIC)))
pFalric->SetVisibility(VISIBILITY_ON);
if (Creature* pMarwyn = me->GetCreature(*me, pInstance->GetData64(DATA_MARWYN)))
pMarwyn->SetVisibility(VISIBILITY_ON);
if (Creature* pLichKing = me->GetCreature(*me, uiLichKing))
{
pLichKing->GetMotionMaster()->MovePoint(0, LichKingSpawnPos);
DoScriptText(SAY_LK_INTRO_3, pLichKing);
}
events.ScheduleEvent(EVENT_INTRO_LK_6, 8000);
break;
case EVENT_INTRO_LK_6:
if (Creature* pFalric = me->GetCreature(*me, pInstance->GetData64(DATA_FALRIC)))
DoScriptText(SAY_FALRIC_INTRO_1, pFalric);
@@ -498,7 +498,7 @@ public:
events.ScheduleEvent(EVENT_INTRO_LK_8, 2000);
break;
case EVENT_INTRO_LK_8:
if (Creature* pFalric = me->GetCreature(*me, pInstance->GetData64(DATA_FALRIC)))
DoScriptText(SAY_FALRIC_INTRO_2, pFalric);
@@ -516,7 +516,7 @@ public:
// TODO: Loralen/Koreln shall run also
events.ScheduleEvent(EVENT_INTRO_END, 10000);
break;
case EVENT_INTRO_END:
if (pInstance)
pInstance->SetData(DATA_WAVE_COUNT, SPECIAL); // start first wave
@@ -83,11 +83,11 @@ struct boss_horAI : ScriptedAI
{
pInstance = me->GetInstanceScript();
}
InstanceScript* pInstance;
EventMap events;
SummonList summons;
void Reset()
{
events.Reset();
@@ -121,11 +121,11 @@ struct boss_horAI : ScriptedAI
break;
}
}
void JustSummoned(Creature *pSummoned)
{
summons.Summon(pSummoned);
if (Unit *pUnit = pSummoned->SelectNearestTarget())
{
if (pSummoned->AI())
@@ -27,7 +27,7 @@ EndScriptData */
enum Spells
{
SPELL_ARCANE_SHIELD = 53813, //Dummy --> Channeled, shields the caster from damage.
SPELL_EMPOWERED_ARCANE_EXPLOSION = 51110,
SPELL_EMPOWERED_ARCANE_EXPLOSION_2 = 59377,
@@ -58,7 +58,7 @@ enum eCreature
NPC_PHANTASMAL_AIR = 27650,
NPC_PHANTASMAL_FIRE = 27651,
NPC_PHANTASMAL_WATER = 27653,
NPC_PHANTASMAL_MURLOC = 27649,
NPC_PHANTASMAL_NAGAL = 27648,
NPC_PHANTASMAL_OGRE = 27647
@@ -176,7 +176,7 @@ public:
pWho->SetInCombatWith(me);
me->GetMotionMaster()->MoveChase(pWho, 0,0);
}
}
}
}
@@ -190,7 +190,7 @@ public:
uiGroup[0] = urand(0,2);
uiGroup[1] = urand(0,2);
uiGroup[2] = urand(0,2);
}
}
}
void SetPosition(uint8 uiI)
@@ -247,7 +247,7 @@ public:
if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) < 2)
return;
if (uiTeleportTimer <= uiDiff)
{
me->InterruptNonMeleeSpells(false);
@@ -291,7 +291,7 @@ public:
if (uiFrostBombTimer <= uiDiff)
{
DoCastVictim(SPELL_FROSTBOMB);
uiFrostBombTimer = urand(5000,8000);
uiFrostBombTimer = urand(5000,8000);
} else uiFrostBombTimer -= uiDiff;
if (uiTimeBombTimer <= uiDiff)
@@ -342,7 +342,7 @@ public:
break;
case SPELL_TELEPORT:
me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting
bCanCast = true;
bCanCast = true;
break;
default:
break;
@@ -83,7 +83,7 @@ public:
pGO->SetGoState(GO_STATE_ACTIVE);
else
pGO->SetGoState(GO_STATE_READY);
GameObjectList.push_back(pGO->GetGUID());
}
}
@@ -141,7 +141,7 @@ public:
return 0;
}
void OpenCageDoors()
{
if (GameObjectList.empty())
@@ -115,7 +115,7 @@ enum eEnums
SPELL_FLAME_TSUNAMI_DMG_AURA = 57491, // periodic damage, npc has this aura
SPELL_FLAME_TSUNAMI_BUFF = 60430,
NPC_FLAME_TSUNAMI = 30616, // for the flame waves
NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike
@@ -398,7 +398,7 @@ public:
pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_DUO,H_ACHIEV_TWILIGHT_DUO));
pInstance->DoCompleteAchievement(RAID_MODE(ACHIEV_TWILIGHT_ZONE,H_ACHIEV_TWILIGHT_ZONE));
}
pInstance->SetData(TYPE_SARTHARION_EVENT, DONE);
}
}
@@ -860,7 +860,7 @@ struct dummy_dragonAI : public ScriptedAI
case NPC_TENEBRON:
{
iTextId = WHISPER_HATCH_EGGS;
if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
if (pInstance && !pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
{
for(uint32 i = 0; i < 6; ++i)
me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i].x, TwilightEggs[i].y, TwilightEggs[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
@@ -1273,7 +1273,7 @@ public:
else
{
OpenPortal();
DoCast(me->getVictim(), SPELL_TWILIGHT_TORMENT_VESP);
DoCast(me->getVictim(), SPELL_TWILIGHT_TORMENT_VESP);
m_uiAcolyteVesperonTimer = urand(60000,70000);
}
}
@@ -1324,7 +1324,7 @@ public:
InstanceScript* pInstance;
uint32 uiDespawnTimer;
void Reset()
{
uiDespawnTimer = 28000;
@@ -1361,7 +1361,7 @@ public:
if (map->IsDungeon())
{
Map::PlayerList const &PlayerList = map->GetPlayers();
if (PlayerList.isEmpty())
return;
@@ -1437,14 +1437,14 @@ public:
uiDespawnTimer = 28000;
if (pInstance)
{
me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me);
me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER,me);
}
DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO);
}
void JustDied(Unit* pKiller)
{
me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO);
me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO);
// remove twilight torment on Vesperon
if (pInstance)
@@ -1455,7 +1455,7 @@ public:
if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP))
pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP);
Map *map = me->GetMap();
if (map->IsDungeon())
{
@@ -1520,7 +1520,7 @@ public:
struct mob_twilight_eggsAI : public Scripted_NoMovementAI
{
mob_twilight_eggsAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature)
{
{
pInstance = pCreature->GetInstanceScript();
}
@@ -1538,23 +1538,23 @@ public:
m_uiFadeArmorTimer = 1000;
m_uiHatchEggTimer = 20000;
}
void SpawnWhelps()
{
me->RemoveAllAuras();
if (!pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS)
me->SummonCreature(NPC_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
else
else
me->SummonCreature(NPC_SHARTHARION_TWILIGHT_WHELP, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
me->DealDamage(me, me->GetHealth());
}
void JustSummoned(Creature* pWho)
{
pWho->SetInCombatWithZone();
}
void UpdateAI(const uint32 uiDiff)
{
if (m_uiHatchEggTimer <= uiDiff)
@@ -1565,9 +1565,9 @@ public:
SpawnWhelps();
}
else
m_uiHatchEggTimer -= uiDiff;
m_uiHatchEggTimer -= uiDiff;
}
void AttackStart(Unit* pWho) {}
void MoveInLineOfSight(Unit* pWho) {}
@@ -1608,7 +1608,7 @@ public:
TsunamiBuff_timer = 1000;
entry = 0;
}
void UpdateAI(const uint32 diff)
{
if (Tsunami_Timer <= diff)
@@ -1616,7 +1616,7 @@ public:
DoCast(me,SPELL_FLAME_TSUNAMI_DMG_AURA);
Tsunami_Timer = 500;
}else Tsunami_Timer -= diff;
if(TsunamiBuff_timer <= diff)
{
if (Unit* LavaBlaze = GetClosestCreatureWithEntry(me,NPC_LAVA_BLAZE, 10.0f, true))
@@ -689,7 +689,7 @@ public:
}
void UpdateAI(const uint32 diff)
{
{
}
}; };

Some files were not shown because too many files have changed in this diff Show More