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

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

Loading…
Cancel
Save