Core/Units: Rename and change Get/SetVisibility to use a bool value instead of an unnecessary enum
Also replace some SetVisibility hacks to directly call UpdateObjectVisibility --HG-- branch : trunk
This commit is contained in:
@@ -463,15 +463,15 @@ public:
|
||||
if (pInstance)
|
||||
{
|
||||
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
|
||||
if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((me->GetVisibility() != VISIBILITY_OFF) || (me->getFaction() != 35)))
|
||||
if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && (me->IsVisible() || (me->getFaction() != 35)))
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
me->setFaction(35);
|
||||
}
|
||||
else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((me->GetVisibility() != VISIBILITY_ON) || (me->getFaction() == 35)))
|
||||
else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && (!me->IsVisible() || (me->getFaction() == 35)))
|
||||
{
|
||||
me->setFaction(1720);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ public:
|
||||
Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
|
||||
if (Check)
|
||||
{
|
||||
Check->SetVisibility(VISIBILITY_OFF);
|
||||
Check->SetVisible(false);
|
||||
|
||||
if (me->IsWithinDistInMap(Check, 75))
|
||||
{
|
||||
|
||||
@@ -756,19 +756,19 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
||||
case JAINA:
|
||||
if (pInstance && pInstance->GetData(DATA_ALLIANCE_RETREAT))
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
HideNearPos(me->GetPositionX(), me->GetPositionY());
|
||||
HideNearPos(5037.76f, -1889.71f);
|
||||
for (uint8 i = 0; i < 92; ++i)//summon fires
|
||||
me->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
|
||||
|
||||
}
|
||||
else me->SetVisibility(VISIBILITY_ON);
|
||||
else me->SetVisible(true);
|
||||
break;
|
||||
case THRALL: //thrall
|
||||
if (pInstance && pInstance->GetData(DATA_HORDE_RETREAT))
|
||||
{
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
HideNearPos(me->GetPositionX(), me->GetPositionY());
|
||||
HideNearPos(5563, -2763.19f);
|
||||
HideNearPos(5542.2f, -2629.36f);
|
||||
@@ -776,7 +776,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
||||
me->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
|
||||
|
||||
}
|
||||
else me->SetVisibility(VISIBILITY_ON);
|
||||
else me->SetVisible(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -794,10 +794,10 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
||||
RespawnNearPos(5563, -2763.19f);
|
||||
RespawnNearPos(5542.2f, -2629.36f);
|
||||
}
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
}else{
|
||||
RespawnTimer -= diff;
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -821,7 +821,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
|
||||
HideNearPos(5603.75f, -2853.12f);
|
||||
break;
|
||||
}
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
} else RetreatTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -914,7 +914,7 @@ void hyjalAI::JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (IsDummy)return;
|
||||
me->Respawn();
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
DoRespawn = true;
|
||||
RespawnTimer = 120000;
|
||||
Talk(DEATH);
|
||||
@@ -954,7 +954,7 @@ void hyjalAI::HideNearPos(float x, float y)
|
||||
{
|
||||
for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
|
||||
{
|
||||
(*itr)->SetVisibility(VISIBILITY_OFF);
|
||||
(*itr)->SetVisible(false);
|
||||
(*itr)->setFaction(35);//make them friendly so mobs won't attack them
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ public:
|
||||
Creature* trigger = me->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,me->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000);
|
||||
if (trigger)
|
||||
{
|
||||
trigger->SetVisibility(VISIBILITY_OFF);
|
||||
trigger->SetVisible(false);
|
||||
trigger->setFaction(me->getFaction());
|
||||
trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
|
||||
trigger->CastSpell(me,SPELL_METEOR,true);
|
||||
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
Map* pMap = pCreature->GetMap();
|
||||
if (pMap->IsDungeon() && pUnit)
|
||||
{
|
||||
pUnit->SetVisibility(VISIBILITY_OFF);
|
||||
pUnit->SetVisible(false);
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
if (PlayerList.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
uiOutroTimer = 500;
|
||||
break;
|
||||
case 5:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
me->Kill(me);
|
||||
break;
|
||||
|
||||
|
||||
+1
-1
@@ -843,7 +843,7 @@ public:
|
||||
break;
|
||||
case 39:
|
||||
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
|
||||
pMalganis->SetVisibility(VISIBILITY_OFF);
|
||||
pMalganis->SetVisible(false);
|
||||
DoScriptText(SAY_PHASE208, me);
|
||||
JumpToNextStep(7000);
|
||||
break;
|
||||
|
||||
@@ -462,7 +462,7 @@ public:
|
||||
break;
|
||||
case 108:
|
||||
//last waypoint, just set Thrall invisible, respawn is turned off
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user