Merge branch 'marauder_fame'

feature/prepare-cross-merge
Nuno 4 years ago committed by kaetemi
parent 9b5a4d94cf
commit 08393ea94d
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -5131,10 +5131,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
if (command_args.size() == 4 || (command_args.size () == 5 && command_args[4] != "0")) if (command_args.size() == 4 || (command_args.size () == 5 && command_args[4] != "0"))
{ {
// Make sure fame values are properly capped. // Make sure fame values are properly capped.
CFameManager::getInstance().enforceFameCaps(c->getId(), c->getAllegiance()); CFameManager::getInstance().enforceFameCaps(c->getId(), c->getOrganization(), c->getAllegiance());
// set tribe fame threshold and clamp fame if necessary // set tribe fame threshold and clamp fame if necessary
CFameManager::getInstance().setAndEnforceTribeFameCap(c->getId(), c->getAllegiance()); CFameManager::getInstance().setAndEnforceTribeFameCap(c->getId(), c->getOrganization(), c->getAllegiance());
} }
} }

@ -412,6 +412,7 @@ void CFameManager::savePlayerFame(const NLMISC::CEntityId &playerId, EGSPD::CFam
if( entry == NULL ) if( entry == NULL )
entry = fameContainer.addToEntries( id ); entry = fameContainer.addToEntries( id );
EGS_PD_AST(entry); EGS_PD_AST(entry);
nlinfo("%d : %d", it->second->Fames[i]);
entry->setFame( it->second->Fames[i] ); entry->setFame( it->second->Fames[i] );
entry->setLastFameChangeTrend( fow->LastFameChangeTrends[i] ); entry->setLastFameChangeTrend( fow->LastFameChangeTrends[i] );
} }
@ -901,7 +902,7 @@ void CFameManager::addFameIndexed(const CEntityId &entityId, uint32 faction, sin
if ( c ) if ( c )
{ {
// Bound the fame based on current allegiance. // Bound the fame based on current allegiance.
sint32 maxFame = getMaxFameByFactionIndex(c->getAllegiance(), faction); sint32 maxFame = getMaxFameByFactionIndex(c->getAllegiance(), c->getOrganization(), faction);
clamp(fame,FameAbsoluteMin,maxFame); clamp(fame,FameAbsoluteMin,maxFame);
// Check to make sure player still qualifies to be in declared allegiances. // Check to make sure player still qualifies to be in declared allegiances.
c->verifyClanAllegiance(PVP_CLAN::getClanFromIndex(faction), sint32(fame)); c->verifyClanAllegiance(PVP_CLAN::getClanFromIndex(faction), sint32(fame));
@ -932,7 +933,7 @@ void CFameManager::addFameIndexed(const CEntityId &entityId, uint32 faction, sin
if ( g ) if ( g )
{ {
// Bound the fame based on current allegiance. // Bound the fame based on current allegiance.
sint32 maxFame = getMaxFameByFactionIndex(g->getAllegiance(), faction); sint32 maxFame = getMaxFameByFactionIndex(g->getAllegiance(), 0, faction);
clamp(fame,FameAbsoluteMin,maxFame); clamp(fame,FameAbsoluteMin,maxFame);
g->verifyClanAllegiance(PVP_CLAN::getClanFromIndex(faction), sint32(fame)); g->verifyClanAllegiance(PVP_CLAN::getClanFromIndex(faction), sint32(fame));
g->setFameValueGuild(faction, sint32(fame), maxFame, fow.LastFameChangeTrends[faction]); g->setFameValueGuild(faction, sint32(fame), maxFame, fow.LastFameChangeTrends[faction]);
@ -1238,7 +1239,7 @@ void CFameManager::setEntityFame(const NLMISC::CEntityId & entityId, uint32 fact
{ {
nldebug("FAME: set fame for character %s as P:%d", entityId.toString().c_str(), fame); nldebug("FAME: set fame for character %s as P:%d", entityId.toString().c_str(), fame);
sint32 maxFame = getMaxFameByFactionIndex(ch->getAllegiance(), faction); sint32 maxFame = getMaxFameByFactionIndex(ch->getAllegiance(), ch->getOrganization(), faction);
ch->setFameValuePlayer(faction, fame, maxFame, fow.LastFameChangeTrends[faction]); ch->setFameValuePlayer(faction, fame, maxFame, fow.LastFameChangeTrends[faction]);
/* /*
@ -1255,7 +1256,7 @@ void CFameManager::setEntityFame(const NLMISC::CEntityId & entityId, uint32 fact
} }
else if(gu) else if(gu)
{ {
sint32 maxFame = getMaxFameByFactionIndex(gu->getAllegiance(), faction); sint32 maxFame = getMaxFameByFactionIndex(gu->getAllegiance(), 0, faction);
gu->setFameValueGuild(faction, fame, maxFame, fow.LastFameChangeTrends[faction]); gu->setFameValueGuild(faction, fame, maxFame, fow.LastFameChangeTrends[faction]);
} }
else else
@ -1279,8 +1280,20 @@ sint32 CFameManager::getStartFame(PVP_CLAN::TPVPClan playerClan, PVP_CLAN::TPVPC
} }
// - getMaxFameByClan: playerClan must be Neutral or the same type (Cult or Clan) as targetClan, targetClan must be any non-neutral clan. // - getMaxFameByClan: playerClan must be Neutral or the same type (Cult or Clan) as targetClan, targetClan must be any non-neutral clan.
sint32 CFameManager::getMaxFameByClan(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> playerClans, PVP_CLAN::TPVPClan targetClan) sint32 CFameManager::getMaxFameByClan(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> playerClans, uint32 organization, PVP_CLAN::TPVPClan targetClan)
{ {
if (targetClan == PVP_CLAN::Marauder)
{
if (organization == 5)
return 100*kFameMultipler;
return 30*kFameMultipler;
}
if (organization == 5) // marauder
{
return -30*kFameMultipler;
}
// Local variables for the lookup values. // Local variables for the lookup values.
int playerLookup, targetLookup; int playerLookup, targetLookup;
@ -1337,18 +1350,19 @@ sint32 CFameManager::getMaxFameByClan(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TP
} }
} }
// Wasn't caught above, probably a tribe. Return a default value. // Wasn't caught above, probably a tribe. Return a default value.
return FameMaxDefault; return FameMaxDefault;
} }
sint32 CFameManager::getMaxFameByFactionIndex(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance, uint32 factionIndex) sint32 CFameManager::getMaxFameByFactionIndex(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance, uint32 organization, uint32 factionIndex)
{ {
PVP_CLAN::TPVPClan pvpClan; PVP_CLAN::TPVPClan pvpClan;
// try first with a clan // try first with a clan
pvpClan= PVP_CLAN::getClanFromIndex(factionIndex); pvpClan= PVP_CLAN::getClanFromIndex(factionIndex);
if(pvpClan != PVP_CLAN::Unknown) if(pvpClan != PVP_CLAN::Unknown)
return getMaxFameByClan(allegiance, pvpClan); return getMaxFameByClan(allegiance, organization, pvpClan);
// search for tribe // search for tribe
else else
{ {
@ -1373,42 +1387,51 @@ sint32 CFameManager::getMaxFameByFactionIndex(std::pair<PVP_CLAN::TPVPClan, PVP_
// get the // get the
const CStaticFames::CTribeCultThreshold * tc = 0; const CStaticFames::CTribeCultThreshold * tc = 0;
switch( allegiance.second ) if (organization == 5) // marauder
{ {
case PVP_CLAN::Matis: tc = &tribeThres[ttIndex].Marauder;
tc = &tribeThres[ttIndex].Matis; return tc->getMarauder();
break;
case PVP_CLAN::Fyros:
tc = &tribeThres[ttIndex].Fyros;
break;
case PVP_CLAN::Tryker:
tc = &tribeThres[ttIndex].Tryker;
break;
case PVP_CLAN::Zorai:
tc = &tribeThres[ttIndex].Zorai;
break;
case PVP_CLAN::Neutral:
tc = &tribeThres[ttIndex].Neutral;
break;
default:
//nlwarning("Character %s have bad civilization allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.second, PVP_CLAN::toString(allegiance.second).c_str());
return FameMaxDefault;
} }
else
switch(allegiance.first)
{ {
case PVP_CLAN::Kami:
return tc->getKami(); switch( allegiance.second )
break; {
case PVP_CLAN::Karavan: case PVP_CLAN::Matis:
return tc->getKaravan(); tc = &tribeThres[ttIndex].Matis;
break; break;
case PVP_CLAN::Neutral: case PVP_CLAN::Fyros:
return tc->getNeutral(); tc = &tribeThres[ttIndex].Fyros;
break; break;
default: case PVP_CLAN::Tryker:
//nlwarning("Character %s have bad cult allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.first, PVP_CLAN::toString(allegiance.first).c_str()); tc = &tribeThres[ttIndex].Tryker;
return FameMaxDefault; break;
case PVP_CLAN::Zorai:
tc = &tribeThres[ttIndex].Zorai;
break;
case PVP_CLAN::Neutral:
tc = &tribeThres[ttIndex].Neutral;
break;
default:
//nlwarning("Character %s have bad civilization allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.second, PVP_CLAN::toString(allegiance.second).c_str());
return FameMaxDefault;
}
switch(allegiance.first)
{
case PVP_CLAN::Kami:
return tc->getKami();
break;
case PVP_CLAN::Karavan:
return tc->getKaravan();
break;
case PVP_CLAN::Neutral:
return tc->getNeutral();
break;
default:
//nlwarning("Character %s have bad cult allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.first, PVP_CLAN::toString(allegiance.first).c_str());
return FameMaxDefault;
}
} }
} }
} }
@ -1433,7 +1456,7 @@ void CFameManager::doInitTribeThresholdIndex()
} }
void CFameManager::enforceFameCaps(const NLMISC::CEntityId &entityId, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance) void CFameManager::enforceFameCaps(const NLMISC::CEntityId &entityId, uint32 organization, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance)
{ {
const TDataSetRow rowId = TheFameDataset.getDataSetRow(entityId); const TDataSetRow rowId = TheFameDataset.getDataSetRow(entityId);
TFameContainer::iterator it = _FamesOwners.find(rowId); TFameContainer::iterator it = _FamesOwners.find(rowId);
@ -1464,6 +1487,51 @@ void CFameManager::enforceFameCaps(const NLMISC::CEntityId &entityId, std::pair<
sint32 fame; sint32 fame;
sint32 maxFame; sint32 maxFame;
if (organization == 5) // marauder
{
for (int looper = PVP_CLAN::BeginCults; looper <= PVP_CLAN::EndCults; looper++)
{
theFactionIndex = PVP_CLAN::getFactionIndex((PVP_CLAN::TPVPClan)looper);
fame = fow.Fames[theFactionIndex];
maxFame = -30*kFameMultipler;
if( fame != NO_FAME)
{
clamp(fame,FameAbsoluteMin, maxFame);
fow.Fames[theFactionIndex] = fame;
}
if (ch)
{
ch->setFameValuePlayer(theFactionIndex, fame, maxFame, fow.LastFameChangeTrends[theFactionIndex]);
}
if (gu)
{
gu->setFameValueGuild(theFactionIndex, fame, maxFame, fow.LastFameChangeTrends[theFactionIndex]);
}
}
for (int looper = PVP_CLAN::BeginCivs; looper <= PVP_CLAN::EndCivs; looper++)
{
theFactionIndex = PVP_CLAN::getFactionIndex((PVP_CLAN::TPVPClan)looper);
fame = fow.Fames[theFactionIndex];
maxFame = -30*kFameMultipler;
if( fame != NO_FAME)
{
clamp(fame,FameAbsoluteMin,maxFame);
fow.Fames[theFactionIndex] = fame;
}
if (ch)
{
ch->setFameValuePlayer(theFactionIndex, fame, maxFame, fow.LastFameChangeTrends[theFactionIndex]);
}
if (gu)
{
gu->setFameValueGuild(theFactionIndex, fame, maxFame, fow.LastFameChangeTrends[theFactionIndex]);
}
}
return;
}
// Check cults, first member of allegiance // Check cults, first member of allegiance
PVP_CLAN::TPVPClan theCult = allegiance.first; PVP_CLAN::TPVPClan theCult = allegiance.first;
if (theCult != PVP_CLAN::None) if (theCult != PVP_CLAN::None)
@ -1472,7 +1540,7 @@ void CFameManager::enforceFameCaps(const NLMISC::CEntityId &entityId, std::pair<
{ {
theFactionIndex = PVP_CLAN::getFactionIndex((PVP_CLAN::TPVPClan)looper); theFactionIndex = PVP_CLAN::getFactionIndex((PVP_CLAN::TPVPClan)looper);
fame = fow.Fames[theFactionIndex]; fame = fow.Fames[theFactionIndex];
maxFame = getMaxFameByClan(allegiance,(PVP_CLAN::TPVPClan)looper); maxFame = getMaxFameByClan(allegiance, organization, (PVP_CLAN::TPVPClan)looper);
if( fame != NO_FAME) if( fame != NO_FAME)
{ {
clamp(fame,FameAbsoluteMin,maxFame); clamp(fame,FameAbsoluteMin,maxFame);
@ -1496,7 +1564,7 @@ void CFameManager::enforceFameCaps(const NLMISC::CEntityId &entityId, std::pair<
{ {
theFactionIndex = PVP_CLAN::getFactionIndex((PVP_CLAN::TPVPClan)looper); theFactionIndex = PVP_CLAN::getFactionIndex((PVP_CLAN::TPVPClan)looper);
fame = fow.Fames[theFactionIndex]; fame = fow.Fames[theFactionIndex];
maxFame = getMaxFameByClan(allegiance,(PVP_CLAN::TPVPClan)looper); maxFame = getMaxFameByClan(allegiance, organization, (PVP_CLAN::TPVPClan)looper);
if( fame != NO_FAME) if( fame != NO_FAME)
{ {
clamp(fame,FameAbsoluteMin,maxFame); clamp(fame,FameAbsoluteMin,maxFame);
@ -1514,7 +1582,7 @@ void CFameManager::enforceFameCaps(const NLMISC::CEntityId &entityId, std::pair<
} }
} }
void CFameManager::setAndEnforceTribeFameCap(const NLMISC::CEntityId &entityId, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance) void CFameManager::setAndEnforceTribeFameCap(const NLMISC::CEntityId &entityId, uint32 organization, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance)
{ {
const TDataSetRow rowId = TheFameDataset.getDataSetRow(entityId); const TDataSetRow rowId = TheFameDataset.getDataSetRow(entityId);
TFameContainer::iterator it = _FamesOwners.find(rowId); TFameContainer::iterator it = _FamesOwners.find(rowId);
@ -1551,42 +1619,50 @@ void CFameManager::setAndEnforceTribeFameCap(const NLMISC::CEntityId &entityId,
{ {
theFactionIndex = (*it).FameIndex; theFactionIndex = (*it).FameIndex;
switch( allegiance.second ) if (organization == 5) // marauder
{ {
case PVP_CLAN::Matis: tc = &(*it).Marauder;
tc = &(*it).Matis; threshold = tc->getMarauder();
break;
case PVP_CLAN::Fyros:
tc = &(*it).Fyros;
break;
case PVP_CLAN::Tryker:
tc = &(*it).Tryker;
break;
case PVP_CLAN::Zorai:
tc = &(*it).Zorai;
break;
case PVP_CLAN::Neutral:
tc = &(*it).Neutral;
break;
default:
nlwarning("Character %s have bad civilization allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.second, PVP_CLAN::toString(allegiance.second).c_str());
return;
} }
else
switch(allegiance.first)
{ {
case PVP_CLAN::Kami: switch( allegiance.second )
threshold = tc->getKami(); {
break; case PVP_CLAN::Matis:
case PVP_CLAN::Karavan: tc = &(*it).Matis;
threshold = tc->getKaravan(); break;
break; case PVP_CLAN::Fyros:
case PVP_CLAN::Neutral: tc = &(*it).Fyros;
threshold = tc->getNeutral(); break;
break; case PVP_CLAN::Tryker:
default: tc = &(*it).Tryker;
nlwarning("Character %s have bad cult allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.first, PVP_CLAN::toString(allegiance.first).c_str()); break;
return; case PVP_CLAN::Zorai:
tc = &(*it).Zorai;
break;
case PVP_CLAN::Neutral:
tc = &(*it).Neutral;
break;
default:
nlwarning("Character %s have bad civilization allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.second, PVP_CLAN::toString(allegiance.second).c_str());
return;
}
switch(allegiance.first)
{
case PVP_CLAN::Kami:
threshold = tc->getKami();
break;
case PVP_CLAN::Karavan:
threshold = tc->getKaravan();
break;
case PVP_CLAN::Neutral:
threshold = tc->getNeutral();
break;
default:
nlwarning("Character %s have bad cult allegiance...'%d/%s' !", entityId.toString().c_str(), allegiance.first, PVP_CLAN::toString(allegiance.first).c_str());
return;
}
} }
fame = fow.Fames[theFactionIndex]; fame = fow.Fames[theFactionIndex];
@ -2251,7 +2327,7 @@ NLMISC_COMMAND (testit, "testit", "")
} }
//int retval = CFameManager::getInstance().getStartFame(pCiv,tClan); //int retval = CFameManager::getInstance().getStartFame(pCiv,tClan);
int retval = CFameManager::getInstance().getMaxFameByClan(std::make_pair(pCult,pCiv),tClan); int retval = CFameManager::getInstance().getMaxFameByClan(std::make_pair(pCult,pCiv),0,tClan);
log.displayNL("Fame value = %d.", retval); log.displayNL("Fame value = %d.", retval);
return true; return true;

@ -147,14 +147,14 @@ public:
sint32 getStartFame(PVP_CLAN::TPVPClan playerClan, PVP_CLAN::TPVPClan targetClan); sint32 getStartFame(PVP_CLAN::TPVPClan playerClan, PVP_CLAN::TPVPClan targetClan);
// - getMaxFameByClan: playerClan must be Neutral or the same type (Cult or Clan) as targetClan, // - getMaxFameByClan: playerClan must be Neutral or the same type (Cult or Clan) as targetClan,
// targetClan must be any non-neutral clan. // targetClan must be any non-neutral clan.
sint32 getMaxFameByClan(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> playerClans, PVP_CLAN::TPVPClan targetClan); sint32 getMaxFameByClan(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> playerClans, uint32 organization, PVP_CLAN::TPVPClan targetClan);
sint32 getMaxFameByFactionIndex(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> playerClans, uint32 factionIndex); sint32 getMaxFameByFactionIndex(std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> playerClans, uint32 organization, uint32 factionIndex);
// Ensures that the fame values are properly capped based on allegiance. // Ensures that the fame values are properly capped based on allegiance.
void enforceFameCaps(const NLMISC::CEntityId &entityId, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance); void enforceFameCaps(const NLMISC::CEntityId &entityId, uint32 organization, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance);
// Set tribe fame cap and ensures fame values are properly capped, based on allegiance // Set tribe fame cap and ensures fame values are properly capped, based on allegiance
void setAndEnforceTribeFameCap(const NLMISC::CEntityId &entityId, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance); void setAndEnforceTribeFameCap(const NLMISC::CEntityId &entityId, uint32 organization, std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance);
// Callback function for when one of the threshold CVariables are changed. // Callback function for when one of the threshold CVariables are changed.
static void thresholdChanged(NLMISC::IVariable &var); static void thresholdChanged(NLMISC::IVariable &var);

@ -2071,7 +2071,7 @@ bool CGuild::setDeclaredCult(PVP_CLAN::TPVPClan newClan, bool noCheck)
//character->sendEventForMissionAvailabilityCheck(); //character->sendEventForMissionAvailabilityCheck();
} }
_DeclaredCult = newClan; _DeclaredCult = newClan;
CFameManager::getInstance().enforceFameCaps(getEId(), getAllegiance()); CFameManager::getInstance().enforceFameCaps(getEId(), 0, getAllegiance());
// Go through membership list, change anyone who doesn't fit in guild to "None". // Go through membership list, change anyone who doesn't fit in guild to "None".
verifyGuildmembersAllegiance(); verifyGuildmembersAllegiance();
@ -2105,7 +2105,7 @@ bool CGuild::setDeclaredCiv(PVP_CLAN::TPVPClan newClan, bool noCheck)
//character->sendEventForMissionAvailabilityCheck(); //character->sendEventForMissionAvailabilityCheck();
} }
_DeclaredCiv = newClan; _DeclaredCiv = newClan;
CFameManager::getInstance().enforceFameCaps(getEId(), getAllegiance()); CFameManager::getInstance().enforceFameCaps(getEId(), 0, getAllegiance());
// Go through membership list, change anyone who doesn't fit in guild to "None". // Go through membership list, change anyone who doesn't fit in guild to "None".
verifyGuildmembersAllegiance(); verifyGuildmembersAllegiance();
@ -2232,7 +2232,7 @@ void CGuild::resetFameDatabase()
{ {
// update player fame info // update player fame info
sint32 fame = fi.getFameIndexed(getEId(), i); sint32 fame = fi.getFameIndexed(getEId(), i);
sint32 maxFame = CFameManager::getInstance().getMaxFameByFactionIndex(getAllegiance(), i); sint32 maxFame = CFameManager::getInstance().getMaxFameByFactionIndex(getAllegiance(), 0, i);
setFameValueGuild(i, fame, maxFame, 0); setFameValueGuild(i, fame, maxFame, 0);
} }
} }
@ -2265,7 +2265,7 @@ void CGuild::setStartFameAndAllegiance( const CEntityId& guildCreator )
CFameManager::getInstance().setEntityFame(getEId(), i, 0); CFameManager::getInstance().setEntityFame(getEId(), i, 0);
} }
} }
CFameManager::getInstance().enforceFameCaps( getEId(), allegiance ); CFameManager::getInstance().enforceFameCaps( getEId(), 0, allegiance );
} }

@ -11880,9 +11880,21 @@ void CCharacter::setOrganization(uint32 org)
CBankAccessor_PLR::getUSER().getRRPS_LEVELS(1).setVALUE(_PropertyDatabase, _Organization); CBankAccessor_PLR::getUSER().getRRPS_LEVELS(1).setVALUE(_PropertyDatabase, _Organization);
CBankAccessor_PLR::getUSER().getRRPS_LEVELS(2).setVALUE(_PropertyDatabase, _OrganizationStatus); CBankAccessor_PLR::getUSER().getRRPS_LEVELS(2).setVALUE(_PropertyDatabase, _OrganizationStatus);
CBankAccessor_PLR::getUSER().getRRPS_LEVELS(3).setVALUE(_PropertyDatabase, _OrganizationPoints); CBankAccessor_PLR::getUSER().getRRPS_LEVELS(3).setVALUE(_PropertyDatabase, _OrganizationPoints);
CPVPManager2::getInstance()->updateFactionChannel(this);
if (org != 0)
{
setDeclaredCult(PVP_CLAN::Neutral);
setDeclaredCiv(PVP_CLAN::Neutral);
}
CPVPManager2::getInstance()->updateFactionChannel(this);
updateJewelsTags(false); updateJewelsTags(false);
// Make sure fame values are properly capped.
CFameManager::getInstance().enforceFameCaps(getId(), org, getAllegiance());
// set tribe fame threshold and clamp fame if necessary
CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), org, getAllegiance());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -16541,7 +16553,7 @@ void CCharacter::setFameValuePlayer(uint32 factionIndex, sint32 playerFame, sint
sint32 marauderFame = CFameInterface::getInstance().getFameIndexed(_Id, marauderIdx); sint32 marauderFame = CFameInterface::getInstance().getFameIndexed(_Id, marauderIdx);
if (factionIndex != marauderIdx) if (factionIndex != marauderIdx)
{ {
sint32 maxOtherfame = -100*6000; sint32 maxOtherfame = -100*kFameMultipler;
for (uint8 fameIdx = 0; fameIdx < 7; fameIdx++) for (uint8 fameIdx = 0; fameIdx < 7; fameIdx++)
{ {
if (fameIdx == marauderIdx) if (fameIdx == marauderIdx)
@ -16553,11 +16565,16 @@ void CCharacter::setFameValuePlayer(uint32 factionIndex, sint32 playerFame, sint
maxOtherfame = fame; maxOtherfame = fame;
} }
// Marauder fame is when player have negative fame in other clans if (marauderFame < 50*kFameMultipler)
maxOtherfame = -maxOtherfame; {
if (maxOtherfame < -50*kFameMultipler) // Cap to 50
if (marauderFame < 50 * 6000 || maxOtherfame < 50 * 6000) { maxOtherfame = -50*kFameMultipler;
CFameManager::getInstance().setEntityFame(_Id, marauderIdx, maxOtherfame, false); CFameManager::getInstance().setEntityFame(_Id, marauderIdx, -maxOtherfame, false);
}
else
{
if (maxOtherfame > -40*kFameMultipler)
CFameManager::getInstance().setEntityFame(_Id, marauderIdx, -maxOtherfame, false);
} }
} }
@ -16642,15 +16659,15 @@ void CCharacter::resetFameDatabase()
// Check fames and fix bad values // Check fames and fix bad values
if (!haveAnyPrivilege()) if (!haveAnyPrivilege())
{ {
CFameManager::getInstance().enforceFameCaps(getId(), getAllegiance()); CFameManager::getInstance().enforceFameCaps(getId(), getOrganization(), getAllegiance());
CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), getAllegiance()); CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), getOrganization(), getAllegiance());
} }
for (uint i = 0; i < CStaticFames::getInstance().getNbFame(); ++i) for (uint i = 0; i < CStaticFames::getInstance().getNbFame(); ++i)
{ {
// update player fame info // update player fame info
sint32 fame = fi.getFameIndexed(_Id, i, false, true); sint32 fame = fi.getFameIndexed(_Id, i, false, true);
sint32 maxFame = CFameManager::getInstance().getMaxFameByFactionIndex(getAllegiance(), i); sint32 maxFame = CFameManager::getInstance().getMaxFameByFactionIndex(getAllegiance(), getOrganization(), i);
setFameValuePlayer(i, fame, maxFame, 0); setFameValuePlayer(i, fame, maxFame, 0);
} }
} }
@ -20297,9 +20314,9 @@ bool CCharacter::setDeclaredCult(PVP_CLAN::TPVPClan newClan)
{ {
// No problems, let the change happen. // No problems, let the change happen.
// Make sure fame values are properly capped. // Make sure fame values are properly capped.
CFameManager::getInstance().enforceFameCaps(this->getId(), this->getAllegiance()); CFameManager::getInstance().enforceFameCaps(this->getId(), this->getOrganization(), this->getAllegiance());
// set tribe fame threshold and clamp fame if necessary // set tribe fame threshold and clamp fame if necessary
CFameManager::getInstance().setAndEnforceTribeFameCap(this->getId(), this->getAllegiance()); CFameManager::getInstance().setAndEnforceTribeFameCap(this->getId(), this->getOrganization(), this->getAllegiance());
// handle with faction channel // handle with faction channel
CPVPManager2::getInstance()->updateFactionChannel(this); CPVPManager2::getInstance()->updateFactionChannel(this);
// write new allegiance in database // write new allegiance in database
@ -20358,9 +20375,9 @@ bool CCharacter::setDeclaredCiv(PVP_CLAN::TPVPClan newClan)
{ {
// No problems, let the change happen. // No problems, let the change happen.
// Make sure fame values are properly capped. // Make sure fame values are properly capped.
CFameManager::getInstance().enforceFameCaps(this->getId(), this->getAllegiance()); CFameManager::getInstance().enforceFameCaps(this->getId(), this->getOrganization(), this->getAllegiance());
// set tribe fame threshold and clamp fame if necessary // set tribe fame threshold and clamp fame if necessary
CFameManager::getInstance().setAndEnforceTribeFameCap(this->getId(), this->getAllegiance()); CFameManager::getInstance().setAndEnforceTribeFameCap(this->getId(), this->getOrganization(), this->getAllegiance());
// handle with faction channel // handle with faction channel
CPVPManager2::getInstance()->updateFactionChannel(this); CPVPManager2::getInstance()->updateFactionChannel(this);
// write new allegiance in database // write new allegiance in database

@ -3331,6 +3331,11 @@ void CCharacter::useItem(uint32 slot)
fx.Aura = MAGICFX::NoAura; fx.Aura = MAGICFX::NoAura;
} }
} }
else if (getOrganization() == 5 && CFameInterface::getInstance().getFameIndexed(_Id, PVP_CLAN::getFactionIndex(PVP_CLAN::Marauder)))
>= 600000)
{
fx.Aura = MAGICFX::MarauderKami;
}
else else
{ {
fx.Aura = MAGICFX::NoAura; fx.Aura = MAGICFX::NoAura;

Loading…
Cancel
Save