diff options
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index d34f31e0489..4587d8f1d3f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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 ); } |