Sourcefile sleanups -> tabs to spaces, remove whitespace - also update the cleanupscripts very slightly
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -711,7 +711,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
SendToOne(&data, p);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Player *plr = sObjectMgr.GetPlayer(p);
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -127,7 +127,7 @@ class ConditionMgr
|
||||
friend class ACE_Singleton<ConditionMgr, ACE_Null_Mutex>;
|
||||
ConditionMgr();
|
||||
~ConditionMgr();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
void LoadConditions(bool isReload = false);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user