Jump to content

Don't allow enter an instance while raid is in combat


Recommended Posts

Posted

Instances like TOC has a counter of how many times the raid has wiped, so it's important tha testers cannot enter the instance until the raid is not in combat (all of them have wiped or have defeated the boss). In any other case, testers will always have the best mark, and then, the best loot, that's unfair.

I wonder if can be implemented in core a system that don't allow testers to enter an instance while the raid is in combat. I think that in offy this system is working.

Thank you

Posted

We already have IsEncounterInProgress() for scripted instance. IsEncounterInProgress() is not implemented though, but the intention was probably in the early days to implement this feature.

Personally i think it's much better to fully do this from Mangos side, just need to dig out the conditions and find a suitable location to do the check based on those conditions :)

Posted

doing it from mangos side would be prone to "stuck in combat bugs" blocking the instance (that happened a lot in ascent). Using a IsEncounterInProgress() would allow to manually tune the combat state of the raid.

Posted

IsEncounterInProgress in instance scripts (ScriptDev2) checks if Boss Encounter is in progress. I think it shouldn't allow enter the instance only if some boss encounter has IN_PROGRESS state

Posted

wtf! xD look at this

-------------------------------------------------------------------------------

bool InstanceMap::CanEnter(Player *player)

{

if(player->GetMapRef().getTarget() == this)

{

sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());

assert(false);

return false;

}

// cannot enter if the instance is full (player cap), GMs don't count

uint32 maxPlayers = GetMaxPlayers();

if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= maxPlayers)

{

sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());

player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);

return false;

}

// cannot enter while players in the instance are in combat

Group *pGroup = player->GetGroup();

if(pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->isAlive() && player->GetMapId() != GetId())

{

player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);

return false;

}

return Map::CanEnter(player);

}

------------------------------------------------------------------------------------

The function is written, but i think that not in the correct way, maybe player->isAlive() should be removed, beacouse if the player die inside, when he wipes, it's dead outside, and that restriction will never be true.

And also I would replace return Map::CanEnter(player); by return true;, but i'm not very sure about that

What do you think?

Posted

I have tested with

// cannot enter while players in the instance are in combat

Group *pGroup = player->GetGroup();

if(pGroup && pGroup->InCombatToInstance(GetInstanceId()))

{

player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);

return false;

}

return true;

}

and it works, so problem solved I think

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use