*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -326,18 +326,18 @@ void GameObject::Update(uint32 /*p_time*/)
|
||||
// search unfriendly creature
|
||||
if(owner && NeedDespawn) // hunter trap
|
||||
{
|
||||
MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius);
|
||||
MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> checker(this,ok, u_check);
|
||||
Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, owner, radius);
|
||||
Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> checker(this, ok, u_check);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
|
||||
// or unfriendly player/pet
|
||||
if(!ok)
|
||||
{
|
||||
TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
TypeContainerVisitor<Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,6 +632,23 @@ namespace Trinity
|
||||
float i_range;
|
||||
};
|
||||
|
||||
class AnyUnfriendlyNoTotemUnitInObjectRangeCheck
|
||||
{
|
||||
public:
|
||||
AnyUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) {}
|
||||
bool operator()(Unit* u)
|
||||
{
|
||||
if(u->isAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u) && !((Creature*)u)->isTotem())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
WorldObject const* i_obj;
|
||||
Unit const* i_funit;
|
||||
float i_range;
|
||||
};
|
||||
|
||||
class CreatureWithDbGUIDCheck
|
||||
{
|
||||
public:
|
||||
|
||||
+4
-2
@@ -1411,8 +1411,10 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pPlayer = itr->getSource();
|
||||
if(pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId)
|
||||
return true;
|
||||
if(pPlayer && pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaid() || pPlayer->GetMap()->IsHeroic()))
|
||||
for(std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i!=pPlayer->getAttackers().end(); ++i)
|
||||
if((*i) && (*i)->GetTypeId() == TYPEID_UNIT && ((Creature*)(*i))->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1781,7 +1781,7 @@ bool InstanceMap::CanEnter(Player *player)
|
||||
|
||||
// cannot enter while players in the instance are in combat
|
||||
Group *pGroup = player->GetGroup();
|
||||
if(!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->isAlive() && player->GetMapId() != GetId())
|
||||
if(!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())
|
||||
{
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
|
||||
return false;
|
||||
|
||||
@@ -266,3 +266,11 @@ void MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
||||
delete itr->second;
|
||||
m_InstancedMaps.erase(itr++);
|
||||
}
|
||||
|
||||
bool MapInstanced::CanEnter(Player *player)
|
||||
{
|
||||
if(Map* map = GetInstance(player))
|
||||
return map->CanEnter(player);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ class TRINITY_DLL_DECL MapInstanced : public Map
|
||||
void RemoveAllObjectsInRemoveList();
|
||||
bool RemoveBones(uint64 guid, float x, float y);
|
||||
void UnloadAll(bool pForce);
|
||||
bool CanEnter(Player* player);
|
||||
|
||||
Map* GetInstance(const WorldObject* obj);
|
||||
Map* FindMap(uint32 InstanceId) { return _FindMap(InstanceId); }
|
||||
|
||||
+1
-1
@@ -1121,7 +1121,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
|
||||
m_diminishLevel = unit->GetDiminishing(m_diminishGroup);
|
||||
DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup);
|
||||
// Increase Diminishing on unit, current informations for actually casts will use values above
|
||||
if((type == DRTYPE_PLAYER && unit->GetTypeId() == TYPEID_PLAYER) || type == DRTYPE_ALL)
|
||||
if((type == DRTYPE_PLAYER && (unit->GetTypeId() == TYPEID_PLAYER || ((Creature*)unit)->isPet() || ((Creature*)unit)->isPossessedByPlayer())) || type == DRTYPE_ALL)
|
||||
unit->IncrDiminishing(m_diminishGroup);
|
||||
}
|
||||
|
||||
|
||||
@@ -339,9 +339,17 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
|
||||
switch(m_spellInfo->Id) // better way to check unknown
|
||||
{
|
||||
case 35354://hand of death
|
||||
case 35354: //Hand of Death
|
||||
{
|
||||
if(unitTarget && unitTarget->HasAura(38528,0))//protection of elune
|
||||
if(unitTarget && unitTarget->HasAura(38528,0)) //Protection of Elune
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 43648: //Electrical Storm
|
||||
{
|
||||
if(unitTarget && unitTarget->HasAura(44007, 0)) // Immune Aura
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
@@ -484,6 +484,9 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
|
||||
case 23333: // BG spell
|
||||
case 23335: // BG spell
|
||||
case 34976: // BG spell
|
||||
case 31579: // Arcane Empowerment Rank1 talent aura with one positive and one negative (check not needed in wotlk)
|
||||
case 31582: // Arcane Empowerment Rank2
|
||||
case 31583: // Arcane Empowerment Rank3
|
||||
return true;
|
||||
case 28441: // not positive dummy spell
|
||||
case 37675: // Chaos Blast
|
||||
|
||||
+5
-5
@@ -10158,13 +10158,13 @@ void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Un
|
||||
if(duration == -1 || group == DIMINISHING_NONE || caster->IsFriendlyTo(this) )
|
||||
return;
|
||||
|
||||
// test pet/charm masters instead pets/charmeds
|
||||
Unit const* targetOwner = GetCharmerOrOwner();
|
||||
Unit const* casterOwner = caster->GetCharmerOrOwner();
|
||||
|
||||
// Duration of crowd control abilities on pvp target is limited by 10 sec. (2.2.0)
|
||||
if(duration > 10000 && IsDiminishingReturnsGroupDurationLimited(group))
|
||||
{
|
||||
// test pet/charm masters instead pets/charmeds
|
||||
Unit const* targetOwner = GetCharmerOrOwner();
|
||||
Unit const* casterOwner = caster->GetCharmerOrOwner();
|
||||
|
||||
Unit const* target = targetOwner ? targetOwner : this;
|
||||
Unit const* source = casterOwner ? casterOwner : caster;
|
||||
|
||||
@@ -10175,7 +10175,7 @@ void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Un
|
||||
float mod = 1.0f;
|
||||
|
||||
// Some diminishings applies to mobs too (for example, Stun)
|
||||
if((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && GetTypeId() == TYPEID_PLAYER) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL)
|
||||
if((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && (targetOwner ? targetOwner->GetTypeId():GetTypeId()) == TYPEID_PLAYER) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL)
|
||||
{
|
||||
DiminishingLevels diminish = Level;
|
||||
switch(diminish)
|
||||
|
||||
Reference in New Issue
Block a user