Merge branch 'outpost_refactoring'

feature/core4-atys
Nuno 3 years ago committed by kaetemi
parent 5fe1c8b378
commit adf9719076
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -2436,7 +2436,7 @@ uint32 COutpost::computeSquadCountA(uint32 roundLevel) const
return (uint32)ceil((float)(roundLevel+1)/OutpostInTestFightSquadCount.get());
//////
return (uint32)ceil((float)(roundLevel+1)/1.5f);
return (uint32)ceil((float)(roundLevel+1)/2.0f);
}
//----------------------------------------------------------------------------
@ -2447,7 +2447,7 @@ uint32 COutpost::computeSquadCountB(uint32 roundLevel) const
return (uint32)floor((float)(roundLevel+1)/OutpostInTestFightSquadCount.get());
//////
return (uint32)floor((float)(roundLevel+1)/1.5f);
return (uint32)floor((float)(roundLevel+1)/2.0f);
}
//----------------------------------------------------------------------------

@ -19610,11 +19610,7 @@ void CCharacter::setOutpostAlias( uint32 id )
else
{
if( _OutpostAlias != 0 )
{
sendDynamicSystemMessage( _Id, "OUTPOST_NO_MORE_IN_CONFLICT");
if (getCurrentPVPZone() != CAIAliasTranslator::Invalid)
CPVPManager::getInstance()->enterPVPZone( this, getCurrentPVPZone() );
}
// _PropertyDatabase.setProp("CHARACTER_INFO:PVP_OUTPOST:ROUND_LVL_CUR", 0 );
CBankAccessor_PLR::getCHARACTER_INFO().getPVP_OUTPOST().setROUND_LVL_CUR(_PropertyDatabase, 0 );
// _PropertyDatabase.setProp("CHARACTER_INFO:PVP_OUTPOST:ROUND_END_DATE", 0 );
@ -19834,7 +19830,10 @@ void CCharacter::outpostSideChosen( bool neutral, OUTPOSTENUMS::TPVPSide side )
CGuild *guild = CGuildManager::getInstance()->getGuildFromId(_GuildId);
if (!neutral || outpostInFire)
if (neutral)
nlinfo("Player %s choose neutral", getName().toString().c_str());
if (!neutral)
{
// validate outpost alias
setOutpostAlias( _OutpostIdBeforeUserValidation );
@ -19844,6 +19843,7 @@ void CCharacter::outpostSideChosen( bool neutral, OUTPOSTENUMS::TPVPSide side )
// he his guild owns the outpost he can only help his guild
if (_GuildId == outpost->getOwnerGuild())
{
nlinfo("Guildmate %s choose side Owner at OP %s", getName().toString().c_str(), CPrimitivesParser::aliasToString(_OutpostIdBeforeUserValidation).c_str());
setOutpostSide( OUTPOSTENUMS::OutpostOwner );
_OutpostIdBeforeUserValidation = 0;
return;
@ -19852,6 +19852,7 @@ void CCharacter::outpostSideChosen( bool neutral, OUTPOSTENUMS::TPVPSide side )
if (_GuildId == COutpostManager::getInstance().getOutpostFromAlias(_OutpostIdBeforeUserValidation)->getAttackerGuild())
{
setOutpostSide( OUTPOSTENUMS::OutpostAttacker );
nlinfo("Guildmate %s choose side Attacker at OP %s", getName().toString().c_str(), CPrimitivesParser::aliasToString(_OutpostIdBeforeUserValidation).c_str());
_OutpostIdBeforeUserValidation = 0;
return;
}
@ -19865,28 +19866,33 @@ void CCharacter::outpostSideChosen( bool neutral, OUTPOSTENUMS::TPVPSide side )
side = OUTPOSTENUMS::OutpostAttacker;
}
}
// his guild doesn't participate in outpost conflict but player don't made a choice when op is under attack => random
if (neutral && outpostInFire)
else
{
// his guild doesn't participate in outpost conflict so he can choose the side he wants
if (side == OUTPOSTENUMS::OutpostOwner)
nlinfo("Player %s choose side Owner at OP %s", getName().toString().c_str(), CPrimitivesParser::aliasToString(_OutpostIdBeforeUserValidation).c_str());
if (side == OUTPOSTENUMS::OutpostAttacker)
nlinfo("Player %s choose side Attacker at OP %s", getName().toString().c_str(), CPrimitivesParser::aliasToString(_OutpostIdBeforeUserValidation).c_str());
setOutpostSide(side);
}
}
else if (outpostInFire)
{
if (outpost->getName().substr(0, 14) == "outpost_nexus_")
{
nlinfo("Player are neutral in %s in fire : ", outpost->getName().c_str());
//setOutpostSide(OUTPOSTENUMS::UnknownPVPSide);
nlinfo("Player are neutral in %s in fire", outpost->getName().c_str());
setOutpostSide(OUTPOSTENUMS::UnknownPVPSide);
}
else
{
setOutpostAlias(_OutpostIdBeforeUserValidation);
if (uint32(RandomGenerator.rand(1)) == 0)
setOutpostSide(OUTPOSTENUMS::OutpostOwner);
else
setOutpostSide(OUTPOSTENUMS::OutpostAttacker);
}
}
else
// his guild doesn't participate in outpost conflict so he can choose the side he wants
setOutpostSide(side);
}
_OutpostIdBeforeUserValidation = 0;
}

@ -553,7 +553,9 @@ void CPVPManager::enterPVPZone( CCharacter * user, TAIAlias pvpZoneAlias )
// check if he's re-entering into the same outpost
if( pvpZoneAlias == oldZone->getAlias() )
{
#ifdef PVP_DEBUG
egs_pvpinfo("<CPVPManager::enterPVPZone> re-entering outpost %s",CPrimitivesParser::aliasToString(pvpZoneAlias).c_str());
#endif // PVP_DEBUG
user->stopOutpostLeavingTimer();
CCharacter::sendDynamicSystemMessage( user->getEntityRowId(), "PVP_ZONE_ENTER_BACK" );
}
@ -600,7 +602,9 @@ void CPVPManager::enterPVPZone( CCharacter * user, TAIAlias pvpZoneAlias )
else if( user->getEnterFlag() )
{
// entering into an outpost zone
#ifdef PVP_DEBUG
egs_pvpinfo("<CPVPManager::enterPVPZone> entering outpost %s",CPrimitivesParser::aliasToString(pvpZoneAlias).c_str());
#endif // PVP_DEBUG
user->outpostOpenChooseSideDialog( pvpZoneAlias );
user->setOutpostAliasBeforeUserValidation( pvpZoneAlias );
}

Loading…
Cancel
Save