[7362] Use IN_MILISECONDS where appropriate, other cleanups. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -630,29 +630,29 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
|
||||
sLog.outError("auction to item, that doesn't exist !!!!");
|
||||
return false;
|
||||
}
|
||||
data << (uint32) Id;
|
||||
data << (uint32) pItem->GetEntry();
|
||||
data << uint32(Id);
|
||||
data << uint32(pItem->GetEntry());
|
||||
|
||||
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; i++)
|
||||
{
|
||||
data << (uint32) pItem->GetEnchantmentId(EnchantmentSlot(i));
|
||||
data << (uint32) pItem->GetEnchantmentDuration(EnchantmentSlot(i));
|
||||
data << (uint32) pItem->GetEnchantmentCharges(EnchantmentSlot(i));
|
||||
data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i)));
|
||||
data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
|
||||
data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
|
||||
}
|
||||
|
||||
data << (uint32) pItem->GetItemRandomPropertyId(); //random item property id
|
||||
data << (uint32) pItem->GetItemSuffixFactor(); //SuffixFactor
|
||||
data << (uint32) pItem->GetCount(); //item->count
|
||||
data << (uint32) pItem->GetSpellCharges(); //item->charge FFFFFFF
|
||||
data << (uint32) 0; //Unknown
|
||||
data << (uint64) owner; //Auction->owner
|
||||
data << (uint32) startbid; //Auction->startbid (not sure if useful)
|
||||
data << (uint32) (bid ? GetAuctionOutBid() : 0);
|
||||
data << uint32(pItem->GetItemRandomPropertyId()); //random item property id
|
||||
data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor
|
||||
data << uint32(pItem->GetCount()); //item->count
|
||||
data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF
|
||||
data << uint32(0); //Unknown
|
||||
data << uint32(owner); //Auction->owner
|
||||
data << uint32(startbid); //Auction->startbid (not sure if useful)
|
||||
data << uint32(bid ? GetAuctionOutBid() : 0);
|
||||
//minimal outbid
|
||||
data << (uint32) buyout; //auction->buyout
|
||||
data << (uint32) (expire_time - time(NULL))* 1000; //time left
|
||||
data << (uint64) bidder; //auction->bidder current
|
||||
data << (uint32) bid; //current bid
|
||||
data << uint32(buyout); //auction->buyout
|
||||
data << uint32((expire_time-time(NULL))*IN_MILISECONDS);//time left
|
||||
data << uint64(bidder) ; //auction->bidder current
|
||||
data << uint32(bid); //current bid
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
class BattleGround;
|
||||
|
||||
#define EY_MAX_TEAM_SCORE 2000
|
||||
#define BG_EY_FLAG_RESPAWN_TIME 10000 //10 seconds
|
||||
#define BG_EY_FPOINTS_TICK_TIME 2000 //2 seconds
|
||||
#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILISECONDS) //10 seconds
|
||||
#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILISECONDS) //2 seconds
|
||||
|
||||
enum BG_EY_WorldStates
|
||||
{
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "BattleGround.h"
|
||||
|
||||
#define BG_WS_MAX_TEAM_SCORE 3
|
||||
#define BG_WS_FLAG_RESPAWN_TIME 23000
|
||||
#define BG_WS_FLAG_DROP_TIME 10000
|
||||
#define BG_WS_FLAG_RESPAWN_TIME (23*IN_MILISECONDS)
|
||||
#define BG_WS_FLAG_DROP_TIME (10*IN_MILISECONDS)
|
||||
|
||||
enum BG_WS_Sound
|
||||
{
|
||||
|
||||
@@ -1639,7 +1639,7 @@ void Creature::setDeathState(DeathState s)
|
||||
{
|
||||
if((s == JUST_DIED && !m_isDeadByDefault)||(s == JUST_ALIVED && m_isDeadByDefault))
|
||||
{
|
||||
m_deathTimer = m_corpseDelay*1000;
|
||||
m_deathTimer = m_corpseDelay*IN_MILISECONDS;
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY) || isWorldBoss())
|
||||
@@ -1991,7 +1991,7 @@ void Creature::SaveRespawnTime()
|
||||
if(m_respawnTime > time(NULL)) // dead (no corpse)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
else if(m_deathTimer > 0) // dead (corpse)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/1000);
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
|
||||
}
|
||||
|
||||
bool Creature::IsOutOfThreatArea(Unit* pVictim) const
|
||||
@@ -2116,7 +2116,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
|
||||
|
||||
uint32 cooldown = GetSpellRecoveryTime(spellInfo);
|
||||
if(cooldown)
|
||||
_AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/1000);
|
||||
_AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILISECONDS);
|
||||
|
||||
if(spellInfo->Category)
|
||||
_AddCreatureCategoryCooldown(spellInfo->Category, time(NULL));
|
||||
@@ -2135,7 +2135,7 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const
|
||||
return true;
|
||||
|
||||
CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category);
|
||||
return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / 1000)) > time(NULL));
|
||||
return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILISECONDS)) > time(NULL));
|
||||
}
|
||||
|
||||
bool Creature::HasSpellCooldown(uint32 spell_id) const
|
||||
@@ -2164,7 +2164,7 @@ time_t Creature::GetRespawnTimeEx() const
|
||||
if(m_respawnTime > now) // dead (no corpse)
|
||||
return m_respawnTime;
|
||||
else if(m_deathTimer > 0) // dead (corpse)
|
||||
return now+m_respawnDelay+m_deathTimer/1000;
|
||||
return now+m_respawnDelay+m_deathTimer/IN_MILISECONDS;
|
||||
else
|
||||
return now;
|
||||
}
|
||||
@@ -2206,7 +2206,7 @@ void Creature::AllLootRemovedFromCorpse()
|
||||
|
||||
// corpse was not skinnable -> apply corpse looted timer
|
||||
if (!cinfo || !cinfo->SkinLootId)
|
||||
nDeathTimer = (uint32)((m_corpseDelay * 1000) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED));
|
||||
nDeathTimer = (uint32)((m_corpseDelay * IN_MILISECONDS) * sWorld.getRate(RATE_CORPSE_DECAY_LOOTED));
|
||||
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
|
||||
else
|
||||
nDeathTimer = 0;
|
||||
|
||||
@@ -1076,7 +1076,7 @@ uint32 GameEvent::Update() // return the next e
|
||||
for(std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
|
||||
StopEvent(*itr);
|
||||
sLog.outDetail("Next game event check in %u seconds.", nextEventDelay + 1);
|
||||
return (nextEventDelay + 1) * 1000; // Add 1 second to be sure event has started/stopped at next call
|
||||
return (nextEventDelay + 1) * IN_MILISECONDS; // Add 1 second to be sure event has started/stopped at next call
|
||||
}
|
||||
|
||||
void GameEvent::UnApplyEvent(uint16 event_id)
|
||||
|
||||
@@ -48,7 +48,7 @@ class Player;
|
||||
|
||||
#define CENTER_GRID_OFFSET (SIZE_OF_GRIDS/2)
|
||||
|
||||
#define MIN_GRID_DELAY MINUTE*1000
|
||||
#define MIN_GRID_DELAY (MINUTE*IN_MILISECONDS)
|
||||
#define MIN_MAP_UPDATE_DELAY 50
|
||||
|
||||
#define SIZE_OF_GRID_CELL (SIZE_OF_GRIDS/MAX_NUMBER_OF_CELLS)
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
||||
|
||||
// save or plan save after 20 sec (logout delay) if current next save time more this value and _not_ output any messages to prevent cheat planning
|
||||
uint32 save_interval = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
if(save_interval==0 || save_interval > 20*1000 && player->GetSaveTimer() <= save_interval - 20*1000)
|
||||
if(save_interval==0 || save_interval > 20*IN_MILISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILISECONDS)
|
||||
player->SaveToDB();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1147,7 +1147,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket&/* recv_data*/)
|
||||
recv_data >> guid;
|
||||
recv_data >> flags >> time;
|
||||
DEBUG_LOG("Guid " I64FMTD,guid);
|
||||
DEBUG_LOG("Flags %u, time %u",flags, time/1000);
|
||||
DEBUG_LOG("Flags %u, time %u",flags, time/IN_MILISECONDS);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1054,7 +1054,7 @@ void Pet::_LoadSpellCooldowns()
|
||||
continue;
|
||||
|
||||
data << uint32(spell_id);
|
||||
data << uint32(uint32(db_time-curTime)*1000); // in m.secs
|
||||
data << uint32(uint32(db_time-curTime)*IN_MILISECONDS);
|
||||
|
||||
_AddCreatureSpellCooldown(spell_id,db_time);
|
||||
|
||||
|
||||
+1
-1
@@ -291,7 +291,7 @@ void PetAI::UpdateAllies()
|
||||
Unit* owner = i_pet.GetCharmerOrOwner();
|
||||
Group *pGroup = NULL;
|
||||
|
||||
m_updateAlliesTimer = 10000; //update friendly targets every 10 seconds, lesser checks increase performance
|
||||
m_updateAlliesTimer = 10*IN_MILISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance
|
||||
|
||||
if(!owner)
|
||||
return;
|
||||
|
||||
+24
-23
@@ -68,7 +68,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#define ZONE_UPDATE_INTERVAL 1000
|
||||
#define ZONE_UPDATE_INTERVAL (1*IN_MILISECONDS)
|
||||
|
||||
#define PLAYER_SKILL_INDEX(x) (PLAYER_SKILL_INFO_1_1 + ((x)*3))
|
||||
#define PLAYER_SKILL_VALUE_INDEX(x) (PLAYER_SKILL_INDEX(x)+1)
|
||||
@@ -367,7 +367,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this)
|
||||
|
||||
m_swingErrorMsg = 0;
|
||||
|
||||
m_DetectInvTimer = 1000;
|
||||
m_DetectInvTimer = 1*IN_MILISECONDS;
|
||||
|
||||
m_bgBattleGroundID = 0;
|
||||
m_bgTypeID = BATTLEGROUND_TYPE_NONE;
|
||||
@@ -872,7 +872,7 @@ void Player::StartMirrorTimer(MirrorTimerType Type, uint32 MaxValue)
|
||||
void Player::ModifyMirrorTimer(MirrorTimerType Type, uint32 MaxValue, uint32 CurrentValue, uint32 Regen)
|
||||
{
|
||||
if(Type==BREATH_TIMER)
|
||||
m_breathTimer = ((MaxValue + 1000) - CurrentValue) / Regen;
|
||||
m_breathTimer = ((MaxValue + 1*IN_MILISECONDS) - CurrentValue) / Regen;
|
||||
|
||||
WorldPacket data(SMSG_START_MIRROR_TIMER, (21));
|
||||
data << (uint32)Type;
|
||||
@@ -930,7 +930,7 @@ void Player::HandleDrowning()
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 UnderWaterTime = 3*MINUTE*1000; // default duration
|
||||
uint32 UnderWaterTime = 3*MINUTE*IN_MILISECONDS; // default duration
|
||||
|
||||
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
|
||||
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
|
||||
@@ -942,7 +942,7 @@ void Player::HandleDrowning()
|
||||
if (!(m_isunderwater & UNDERWATER_WATER_TRIGGER))
|
||||
{
|
||||
m_isunderwater|= UNDERWATER_WATER_TRIGGER;
|
||||
m_breathTimer = UnderWaterTime + 1000;
|
||||
m_breathTimer = UnderWaterTime + 1*IN_MILISECONDS;
|
||||
}
|
||||
//single trigger "show Breathbar"
|
||||
if ( m_breathTimer <= UnderWaterTime && !(m_isunderwater & UNDERWATER_WATER_BREATHB))
|
||||
@@ -987,7 +987,7 @@ void Player::HandleLava()
|
||||
if (!(m_isunderwater & UNDERWATER_INLAVA))
|
||||
{
|
||||
m_isunderwater|= UNDERWATER_WATER_BREATHB;
|
||||
m_breathTimer = 1000;
|
||||
m_breathTimer = 1*IN_MILISECONDS;
|
||||
}
|
||||
*/
|
||||
// Reset BreathTimer and still in the lava
|
||||
@@ -1000,7 +1000,7 @@ void Player::HandleLava()
|
||||
if ( !isGameMaster() )
|
||||
EnvironmentalDamage(guid, DAMAGE_LAVA, damage);
|
||||
|
||||
m_breathTimer = 1000;
|
||||
m_breathTimer = 1*IN_MILISECONDS;
|
||||
}
|
||||
}
|
||||
else if (!isAlive()) // Disable breath timer and reset underwater flags
|
||||
@@ -1313,7 +1313,7 @@ void Player::Update( uint32 p_time )
|
||||
{
|
||||
m_drunkTimer += p_time;
|
||||
|
||||
if (m_drunkTimer > 10000)
|
||||
if (m_drunkTimer > 10*IN_MILISECONDS)
|
||||
HandleSobering();
|
||||
}
|
||||
|
||||
@@ -2533,7 +2533,7 @@ void Player::SendInitialSpells()
|
||||
time_t cooldown = 0;
|
||||
time_t curTime = time(NULL);
|
||||
if(itr->second.end > curTime)
|
||||
cooldown = (itr->second.end-curTime)*1000;
|
||||
cooldown = (itr->second.end-curTime)*IN_MILISECONDS;
|
||||
|
||||
data << uint16(itr->second.itemid); // cast item id
|
||||
data << uint16(sEntry->Category); // spell category
|
||||
@@ -3227,8 +3227,8 @@ void Player::RemoveArenaSpellCooldowns()
|
||||
SpellEntry const * entry = sSpellStore.LookupEntry(itr->first);
|
||||
// check if spellentry is present and if the cooldown is less than 15 mins
|
||||
if( entry &&
|
||||
entry->RecoveryTime <= 15 * MINUTE * 1000 &&
|
||||
entry->CategoryRecoveryTime <= 15 * MINUTE * 1000 )
|
||||
entry->RecoveryTime <= 15 * MINUTE * IN_MILISECONDS &&
|
||||
entry->CategoryRecoveryTime <= 15 * MINUTE * IN_MILISECONDS )
|
||||
{
|
||||
// notify player
|
||||
WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8));
|
||||
@@ -4003,7 +4003,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
{
|
||||
if(Aura* Aur = GetAura(SPELL_ID_PASSIVE_RESURRECTION_SICKNESS,i))
|
||||
{
|
||||
Aur->SetAuraDurationAndUpdate(delta*1000);
|
||||
Aur->SetAuraDurationAndUpdate(delta*IN_MILISECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4023,7 +4023,7 @@ void Player::KillPlayer()
|
||||
ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable());
|
||||
|
||||
// 6 minutes until repop at graveyard
|
||||
m_deathTimer = 6*MINUTE*1000;
|
||||
m_deathTimer = 6*MINUTE*IN_MILISECONDS;
|
||||
|
||||
UpdateCorpseReclaimDelay(); // dependent at use SetDeathPvP() call before kill
|
||||
SendCorpseReclaimDelay();
|
||||
@@ -12959,10 +12959,10 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
|
||||
|
||||
// shared timed quest
|
||||
if(questGiver && questGiver->GetTypeId()==TYPEID_PLAYER)
|
||||
limittime = ((Player*)questGiver)->getQuestStatusMap()[quest_id].m_timer / 1000;
|
||||
limittime = ((Player*)questGiver)->getQuestStatusMap()[quest_id].m_timer / IN_MILISECONDS;
|
||||
|
||||
AddTimedQuest( quest_id );
|
||||
questStatusData.m_timer = limittime * 1000;
|
||||
questStatusData.m_timer = limittime * IN_MILISECONDS;
|
||||
qtime = static_cast<uint32>(time(NULL)) + limittime;
|
||||
}
|
||||
else
|
||||
@@ -15527,7 +15527,7 @@ void Player::_LoadQuestStatus(QueryResult *result)
|
||||
if (quest_time <= sWorld.GetGameTime())
|
||||
questStatusData.m_timer = 1;
|
||||
else
|
||||
questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * 1000;
|
||||
questStatusData.m_timer = (quest_time - sWorld.GetGameTime()) * IN_MILISECONDS;
|
||||
}
|
||||
else
|
||||
quest_time = 0;
|
||||
@@ -16237,6 +16237,7 @@ void Player::_SaveAuras()
|
||||
AuraMap::const_iterator itr2 = itr;
|
||||
// save previous spellEffectPair to db
|
||||
itr2--;
|
||||
|
||||
SpellEntry const *spellInfo = itr2->second->GetSpellProto();
|
||||
|
||||
//skip all auras from spells that are passive or need a shapeshift
|
||||
@@ -16412,11 +16413,11 @@ void Player::_SaveQuestStatus()
|
||||
case QUEST_NEW :
|
||||
CharacterDatabase.PExecute("INSERT INTO character_queststatus (guid,quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) "
|
||||
"VALUES ('%u', '%u', '%u', '%u', '%u', '" I64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')",
|
||||
GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / 1000 + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
|
||||
GetGUIDLow(), i->first, i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS+ sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3]);
|
||||
break;
|
||||
case QUEST_CHANGED :
|
||||
CharacterDatabase.PExecute("UPDATE character_queststatus SET status = '%u',rewarded = '%u',explored = '%u',timer = '" I64FMTD "',mobcount1 = '%u',mobcount2 = '%u',mobcount3 = '%u',mobcount4 = '%u',itemcount1 = '%u',itemcount2 = '%u',itemcount3 = '%u',itemcount4 = '%u' WHERE guid = '%u' AND quest = '%u' ",
|
||||
i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / 1000 + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
|
||||
i->second.m_status, i->second.m_rewarded, i->second.m_explored, uint64(i->second.m_timer / IN_MILISECONDS + sWorld.GetGameTime()), i->second.m_creatureOrGOcount[0], i->second.m_creatureOrGOcount[1], i->second.m_creatureOrGOcount[2], i->second.m_creatureOrGOcount[3], i->second.m_itemcount[0], i->second.m_itemcount[1], i->second.m_itemcount[2], i->second.m_itemcount[3], GetGUIDLow(), i->first );
|
||||
break;
|
||||
case QUEST_UNCHANGED:
|
||||
break;
|
||||
@@ -17145,7 +17146,7 @@ void Player::PetSpellInitialize()
|
||||
time_t cooldown = 0;
|
||||
|
||||
if(itr->second > curTime)
|
||||
cooldown = (itr->second - curTime) * 1000;
|
||||
cooldown = (itr->second - curTime) * IN_MILISECONDS;
|
||||
|
||||
data << uint16(itr->first); // spellid
|
||||
data << uint16(0); // spell category?
|
||||
@@ -17158,7 +17159,7 @@ void Player::PetSpellInitialize()
|
||||
time_t cooldown = 0;
|
||||
|
||||
if(itr->second > curTime)
|
||||
cooldown = (itr->second - curTime) * 1000;
|
||||
cooldown = (itr->second - curTime) * IN_MILISECONDS;
|
||||
|
||||
data << uint16(itr->first); // spellid
|
||||
data << uint16(0); // spell category?
|
||||
@@ -17662,7 +17663,7 @@ void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
|
||||
{
|
||||
data << unSpellId;
|
||||
data << unTimeMs; // in m.secs
|
||||
AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/1000);
|
||||
AddSpellCooldown(unSpellId, 0, curTime + unTimeMs/IN_MILISECONDS);
|
||||
}
|
||||
}
|
||||
GetSession()->SendPacket(&data);
|
||||
@@ -18049,7 +18050,7 @@ void Player::SendCooldownEvent(SpellEntry const *spellInfo)
|
||||
if (cooldown < 0)
|
||||
cooldown = 0;
|
||||
// Add cooldown
|
||||
AddSpellCooldown(spellInfo->Id, 0, time(NULL) + cooldown / 1000);
|
||||
AddSpellCooldown(spellInfo->Id, 0, time(NULL) + cooldown / IN_MILISECONDS);
|
||||
// Send activate
|
||||
WorldPacket data(SMSG_COOLDOWN_EVENT, (4+8));
|
||||
data << spellInfo->Id;
|
||||
@@ -19702,7 +19703,7 @@ void Player::SendCorpseReclaimDelay(bool load)
|
||||
|
||||
//! corpse reclaim delay 30 * 1000ms or longer at often deaths
|
||||
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
|
||||
data << uint32(delay*1000);
|
||||
data << uint32(delay*IN_MILISECONDS);
|
||||
GetSession()->SendPacket( &data );
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1982,7 +1982,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
/*** REST SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
bool isRested() const { return GetRestTime() >= 10000; }
|
||||
bool isRested() const { return GetRestTime() >= 10*IN_MILISECONDS; }
|
||||
uint32 GetXPRestBonus(uint32 xp);
|
||||
uint32 GetRestTime() const { return m_restTime;};
|
||||
void SetRestTime(uint32 v) { m_restTime = v;};
|
||||
@@ -2446,7 +2446,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
|
||||
continue;
|
||||
|
||||
// special case (skip >10sec spell casts for instant cast setting)
|
||||
if( mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
|
||||
if( mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10*IN_MILISECONDS) && mod->value <= -100)
|
||||
continue;
|
||||
|
||||
totalpct += mod->value;
|
||||
|
||||
+6
-6
@@ -49,7 +49,7 @@
|
||||
#include "Util.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
#define SPELL_CHANNEL_UPDATE_INTERVAL 1000
|
||||
#define SPELL_CHANNEL_UPDATE_INTERVAL (1*IN_MILISECONDS)
|
||||
|
||||
extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS];
|
||||
|
||||
@@ -2497,8 +2497,8 @@ void Spell::SendSpellCooldown()
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
|
||||
time_t catrecTime = catrec ? curTime+catrec/1000 : 0; // in secs
|
||||
time_t recTime = rec ? curTime+rec/1000 : catrecTime;// in secs
|
||||
time_t catrecTime = catrec ? curTime+catrec/IN_MILISECONDS : 0;
|
||||
time_t recTime = rec ? curTime+rec/IN_MILISECONDS : catrecTime;
|
||||
|
||||
// self spell cooldown
|
||||
if(recTime > 0)
|
||||
@@ -3464,7 +3464,7 @@ void Spell::TakeReagents()
|
||||
ItemPrototype const *proto = m_CastItem->GetProto();
|
||||
if( proto && proto->ItemId == itemid )
|
||||
{
|
||||
for(int s=0;s<5;s++)
|
||||
for(int s=0;s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
{
|
||||
// CastItem will be used up and does not count as reagent
|
||||
int32 charges = m_CastItem->GetSpellCharges(s);
|
||||
@@ -3774,7 +3774,7 @@ uint8 Spell::CanCast(bool strict)
|
||||
// - with greater than 15 min CD without SPELL_ATTR_EX4_USABLE_IN_ARENA flag
|
||||
// - with SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA flag
|
||||
if( (m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA) ||
|
||||
GetSpellRecoveryTime(m_spellInfo) > 15 * MINUTE * 1000 && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA) )
|
||||
GetSpellRecoveryTime(m_spellInfo) > 15 * MINUTE * IN_MILISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR_EX4_USABLE_IN_ARENA) )
|
||||
if(MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId()))
|
||||
if(mapEntry->IsBattleArena())
|
||||
return SPELL_FAILED_NOT_IN_ARENA;
|
||||
@@ -4963,7 +4963,7 @@ uint8 Spell::CheckItems()
|
||||
ItemPrototype const *proto = m_CastItem->GetProto();
|
||||
if(!proto)
|
||||
return SPELL_FAILED_ITEM_NOT_READY;
|
||||
for(int s=0;s<5;s++)
|
||||
for(int s=0;s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
{
|
||||
// CastItem will be used up and does not count as reagent
|
||||
int32 charges = m_CastItem->GetSpellCharges(s);
|
||||
|
||||
+1
-1
@@ -234,7 +234,7 @@ enum SpellTargets
|
||||
SPELL_TARGETS_CHAINHEAL,
|
||||
};
|
||||
|
||||
#define SPELL_SPELL_CHANNEL_UPDATE_INTERVAL 1000
|
||||
#define SPELL_SPELL_CHANNEL_UPDATE_INTERVAL (1*IN_MILISECONDS)
|
||||
|
||||
typedef std::multimap<uint64, uint64> SpellTargetTimeMap;
|
||||
|
||||
|
||||
+12
-12
@@ -654,7 +654,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
// Add main hand dps * effect[2] amount
|
||||
float averange = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
|
||||
int32 count = m_caster->CalculateSpellDamage(m_spellInfo, 2, m_spellInfo->EffectBasePoints[2], unitTarget);
|
||||
damage += count * int32(averange * 1000) / m_caster->GetAttackTime(BASE_ATTACK);
|
||||
damage += count * int32(averange * IN_MILISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3471,7 +3471,7 @@ void Spell::EffectDispel(uint32 i)
|
||||
|
||||
// On succes dispel
|
||||
// Devour Magic
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == 12)
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC)
|
||||
{
|
||||
uint32 heal_spell = 0;
|
||||
switch (m_spellInfo->Id)
|
||||
@@ -3544,7 +3544,7 @@ void Spell::EffectDistract(uint32 /*i*/)
|
||||
// Set creature Distracted, Stop it, And turn it
|
||||
unitTarget->SetOrientation(angle);
|
||||
unitTarget->StopMoving();
|
||||
unitTarget->GetMotionMaster()->MoveDistract(damage*1000);
|
||||
unitTarget->GetMotionMaster()->MoveDistract(damage*IN_MILISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4573,7 +4573,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
}
|
||||
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
if(pGameObj->GetGoType() != GAMEOBJECT_TYPE_FLAGDROP) // make dropped flag clickable for other players (not set owner guid (created by) for this)...
|
||||
@@ -4616,7 +4616,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
||||
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/1000 : 0);
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
m_caster->AddGameObject(linkedGO);
|
||||
@@ -5335,7 +5335,7 @@ void Spell::EffectDuel(uint32 i)
|
||||
pGameObj->SetUInt32Value(GAMEOBJECT_FACTION, m_caster->getFaction() );
|
||||
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()+1 );
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
m_caster->AddGameObject(pGameObj);
|
||||
@@ -5412,7 +5412,7 @@ void Spell::EffectSummonPlayer(uint32 /*i*/)
|
||||
WorldPacket data(SMSG_SUMMON_REQUEST, 8+4+4);
|
||||
data << uint64(m_caster->GetGUID()); // summoner guid
|
||||
data << uint32(m_caster->GetZoneId()); // summoner zone
|
||||
data << uint32(MAX_PLAYER_SUMMON_DELAY*1000); // auto decline after msecs
|
||||
data << uint32(MAX_PLAYER_SUMMON_DELAY*IN_MILISECONDS); // auto decline after msecs
|
||||
((Player*)unitTarget)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -5595,7 +5595,7 @@ void Spell::EffectEnchantHeldItem(uint32 i)
|
||||
return;
|
||||
|
||||
// Apply the temporary enchantment
|
||||
item->SetEnchantment(slot, enchant_id, duration*1000, 0);
|
||||
item->SetEnchantment(slot, enchant_id, duration*IN_MILISECONDS, 0);
|
||||
item_owner->ApplyEnchantment(item,slot,true);
|
||||
}
|
||||
}
|
||||
@@ -5726,7 +5726,7 @@ void Spell::EffectSummonObject(uint32 i)
|
||||
|
||||
//pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL,m_caster->getLevel());
|
||||
int32 duration = GetSpellDuration(m_spellInfo);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
m_caster->AddGameObject(pGameObj);
|
||||
|
||||
@@ -6410,7 +6410,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
case 3: lastSec = 17; break;
|
||||
}
|
||||
|
||||
duration = duration - lastSec*1000 + FISHING_BOBBER_READY_TIME*1000;
|
||||
duration = duration - lastSec*IN_MILISECONDS + FISHING_BOBBER_READY_TIME*IN_MILISECONDS;
|
||||
break;
|
||||
}
|
||||
case GAMEOBJECT_TYPE_SUMMONING_RITUAL:
|
||||
@@ -6430,7 +6430,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
}
|
||||
}
|
||||
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/1000 : 0);
|
||||
pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
|
||||
pGameObj->SetOwnerGUID(m_caster->GetGUID() );
|
||||
|
||||
@@ -6453,7 +6453,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
||||
if(linkedGO->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0, 0, 0, 0, 100, 1))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/1000 : 0);
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
//linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() );
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
linkedGO->SetOwnerGUID(m_caster->GetGUID() );
|
||||
|
||||
@@ -225,6 +225,13 @@ enum SpellFailedReason
|
||||
SPELL_FAILED_UNKNOWN = 181
|
||||
};
|
||||
|
||||
// only used in code
|
||||
enum SpellCategories
|
||||
{
|
||||
SPELLCATEGORY_HEALTH_MANA_POTIONS = 4,
|
||||
SPELLCATEGORY_DEVOUR_MAGIC = 12
|
||||
};
|
||||
|
||||
enum SpellFamilyNames
|
||||
{
|
||||
SPELLFAMILY_GENERIC = 0,
|
||||
|
||||
+1
-1
@@ -4009,7 +4009,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit
|
||||
// set its duration and maximum duration
|
||||
// max duration 2 minutes (in msecs)
|
||||
int32 dur = aur->GetAuraDuration();
|
||||
const int32 max_dur = 2*MINUTE*1000;
|
||||
const int32 max_dur = 2*MINUTE*IN_MILISECONDS;
|
||||
new_aur->SetAuraMaxDuration( max_dur > dur ? dur : max_dur );
|
||||
new_aur->SetAuraDuration( max_dur > dur ? dur : max_dur );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone
|
||||
m_type = WEATHER_TYPE_FINE;
|
||||
m_grade = 0;
|
||||
|
||||
sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (1000*MINUTE)) );
|
||||
sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILISECONDS)) );
|
||||
}
|
||||
|
||||
/// Launch a weather update
|
||||
|
||||
+8
-7
@@ -822,7 +822,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
}
|
||||
if(reload)
|
||||
{
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*1000);
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS);
|
||||
m_timers[WUPDATE_UPTIME].Reset();
|
||||
}
|
||||
|
||||
@@ -1440,18 +1440,19 @@ void World::SetInitialWorldSettings()
|
||||
|
||||
m_timers[WUPDATE_OBJECTS].SetInterval(0);
|
||||
m_timers[WUPDATE_SESSIONS].SetInterval(0);
|
||||
m_timers[WUPDATE_WEATHERS].SetInterval(1000);
|
||||
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*1000); //set auction update interval to 1 minute
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*1000);
|
||||
m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILISECONDS);
|
||||
m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILISECONDS);
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS);
|
||||
//Update "uptime" table based on configuration entry in minutes.
|
||||
m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*1000); //erase corpses every 20 minutes
|
||||
m_timers[WUPDATE_CORPSES].SetInterval(20*MINUTE*IN_MILISECONDS);
|
||||
//erase corpses every 20 minutes
|
||||
|
||||
//to set mailtimer to return mails every day between 4 and 5 am
|
||||
//mailtimer is increased when updating auctions
|
||||
//one second is 1000 -(tested on win system)
|
||||
mail_timer = ((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * 1000) / m_timers[WUPDATE_AUCTIONS].GetInterval() );
|
||||
mail_timer = ((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval() );
|
||||
//1440
|
||||
mail_timer_expires = ( (DAY * 1000) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
|
||||
mail_timer_expires = ( (DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
|
||||
sLog.outDebug("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires);
|
||||
|
||||
///- Initilize static helper structures
|
||||
|
||||
@@ -164,6 +164,7 @@ enum TimeConstants
|
||||
HOUR = MINUTE*60,
|
||||
DAY = HOUR*24,
|
||||
MONTH = DAY*30,
|
||||
YEAR = MONTH*12,
|
||||
IN_MILISECONDS = 1000
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7360"
|
||||
#define REVISION_NR "7362"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user