mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Some minor cleanups
Fixed SQL added in prev commit.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
-- Fix sai of Darkspear Scout after recent fixing action 60
|
||||
SET @N_DScout = 40416;
|
||||
SET @N_Voljin = 40391;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@N_DScout AND `source_type`=0;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@N_DScout*100 AND `source_type`=9;
|
||||
INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`)VALUES
|
||||
|
||||
@@ -717,14 +717,13 @@ void SmartAI::SetFly(bool fly)
|
||||
{
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01);
|
||||
me->SetFlying(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01);
|
||||
me->SetFlying(false);
|
||||
}
|
||||
me->SetFlying(fly);
|
||||
me->SendMovementFlagUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -641,20 +641,21 @@ const float m_diminishing_k[MAX_CLASSES] =
|
||||
|
||||
float Player::GetMissPercentageFromDefence() const
|
||||
{
|
||||
const float miss_cap[MAX_CLASSES] =
|
||||
float const miss_cap[MAX_CLASSES] =
|
||||
{
|
||||
16.00f, // Warrior //correct
|
||||
16.00f, // Paladin //correct
|
||||
16.00f, // Hunter //?
|
||||
16.00f, // Rogue //?
|
||||
16.00f, // Priest //?
|
||||
16.00f, // DK //correct
|
||||
16.00f, // Shaman //?
|
||||
16.00f, // Mage //?
|
||||
16.00f, // Warlock //?
|
||||
0.0f, // ??
|
||||
16.00f // Druid //?
|
||||
16.00f, // Warrior //correct
|
||||
16.00f, // Paladin //correct
|
||||
16.00f, // Hunter //?
|
||||
16.00f, // Rogue //?
|
||||
16.00f, // Priest //?
|
||||
16.00f, // DK //correct
|
||||
16.00f, // Shaman //?
|
||||
16.00f, // Mage //?
|
||||
16.00f, // Warlock //?
|
||||
0.0f, // ??
|
||||
16.00f // Druid //?
|
||||
};
|
||||
|
||||
float diminishing = 0.0f, nondiminishing = 0.0f;
|
||||
// Modify value from defense skill (only bonus from defense rating diminishes)
|
||||
nondiminishing += (GetSkillValue(SKILL_DEFENSE) - GetMaxSkillValueForLevel()) * 0.04f;
|
||||
@@ -669,17 +670,17 @@ void Player::UpdateParryPercentage()
|
||||
{
|
||||
const float parry_cap[MAX_CLASSES] =
|
||||
{
|
||||
47.003525f, // Warrior
|
||||
47.003525f, // Paladin
|
||||
145.560408f, // Hunter
|
||||
145.560408f, // Rogue
|
||||
0.0f, // Priest
|
||||
47.003525f, // DK
|
||||
145.560408f, // Shaman
|
||||
0.0f, // Mage
|
||||
0.0f, // Warlock
|
||||
0.0f, // ??
|
||||
0.0f // Druid
|
||||
47.003525f, // Warrior
|
||||
47.003525f, // Paladin
|
||||
145.560408f, // Hunter
|
||||
145.560408f, // Rogue
|
||||
0.0f, // Priest
|
||||
47.003525f, // DK
|
||||
145.560408f, // Shaman
|
||||
0.0f, // Mage
|
||||
0.0f, // Warlock
|
||||
0.0f, // ??
|
||||
0.0f // Druid
|
||||
};
|
||||
|
||||
// No parry
|
||||
@@ -706,17 +707,17 @@ void Player::UpdateDodgePercentage()
|
||||
{
|
||||
const float dodge_cap[MAX_CLASSES] =
|
||||
{
|
||||
88.129021f, // Warrior
|
||||
88.129021f, // Paladin
|
||||
145.560408f, // Hunter
|
||||
145.560408f, // Rogue
|
||||
150.375940f, // Priest
|
||||
88.129021f, // DK
|
||||
145.560408f, // Shaman
|
||||
150.375940f, // Mage
|
||||
150.375940f, // Warlock
|
||||
0.0f, // ??
|
||||
116.890707f // Druid
|
||||
88.129021f, // Warrior
|
||||
88.129021f, // Paladin
|
||||
145.560408f, // Hunter
|
||||
145.560408f, // Rogue
|
||||
150.375940f, // Priest
|
||||
88.129021f, // DK
|
||||
145.560408f, // Shaman
|
||||
150.375940f, // Mage
|
||||
150.375940f, // Warlock
|
||||
0.0f, // ??
|
||||
116.890707f // Druid
|
||||
};
|
||||
|
||||
float diminishing = 0.0f, nondiminishing = 0.0f;
|
||||
|
||||
@@ -21,13 +21,11 @@
|
||||
#include "Grid.h"
|
||||
#include "Log.h"
|
||||
|
||||
void
|
||||
InvalidState::Update(Map &, NGridType &, GridInfo &, const uint32) const
|
||||
void InvalidState::Update(Map &, NGridType &, GridInfo &, const uint32) const
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 t_diff) const
|
||||
void ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 t_diff) const
|
||||
{
|
||||
// Only check grid activity every (grid_expiry/10) ms, because it's really useless to do it every cycle
|
||||
info.UpdateTimeTracker(t_diff);
|
||||
@@ -48,16 +46,14 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 t_dif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32) const
|
||||
void IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32) const
|
||||
{
|
||||
m.ResetGridExpiry(grid);
|
||||
grid.SetGridState(GRID_STATE_REMOVAL);
|
||||
sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", grid.getX(), grid.getY(), m.GetId());
|
||||
}
|
||||
|
||||
void
|
||||
RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 t_diff) const
|
||||
void RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 t_diff) const
|
||||
{
|
||||
if (!info.getUnloadLock())
|
||||
{
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
|
||||
using namespace Trinity;
|
||||
|
||||
void
|
||||
VisibleNotifier::SendToSelf()
|
||||
void VisibleNotifier::SendToSelf()
|
||||
{
|
||||
// at this moment i_clientGUIDs have guids that not iterate at grid level checks
|
||||
// but exist one case when this possible and object not out of range: transports
|
||||
@@ -73,10 +72,9 @@ VisibleNotifier::SendToSelf()
|
||||
i_player.SendInitialVisiblePackets(*it);
|
||||
}
|
||||
|
||||
void
|
||||
VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
void VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (iter->getSource() == &i_object)
|
||||
continue;
|
||||
@@ -91,8 +89,7 @@ VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
void VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (!iter->getSource()->GetSharedVisionList().empty())
|
||||
@@ -102,8 +99,7 @@ VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
(*i)->UpdateVisibilityOf(&i_object);
|
||||
}
|
||||
|
||||
void
|
||||
VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
|
||||
void VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
|
||||
@@ -241,8 +237,7 @@ void AIRelocationNotifier::Visit(CreatureMapType &m)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
void MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -321,8 +316,8 @@ MessageDistDeliverer::VisitObject(Player* plr)
|
||||
}
|
||||
*/
|
||||
|
||||
template<class T> void
|
||||
ObjectUpdater::Visit(GridRefManager<T> &m)
|
||||
template<class T>
|
||||
void ObjectUpdater::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
#include "SpellAuras.h"
|
||||
|
||||
template<class T>
|
||||
inline void
|
||||
Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
inline void Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
@@ -38,8 +37,7 @@ Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
Trinity::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
inline void Trinity::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->getSource()->IsInWorld())
|
||||
|
||||
@@ -130,8 +130,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellCoord &cell, CorpseMapTyp
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ObjectGridLoader::Visit(GameObjectMapType &m)
|
||||
void ObjectGridLoader::Visit(GameObjectMapType &m)
|
||||
{
|
||||
uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX();
|
||||
uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY();
|
||||
@@ -156,8 +155,7 @@ ObjectGridLoader::Visit(CreatureMapType &m)
|
||||
LoadHelper(cell_guids.creatures, cellCoord, m, i_creatures, i_map);
|
||||
}
|
||||
|
||||
void
|
||||
ObjectWorldLoader::Visit(CorpseMapType &m)
|
||||
void ObjectWorldLoader::Visit(CorpseMapType &m)
|
||||
{
|
||||
uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX();
|
||||
uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY();
|
||||
|
||||
Reference in New Issue
Block a user