*Merge.
--HG-- branch : trunk rename : sql/updates/XXX_characters_auctionhouse.sql => sql/updates/1164_characters.sql
This commit is contained in:
+10
-23
@@ -727,42 +727,29 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
|
||||
if(plr->GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
|
||||
return;
|
||||
|
||||
BattleGroundMarks mark;
|
||||
bool IsSpell;
|
||||
if(!plr || !count)
|
||||
return;
|
||||
|
||||
BattleGroundMarks mark;
|
||||
switch(GetTypeID())
|
||||
{
|
||||
case BATTLEGROUND_AV:
|
||||
IsSpell = true;
|
||||
if(count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_AV_MARK_WINNER;
|
||||
else
|
||||
mark = SPELL_AV_MARK_LOSER;
|
||||
mark = ITEM_AV_MARK_OF_HONOR;
|
||||
break;
|
||||
case BATTLEGROUND_WS:
|
||||
IsSpell = true;
|
||||
if(count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_WS_MARK_WINNER;
|
||||
else
|
||||
mark = SPELL_WS_MARK_LOSER;
|
||||
mark = ITEM_WS_MARK_OF_HONOR;
|
||||
break;
|
||||
case BATTLEGROUND_AB:
|
||||
IsSpell = true;
|
||||
if(count == ITEM_WINNER_COUNT)
|
||||
mark = SPELL_AB_MARK_WINNER;
|
||||
else
|
||||
mark = SPELL_AB_MARK_LOSER;
|
||||
mark = ITEM_AB_MARK_OF_HONOR;
|
||||
break;
|
||||
case BATTLEGROUND_EY:
|
||||
IsSpell = false;
|
||||
case BATTLEGROUND_EY:
|
||||
mark = ITEM_EY_MARK_OF_HONOR;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if(IsSpell)
|
||||
plr->CastSpell(plr, mark, true);
|
||||
else if ( objmgr.GetItemPrototype( mark ) )
|
||||
if ( objmgr.GetItemPrototype( mark ) )
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint32 no_space_count = 0;
|
||||
@@ -770,7 +757,7 @@ void BattleGround::RewardMark(Player *plr,uint32 count)
|
||||
if( msg != EQUIP_ERR_OK ) // convert to possible store amount
|
||||
count -= no_space_count;
|
||||
|
||||
if( count != 0 && !dest.empty()) // can add some
|
||||
if(!dest.empty()) // can add some
|
||||
if(Item* item = plr->StoreNewItem( dest, mark, true, 0))
|
||||
plr->SendNewItem(item,count,false,true);
|
||||
|
||||
|
||||
@@ -53,12 +53,9 @@ enum BattleGroundQuests
|
||||
|
||||
enum BattleGroundMarks
|
||||
{
|
||||
SPELL_WS_MARK_LOSER = 24950,
|
||||
SPELL_WS_MARK_WINNER = 24951,
|
||||
SPELL_AB_MARK_LOSER = 24952,
|
||||
SPELL_AB_MARK_WINNER = 24953,
|
||||
SPELL_AV_MARK_LOSER = 24954,
|
||||
SPELL_AV_MARK_WINNER = 24955,
|
||||
ITEM_AV_MARK_OF_HONOR = 20560,
|
||||
ITEM_WS_MARK_OF_HONOR = 20558,
|
||||
ITEM_AB_MARK_OF_HONOR = 20559,
|
||||
ITEM_EY_MARK_OF_HONOR = 29024
|
||||
};
|
||||
|
||||
|
||||
@@ -30,23 +30,6 @@
|
||||
|
||||
using namespace Trinity;
|
||||
|
||||
/*void
|
||||
Trinity::PlayerNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if( iter->getSource() == &i_player )
|
||||
continue;
|
||||
|
||||
iter->getSource()->UpdateVisibilityOf(&i_player);
|
||||
i_player.UpdateVisibilityOf(iter->getSource());
|
||||
|
||||
if (!i_player.GetSharedVisionList().empty())
|
||||
for (SharedVisionList::const_iterator it = i_player.GetSharedVisionList().begin(); it != i_player.GetSharedVisionList().end(); ++it)
|
||||
(*it)->UpdateVisibilityOf(iter->getSource());
|
||||
}
|
||||
}*/
|
||||
|
||||
void
|
||||
VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
@@ -60,27 +43,7 @@ VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
}
|
||||
|
||||
void
|
||||
VisibleNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if( iter->getSource() == &i_player )
|
||||
continue;
|
||||
|
||||
iter->getSource()->UpdateVisibilityOf(&i_player);
|
||||
//i_player.UpdateVisibilityOf(iter->getSource());
|
||||
|
||||
//if (!i_player.GetSharedVisionList().empty())
|
||||
// for (SharedVisionList::const_iterator it = i_player.GetSharedVisionList().begin(); it != i_player.GetSharedVisionList().end(); ++it)
|
||||
// (*it)->UpdateVisibilityOf(iter->getSource());
|
||||
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VisibleNotifier::Notify()
|
||||
PlayerRelocationNotifier::Notify()
|
||||
{
|
||||
// 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
|
||||
@@ -144,15 +107,9 @@ VisibleNotifier::Notify()
|
||||
|
||||
// send data at target visibility change (adding to client)
|
||||
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
|
||||
{
|
||||
// target aura duration for caster show only if target exist at caster client
|
||||
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
|
||||
i_player.SendAurasForTarget((Unit*)(*vItr));
|
||||
|
||||
// non finished movements show to player
|
||||
if((*vItr)->GetTypeId()==TYPEID_UNIT && ((Creature*)(*vItr))->isAlive())
|
||||
((Creature*)(*vItr))->SendMonsterMoveWithSpeedToCurrentDestination(&i_player);
|
||||
}
|
||||
i_player.SendInitialVisiblePackets((Unit*)(*vItr));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+25
-36
@@ -38,16 +38,7 @@ class Player;
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
|
||||
/*struct TRINITY_DLL_DECL PlayerNotifier
|
||||
{
|
||||
explicit PlayerNotifier(Player &pl) : i_player(pl) {}
|
||||
void Visit(PlayerMapType &);
|
||||
template<class SKIP> void Visit(GridRefManager<SKIP> &) {}
|
||||
Player &i_player;
|
||||
};*/
|
||||
|
||||
struct TRINITY_DLL_DECL VisibleNotifier
|
||||
struct TRINITY_DLL_DECL PlayerRelocationNotifier
|
||||
{
|
||||
Player &i_player;
|
||||
UpdateData i_data;
|
||||
@@ -55,12 +46,28 @@ namespace Trinity
|
||||
Player::ClientGUIDs i_clientGUIDs;
|
||||
std::set<WorldObject*> i_visibleNow;
|
||||
|
||||
explicit VisibleNotifier(Player &player) : i_player(player),i_clientGUIDs(player.m_clientGUIDs) {}
|
||||
template<class T> void Visit(GridRefManager<T> &m);
|
||||
void Visit(PlayerMapType &);
|
||||
PlayerRelocationNotifier(Player &player) : i_player(player),i_clientGUIDs(player.m_clientGUIDs) {}
|
||||
|
||||
#ifdef WIN32
|
||||
template<class T> inline void Visit(GridRefManager<T> &);
|
||||
template<> inline void Visit(PlayerMapType &);
|
||||
template<> inline void Visit(CreatureMapType &);
|
||||
#endif
|
||||
|
||||
void Notify(void);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL CreatureRelocationNotifier
|
||||
{
|
||||
Creature &i_creature;
|
||||
CreatureRelocationNotifier(Creature &c) : i_creature(c) {}
|
||||
template<class T> void Visit(GridRefManager<T> &) {}
|
||||
#ifdef WIN32
|
||||
template<> inline void Visit(PlayerMapType &);
|
||||
template<> inline void Visit(CreatureMapType &);
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL VisibleChangesNotifier
|
||||
{
|
||||
WorldObject &i_object;
|
||||
@@ -170,25 +177,6 @@ namespace Trinity
|
||||
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL PlayerRelocationNotifier
|
||||
{
|
||||
Player &i_player;
|
||||
PlayerRelocationNotifier(Player &pl) : i_player(pl) {}
|
||||
template<class T> void Visit(GridRefManager<T> &) {}
|
||||
void Visit(PlayerMapType &);
|
||||
void Visit(CreatureMapType &);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL CreatureRelocationNotifier
|
||||
{
|
||||
Creature &i_creature;
|
||||
CreatureRelocationNotifier(Creature &c) : i_creature(c) {}
|
||||
template<class T> void Visit(GridRefManager<T> &) {}
|
||||
#ifdef WIN32
|
||||
template<> void Visit(PlayerMapType &);
|
||||
#endif
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL DynamicObjectUpdater
|
||||
{
|
||||
DynamicObject &i_dynobject;
|
||||
@@ -1045,10 +1033,11 @@ namespace Trinity
|
||||
};
|
||||
|
||||
#ifndef WIN32
|
||||
template<> void PlayerRelocationNotifier::Visit<Creature>(CreatureMapType &);
|
||||
template<> void PlayerRelocationNotifier::Visit<Player>(PlayerMapType &);
|
||||
template<> void CreatureRelocationNotifier::Visit<Player>(PlayerMapType &);
|
||||
template<> void CreatureRelocationNotifier::Visit<Creature>(CreatureMapType &);
|
||||
template<class T> inline void PlayerRelocationNotifier::Visit(GridRefManager<T> &);
|
||||
template<> inline void PlayerRelocationNotifier::Visit<Creature>(CreatureMapType &);
|
||||
template<> inline void PlayerRelocationNotifier::Visit<Player>(PlayerMapType &);
|
||||
template<> inline void CreatureRelocationNotifier::Visit<Player>(PlayerMapType &);
|
||||
template<> inline void CreatureRelocationNotifier::Visit<Creature>(CreatureMapType &);
|
||||
template<> inline void DynamicObjectUpdater::Visit<Creature>(CreatureMapType &);
|
||||
template<> inline void DynamicObjectUpdater::Visit<Player>(PlayerMapType &);
|
||||
#endif
|
||||
|
||||
@@ -29,17 +29,6 @@
|
||||
#include "CreatureAI.h"
|
||||
#include "SpellAuras.h"
|
||||
|
||||
template<class T>
|
||||
inline void
|
||||
Trinity::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
Trinity::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
@@ -48,28 +37,10 @@ Trinity::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
}
|
||||
|
||||
inline void
|
||||
Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(&i_player==iter->getSource())
|
||||
continue;
|
||||
|
||||
// visibility for players updated by ObjectAccessor::UpdateVisibilityFor calls in appropriate places
|
||||
|
||||
// Cancel Trade
|
||||
if(i_player.GetTrader()==iter->getSource())
|
||||
// iteraction distance
|
||||
if(!i_player.IsWithinDistInMap(iter->getSource(), 5))
|
||||
i_player.GetSession()->SendCancelTrade(); // will clode both side trade windows
|
||||
}
|
||||
}
|
||||
|
||||
inline void PlayerCreatureRelocationWorker(Player* pl, Creature* c)
|
||||
{
|
||||
// update creature visibility at player/creature move
|
||||
pl->UpdateVisibilityOf(c);
|
||||
if(!pl->isAlive() || !c->isAlive() || pl->isInFlight())
|
||||
return;
|
||||
|
||||
// Creature AI reaction
|
||||
if(c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS))
|
||||
@@ -94,27 +65,71 @@ inline void CreatureCreatureRelocationWorker(Creature* c1, Creature* c2)
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void
|
||||
Trinity::PlayerRelocationNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource()->m_Notified) //self is also skipped in this check
|
||||
continue;
|
||||
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
|
||||
iter->getSource()->UpdateVisibilityOf(&i_player);
|
||||
|
||||
//if (!i_player.GetSharedVisionList().empty())
|
||||
// for (SharedVisionList::const_iterator it = i_player.GetSharedVisionList().begin(); it != i_player.GetSharedVisionList().end(); ++it)
|
||||
// (*it)->UpdateVisibilityOf(iter->getSource());
|
||||
|
||||
// Cancel Trade
|
||||
if(i_player.GetTrader()==iter->getSource())
|
||||
if(!i_player.IsWithinDistInMap(iter->getSource(), 5)) // iteraction distance
|
||||
i_player.GetSession()->SendCancelTrade(); // will clode both side trade windows
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
if(!i_player.isAlive() || i_player.isInFlight())
|
||||
return;
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource()->m_Notified)
|
||||
continue;
|
||||
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
if( !iter->getSource()->m_Notified && iter->getSource()->isAlive())
|
||||
PlayerCreatureRelocationWorker(&i_player,iter->getSource());
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_data_updates,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
|
||||
PlayerCreatureRelocationWorker(&i_player, iter->getSource());
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
inline void
|
||||
Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
if(!i_creature.isAlive())
|
||||
return;
|
||||
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource()->m_Notified)
|
||||
continue;
|
||||
|
||||
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
if( !iter->getSource()->m_Notified && iter->getSource()->isAlive() && !iter->getSource()->isInFlight())
|
||||
PlayerCreatureRelocationWorker(iter->getSource(), &i_creature);
|
||||
iter->getSource()->UpdateVisibilityOf(&i_creature);
|
||||
|
||||
PlayerCreatureRelocationWorker(iter->getSource(), &i_creature);
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -124,11 +139,15 @@ Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m)
|
||||
if(!i_creature.isAlive())
|
||||
return;
|
||||
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Creature* c = iter->getSource();
|
||||
if( !iter->getSource()->m_Notified && c != &i_creature && c->isAlive())
|
||||
CreatureCreatureRelocationWorker(c, &i_creature);
|
||||
if(iter->getSource()->m_Notified)
|
||||
continue;
|
||||
|
||||
if(!iter->getSource()->isAlive())
|
||||
continue;
|
||||
|
||||
CreatureCreatureRelocationWorker(iter->getSource(), &i_creature);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+23
-20
@@ -624,34 +624,15 @@ void Map::RelocationNotify()
|
||||
|
||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//UpdatePlayerVisibility((Player*)unit, cell, val);
|
||||
//Trinity::PlayerNotifier pl_notifier(*player);
|
||||
//VisitWorld(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), pl_notifier);
|
||||
|
||||
//UpdateObjectsVisibilityFor((Player*)unit, cell, val);
|
||||
Trinity::VisibleNotifier ob_notifier(*((Player*)unit));
|
||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), ob_notifier);
|
||||
ob_notifier.Notify();
|
||||
|
||||
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
|
||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||
notifier.Notify();
|
||||
}
|
||||
else
|
||||
{
|
||||
Trinity::CreatureRelocationNotifier notifier(*((Creature*)unit));
|
||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||
}
|
||||
|
||||
// Update visibility back to player who is controlling the unit
|
||||
if(unit->GetSharedVisionList().size())
|
||||
{
|
||||
for(SharedVisionList::const_iterator it = unit->GetSharedVisionList().begin(); it != unit->GetSharedVisionList().end(); ++it)
|
||||
{
|
||||
Trinity::VisibleNotifier ob_notifier(**it);
|
||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), ob_notifier);
|
||||
ob_notifier.Notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Clear list
|
||||
@@ -768,6 +749,28 @@ void Map::Update(const uint32 &t_diff)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update bindsight players
|
||||
if(obj->isType(TYPEMASK_UNIT))
|
||||
{
|
||||
if(!((Unit*)obj)->GetSharedVisionList().empty())
|
||||
for(SharedVisionList::const_iterator it = ((Unit*)obj)->GetSharedVisionList().begin(); it != ((Unit*)obj)->GetSharedVisionList().end(); ++it)
|
||||
{
|
||||
Trinity::PlayerRelocationNotifier notifier(**it);
|
||||
VisitAll(obj->GetPositionX(), obj->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||
notifier.Notify();
|
||||
}
|
||||
}
|
||||
else if(obj->GetTypeId() == TYPEID_DYNAMICOBJECT)
|
||||
{
|
||||
if(Unit *caster = ((DynamicObject*)obj)->GetCaster())
|
||||
if(caster->GetTypeId() == TYPEID_PLAYER && caster->GetUInt64Value(PLAYER_FARSIGHT) == obj->GetGUID())
|
||||
{
|
||||
Trinity::PlayerRelocationNotifier notifier(*((Player*)caster));
|
||||
VisitAll(obj->GetPositionX(), obj->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||
notifier.Notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6625,6 +6625,7 @@ void ObjectMgr::LoadSpellDisabledEntrys()
|
||||
{
|
||||
m_DisabledPlayerSpells.clear(); // need for reload case
|
||||
m_DisabledCreatureSpells.clear();
|
||||
m_DisabledPetSpells.clear();
|
||||
QueryResult *result = WorldDatabase.Query("SELECT entry, disable_mask FROM spell_disabled");
|
||||
|
||||
uint32 total_count = 0;
|
||||
@@ -6657,6 +6658,8 @@ void ObjectMgr::LoadSpellDisabledEntrys()
|
||||
m_DisabledPlayerSpells.insert(spellid);
|
||||
if(disable_mask & SPELL_DISABLE_CREATURE)
|
||||
m_DisabledCreatureSpells.insert(spellid);
|
||||
if(disable_mask & SPELL_DISABLE_PET)
|
||||
m_DisabledPetSpells.insert(spellid);
|
||||
++total_count;
|
||||
} while ( result->NextRow() );
|
||||
|
||||
|
||||
@@ -739,6 +739,7 @@ class ObjectMgr
|
||||
void LoadSpellDisabledEntrys();
|
||||
bool IsPlayerSpellDisabled(uint32 spellid) { return (m_DisabledPlayerSpells.count(spellid) != 0); }
|
||||
bool IsCreatureSpellDisabled(uint32 spellid) { return (m_DisabledCreatureSpells.count(spellid) != 0); }
|
||||
bool IsPetSpellDisabled(uint32 spellid) { return (m_DisabledPetSpells.count(spellid) != 0); }
|
||||
|
||||
int GetIndexForLocale(LocaleConstant loc);
|
||||
LocaleConstant GetLocaleForIndex(int i);
|
||||
@@ -859,6 +860,7 @@ class ObjectMgr
|
||||
|
||||
std::set<uint32> m_DisabledPlayerSpells;
|
||||
std::set<uint32> m_DisabledCreatureSpells;
|
||||
std::set<uint32> m_DisabledPetSpells;
|
||||
|
||||
GraveYardMap mGraveYardMap;
|
||||
|
||||
|
||||
+15
-24
@@ -17597,19 +17597,7 @@ void Player::HandleStealthedUnitsDetection()
|
||||
sLog.outDebug("Object %u (Type: %u) is detected in stealth by player %u. Distance = %f",(*i)->GetGUIDLow(),(*i)->GetTypeId(),GetGUIDLow(),GetDistance(*i));
|
||||
#endif
|
||||
|
||||
// target aura duration for caster show only if target exist at caster client
|
||||
// send data at target visibility change (adding to client)
|
||||
if((*i)!=this && (*i)->isType(TYPEMASK_UNIT))
|
||||
{
|
||||
SendAurasForTarget(*i);
|
||||
//if(((Unit*)(*i))->isAlive()) //should be always alive
|
||||
{
|
||||
if((*i)->GetTypeId()==TYPEID_UNIT)
|
||||
((Creature*)(*i))->SendMonsterMoveWithSpeedToCurrentDestination(this);
|
||||
if(((Unit*)(*i))->getVictim())
|
||||
((Unit*)(*i))->SendAttackStart(((Unit*)(*i))->getVictim());
|
||||
}
|
||||
}
|
||||
SendInitialVisiblePackets(*i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18710,21 +18698,24 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
|
||||
// target aura duration for caster show only if target exist at caster client
|
||||
// send data at target visibility change (adding to client)
|
||||
if(target!=this && target->isType(TYPEMASK_UNIT))
|
||||
{
|
||||
SendAurasForTarget((Unit*)target);
|
||||
if(((Unit*)target)->isAlive())
|
||||
{
|
||||
if(target->GetTypeId()==TYPEID_UNIT)
|
||||
((Creature*)target)->SendMonsterMoveWithSpeedToCurrentDestination(this);
|
||||
if(((Unit*)target)->getVictim())
|
||||
((Unit*)target)->SendAttackStart(((Unit*)target)->getVictim());
|
||||
}
|
||||
}
|
||||
if(target->isType(TYPEMASK_UNIT))
|
||||
SendInitialVisiblePackets((Unit*)target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SendInitialVisiblePackets(Unit* target)
|
||||
{
|
||||
SendAurasForTarget(target);
|
||||
if(target->isAlive())
|
||||
{
|
||||
if(target->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE)
|
||||
target->SendMonsterMoveWithSpeedToCurrentDestination(this);
|
||||
if(target->hasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim())
|
||||
target->SendAttackStart(target->getVictim());
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void UpdateVisibilityOf_helper(std::set<uint64>& s64, T* target)
|
||||
{
|
||||
|
||||
@@ -2100,6 +2100,7 @@ class TRINITY_DLL_SPEC Player : public Unit
|
||||
bool IsVisibleGloballyFor(Player* pl) const;
|
||||
|
||||
void UpdateVisibilityOf(WorldObject* target);
|
||||
void SendInitialVisiblePackets(Unit* target);
|
||||
|
||||
template<class T>
|
||||
void UpdateVisibilityOf(T* target, UpdateData& data, UpdateDataMapType& data_updates, std::set<WorldObject*>& visibleNow);
|
||||
|
||||
+10
-1
@@ -2031,7 +2031,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet()))
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if(objmgr.IsPlayerSpellDisabled(m_spellInfo->Id))
|
||||
{
|
||||
@@ -2040,6 +2040,15 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isPet())
|
||||
{
|
||||
if(objmgr.IsPetSpellDisabled(m_spellInfo->Id))
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_SPELL_UNAVAILABLE);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(objmgr.IsCreatureSpellDisabled(m_spellInfo->Id))
|
||||
|
||||
@@ -2786,33 +2786,7 @@ void Spell::DoCreateItem(uint32 i, uint32 itemtype)
|
||||
|
||||
// we succeeded in creating at least one item, so a levelup is possible
|
||||
player->UpdateCraftSkill(m_spellInfo->Id);
|
||||
}
|
||||
|
||||
// for battleground marks send by mail if not add all expected
|
||||
if(no_space > 0 )
|
||||
{
|
||||
BattleGroundTypeId bgType;
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case SPELL_AV_MARK_WINNER:
|
||||
case SPELL_AV_MARK_LOSER:
|
||||
bgType = BATTLEGROUND_AV;
|
||||
break;
|
||||
case SPELL_WS_MARK_WINNER:
|
||||
case SPELL_WS_MARK_LOSER:
|
||||
bgType = BATTLEGROUND_WS;
|
||||
break;
|
||||
case SPELL_AB_MARK_WINNER:
|
||||
case SPELL_AB_MARK_LOSER:
|
||||
bgType = BATTLEGROUND_AB;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if(BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgType))
|
||||
bg->SendRewardMarkByMail(player,newitemid,no_space);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Spell::EffectCreateItem(uint32 i)
|
||||
|
||||
+2
-1
@@ -257,7 +257,8 @@ enum SpellFamilyNames
|
||||
enum SpellDisableTypes
|
||||
{
|
||||
SPELL_DISABLE_PLAYER = 1,
|
||||
SPELL_DISABLE_CREATURE = 2
|
||||
SPELL_DISABLE_CREATURE = 2,
|
||||
SPELL_DISABLE_PET = 4
|
||||
};
|
||||
|
||||
enum SpellEffectTargetTypes
|
||||
|
||||
Reference in New Issue
Block a user