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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
|
||||
me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
|
||||
//Reset Phase
|
||||
if (pInst)
|
||||
@@ -404,7 +404,7 @@ public:
|
||||
//Remove any target
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
me->SetHealth(0);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
break;
|
||||
|
||||
//Dead phase
|
||||
@@ -542,7 +542,7 @@ public:
|
||||
//Reset flags
|
||||
me->RemoveAurasDueToSpell(SPELL_TRANSFORM);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
|
||||
if (pInst)
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
@@ -670,7 +670,7 @@ public:
|
||||
DoCast(me, SPELL_TRANSFORM, false);
|
||||
me->SetFullHealth();
|
||||
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
//Emerging phase
|
||||
@@ -1062,7 +1062,7 @@ public:
|
||||
p->Kill(p);
|
||||
|
||||
//Dissapear and reappear at new position
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
|
||||
if (!pTarget)
|
||||
@@ -1086,7 +1086,7 @@ public:
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
} else EvadeTimer -= diff;
|
||||
}
|
||||
|
||||
@@ -1174,7 +1174,7 @@ public:
|
||||
p->Kill(p);
|
||||
|
||||
//Dissapear and reappear at new position
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
|
||||
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (!pTarget)
|
||||
@@ -1198,7 +1198,7 @@ public:
|
||||
EvadeTimer = 5000;
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
} else EvadeTimer -= diff;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
Invisible = false;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
|
||||
if (IsImage)
|
||||
me->setDeathState(JUST_DIED);
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
if (Invisible_Timer <= diff)
|
||||
{
|
||||
//Making Skeram visible after telporting
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
me->SetVisible(true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
Invisible_Timer = 2500;
|
||||
@@ -251,7 +251,7 @@ public:
|
||||
|
||||
me->RemoveAllAuras();
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
me->GetMap()->CreatureRelocation(me, bossc->x, bossc->y, bossc->z, bossc->r);
|
||||
Invisible = true;
|
||||
delete place1;
|
||||
|
||||
@@ -380,8 +380,8 @@ public:
|
||||
if (eventProgress == 11)
|
||||
{
|
||||
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
|
||||
naralex->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
naralex->SetVisible(false);
|
||||
me->SetVisible(false);
|
||||
pInstance->SetData(TYPE_NARALEX_PART3, DONE);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -595,7 +595,7 @@ public:
|
||||
break;
|
||||
case 14:
|
||||
DoScriptText(ARYGOS_SAY_1,Arygos);
|
||||
Merithra->SetVisibility(VISIBILITY_OFF);
|
||||
Merithra->SetVisible(false);
|
||||
break;
|
||||
case 15:
|
||||
Arygos->GetMotionMaster()->MoveCharge(-8065,1530,2.61f,10);
|
||||
@@ -625,7 +625,7 @@ public:
|
||||
break;
|
||||
case 23:
|
||||
Caelestrasz->GetMotionMaster()->MoveCharge(-8065,1530,2.61f,10);
|
||||
Arygos->SetVisibility(VISIBILITY_OFF);
|
||||
Arygos->SetVisible(false);
|
||||
Arygos->GetMotionMaster()->MoveCharge(-8034.535f,1535.14f,2.61f,10);
|
||||
break;
|
||||
case 24:
|
||||
@@ -655,7 +655,7 @@ public:
|
||||
DoScriptText(ANACHRONOS_SAY_3, me, Fandral);
|
||||
break;
|
||||
case 32:
|
||||
Caelestrasz->SetVisibility(VISIBILITY_OFF);
|
||||
Caelestrasz->SetVisible(false);
|
||||
Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535f,1535.14f,2.61f,42);
|
||||
Fandral->GetMotionMaster()->MoveCharge(-8108,1529,2.77f,8);
|
||||
me->GetMotionMaster()->MoveCharge(-8113,1525,2.77f,8);
|
||||
@@ -745,7 +745,7 @@ public:
|
||||
DoScriptText(ANACHRONOS_EMOTE_2,me);
|
||||
break;
|
||||
case 55:
|
||||
Fandral->SetVisibility(VISIBILITY_OFF);
|
||||
Fandral->SetVisible(false);
|
||||
break;
|
||||
case 56:
|
||||
DoScriptText(ANACHRONOS_EMOTE_3, me);
|
||||
@@ -781,7 +781,7 @@ public:
|
||||
me->GetMotionMaster()->MoveCharge(-8000,1400,150,9);
|
||||
break;
|
||||
case 65:
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID)))
|
||||
{
|
||||
DoScriptText(ARYGOS_YELL_1,me);
|
||||
@@ -968,7 +968,7 @@ public:
|
||||
Announced = false;
|
||||
Failed = false;
|
||||
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetVisible(false);
|
||||
}
|
||||
|
||||
void SummonNextWave()
|
||||
|
||||
Reference in New Issue
Block a user