--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-13 17:18:33 -05:00
11 changed files with 156 additions and 105 deletions
+1
View File
@@ -0,0 +1 @@
UPDATE `creature_template` SET `mindmg`=700, `maxdmg`=1200, `attackpower`=1000, `flags_extra`=196641 WHERE `entry`=23418;
@@ -391,14 +391,14 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
targets.resize(1); // Only need closest target. targets.resize(1); // Only need closest target.
Unit* target = targets.front(); // Get the first target. Unit* target = targets.front(); // Get the first target.
target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true);
DoResetThreat();
m_creature->AddThreat(target,1000000);
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
{ {
//Return since we have no target if(InCombat)
if (!UpdateVictim()) {
return;
//Supposed to be cast on nearest target //Supposed to be cast on nearest target
if(FixateTimer < diff) if(FixateTimer < diff)
{ {
@@ -409,6 +409,11 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
DoScriptText(SUFF_SAY_AGGRO, m_creature); DoScriptText(SUFF_SAY_AGGRO, m_creature);
} }
}else FixateTimer -= diff; }else FixateTimer -= diff;
}
//Return since we have no target
if (!UpdateVictim())
return;
if(EnrageTimer < diff) if(EnrageTimer < diff)
{ {
@@ -419,7 +424,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI
if(SoulDrainTimer < diff) if(SoulDrainTimer < diff)
{ {
DoCast(m_creature->getVictim(), SPELL_SOUL_DRAIN); DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_SOUL_DRAIN);
SoulDrainTimer = 60000; SoulDrainTimer = 60000;
}else SoulDrainTimer -= diff; }else SoulDrainTimer -= diff;
@@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI
if(CheckTimer < diff) if(CheckTimer < diff)
{ {
Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID); Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
if(Shade && Shade->isAlive() && m_creature->isAlive()) if(Shade && Shade->isAlive() && m_creature->isAlive())
{ {
if(m_creature->GetDistance2d(Shade) < 20) if(m_creature->GetDistance2d(Shade) < 20)
@@ -165,10 +165,13 @@ struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI
struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
{ {
boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c) boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature)
{ {
pInstance = ((ScriptedInstance*)c->GetInstanceData()); pInstance = ((ScriptedInstance*)c->GetInstanceData());
AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0;
m_creature->setActive(true);//if view distance is too low
m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
} }
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
@@ -189,30 +192,28 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
bool HasKilledAkama; bool HasKilledAkama;
bool reseting; bool reseting;
bool GridSearcherSucceeded; bool GridSearcherSucceeded;
bool HasKilledAkamaAndReseting;
SummonList summons;
void Reset() void Reset()
{ {
reseting = true; reseting = true;
HasKilledAkamaAndReseting = false;
GridSearcherSucceeded = false; GridSearcherSucceeded = false;
if(!Sorcerers.empty())
{
for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
{
if(Creature* Sorcerer = (Unit::GetCreature(*m_creature, *itr)))
if(Sorcerer->isAlive())
{
Sorcerer->SetVisibility(VISIBILITY_OFF);
Sorcerer->Kill(Sorcerer);
}
}
Sorcerers.clear(); Sorcerers.clear();
summons.DespawnAll();//despawn all adds
if(Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID))
{
Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event
if(Akama->isDead())
{
Akama->Respawn();//respawn akama if dead
Akama->AI()->EnterEvadeMode();
}
} }
if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID))
Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SorcererCount = 0; SorcererCount = 0;
DeathCount = 0; DeathCount = 0;
@@ -236,6 +237,8 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
reseting = false; reseting = false;
} }
void JustSummoned(Creature *summon) {summons.Summon(summon);}
void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);}
void MoveInLineOfSight(Unit *who) void MoveInLineOfSight(Unit *who)
{ {
@@ -247,9 +250,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
{ {
for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
{ {
Creature* Channeler = NULL; Creature* Channeler = (Unit::GetCreature(*m_creature, *itr));
Channeler = (Unit::GetCreature(*m_creature, *itr));
if (Channeler) if (Channeler)
{ {
if (Channeler->isDead()) if (Channeler->isDead())
@@ -387,7 +388,10 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
{ {
// Akama is set in the threatlist so when we reset, we make sure that he is not included in our check // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check
if(m_creature->getThreatManager().getThreatList().size() < 2) if(m_creature->getThreatManager().getThreatList().size() < 2)
{
EnterEvadeMode(); EnterEvadeMode();
return;
}
if(DefenderTimer < diff) if(DefenderTimer < diff)
{ {
@@ -399,7 +403,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
bool move = true; bool move = true;
if(AkamaGUID) if(AkamaGUID)
{ {
if(Unit* Akama = Unit::GetUnit(*m_creature, AkamaGUID)) if(Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID))
{ {
float x, y, z; float x, y, z;
Akama->GetPosition(x,y,z); Akama->GetPosition(x,y,z);
@@ -424,7 +428,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
{ {
if(AkamaGUID) if(AkamaGUID)
{ {
Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID); Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID);
if(Akama && Akama->isAlive()) if(Akama && Akama->isAlive())
{ {
IsBanished = false; IsBanished = false;
@@ -449,31 +453,30 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
{ {
if(AkamaGUID) if(AkamaGUID)
{ {
Unit* Akama = Unit::GetUnit((*m_creature), AkamaGUID); Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID);
if(Akama && Akama->isAlive()) if(Akama && Akama->isAlive())
{ {
//10 % less health every few seconds. //10 % less health every few seconds.
m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
ReduceHealthTimer = 12000; ReduceHealthTimer = 12000;
} }
else
{
HasKilledAkama = true; // Akama is dead or missing, we stop fighting and disappear
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetHealth(m_creature->GetMaxHealth());
m_creature->RemoveAllAuras();
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
} }
}else ReduceHealthTimer -= diff; }else ReduceHealthTimer -= diff;
if(HasKilledAkama) if(HasKilledAkama)
{ {
if(ResetTimer < diff) if(!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug
{ {
InCombat = false; HasKilledAkamaAndReseting = true;
EnterEvadeMode(); // Reset a little while after killing Akama m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop();
//m_creature->SetHealth(m_creature->GetMaxHealth());
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->GetMotionMaster()->MoveTargetedHome();
} }
if(ResetTimer < diff)
EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama
else ResetTimer -= diff; else ResetTimer -= diff;
} }
@@ -505,7 +508,17 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
ShadeHasDied = false; ShadeHasDied = false;
StartCombat = false; StartCombat = false;
pInstance = ((ScriptedInstance*)c->GetInstanceData()); pInstance = ((ScriptedInstance*)c->GetInstanceData());
ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : 0; ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED;
m_creature->setActive(true);
EventBegun = false;
CastSoulRetrieveTimer = 0;
SoulRetrieveTimer = 0;
SummonBrokenTimer = 0;
EndingTalkCount = 0;
WayPointId = 0;
BrokenSummonIndex = 0;
BrokenList.clear();
HasYelledOnce = false;
} }
ScriptedInstance* pInstance; ScriptedInstance* pInstance;
@@ -534,21 +547,13 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
DestructivePoisonTimer = 15000; DestructivePoisonTimer = 15000;
LightningBoltTimer = 10000; LightningBoltTimer = 10000;
CheckTimer = 2000; CheckTimer = 2000;
CastSoulRetrieveTimer = 0;
SoulRetrieveTimer = 0;
SummonBrokenTimer = 0;
EndingTalkCount = 0;
WayPointId = 0;
BrokenSummonIndex = 0;
BrokenList.clear();
EventBegun = false;
HasYelledOnce = false;
if(!EventBegun)
{
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
} }
}
void Aggro(Unit* who) {} void Aggro(Unit* who) {}
@@ -589,7 +594,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
case 0: ++WayPointId; break; case 0: ++WayPointId; break;
case 1: case 1:
if(Unit* Shade = Unit::GetUnit(*m_creature, ShadeGUID)) if(Creature* Shade = Unit::GetCreature(*m_creature, ShadeGUID))
{ {
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID);
DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE);
@@ -603,6 +608,20 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
void JustDied(Unit* killer) void JustDied(Unit* killer)
{ {
DoScriptText(SAY_DEATH, m_creature); DoScriptText(SAY_DEATH, m_creature);
EventBegun = false;
ShadeHasDied = false;
StartCombat = false;
CastSoulRetrieveTimer = 0;
SoulRetrieveTimer = 0;
SummonBrokenTimer = 0;
EndingTalkCount = 0;
WayPointId = 0;
BrokenSummonIndex = 0;
BrokenList.clear();
HasYelledOnce = false;
Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
if(Shade && Shade->isAlive())
((boss_shade_of_akamaAI*)Shade->AI())->HasKilledAkama = true;
} }
void UpdateAI(const uint32 diff) void UpdateAI(const uint32 diff)
@@ -650,7 +669,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
{ {
if(ShadeGUID) if(ShadeGUID)
{ {
Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID); Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
if(Shade && !Shade->isAlive()) if(Shade && !Shade->isAlive())
{ {
ShadeHasDied = true; ShadeHasDied = true;
@@ -658,6 +677,11 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE); m_creature->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z);
} }
if(Shade && Shade->isAlive())
{
if(Shade->getThreatManager().getThreatList().size() < 2)
Shade->AI()->EnterEvadeMode();
}
} }
CheckTimer = 5000; CheckTimer = 5000;
}else CheckTimer -= diff; }else CheckTimer -= diff;
@@ -710,7 +734,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
{ {
bool Yelled = false; bool Yelled = false;
for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr)) if(Creature* pUnit = Unit::GetCreature(*m_creature, *itr))
{ {
if(!Yelled) if(!Yelled)
{ {
@@ -727,7 +751,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
if(!BrokenList.empty()) if(!BrokenList.empty())
{ {
for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr)) if(Creature* pUnit = Unit::GetCreature(*m_creature, *itr))
// This is the incorrect spell, but can't seem to find the right one. // This is the incorrect spell, but can't seem to find the right one.
pUnit->CastSpell(pUnit, 39656, true); pUnit->CastSpell(pUnit, 39656, true);
} }
@@ -738,7 +762,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
if(!BrokenList.empty()) if(!BrokenList.empty())
{ {
for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) for(std::list<uint64>::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr)
if(Unit* pUnit = Unit::GetUnit((*m_creature), *itr)) if(Creature* pUnit = Unit::GetCreature((*m_creature), *itr))
pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0);
} }
SoulRetrieveTimer = 0; SoulRetrieveTimer = 0;
@@ -751,7 +775,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
if(DestructivePoisonTimer < diff) if(DestructivePoisonTimer < diff)
{ {
Unit* Shade = Unit::GetUnit((*m_creature), ShadeGUID); Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID);
if (Shade && Shade->isAlive()) if (Shade && Shade->isAlive())
DoCast(Shade, SPELL_DESTRUCTIVE_POISON); DoCast(Shade, SPELL_DESTRUCTIVE_POISON);
DestructivePoisonTimer = 15000; DestructivePoisonTimer = 15000;
@@ -60,6 +60,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI
void Reset() void Reset()
{ {
damageTaken = 0;
SwarmTimer = 45000; SwarmTimer = 45000;
SleepTimer = 60000; SleepTimer = 60000;
AuraTimer = 5000; AuraTimer = 5000;
@@ -239,6 +239,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED);
DoomfireSpiritGUID = 0; DoomfireSpiritGUID = 0;
damageTaken = 0;
WorldTreeGUID = 0; WorldTreeGUID = 0;
DrainNordrassilTimer = 0; DrainNordrassilTimer = 0;
@@ -51,6 +51,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI
void Reset() void Reset()
{ {
damageTaken = 0;
RainTimer = 20000; RainTimer = 20000;
DoomTimer = 50000; DoomTimer = 50000;
HowlTimer = 30000; HowlTimer = 30000;
@@ -48,6 +48,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI
void Reset() void Reset()
{ {
damageTaken = 0;
CleaveTimer = 5000; CleaveTimer = 5000;
WarStompTimer = 15000; WarStompTimer = 15000;
MarkTimer = 45000; MarkTimer = 45000;
@@ -48,6 +48,7 @@ struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI
void Reset() void Reset()
{ {
damageTaken = 0;
FrostArmorTimer = 37000; FrostArmorTimer = 37000;
DecayTimer = 45000; DecayTimer = 45000;
NovaTimer = 15000; NovaTimer = 15000;
@@ -158,7 +158,7 @@ hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c)
void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage)
{ {
if(done_by->GetTypeId() == TYPEID_PLAYER) if(done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && ((Creature*)done_by)->isPet()))
{ {
damageTaken += damage; damageTaken += damage;
if(pInstance) if(pInstance)
@@ -431,6 +431,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]); AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]);
switch(OverrunType) switch(OverrunType)
{ {
case 0:
default: default:
AddWaypoint( 5, HordeOverrunWP[0][0]+irand(-10,10), HordeOverrunWP[0][1]+irand(-10,10), HordeOverrunWP[0][2]); AddWaypoint( 5, HordeOverrunWP[0][0]+irand(-10,10), HordeOverrunWP[0][1]+irand(-10,10), HordeOverrunWP[0][2]);
AddWaypoint( 6, HordeOverrunWP[1][0]+irand(-10,10), HordeOverrunWP[1][1]+irand(-10,10), HordeOverrunWP[1][2]); AddWaypoint( 6, HordeOverrunWP[1][0]+irand(-10,10), HordeOverrunWP[1][1]+irand(-10,10), HordeOverrunWP[1][2]);
@@ -465,7 +466,7 @@ void hyjal_trashAI::JustDied(Unit *victim)
if(IsEvent && !m_creature->isWorldBoss()) if(IsEvent && !m_creature->isWorldBoss())
pInstance->SetData(DATA_TRASH, 0);//signal trash is dead pInstance->SetData(DATA_TRASH, 0);//signal trash is dead
if((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/2 && m_creature->isWorldBoss())) if((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss()))
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
if(IsOverrun) if(IsOverrun)
+4 -1
View File
@@ -310,13 +310,16 @@ ObjectGridStoper::Visit(CreatureMapType &m)
{ {
// stop any fights at grid de-activation and remove dynobjects created at cast by creatures // stop any fights at grid de-activation and remove dynobjects created at cast by creatures
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
{
iter->getSource()->RemoveAllDynObjects();
if(iter->getSource()->isInCombat())
{ {
iter->getSource()->CombatStop(); iter->getSource()->CombatStop();
iter->getSource()->DeleteThreatList(); iter->getSource()->DeleteThreatList();
iter->getSource()->RemoveAllDynObjects();
iter->getSource()->AI()->EnterEvadeMode(); iter->getSource()->AI()->EnterEvadeMode();
} }
} }
}
void void
ObjectGridCleaner::Stop(GridType &grid) ObjectGridCleaner::Stop(GridType &grid)
+15 -3
View File
@@ -17987,7 +17987,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false; return false;
} }
if(u->GetVisibility() == VISIBILITY_OFF || u->m_invisibilityMask ) if(u->GetVisibility() == VISIBILITY_OFF)
{ {
// GMs see any players, not higher GMs and all units // GMs see any players, not higher GMs and all units
if(isGameMaster()) if(isGameMaster())
@@ -18000,13 +18000,25 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false; return false;
} }
// GM's can see everyone with invisibilitymask with less or equal security level
if(m_mover->m_invisibilityMask || u->m_invisibilityMask)
{
if(isGameMaster())
{
if(u->GetTypeId() == TYPEID_PLAYER)
return ((Player*)u)->GetSession()->GetSecurity() <= GetSession()->GetSecurity();
else
return true;
}
// player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting) // player see other player with stealth/invisibility only if he in same group or raid or same team (raid/team case dependent from conf setting)
if((m_mover->m_invisibilityMask || u->m_invisibilityMask) && !m_mover->canDetectInvisibilityOf(u)) if(!m_mover->canDetectInvisibilityOf(u))
if(!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisibleFor(((Player*)u)))) if(!(u->GetTypeId()==TYPEID_PLAYER && !IsHostileTo(u) && IsGroupVisibleFor(((Player*)u))))
return false; return false;
}
// GM invisibility checks early, invisibility if any detectable, so if not stealth then visible // GM invisibility checks early, invisibility if any detectable, so if not stealth then visible
if(u->GetVisibility() == VISIBILITY_GROUP_STEALTH) if(u->GetVisibility() == VISIBILITY_GROUP_STEALTH && !isGameMaster())
{ {
// if player is dead then he can't detect anyone in any cases // if player is dead then he can't detect anyone in any cases
//do not know what is the use of this detect //do not know what is the use of this detect