Bulk disable webig changes

ryzomclassic-develop
kaetemi 5 years ago
parent e0a14d79ac
commit 2927b3dfb9

@ -1028,6 +1028,7 @@ void CBSAIDeathReport::callback(const std::string &name, NLNET::TServiceId id)
playerAggroable.push_back(aggroIt->first); playerAggroable.push_back(aggroIt->first);
} }
#ifdef RYZOM_FORGE
NLNET::CMessage msgout("TRIGGER_WEBIG"); NLNET::CMessage msgout("TRIGGER_WEBIG");
if (!eventBotKilled.empty()) if (!eventBotKilled.empty())
msgout.serial(eventBotKilled); msgout.serial(eventBotKilled);
@ -1041,6 +1042,7 @@ void CBSAIDeathReport::callback(const std::string &name, NLNET::TServiceId id)
msgout.serial(playerAggroable[i]); msgout.serial(playerAggroable[i]);
} }
sendMessageViaMirror("EGS", msgout); sendMessageViaMirror("EGS", msgout);
#endif
} }
} }
break; break;

@ -4585,6 +4585,7 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
} }
#ifdef RYZOM_FORGE
NLMISC_COMMAND (connectLangChannel, "Connect to lang channel", "<user id> <lang> <leave:0|1>") NLMISC_COMMAND (connectLangChannel, "Connect to lang channel", "<user id> <lang> <leave:0|1>")
{ {
if ((args.size() < 2) || (args.size() > 3)) if ((args.size() < 2) || (args.size() > 3))
@ -4625,6 +4626,7 @@ NLMISC_COMMAND (connectLangChannel, "Connect to lang channel", "<user id> <lang>
CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params ); CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params );
return false; return false;
} }
#endif
NLMISC_COMMAND (updateTarget, "Update current target", "<user id>") NLMISC_COMMAND (updateTarget, "Update current target", "<user id>")
{ {
@ -6994,6 +6996,7 @@ NLMISC_COMMAND(listGuildMembers, "display guild members list", "<csr eid> <guild
return true; return true;
} }
#ifdef RYZOM_FORGE_ROOM
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(roomInvite, "send a room invite to a player character", "<eid> <member name>") NLMISC_COMMAND(roomInvite, "send a room invite to a player character", "<eid> <member name>")
{ {
@ -7077,6 +7080,7 @@ NLMISC_COMMAND(roomKick, "kick player from room", "<eid> <member name>")
return true; return true;
} }
#endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(guildInvite, "send a guild invite to a player character", "<eid> <member name>") NLMISC_COMMAND(guildInvite, "send a guild invite to a player character", "<eid> <member name>")
@ -7960,6 +7964,7 @@ NLMISC_COMMAND(addGuildBuilding, "sadd a building to guild", "<player eid> <buil
return true; return true;
} }
#ifdef RYZOM_FORGE
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(setOrganization, "set the organization of a player to the given faction", "<player eid> <faction>") NLMISC_COMMAND(setOrganization, "set the organization of a player to the given faction", "<player eid> <faction>")
{ {
@ -8006,6 +8011,7 @@ NLMISC_COMMAND(setOrganizationStatus, "set the organization status of a player",
return true; return true;
} }
#endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(eventCreateNpcGroup, "create an event npc group", "<player eid> <nbBots> <sheet> [<dispersionRadius=10m>] [<spawnBots=true>] [<orientation=random|self|-360..360>] [<name>] [<x>] [<y>] [client_sheet] [inVIllage?inOutpost?inStable?inAtys?]") NLMISC_COMMAND(eventCreateNpcGroup, "create an event npc group", "<player eid> <nbBots> <sheet> [<dispersionRadius=10m>] [<spawnBots=true>] [<orientation=random|self|-360..360>] [<name>] [<x>] [<y>] [client_sheet] [inVIllage?inOutpost?inStable?inAtys?]")

@ -545,11 +545,15 @@ bool CBuildingPhysicalPlayer::isUserAllowed(CCharacter * user, uint16 ownerId, u
if (user->isDead()) if (user->isDead())
return false; return false;
#ifdef RYZOM_FORGE_ROOM
CCharacter * owner = PlayerManager.getChar( _Players[ownerId] ); CCharacter * owner = PlayerManager.getChar( _Players[ownerId] );
if (owner) if (owner)
return ( (user->getId() == _Players[ownerId]) || owner->playerHaveRoomAccess(user->getId()) ); return ( (user->getId() == _Players[ownerId]) || owner->playerHaveRoomAccess(user->getId()) );
else else
return false; return false;
#else
return (user->getId() == _Players[ownerId]);
#endif
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

@ -91,8 +91,6 @@ void CRoomInstanceGuild::removeUser( CCharacter* user )
return; return;
} }
user->sendUrl("app_ryzhome action=quit_guild_room&room_name="+guildBuilding->getName(), "");
--_RefCount; --_RefCount;
if ( _RefCount == 0 ) if ( _RefCount == 0 )
{ {
@ -106,14 +104,14 @@ void CRoomInstanceGuild::addUser( CCharacter* user, CCharacter* owner )
{ {
BOMB_IF( !user, "<BUILDING> null character!", return ); BOMB_IF( !user, "<BUILDING> null character!", return );
#ifdef RYZOM_FORGE_ROOM
CBuildingPhysicalGuild * guildBuilding = dynamic_cast<CBuildingPhysicalGuild *>( _Building ); CBuildingPhysicalGuild * guildBuilding = dynamic_cast<CBuildingPhysicalGuild *>( _Building );
BOMB_IF( !guildBuilding, "<BUILDING> building type does not match with room type", return ); BOMB_IF( !guildBuilding, "<BUILDING> building type does not match with room type", return );
#endif
// open guild inventory window // open guild inventory window
PlayerManager.sendImpulseToClient(user->getId(), "GUILD:OPEN_INVENTORY"); PlayerManager.sendImpulseToClient(user->getId(), "GUILD:OPEN_INVENTORY");
user->sendUrl("app_ryzhome action=open_guild_room&owner="+ owner->getName().toString()+"&room_name="+guildBuilding->getName(), "");
++_RefCount; ++_RefCount;
} }
@ -147,16 +145,20 @@ void CRoomInstancePlayer::removeUser( CCharacter* user )
); );
return; return;
} }
user->sendUrl("app_ryzhome action=quit_player_room&room_name="+playerBuilding->getName(), "");
--_RefCount; --_RefCount;
if ( _RefCount == 0 ) if ( _RefCount == 0 )
{ {
#ifdef RYZOM_FORGE_ROOM
playerBuilding->resetRoomCell( _RoomIdx , user->getInRoomOfPlayer()); playerBuilding->resetRoomCell( _RoomIdx , user->getInRoomOfPlayer());
#else
playerBuilding->resetRoomCell( _RoomIdx , user->getId() );
#endif
release(); release();
} }
#ifdef RYZOM_FORGE_ROOM
user->setInRoomOfPlayer(CEntityId::Unknown); user->setInRoomOfPlayer(CEntityId::Unknown);
#endif
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -164,11 +166,15 @@ void CRoomInstancePlayer::addUser( CCharacter* user, CCharacter* owner )
{ {
BOMB_IF( !user, "<BUILDING> null character!", return ); BOMB_IF( !user, "<BUILDING> null character!", return );
#ifdef RYZOM_FORGE_ROOM
CBuildingPhysicalPlayer * playerBuilding = dynamic_cast<CBuildingPhysicalPlayer *>( _Building ); CBuildingPhysicalPlayer * playerBuilding = dynamic_cast<CBuildingPhysicalPlayer *>( _Building );
BOMB_IF( !playerBuilding, "<BUILDING> building type does not match with room type", return ); BOMB_IF( !playerBuilding, "<BUILDING> building type does not match with room type", return );
#endif
// open room inventory window // open room inventory window
// TODO: Does a visiting user have access to the inventory? -Kaetemi
PlayerManager.sendImpulseToClient(user->getId(), "ITEM:OPEN_ROOM_INVENTORY"); PlayerManager.sendImpulseToClient(user->getId(), "ITEM:OPEN_ROOM_INVENTORY");
#ifdef RYZOM_FORGE_ROOM
if (owner) if (owner)
{ {
owner->removeRoomAccesToPlayer(user->getId(),false); owner->removeRoomAccesToPlayer(user->getId(),false);
@ -179,7 +185,7 @@ void CRoomInstancePlayer::addUser( CCharacter* user, CCharacter* owner )
// Very rare case // Very rare case
owner = user; owner = user;
} }
user->sendUrl("app_ryzhome action=open_player_room&owner="+ owner->getName().toString()+"&room_name="+playerBuilding->getName(), ""); #endif
++_RefCount; ++_RefCount;
} }

@ -1956,7 +1956,7 @@ void cbClientSendCustomEmote( NLNET::CMessage& msgin, const std::string &service
return; return;
} }
if(behaviour >= 140 && behaviour <= 169) if (behaviour >= (MBEHAV::EMOTE_BEGIN + 80) && behaviour <= (MBEHAV::EMOTE_BEGIN + 109))
{ {
string name = CEntityIdTranslator::getInstance()->getByEntity(id).toString(); string name = CEntityIdTranslator::getInstance()->getByEntity(id).toString();
nlwarning("HACK: %s %s tries to launch a firework %d", id.toString().c_str(), name.c_str(), behaviour); nlwarning("HACK: %s %s tries to launch a firework %d", id.toString().c_str(), name.c_str(), behaviour);
@ -2737,7 +2737,8 @@ void cbClientSetCharacterTitle( NLNET::CMessage& msgin, const std::string & serv
} }
// kxu: TODO: check validity of title chosen by player // kxu: TODO: check validity of title chosen by player
c->setNewTitle(CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)title)); // TODO: Checking validity here is important! This can be easily hacked clientside. -Kaetemi
c->setTitle((CHARACTER_TITLE::ECharacterTitle)title);
c->registerName(); c->registerName();
} }
@ -3072,6 +3073,7 @@ void cbClientQuitGameRequest( NLNET::CMessage& msgin, const std::string & servic
if (player) if (player)
securityCheck.setCookie(player->getLoginCookie()); // if not set (null player), the check won't pass securityCheck.setCookie(player->getLoginCookie()); // if not set (null player), the check won't pass
// TODO_RYZOMCLASSIC: There used to be a value here. -Kaetemi
securityCheck.check(""); securityCheck.check("");
} }
} }
@ -3618,6 +3620,10 @@ TUnifiedCallbackItem CbClientArray[]=
{ "CLIENT:DUEL:REFUSE", cbClientDuelRefuse }, { "CLIENT:DUEL:REFUSE", cbClientDuelRefuse },
{ "CLIENT:DUEL:ABANDON", cbClientDuelAbandon }, { "CLIENT:DUEL:ABANDON", cbClientDuelAbandon },
// TODO_RYZOMCLASSIC: Revert this, add additional client messages for 'League'. -Kaetemi
// { "CLIENT:PVP_CHALLENGE:ASK", cbClientPVPChallengeAsked },
// { "CLIENT:PVP_CHALLENGE:ACCEPT", cbClientPVPChallengeAccept },
// { "CLIENT:PVP_CHALLENGE:REFUSE", cbClientPVPChallengeRefuse },
{ "CLIENT:PVP_CHALLENGE:ASK", cbClientLeagueJoinProposal }, { "CLIENT:PVP_CHALLENGE:ASK", cbClientLeagueJoinProposal },
{ "CLIENT:PVP_CHALLENGE:ACCEPT", cbClientLeagueJoin }, { "CLIENT:PVP_CHALLENGE:ACCEPT", cbClientLeagueJoin },
{ "CLIENT:PVP_CHALLENGE:REFUSE", cbClientLeagueJoinProposalDecline }, { "CLIENT:PVP_CHALLENGE:REFUSE", cbClientLeagueJoinProposalDecline },

@ -446,8 +446,10 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
c->initAnimalHungerDb(); c->initAnimalHungerDb();
c->initFactionPointDb(); c->initFactionPointDb();
#ifdef RYZOM_FORGE
c->initPvpPointDb(); c->initPvpPointDb();
c->initOrganizationInfos(); c->initOrganizationInfos();
#endif
c->updateOutpostAdminFlagInDB(); c->updateOutpostAdminFlagInDB();
@ -519,7 +521,26 @@ void cbClientReady( CMessage& msgin, const std::string &serviceName, NLNET::TSer
// ask backup for offline commands file // ask backup for offline commands file
COfflineCharacterCommand::getInstance()->characterOnline( characterId ); COfflineCharacterCommand::getInstance()->characterOnline( characterId );
#ifdef RYZOM_EPISODE2_REACTIVATE
if( CGameEventManager::getInstance().getChannelEventId() != TChanID::Unknown )
{
if( c->haveAnyPrivilege() )
{
DynChatEGS.addSession(CGameEventManager::getInstance().getChannelEventId(), entityIndex, true);
}
else
{
DynChatEGS.addSession(CGameEventManager::getInstance().getChannelEventId(), entityIndex, false);
}
}
#endif
c->onConnection(); c->onConnection();
#ifdef RYZOM_EPISODE2_REACTIVATE
CPVPManager2::getInstance()->sendFactionWarsToClient( c );
CPVPManager2::getInstance()->addOrRemoveFactionChannel( c );
#endif
} // cbClientReady // } // cbClientReady //
@ -3052,6 +3073,7 @@ void cbTeleportPlayer(NLNET::CMessage& msgin, const std::string &serviceName, NL
chr->teleportCharacter(x, y, z, true, true, t); chr->teleportCharacter(x, y, z, true, true, t);
} }
#ifdef RYZOM_FORGE
//--------------------------------------------------- //---------------------------------------------------
// trigger the webig // trigger the webig
//--------------------------------------------------- //---------------------------------------------------
@ -3076,7 +3098,7 @@ void cbTriggerWebig(NLNET::CMessage& msgin, const std::string &serviceName, NLNE
chr->sendUrl(event, ""); chr->sendUrl(event, "");
} }
} }
#endif
//--------------------------------------------------- //---------------------------------------------------
/// Forage source position validation /// Forage source position validation

@ -48,7 +48,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate
{ {
struct CSubStep struct CSubStep
{ {
string Dynamic;
CSheetId Sheet; CSheetId Sheet;
uint16 Quantity; uint16 Quantity;
}; };
@ -69,36 +68,24 @@ class CMissionStepKillFauna : public IMissionStepTemplate
_SubSteps.reserve( subs.size() ); _SubSteps.reserve( subs.size() );
for ( uint i = 0; i < subs.size(); i++ ) for ( uint i = 0; i < subs.size(); i++ )
{ {
CSubStep subStep;
std::vector< std::string > args; std::vector< std::string > args;
CMissionParser::tokenizeString( subs[i]," \t", args ); CMissionParser::tokenizeString( subs[i]," \t", args );
//// Dynamic Mission Args : #dynamic# <quantity> if ( args.size() != 2 )
if ((args.size() == 2) && (args[0] == "#dynamic#"))
{ {
subStep.Dynamic = missionData.Name; MISLOGSYNTAXERROR("<creature> <quantity> *[; <creature> <quantity>] [: <place>]");
subStep.Quantity = atoi(args[1].c_str()); return false;
} }
//// missionData.ChatParams.push_back( make_pair(args[0],STRING_MANAGER::creature_model) );
else
CSubStep subStep;
subStep.Sheet = CSheetId( args[0] + ".creature");
if ( subStep.Sheet == CSheetId::Unknown )
{ {
if ( args.size() != 2 ) ret = false;
{ MISLOGERROR1("invalid sheet '%s'", args[0].c_str());
MISLOGSYNTAXERROR("<creature> <quantity> *[; <creature> <quantity>] [: <place>]");
return false;
}
missionData.ChatParams.push_back( make_pair(args[0],STRING_MANAGER::creature_model) );
subStep.Dynamic = "";
subStep.Sheet = CSheetId( args[0] + ".creature");
if ( subStep.Sheet == CSheetId::Unknown )
{
ret = false;
MISLOGERROR1("invalid sheet '%s'", args[0].c_str());
}
NLMISC::fromString(args[1], subStep.Quantity);
} }
NLMISC::fromString(args[1], subStep.Quantity);
_SubSteps.push_back(subStep); _SubSteps.push_back(subStep);
} }
if ( script.size() == 3 ) if ( script.size() == 3 )
@ -119,53 +106,16 @@ class CMissionStepKillFauna : public IMissionStepTemplate
} }
uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow )
{ {
string webAppUrl;
bool ret = true;
_User = PlayerManager.getChar(getEntityIdFromRow(userRow));
if ( event.Type == CMissionEvent::Kill ) if ( event.Type == CMissionEvent::Kill )
{ {
CMissionEventKill & eventSpe = (CMissionEventKill&)event; CMissionEventKill & eventSpe = (CMissionEventKill&)event;
CCreature * c = CreatureManager.getCreature( event.TargetEntity ); CCreature * c = CreatureManager.getCreature( event.TargetEntity );
CSheetId faunaSheet;
//// Dynamic Mission Args
if (_SubSteps[subStepIndex].Dynamic.empty()) {
faunaSheet = _SubSteps[subStepIndex].Sheet;
}
else
{
vector<string> params = _User->getCustomMissionParams(_SubSteps[subStepIndex].Dynamic);
if (params.size() < 2)
{
LOGMISSIONSTEPERROR("kill_fauna : invalid dynamic creature");
return 0;
}
else
{
webAppUrl = params[0];
faunaSheet = CSheetId(params[1]);
if (params.size() > 2) {
string placeStr = CMissionParser::getNoBlankString( params[2] );
CPlace * place = CZoneManager::getInstance().getPlaceFromName( placeStr );
if ( !place )
{
ret = false;
LOGMISSIONSTEPERROR("kill_fauna : invalid place "+params[2]);
}
else
_Place = place->getId();
}
}
////
}
if ( !c ) if ( !c )
{ {
LOGMISSIONSTEPERROR("kill_fauna : invalid creature " + toString(event.TargetEntity.getIndex())); LOGMISSIONSTEPERROR("kill_fauna : invalid creature " + toString(event.TargetEntity.getIndex()));
} }
else if ( faunaSheet == c->getType() ) else if ( _SubSteps[subStepIndex].Sheet == c->getType() )
{ {
if ( _Place != 0xFFFF ) if ( _Place != 0xFFFF )
{ {
@ -179,8 +129,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate
if ( region && region->getId() == _Place ) if ( region && region->getId() == _Place )
{ {
if (!webAppUrl.empty())
_User->validateDynamicMissionStep(webAppUrl);
LOGMISSIONSTEPSUCCESS("kill_fauna"); LOGMISSIONSTEPSUCCESS("kill_fauna");
return 1; return 1;
} }
@ -189,8 +137,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate
{ {
if ( places[i] && places[i]->getId() == _Place ) if ( places[i] && places[i]->getId() == _Place )
{ {
if (!webAppUrl.empty())
_User->validateDynamicMissionStep(webAppUrl);
LOGMISSIONSTEPSUCCESS("kill_fauna"); LOGMISSIONSTEPSUCCESS("kill_fauna");
return 1; return 1;
} }
@ -199,8 +145,6 @@ class CMissionStepKillFauna : public IMissionStepTemplate
} }
else else
{ {
if (!webAppUrl.empty())
_User->validateDynamicMissionStep(webAppUrl);
LOGMISSIONSTEPSUCCESS("kill_fauna"); LOGMISSIONSTEPSUCCESS("kill_fauna");
return 1; return 1;
} }
@ -215,87 +159,48 @@ class CMissionStepKillFauna : public IMissionStepTemplate
ret.clear(); ret.clear();
ret.resize( _SubSteps.size() ); ret.resize( _SubSteps.size() );
for ( uint i = 0; i < _SubSteps.size(); i++ ) for ( uint i = 0; i < _SubSteps.size(); i++ )
{
ret[i] = _SubSteps[i].Quantity; ret[i] = _SubSteps[i].Quantity;
}
} }
virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates)
{ {
static const std::string stepTextReact = "MIS_NEED_REACTIVATION";
static const std::string stepText = "MIS_KILL_FAUNA_"; static const std::string stepText = "MIS_KILL_FAUNA_";
static const std::string stepTextLoc = "MIS_KILL_FAUNA_LOC_"; static const std::string stepTextLoc = "MIS_KILL_FAUNA_LOC_";
nlassert( _SubSteps.size() == subStepStates.size() ); nlassert( _SubSteps.size() == subStepStates.size() );
CSheetId faunaSheet;
for ( uint i = 0; i < subStepStates.size(); i++ ) for ( uint i = 0; i < subStepStates.size(); i++ )
{ {
if( subStepStates[i] != 0 ) if( subStepStates[i] != 0 )
{ {
if (_SubSteps[i].Dynamic.empty())
{
faunaSheet = _SubSteps[i].Sheet;
}
else
{
//// Dynamic Mission Args
vector<string> params = _User->getCustomMissionParams(_SubSteps[i].Dynamic);
if (params.size() < 2)
{
faunaSheet = CSheetId::Unknown;
}
else
{
faunaSheet = CSheetId(params[1]);
}
if ((_Place == 0xFFFF) && (params.size() > 2))
{
string placeStr = CMissionParser::getNoBlankString( params[2] );
CPlace * place = CZoneManager::getInstance().getPlaceFromName( placeStr );
if ( !place )
{
MISLOG("sline:%u ERROR : kill_fauna : Invalid place %u", _SourceLine, _Place);
}
else
_Place = place->getId();
}
////
}
nbSubSteps++; nbSubSteps++;
if (faunaSheet != CSheetId::Unknown) retParams.push_back(STRING_MANAGER::TParam());
{ retParams.back().Type = STRING_MANAGER::creature_model;
retParams.push_back(STRING_MANAGER::TParam()); retParams.back().SheetId = _SubSteps[i].Sheet;
retParams.back().Type = STRING_MANAGER::creature_model;
retParams.back().SheetId = faunaSheet;
retParams.push_back(STRING_MANAGER::TParam()); retParams.push_back(STRING_MANAGER::TParam());
retParams.back().Type = STRING_MANAGER::integer; retParams.back().Type = STRING_MANAGER::integer;
retParams.back().Int = subStepStates[i]; retParams.back().Int = subStepStates[i];
}
} }
} }
if (faunaSheet != CSheetId::Unknown) if ( _Place != 0xFFFF )
{ {
if ( _Place != 0xFFFF ) STRING_MANAGER::TParam param;
param.Type = STRING_MANAGER::place;
CPlace * place = CZoneManager::getInstance().getPlaceFromId(_Place);
if ( !place )
{ {
STRING_MANAGER::TParam param; MISLOG("sline:%u ERROR : kill_fauna : Invalid place %u", _SourceLine, _Place);
param.Type = STRING_MANAGER::place;
CPlace * place = CZoneManager::getInstance().getPlaceFromId(_Place);
if ( !place )
{
MISLOG("sline:%u ERROR : kill_fauna : Invalid place %u", _SourceLine, _Place);
}
else
{
param.Identifier = place->getName();
retParams.push_back(param);
}
textPtr = &stepTextLoc;
} }
else else
textPtr = &stepText; {
param.Identifier = place->getName();
retParams.push_back(param);
}
textPtr = &stepTextLoc;
} }
else else
textPtr = &stepTextReact; textPtr = &stepText;
} }
std::vector< CSubStep > _SubSteps; std::vector< CSubStep > _SubSteps;
@ -480,7 +385,6 @@ class CMissionStepKillNpc : public IMissionStepTemplate
{ {
struct CSubStep struct CSubStep
{ {
string Dynamic;
TAIAlias Alias; TAIAlias Alias;
// NLMISC::TStringId NpcName; // NLMISC::TStringId NpcName;
}; };
@ -501,17 +405,9 @@ class CMissionStepKillNpc : public IMissionStepTemplate
for ( uint i = 0; i < subs.size(); i++ ) for ( uint i = 0; i < subs.size(); i++ )
{ {
CSubStep subStep; CSubStep subStep;
//// Dynamic Mission Args : #dynamic# subStep.Alias = CAIAliasTranslator::Invalid;
if (trim(subs[i]) == "#dynamic#") { if ( !CMissionParser::parseBotName(subs[i],subStep.Alias,missionData) )
subStep.Dynamic = missionData.Name; ret = false;
}
////
else
{
subStep.Alias = CAIAliasTranslator::Invalid;
if ( !CMissionParser::parseBotName(subs[i],subStep.Alias,missionData) )
ret = false;
}
_SubSteps.push_back( subStep ); _SubSteps.push_back( subStep );
} }
return ret; return ret;
@ -519,9 +415,6 @@ class CMissionStepKillNpc : public IMissionStepTemplate
} }
uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow )
{ {
string webAppUrl;
CCharacter * user = PlayerManager.getChar(getEntityIdFromRow(userRow));
if ( event.Type == CMissionEvent::Kill ) if ( event.Type == CMissionEvent::Kill )
{ {
CMissionEventKill & eventSpe = (CMissionEventKill&)event; CMissionEventKill & eventSpe = (CMissionEventKill&)event;
@ -532,44 +425,18 @@ class CMissionStepKillNpc : public IMissionStepTemplate
} }
else else
{ {
if (_SubSteps[subStepIndex].Dynamic.empty()) if ( _SubSteps[subStepIndex].Alias != CAIAliasTranslator::Invalid )
{ {
if ( _SubSteps[subStepIndex].Alias != CAIAliasTranslator::Invalid ) if ( _SubSteps[subStepIndex].Alias == c->getAlias() )
{
if ( _SubSteps[subStepIndex].Alias == c->getAlias() )
{
LOGMISSIONSTEPSUCCESS("kill_npc");
return 1;
}
}
else if ( event.TargetEntity == giverRow )
{ {
LOGMISSIONSTEPSUCCESS("kill_npc"); LOGMISSIONSTEPSUCCESS("kill_npc");
return 1; return 1;
} }
} }
else else if ( event.TargetEntity == giverRow )
{ {
//// Dynamic Mission Args LOGMISSIONSTEPSUCCESS("kill_npc");
vector<string> params = user->getCustomMissionParams(_SubSteps[subStepIndex].Dynamic); return 1;
if (params.size() < 2) {
LOGMISSIONSTEPERROR("kill_npc : invalid dynamic npc");
return 0;
}
else
{
webAppUrl = params[0];
string name;
CAIAliasTranslator::getInstance()->getNPCNameFromAlias(c->getAlias(), name);
if ( name == params[1] )
{
user->validateDynamicMissionStep(webAppUrl);
LOGMISSIONSTEPSUCCESS("kill_npc");
return 1;
}
}
////
} }
} }
} }
@ -588,7 +455,6 @@ class CMissionStepKillNpc : public IMissionStepTemplate
virtual void getTextParams( uint & nbSubSteps, const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) virtual void getTextParams( uint & nbSubSteps, const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates)
{ {
static const std::string stepTextReact = "MIS_NEED_REACTIVATION";
static const std::string stepText = "MIS_KILL_NPC_"; static const std::string stepText = "MIS_KILL_NPC_";
textPtr = &stepText; textPtr = &stepText;
nlassert( _SubSteps.size() == subStepStates.size() ); nlassert( _SubSteps.size() == subStepStates.size() );
@ -599,34 +465,10 @@ class CMissionStepKillNpc : public IMissionStepTemplate
nbSubSteps++; nbSubSteps++;
retParams.push_back(STRING_MANAGER::TParam()); retParams.push_back(STRING_MANAGER::TParam());
retParams.back().Type = STRING_MANAGER::bot; retParams.back().Type = STRING_MANAGER::bot;
if (_SubSteps[i].Dynamic.empty()) if ( _SubSteps[i].Alias != CAIAliasTranslator::Invalid )
{ retParams.back().Int = _SubSteps[i].Alias;
if ( _SubSteps[i].Alias != CAIAliasTranslator::Invalid )
retParams.back().Int = _SubSteps[i].Alias;
else
retParams.back().Identifier = "giver";
}
else else
{ retParams.back().Identifier = "giver";
vector<string> params = _User->getCustomMissionParams(_SubSteps[i].Dynamic);
if (params.size() < 2)
{
nlinfo("kill_npc : invalid dynamic npc");
textPtr = &stepTextReact;
return;
}
else
{
vector<TAIAlias> aliases;
CAIAliasTranslator::getInstance()->getNPCAliasesFromName( params[1] , aliases );
if ( aliases.empty() )
{
retParams.back().Int = CAIAliasTranslator::Invalid;
return;
}
retParams.back().Int = aliases[0];
}
}
} }
} }
} }

@ -22,7 +22,6 @@
#include "mission_manager/mission_parser.h" #include "mission_manager/mission_parser.h"
#include "mission_manager/ai_alias_translator.h" #include "mission_manager/ai_alias_translator.h"
#include "player_manager/character.h" #include "player_manager/character.h"
#include "player_manager/player_manager.h"
#include "creature_manager/creature_manager.h" #include "creature_manager/creature_manager.h"
#include "mission_manager/mission_manager.h" #include "mission_manager/mission_manager.h"
#include "game_item_manager/player_inv_xchg.h" #include "game_item_manager/player_inv_xchg.h"
@ -56,71 +55,42 @@ class CMissionStepTalk : public IMissionStepTemplate
return false; return false;
} }
bool ret = true; bool ret = true;
//// Dynamic Mission Args : #dynamic# // parse bot
if (trim(script[1]) == "#dynamic#") if ( !CMissionParser::parseBotName(script[1], _Bot, missionData) )
{ {
_Dynamic = missionData.Name; MISLOGERROR1("invalid npc '%s'", script[1].c_str());
_PhraseId = _Dynamic+"_ACTION"; return false;
_IsDynamic = true;
} }
else
// parse phrase and params
if (script.size() > 2)
{ {
_IsDynamic = false; // parse a specific phrase
// parse bot if (!CMissionParser::parseParamText(line, script[2], _PhraseId, _Params ))
if ( !CMissionParser::parseBotName(script[1], _Bot, missionData) )
{ {
MISLOGERROR1("invalid npc '%s'", script[1].c_str()); MISLOGERROR1("invalid text '%s'", script[2].c_str());
return false; return false;
} }
// parse phrase and params
if (script.size() > 2)
{
// parse a specific phrase
if (!CMissionParser::parseParamText(line, script[2], _PhraseId, _Params ))
{
MISLOGERROR1("invalid text '%s'", script[2].c_str());
return false;
}
}
else
{
// use the default phrase
_PhraseId = "MIS_TALK_TO_MENU";
}
// add a first default param (the name of the bot we talk to)
_Params.insert(_Params.begin(), STRING_MANAGER::TParam());
_Params[0].Identifier = CMissionParser::getNoBlankString(script[1]);
} }
else
{
// use the default phrase
_PhraseId = "MIS_TALK_TO_MENU";
}
// add a first default param (the name of the bot we talk to)
_Params.insert(_Params.begin(), STRING_MANAGER::TParam());
_Params[0].Identifier = CMissionParser::getNoBlankString(script[1]);
return true; return true;
} }
uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow ) uint processEvent( const TDataSetRow & userRow, const CMissionEvent & event,uint subStepIndex,const TDataSetRow & giverRow )
{ {
string webAppUrl;
_User = PlayerManager.getChar(getEntityIdFromRow(userRow));
if (_IsDynamic && _User != NULL)
{
vector<string> params = _User->getCustomMissionParams(_Dynamic);
if (params.size() < 2)
{
LOGMISSIONSTEPERROR("talk_to : invalid npc name");
return 0;
}
else
{
webAppUrl = params[0];
}
}
// not check here : they are done befor. If a talk event comes here, the step is complete // not check here : they are done befor. If a talk event comes here, the step is complete
if( event.Type == CMissionEvent::Talk ) if( event.Type == CMissionEvent::Talk )
{ {
if (!webAppUrl.empty() && _User != NULL)
_User->validateDynamicMissionStep(webAppUrl);
LOGMISSIONSTEPSUCCESS("talk_to"); LOGMISSIONSTEPSUCCESS("talk_to");
return 1; return 1;
} }
@ -134,69 +104,9 @@ class CMissionStepTalk : public IMissionStepTemplate
ret[0] = 1; ret[0] = 1;
} }
bool getDynamicBot(TAIAlias & aliasRet)
{
if (_User != NULL)
{
vector<string> params = _User->getCustomMissionParams(_Dynamic);
if (params.size() < 2)
{
MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine);
return false;
}
else
{
vector<TAIAlias> aliases;
CAIAliasTranslator::getInstance()->getNPCAliasesFromName(params[1], aliases);
if ( aliases.empty() )
{
MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine);
return false;
}
aliasRet = aliases[0];
return true;
}
}
return false;
}
virtual uint32 sendContextText(const TDataSetRow& user, const TDataSetRow& interlocutor, CMission * instance, bool & gift, const NLMISC::CEntityId & giver ) virtual uint32 sendContextText(const TDataSetRow& user, const TDataSetRow& interlocutor, CMission * instance, bool & gift, const NLMISC::CEntityId & giver )
{ {
if (_IsDynamic)
{
if (!getDynamicBot(_Bot) || _User == NULL)
{
MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine);
return 0;
}
_User = PlayerManager.getChar(getEntityIdFromRow(user));
uint32 userId = PlayerManager.getPlayerId(_User->getId());
string text = _PhraseId;
if (_User)
{
uint32 userId = PlayerManager.getPlayerId(_User->getId());
text = _User->getCustomMissionText(_PhraseId);
if (text.empty())
return 0;
}
TVectorParamCheck params;
ucstring phrase = ucstring(_PhraseId+"(){["+text+"]}");
NLNET::CMessage msgout("SET_PHRASE");
msgout.serial(_PhraseId);
msgout.serial(phrase);
sendMessageViaMirror("IOS", msgout);
return STRING_MANAGER::sendStringToClient( user, _PhraseId, params );
/* SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal= text;*/
}
CCreature * bot = CreatureManager.getCreature( interlocutor ); CCreature * bot = CreatureManager.getCreature( interlocutor );
if ( bot ) if ( bot )
{ {
if ( ( _Bot != CAIAliasTranslator::Invalid && _Bot == bot->getAlias() ) || if ( ( _Bot != CAIAliasTranslator::Invalid && _Bot == bot->getAlias() ) ||
@ -216,12 +126,6 @@ class CMissionStepTalk : public IMissionStepTemplate
virtual bool hasBotChatOption(const TDataSetRow & interlocutor, CMission * instance, bool & gift) virtual bool hasBotChatOption(const TDataSetRow & interlocutor, CMission * instance, bool & gift)
{ {
if (_IsDynamic && !getDynamicBot(_Bot))
{
MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine);
return 0;
}
CCreature * bot = CreatureManager.getCreature( interlocutor ); CCreature * bot = CreatureManager.getCreature( interlocutor );
if ( bot ) if ( bot )
{ {
@ -238,27 +142,6 @@ class CMissionStepTalk : public IMissionStepTemplate
virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates) virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates)
{ {
if (_IsDynamic && !getDynamicBot(_Bot))
{
MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine);
static const std::string stepText = "DEBUG_CRASH_P_SMG_CRASH2";
textPtr = &stepText;
return;
}
if (_IsDynamic && _User != NULL)
{
vector<string> params = _User->getCustomMissionParams(_Dynamic);
if (params.size() < 2)
{
MISLOG("sline:%u ERROR : talk_to (sendContextText) : invalid bot", _SourceLine);
return;
}
_Params.insert(_Params.begin(), STRING_MANAGER::TParam());
_Params[0].Identifier = params[1];
}
nbSubSteps = 1; nbSubSteps = 1;
static const std::string stepText = "MIS_TALK_TO"; static const std::string stepText = "MIS_TALK_TO";
textPtr = &stepText; textPtr = &stepText;
@ -270,23 +153,15 @@ class CMissionStepTalk : public IMissionStepTemplate
else else
retParams[0].Identifier = "giver"; retParams[0].Identifier = "giver";
} }
bool solveTextsParams( CMissionSpecificParsingData & missionData,CMissionTemplate * templ ) bool solveTextsParams( CMissionSpecificParsingData & missionData,CMissionTemplate * templ )
{ {
if (!_IsDynamic) bool ret = IMissionStepTemplate::solveTextsParams(missionData,templ);
{ if ( !CMissionParser::solveTextsParams(_SourceLine, _Params,missionData ) )
bool ret = IMissionStepTemplate::solveTextsParams(missionData,templ); ret = false;
if ( !CMissionParser::solveTextsParams(_SourceLine, _Params,missionData ) ) return ret;
ret = false;
return ret;
}
return true;
} }
virtual TAIAlias getInvolvedBot(bool& invalidIsGiver) const { invalidIsGiver=true; return _Bot; }
bool _IsDynamic;
std::string _Dynamic;
std::string _PhraseId; std::string _PhraseId;
TVectorParamCheck _Params; TVectorParamCheck _Params;
TAIAlias _Bot; TAIAlias _Bot;

@ -102,60 +102,37 @@ uint32 IMissionStepTemplate::sendRpStepText(CCharacter * user,const std::vector<
uint nbSteps = 0; uint nbSteps = 0;
const std::string* textPtr = NULL; const std::string* textPtr = NULL;
_User = user; if ( !_RoleplayText.empty() )
if (_RoleplayText.compare(0, 6, "WEBIG_") == 0)
{ {
TVectorParamCheck params; // build the param list
string name = _RoleplayText; getTextParams(nbSteps,(const std::string *&)textPtr,params,stepStates);
if (user)
params.reserve(params.size() + _AdditionalParams.size());
params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end());
if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' )
{ {
uint32 userId = PlayerManager.getPlayerId(user->getId()); buffer = _RoleplayText + "_";
string text = user->getCustomMissionText(_RoleplayText); textPtr = &buffer;
if (text.empty())
return 0;
name = _RoleplayText+"_"+toString(userId);
ucstring phrase = ucstring(name+"(){["+text+"]}");
NLNET::CMessage msgout("SET_PHRASE");
msgout.serial(name);
msgout.serial(phrase);
sendMessageViaMirror("IOS", msgout);
} }
return STRING_MANAGER::sendStringToClient( user->getEntityRowId(), name, params ); else
textPtr = &_RoleplayText;
} }
else
{
if ( !_RoleplayText.empty() )
{
// build the param list
getTextParams(nbSteps,(const std::string *&)textPtr,params,stepStates);
params.reserve(params.size() + _AdditionalParams.size());
params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end());
if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' )
{
buffer = _RoleplayText + "_";
textPtr = &buffer;
}
else
textPtr = &_RoleplayText;
}
if( !textPtr ) if( !textPtr )
return 0; return 0;
// solve dynamic names // solve dynamic names
CMissionParser::solveEntitiesNames(params,user->getEntityRowId(),giver); CMissionParser::solveEntitiesNames(params,user->getEntityRowId(),giver);
// if the text was generated, compute its suffix // if the text was generated, compute its suffix
if ( !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' ) if ( !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' )
{ {
std::string text = NLMISC::toString( "%s%u", textPtr->c_str(),nbSteps ); std::string text = NLMISC::toString( "%s%u", textPtr->c_str(),nbSteps );
return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),text,params); return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),text,params);
}
else
return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),*textPtr,params);
} }
else
return STRING_MANAGER::sendStringToClient( user->getEntityRowId(),*textPtr,params);
}// IMissionStepTemplate::sendRpStepText }// IMissionStepTemplate::sendRpStepText
@ -166,48 +143,30 @@ uint32 IMissionStepTemplate::sendStepText(CCharacter * user,const std::vector<ui
uint nbSteps = 0; uint nbSteps = 0;
const std::string* textPtr = NULL; const std::string* textPtr = NULL;
_User = user;
// build the param list // build the param list
getTextParams(nbSteps,(const std::string *&)textPtr,params,stepStates); getTextParams(nbSteps,(const std::string *&)textPtr,params,stepStates);
// If the text is overriden, add the overide parameters // If the text is overriden, add the overide parameters
if ( !_OverridenText.empty() ) if ( !_OverridenText.empty() )
{ {
if (_OverridenText.compare(0, 6, "WEBIG_") == 0) if ( _AddDefaultParams )
{ {
string text = _OverridenText; params.reserve(params.size() + _AdditionalParams.size());
if (user) params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end());
if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' )
{ {
uint32 userId = PlayerManager.getPlayerId(user->getId()); buffer = _OverridenText + "_";
text = user->getCustomMissionText(_OverridenText); textPtr = &buffer;
if (text.empty())
text = _OverridenText;
} }
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); else
params[0].Literal.fromUtf8(text); textPtr = &_OverridenText;
return STRING_MANAGER::sendStringToClient( user->getEntityRowId(), "LITERAL", params );
} }
else else
{ {
if ( _AddDefaultParams ) params = _AdditionalParams;
{ textPtr = &_OverridenText;
params.reserve(params.size() + _AdditionalParams.size());
params.insert(params.end(), _AdditionalParams.begin(), _AdditionalParams.end());
if ( textPtr && !textPtr->empty() && (*textPtr)[textPtr->size()-1] == '_' )
{
buffer = _OverridenText + "_";
textPtr = &buffer;
}
else
textPtr = &_OverridenText;
}
else
{
params = _AdditionalParams;
textPtr = &_OverridenText;
}
} }
} }
if( !textPtr ) if( !textPtr )

@ -41,7 +41,7 @@ public:
//@{ //@{
/// ctor /// ctor
inline IMissionStepTemplate() inline IMissionStepTemplate()
:_OOOStepIndex(0xFFFFFFFF),_Any(false),_Displayed(true),_IconDisplayedOnStepNPC(true),_IsInOverridenOOO(false),_User(NULL) {} :_OOOStepIndex(0xFFFFFFFF),_Any(false),_Displayed(true),_IconDisplayedOnStepNPC(true),_IsInOverridenOOO(false) {}
//BRIANCODE my appologies, need access to this data from CMissionStepGiveItem //BRIANCODE my appologies, need access to this data from CMissionStepGiveItem
struct CSubStep struct CSubStep
@ -164,8 +164,6 @@ protected:
bool _AddDefaultParams; bool _AddDefaultParams;
/// flag set to true if the step is in an OOO block which text wad overriden /// flag set to true if the step is in an OOO block which text wad overriden
bool _IsInOverridenOOO; bool _IsInOverridenOOO;
/// Player running the mission
CCharacter * _User;
}; };

@ -2441,109 +2441,55 @@ uint32 CMissionTemplate::testPrerequisits( CCharacter * user, CPrerequisitInfos
uint32 CMissionTemplate::sendTitleText( const TDataSetRow & userRow, const TDataSetRow & giver ) const uint32 CMissionTemplate::sendTitleText( const TDataSetRow & userRow, const TDataSetRow & giver ) const
{ {
if (TitleText.compare(0, 6, "WEBIG_") == 0) TVectorParamCheck params(1 + TitleParams.size() );
{ std::copy( TitleParams.begin(),TitleParams.end(), params.begin() + 1 );
string text = TitleText; params[0].Type = STRING_MANAGER::bot;
CCharacter *user = PlayerManager.getChar(getEntityIdFromRow(userRow)); params[0].setEIdAIAlias( getEntityIdFromRow( giver ), CAIAliasTranslator::getInstance()->getAIAlias(getEntityIdFromRow( giver )) );
if (user) CMissionParser::solveEntitiesNames(params,userRow,params[0].getEId());
{ return STRING_MANAGER::sendStringToClient( userRow, TitleText,params );
uint32 userId = PlayerManager.getPlayerId(user->getId());
text = user->getCustomMissionText(TitleText);
if (text.empty())
text = "<Undefined>";
}
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal.fromUtf8(text);
return STRING_MANAGER::sendStringToClient( userRow, "LITERAL", params );
}
else
{
TVectorParamCheck params(1 + TitleParams.size() );
std::copy( TitleParams.begin(),TitleParams.end(), params.begin() + 1 );
params[0].Type = STRING_MANAGER::bot;
params[0].setEIdAIAlias( getEntityIdFromRow( giver ), CAIAliasTranslator::getInstance()->getAIAlias(getEntityIdFromRow( giver )) );
CMissionParser::solveEntitiesNames(params,userRow,params[0].getEId());
return STRING_MANAGER::sendStringToClient( userRow, TitleText,params );
}
}// CMissionTemplate sendTitleText }// CMissionTemplate sendTitleText
uint32 CMissionTemplate::sendAutoText( const TDataSetRow & userRow,const NLMISC::CEntityId & giver) const uint32 CMissionTemplate::sendAutoText( const TDataSetRow & userRow,const NLMISC::CEntityId & giver) const
{ {
if (AutoText.compare(0, 6, "WEBIG_") == 0) TVectorParamCheck params = AutoParams;
{ CMissionParser::solveEntitiesNames(params,userRow,giver);
string text = AutoText; return STRING_MANAGER::sendStringToClient( userRow, AutoText,params );
CCharacter *user = PlayerManager.getChar(getEntityIdFromRow(userRow));
if (user)
{
uint32 userId = PlayerManager.getPlayerId(user->getId());
text = user->getCustomMissionText(AutoText);
if (text.empty())
return 0;
}
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal.fromUtf8(text);
return STRING_MANAGER::sendStringToClient( userRow, "LITERAL", params );
}
else
{
TVectorParamCheck params = AutoParams;
CMissionParser::solveEntitiesNames(params,userRow,giver);
return STRING_MANAGER::sendStringToClient( userRow, AutoText,params );
}
}// CMissionTemplate::sendAutoText }// CMissionTemplate::sendAutoText
uint32 CMissionTemplate::sendDescText( const TDataSetRow & userRow, const TDataSetRow & giver, uint32 descIndex) const uint32 CMissionTemplate::sendDescText( const TDataSetRow & userRow, const TDataSetRow & giver, uint32 descIndex) const
{ {
if (DescText.compare(0, 6, "WEBIG_") == 0) CEntityId id = getEntityIdFromRow( giver );
TVectorParamCheck params;
const TVectorParamCheck* addParams = NULL;
const string * txt = NULL;
if ( descIndex == 0xFFFFFFFF )
{ {
string text = DescText; txt = &DescText;
CCharacter *user = PlayerManager.getChar(getEntityIdFromRow(userRow)); addParams = &DescParams;
if (user)
{
uint32 userId = PlayerManager.getPlayerId(user->getId());
text = user->getCustomMissionText(DescText);
if (text.empty())
text = "<Undefined>";
}
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal.fromUtf8(text);
return STRING_MANAGER::sendStringToClient( userRow, "LITERAL", params );
} }
else else
{ {
CEntityId id = getEntityIdFromRow( giver ); if ( descIndex >= OverloadedDescs.size() )
TVectorParamCheck params;
const TVectorParamCheck* addParams = NULL;
const string * txt = NULL;
if ( descIndex == 0xFFFFFFFF )
{ {
nlwarning("<MISSIONS> Invalid descIndex %u, size is %u",descIndex,OverloadedDescs.size() );
txt = &DescText; txt = &DescText;
addParams = &DescParams; addParams = &DescParams;
} }
else else
{ {
if ( descIndex >= OverloadedDescs.size() ) txt = &(OverloadedDescs[descIndex].Text);
{ addParams = &(OverloadedDescs[descIndex].Params);
nlwarning("<MISSIONS> Invalid descIndex %u, size is %u",descIndex,OverloadedDescs.size() );
txt = &DescText;
addParams = &DescParams;
}
else
{
txt = &(OverloadedDescs[descIndex].Text);
addParams = &(OverloadedDescs[descIndex].Params);
}
} }
params.reserve(1 + (*addParams).size() ); }
params.push_back(STRING_MANAGER::TParam(STRING_MANAGER::entity)); params.reserve(1 + (*addParams).size() );
params.back().setEIdAIAlias(id, CAIAliasTranslator::getInstance()->getAIAlias(id)); params.push_back(STRING_MANAGER::TParam(STRING_MANAGER::entity));
params.insert(params.end(), (*addParams).begin(), (*addParams).end()); params.back().setEIdAIAlias(id, CAIAliasTranslator::getInstance()->getAIAlias(id));
params.insert(params.end(), (*addParams).begin(), (*addParams).end());
CMissionParser::solveEntitiesNames(params,userRow,id); CMissionParser::solveEntitiesNames(params,userRow,id);
return STRING_MANAGER::sendStringToClient( userRow,*txt,params ); return STRING_MANAGER::sendStringToClient( userRow,*txt,params );
}
}// CMissionTemplate sendDetailsText }// CMissionTemplate sendDetailsText
/* /*

@ -936,7 +936,9 @@ NLMISC_COMMAND(getFames, "get fames of player", "<uid> faction1,faction2,faction
std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance = c->getAllegiance(); std::pair<PVP_CLAN::TPVPClan, PVP_CLAN::TPVPClan> allegiance = c->getAllegiance();
log.displayNL("%s", PVP_CLAN::toString(allegiance.first).c_str()); log.displayNL("%s", PVP_CLAN::toString(allegiance.first).c_str());
log.displayNL("%s", PVP_CLAN::toString(allegiance.second).c_str()); log.displayNL("%s", PVP_CLAN::toString(allegiance.second).c_str());
#ifdef RYZOM_FORGE
log.displayNL("%d", c->getOrganization()); log.displayNL("%d", c->getOrganization());
#endif
std::vector<string> fames; std::vector<string> fames;
NLMISC::splitString(args[1], ",", fames); NLMISC::splitString(args[1], ",", fames);
@ -1013,7 +1015,7 @@ NLMISC_COMMAND(getMoney, "get money of player", "<uid>")
return true; return true;
} }
#ifdef RYZOM_FORGE
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "<uid>") NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "<uid>")
{ {
@ -1025,7 +1027,9 @@ NLMISC_COMMAND(getPvpPoints, "get pvp points of player", "<uid>")
return true; return true;
} }
#endif
#ifdef RYZOM_FORGE
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "<uid>") NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "<uid>")
{ {
@ -1038,8 +1042,9 @@ NLMISC_COMMAND(getCivCultOrg, "get civ cult and organization of player", "<uid>"
return true; return true;
} }
#endif
#ifdef RYZOM_FORGE
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(accessPowo, "give access to the powo", "<uid> player_name number") NLMISC_COMMAND(accessPowo, "give access to the powo", "<uid> player_name number")
{ {
@ -1122,6 +1127,7 @@ NLMISC_COMMAND(slide, "slide to the powo", "<uid> x y cell [z] [h]")
return true; return true;
} }
#endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
NLMISC_COMMAND(spawn, "spawn entity", "<uid> quantity sheet dispersion orientation groupname x y look cell") NLMISC_COMMAND(spawn, "spawn entity", "<uid> quantity sheet dispersion orientation groupname x y look cell")

@ -423,16 +423,21 @@ CCharacter::CCharacter(): CEntityBase(false),
for (uint i = 0 ; i < (PVP_CLAN::EndClans-PVP_CLAN::BeginClans+1); ++i) for (uint i = 0 ; i < (PVP_CLAN::EndClans-PVP_CLAN::BeginClans+1); ++i)
_FactionPoint[i] = 0; _FactionPoint[i] = 0;
#ifdef RYZOM_FORGE
_PvpPoint = 0; _PvpPoint = 0;
#endif
_PVPFlagLastTimeChange = 0; _PVPFlagLastTimeChange = 0;
_PVPFlagTimeSettedOn = 0; _PVPFlagTimeSettedOn = 0;
_PvPDatabaseCounter = 0; _PvPDatabaseCounter = 0;
_PVPFlag = false; _PVPFlag = false;
_PVPRecentActionTime = 0; _PVPRecentActionTime = 0;
#ifdef RYZOM_FORGE
_Organization = 0; _Organization = 0;
_OrganizationStatus = 0; _OrganizationStatus = 0;
_OrganizationPoints = 0; _OrganizationPoints = 0;
#endif
// do not start berserk // do not start berserk
_IsBerserk = false; _IsBerserk = false;
@ -660,7 +665,9 @@ CCharacter::CCharacter(): CEntityBase(false),
// For client/server contact list communication // For client/server contact list communication
_ContactIdPool= 0; _ContactIdPool= 0;
#ifdef RYZOM_FORGE_ROOM
_inRoomOfPlayer = CEntityId::Unknown; _inRoomOfPlayer = CEntityId::Unknown;
#endif
for(uint i = 0; i < BRICK_FAMILIES::NbFamilies; ++i ) for(uint i = 0; i < BRICK_FAMILIES::NbFamilies; ++i )
_BrickFamilyBitField[i] = 0; _BrickFamilyBitField[i] = 0;
@ -669,16 +676,20 @@ CCharacter::CCharacter(): CEntityBase(false),
_LastTickNpcControlUpdated = CTickEventHandler::getGameCycle(); _LastTickNpcControlUpdated = CTickEventHandler::getGameCycle();
#ifdef RYZOM_FORGE
_LastWebCommandIndex = 0; _LastWebCommandIndex = 0;
_LastUrlIndex = 0; _LastUrlIndex = 0;
_CustomMissionsParams.clear(); _CustomMissionsParams.clear();
#endif
_FriendVisibility = VisibleToAll; _FriendVisibility = VisibleToAll;
#ifdef RYZOM_FORGE
_LangChannel = "en"; _LangChannel = "en";
_NewTitle = "Refugee"; _NewTitle = "Refugee";
#endif
initDatabase(); initDatabase();
} // CCharacter // } // CCharacter //
@ -704,7 +715,9 @@ void CCharacter::clear()
_ForbidAuraUseStartDate=0; _ForbidAuraUseStartDate=0;
_ForbidAuraUseEndDate=0; _ForbidAuraUseEndDate=0;
_Title= CHARACTER_TITLE::Refugee; _Title= CHARACTER_TITLE::Refugee;
#ifdef RYZOM_FORGE
_NewTitle = "Refugee"; _NewTitle = "Refugee";
#endif
SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0); SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0);
SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0); SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0);
@ -3027,6 +3040,7 @@ void CCharacter::postLoadTreatment()
computeMiscBonus(); computeMiscBonus();
} }
// Always enable XP Catalyaer for non-trial accounts
CPlayer * p = PlayerManager.getPlayer(PlayerManager.getPlayerId( getId() )); CPlayer * p = PlayerManager.getPlayer(PlayerManager.getPlayerId( getId() ));
if (!p->isTrialPlayer()) if (!p->isTrialPlayer())
{ {
@ -3708,7 +3722,7 @@ void CCharacter::setTargetBotchatProgramm( CEntityBase * target, const CEntityId
{ {
// send the web page title // send the web page title
uint32 text; uint32 text;
if(c->getWebPageName().find("MENU_") == 0) if (NLMISC::startsWith(c->getWebPageName(), "MENU_")) // TODO: What is this?
{ {
text = STRING_MANAGER::sendStringToClient(_EntityRowId, c->getWebPageName(), TVectorParamCheck() ); text = STRING_MANAGER::sendStringToClient(_EntityRowId, c->getWebPageName(), TVectorParamCheck() );
} }
@ -3725,6 +3739,7 @@ void CCharacter::setTargetBotchatProgramm( CEntityBase * target, const CEntityId
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
string url = c->getWebPage(); string url = c->getWebPage();
#ifdef RYZOM_FORGE
// add ? or & with // add ? or & with
if ( url.find('?') == string::npos ) if ( url.find('?') == string::npos )
url += NLMISC::toString("?urlidx=%d", getUrlIndex()); url += NLMISC::toString("?urlidx=%d", getUrlIndex());
@ -3732,6 +3747,7 @@ void CCharacter::setTargetBotchatProgramm( CEntityBase * target, const CEntityId
url += NLMISC::toString("&urlidx=%d", getUrlIndex()); url += NLMISC::toString("&urlidx=%d", getUrlIndex());
setUrlIndex(getUrlIndex()+1); setUrlIndex(getUrlIndex()+1);
#endif
url += "&player_eid="+getId().toString(); url += "&player_eid="+getId().toString();
@ -3895,16 +3911,10 @@ void CCharacter::sendBetaTesterStatus()
sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() ); sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() );
/*if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT) if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT)
{ {
_Title = CHARACTER_TITLE::Refugee; _Title = CHARACTER_TITLE::Refugee;
registerName(); registerName();
}*/
if (!p->isBetaTester() && _NewTitle == "FBT")
{
_NewTitle = "Refugee";
registerName();
} }
} }
@ -3919,16 +3929,10 @@ void CCharacter::sendWindermeerStatus()
sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() ); sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() );
/*if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND) if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND)
{ {
_Title = CHARACTER_TITLE::Refugee; _Title = CHARACTER_TITLE::Refugee;
registerName(); registerName();
}*/
if ( !p->isWindermeerCommunity() && _NewTitle == "WIND")
{
_NewTitle = "Refugee";
registerName();
} }
} }
@ -8094,7 +8098,9 @@ void CCharacter::setStartStatistics( const CCreateCharMsg& createCharMsg )
_Race = (EGSPD::CPeople::TPeople) createCharMsg.People; _Race = (EGSPD::CPeople::TPeople) createCharMsg.People;
_Gender = createCharMsg.Sex; _Gender = createCharMsg.Sex;
_Title = CHARACTER_TITLE::Refugee; _Title = CHARACTER_TITLE::Refugee;
#ifdef RYZOM_FORGE
_NewTitle = "Refugee"; _NewTitle = "Refugee";
#endif
// fame information // fame information
// Players start out as Neutral in their declared clans // Players start out as Neutral in their declared clans
@ -9042,7 +9048,9 @@ void CCharacter::setDatabase()
_IneffectiveAuras.activate(); _IneffectiveAuras.activate();
_ConsumableOverdoseEndDates.activate(); _ConsumableOverdoseEndDates.activate();
// init the RRPs // init the RRPs
//RingRewardPoints.initDb(); #ifdef RYZOM_RING_REACTIVATE
RingRewardPoints.initDb();
#endif
}// setDatabase // }// setDatabase //
@ -9105,7 +9113,7 @@ void CCharacter::startTradeItemSession( uint16 session )
fame = MinFameToTrade; fame = MinFameToTrade;
} }
if ( (bot->getOrganization() == 0 && fame < MinFameToTrade) || (bot->getOrganization() != 0 && bot->getOrganization() != getOrganization()) ) else if ( fame < MinFameToTrade )
{ {
SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot); SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot);
params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) ); params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) );
@ -9113,8 +9121,6 @@ void CCharacter::startTradeItemSession( uint16 session )
npcTellToPlayerEx( bot->getEntityRowId(),_EntityRowId,txt ); npcTellToPlayerEx( bot->getEntityRowId(),_EntityRowId,txt );
return; return;
} }
else if (bot->getOrganization() != 0 && bot->getOrganization() == getOrganization())
fame = 0;
float fameFactor = 1.0f; float fameFactor = 1.0f;
@ -9213,8 +9219,7 @@ void CCharacter::startTradePhrases(uint16 session)
{ {
nlwarning("fame %u is INVALID",(uint)bot->getRace() ); nlwarning("fame %u is INVALID",(uint)bot->getRace() );
} }
if ( fame < MinFameToTrade )
if ( (bot->getOrganization() == 0 && fame < MinFameToTrade) || (bot->getOrganization() != 0 && bot->getOrganization() != getOrganization()) )
{ {
SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot); SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot);
params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) ); params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) );
@ -9942,7 +9947,11 @@ bool CCharacter::queryItemPrice( const CGameItemPtr item, uint32& price )
quality = theItem->quality(); quality = theItem->quality();
if ( theItem->maxDurability() ) if ( theItem->maxDurability() )
wornFactor = float(theItem->durability()) / float(theItem->maxDurability()); wornFactor = float(theItem->durability()) / float(theItem->maxDurability());
#ifdef RYZOM_FORGE
price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 ); price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 );
#else
price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor );
#endif
return true; return true;
} }
@ -9984,7 +9993,7 @@ void CCharacter::sellItem( INVENTORIES::TInventory inv, uint32 slot, uint32 quan
fame = MinFameToTrade; fame = MinFameToTrade;
} }
if ( (bot->getOrganization() == 0 && fame < MinFameToTrade) || (bot->getOrganization() != 0 && bot->getOrganization() != getOrganization()) ) else if ( fame < MinFameToTrade )
{ {
SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot); SM_STATIC_PARAMS_1(params, STRING_MANAGER::bot);
params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) ); params[0].setEIdAIAlias( _CurrentInterlocutor, CAIAliasTranslator::getInstance()->getAIAlias(_CurrentInterlocutor) );
@ -9996,8 +10005,6 @@ void CCharacter::sellItem( INVENTORIES::TInventory inv, uint32 slot, uint32 quan
return; return;
} }
else if (bot->getOrganization() != 0 && bot->getOrganization() == getOrganization())
fame = 0;
CInventoryPtr child = _Inventory[ inv ]; CInventoryPtr child = _Inventory[ inv ];
if( child->getSlotCount() > slot && child->getItem( slot ) != NULL ) if( child->getSlotCount() > slot && child->getItem( slot ) != NULL )
@ -10033,13 +10040,6 @@ void CCharacter::sellItem( INVENTORIES::TInventory inv, uint32 slot, uint32 quan
return; return;
} }
// You cannot exchange genesis named items
if (item->getPhraseId().find("genesis_") == 0)
{
nlwarning("Character %s tries to sell '%s'", _Id.toString().c_str(), item->getPhraseId().c_str() );
return;
}
if( ! ITEMFAMILY::isSellableByPlayer( itemForm->Family ) ) if( ! ITEMFAMILY::isSellableByPlayer( itemForm->Family ) )
{ {
nlwarning("<CCharacter sellItem> character %s try to sell an unsealable item %s, must not permited by client", _Id.toString().c_str(), sheet.toString().c_str() ); nlwarning("<CCharacter sellItem> character %s try to sell an unsealable item %s, must not permited by client", _Id.toString().c_str(), sheet.toString().c_str() );
@ -10342,7 +10342,7 @@ void CCharacter::initFactionPointDb()
} }
} }
#ifdef RYZOM_FORGE
//----------------------------------------------- //-----------------------------------------------
// setPvpPoint : set the number of pvp point // setPvpPoint : set the number of pvp point
// //
@ -10447,7 +10447,7 @@ void CCharacter::initOrganizationInfos()
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 );
} }
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CCharacter::sendFactionPointGainMessage(PVP_CLAN::TPVPClan clan, uint32 fpGain) void CCharacter::sendFactionPointGainMessage(PVP_CLAN::TPVPClan clan, uint32 fpGain)
@ -11682,7 +11682,12 @@ void CCharacter::setBerserkFlag(bool isBerserk)
} }
else else
{ {
#ifdef RYZOM_FORGE
sint8 percentTmp = sint8( (127.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) ); sint8 percentTmp = sint8( (127.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) );
#else
// TODO: Find out why this was changed to 127?
sint8 percentTmp = sint8( (100.0 * ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Current ) ) / ( target->getPhysScores()._PhysicalScores[ SCORES::hit_points ].Max ) );
#endif
if( percentTmp < 0 ) if( percentTmp < 0 )
percent = 0; percent = 0;
else else
@ -12062,7 +12067,7 @@ bool CCharacter::processMissionEventList( std::list< CMissionEvent* > & eventLis
bool processed = false; bool processed = false;
bool firstEvent = true; bool firstEvent = true;
CGuild * guild = CGuildManager::getInstance()->getGuildFromId( _GuildId ); CGuild *guild = NULL;
while ( !eventList.empty() ) while ( !eventList.empty() )
{ {
bool eventProcessed = false; bool eventProcessed = false;
@ -12086,6 +12091,7 @@ bool CCharacter::processMissionEventList( std::list< CMissionEvent* > & eventLis
else else
{ {
// We find the guild and each guild members and we instanciate the mission for them // We find the guild and each guild members and we instanciate the mission for them
guild = CGuildManager::getInstance()->getGuildFromId(_GuildId);
if (guild) if (guild)
{ {
for ( std::map<EGSPD::TCharacterId, EGSPD::CGuildMemberPD*>::iterator it = guild->getMembersBegin(); for ( std::map<EGSPD::TCharacterId, EGSPD::CGuildMemberPD*>::iterator it = guild->getMembersBegin();
@ -12867,7 +12873,7 @@ void CCharacter::updateSavedMissions()
TVectorParamCheck params(1); TVectorParamCheck params(1);
sint32 x = 0; sint32 x = 0;
sint32 y = 0; sint32 y = 0;
string msg; const char *msg;
CCreature * c = CreatureManager.getCreature( CAIAliasTranslator::getInstance()->getEntityId( (*itCompass).second.getBotId() ) ); CCreature * c = CreatureManager.getCreature( CAIAliasTranslator::getInstance()->getEntityId( (*itCompass).second.getBotId() ) );
if ( c ) if ( c )
{ {
@ -13126,7 +13132,7 @@ void CCharacter::registerName(const ucstring &newName)
CMessage msgName("CHARACTER_NAME_LANG"); CMessage msgName("CHARACTER_NAME_LANG");
msgName.serial(_EntityRowId); msgName.serial(_EntityRowId);
string sTitle = getFullTitle(); string sTitle = CHARACTER_TITLE::toString(_Title);
ucstring RegisteredName; ucstring RegisteredName;
if (newName.empty()) if (newName.empty())
RegisteredName = getName() + string("$") + sTitle + string("$"); RegisteredName = getName() + string("$") + sTitle + string("$");
@ -13300,6 +13306,7 @@ void CCharacter::setPlaces(const std::vector<const CPlace*> & places)
} }
} }
#ifdef RYZOM_FORGE
//----------------------------------------------- //-----------------------------------------------
// isSpawnValid // isSpawnValid
//----------------------------------------------- //-----------------------------------------------
@ -13359,6 +13366,7 @@ bool CCharacter::isSpawnValid(bool inVillage, bool inOutpost, bool inStable, boo
return true; return true;
} }
#endif
//----------------------------------------------- //-----------------------------------------------
// memorize // memorize
@ -13887,6 +13895,7 @@ uint16 CCharacter::getFirstFreeSlotInKnownPhrase()
return (uint16)_KnownPhrases.size()-1; return (uint16)_KnownPhrases.size()-1;
} // getFirstFreeSlotInKnownPhrase // } // getFirstFreeSlotInKnownPhrase //
#ifdef RYZOM_FORGE
void CCharacter::sendDynamicMessage(const string &phrase, const string &message) void CCharacter::sendDynamicMessage(const string &phrase, const string &message)
{ {
@ -13984,6 +13993,8 @@ string CCharacter::getCustomMissionText(const string &missionName)
return ""; return "";
} }
#endif
#ifdef RYZOM_FORGE #ifdef RYZOM_FORGE
// !!! Deprecated !!! // !!! Deprecated !!!
void CCharacter::addWebCommandCheck(const string &url, const string &data, const string &salt) void CCharacter::addWebCommandCheck(const string &url, const string &data, const string &salt)
@ -14326,6 +14337,7 @@ bool CCharacter::pickUpRawMaterial( uint32 indexInTempInv, bool * lastMaterial )
// Send url for Arcc triggers // Send url for Arcc triggers
#ifdef RYZOM_FORGE
vector<string> params = getCustomMissionParams("__LOOT_SHEET__"); vector<string> params = getCustomMissionParams("__LOOT_SHEET__");
if (params.size() >= 2) if (params.size() >= 2)
{ {
@ -14367,6 +14379,8 @@ bool CCharacter::pickUpRawMaterial( uint32 indexInTempInv, bool * lastMaterial )
} }
} }
} }
#endif
// first slots are filled with loot items, quarter items are not in temp inv but only info in DB // first slots are filled with loot items, quarter items are not in temp inv but only info in DB
uint32 rawMaterialIndex = indexInTempInv - creature->getLootSlotCount(); uint32 rawMaterialIndex = indexInTempInv - creature->getLootSlotCount();
const CCreatureRawMaterial * mp = creature->getCreatureRawMaterial( rawMaterialIndex ); const CCreatureRawMaterial * mp = creature->getCreatureRawMaterial( rawMaterialIndex );
@ -14592,15 +14606,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(), getAllegiance()); // TODO: Remove allegiance
CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), getAllegiance()); CFameManager::getInstance().setAndEnforceTribeFameCap(getId(), getAllegiance()); // TODO: Remove allegiance
} }
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(), i); // TODO: Remove allegiance
setFameValuePlayer(i, fame, maxFame, 0); setFameValuePlayer(i, fame, maxFame, 0);
} }
} }
@ -15242,7 +15256,7 @@ void CCharacter::syncContactListWithCharNameChanges(const std::vector<NLMISC::CE
sendContactListInit(); sendContactListInit();
} }
#ifdef RYZOM_FORGE_ROOM
void CCharacter::setInRoomOfPlayer(const NLMISC::CEntityId &id) void CCharacter::setInRoomOfPlayer(const NLMISC::CEntityId &id)
{ {
_inRoomOfPlayer = id; _inRoomOfPlayer = id;
@ -15298,6 +15312,7 @@ void CCharacter::addRoomAccessToPlayer(const NLMISC::CEntityId &id)
uint32 playerId = PlayerManager.getPlayerId(id); uint32 playerId = PlayerManager.getPlayerId(id);
_RoomersList.push_back(id); _RoomersList.push_back(id);
} }
#endif
//-------------------------------------------------------------- //--------------------------------------------------------------
// CCharacter::addPlayerToFriendList() // CCharacter::addPlayerToFriendList()
@ -15513,7 +15528,7 @@ void CCharacter::addPlayerToIgnoreList(const NLMISC::CEntityId &id)
// update ios state // update ios state
uint32 playerId = PlayerManager.getPlayerId(id); uint32 playerId = PlayerManager.getPlayerId(id);
CPlayer *player = PlayerManager.getPlayer( playerId ); CPlayer *player = PlayerManager.getPlayer( playerId );
if ( (!player) || (!player->havePriv( ":SGM:GM:VG:SG:G:EM:EG:" )) ) // if online, messages from CSRs can't be ignored if ( (!player) || (!player->havePriv( ":SGM:GM:VG:SG:G:" )) ) // if online, messages from CSRs can't be ignored
{ {
CEntityId senderId = getId(); CEntityId senderId = getId();
CEntityId ignoredId = id; CEntityId ignoredId = id;
@ -15584,6 +15599,7 @@ void CCharacter::removePlayerFromIgnoreListByIndex(uint16 index)
sendMessageViaMirror ("IOS", msgName); sendMessageViaMirror ("IOS", msgName);
} }
#ifdef RYZOM_FORGE_ROOM
//-------------------------------------------------------------- //--------------------------------------------------------------
// CCharacter::removeRoomAccesToPlayer() // CCharacter::removeRoomAccesToPlayer()
//-------------------------------------------------------------- //--------------------------------------------------------------
@ -15619,6 +15635,7 @@ void CCharacter::removeRoomAccesToPlayer(const NLMISC::CEntityId &id, bool kick)
} }
} }
} }
#endif
//-------------------------------------------------------------- //--------------------------------------------------------------
// CCharacter::removePlayerFromFriendListByEntityId() // CCharacter::removePlayerFromFriendListByEntityId()
@ -16092,7 +16109,7 @@ void CCharacter::online(bool onlineStatus)
// if the character has a CSR grade, remove from all ignore lists // if the character has a CSR grade, remove from all ignore lists
if ( onlineStatus && (! _IsIgnoredBy.empty()) && havePriv( ":SGM:GM:VG:SG:G:EM:EG:" ) ) if ( onlineStatus && (! _IsIgnoredBy.empty()) && havePriv( ":SGM:GM:VG:SG:G:" ) )
{ {
CMessage msgout( "UNIGNORE_ALL" ); CMessage msgout( "UNIGNORE_ALL" );
msgout.serial( _Id ); msgout.serial( _Id );
@ -16282,13 +16299,16 @@ void CCharacter::onConnection()
{ {
// Add all handledAIGroups for all missions of the player // Add all handledAIGroups for all missions of the player
spawnAllHandledAIGroup(); spawnAllHandledAIGroup();
// Add character to event channel if event occurs
CGameEventManager::getInstance().addCharacterToChannelEvent( this );
// update for the unified entity locator // Update for the unified entity locator
if (IShardUnifierEvent::getInstance() != NULL) if (IShardUnifierEvent::getInstance() != NULL)
{ {
IShardUnifierEvent::getInstance()->charConnected(_Id, getLastDisconnectionDate()); IShardUnifierEvent::getInstance()->charConnected(_Id, getLastDisconnectionDate());
} }
// Notify PvP manager
CPVPManager2::getInstance()->playerConnects(this); CPVPManager2::getInstance()->playerConnects(this);
} }
@ -17183,6 +17203,7 @@ void CCharacter::checkScoresValues( SCORES::TScores score, CHARACTERISTICS::TCha
sint32 base = (_PhysCharacs._PhysicalCharacteristics[ charac ].Base + PhysicalCharacteristicsBaseValue) * PhysicalCharacteristicsFactor + _ScorePermanentModifiers[ score ]; sint32 base = (_PhysCharacs._PhysicalCharacteristics[ charac ].Base + PhysicalCharacteristicsBaseValue) * PhysicalCharacteristicsFactor + _ScorePermanentModifiers[ score ];
if( _PhysScores._PhysicalScores[ score ].Base != base ) if( _PhysScores._PhysicalScores[ score ].Base != base )
{ {
// TODO: What's this?
nlwarning("BADCHECK For player %s, for %s, player should have %u and he has %u !", _Id.toString().c_str(), SCORES::toString(score).c_str(), base, _PhysScores._PhysicalScores[ score ].Base); nlwarning("BADCHECK For player %s, for %s, player should have %u and he has %u !", _Id.toString().c_str(), SCORES::toString(score).c_str(), base, _PhysScores._PhysicalScores[ score ].Base);
//vl _PhysScores._PhysicalScores[ score ].Base = base; //vl _PhysScores._PhysicalScores[ score ].Base = base;
} }
@ -17194,6 +17215,7 @@ void CCharacter::checkScoresValues( SCORES::TScores score, CHARACTERISTICS::TCha
baseRegenerateAction += RegenOffset; baseRegenerateAction += RegenOffset;
if( fabs((_PhysScores._PhysicalScores[ score ].BaseRegenerateRepos * 100.0f) - (100.0f * baseRegenerateRepos)) > 0.001) if( fabs((_PhysScores._PhysicalScores[ score ].BaseRegenerateRepos * 100.0f) - (100.0f * baseRegenerateRepos)) > 0.001)
{ {
// TODO: What's this?
nlwarning("BADCHECK For player %s, for %s regen, player should have %f and he has %f !", _Id.toString().c_str(), SCORES::toString(score).c_str(), baseRegenerateRepos, _PhysScores._PhysicalScores[ score ].BaseRegenerateRepos); nlwarning("BADCHECK For player %s, for %s regen, player should have %f and he has %f !", _Id.toString().c_str(), SCORES::toString(score).c_str(), baseRegenerateRepos, _PhysScores._PhysicalScores[ score ].BaseRegenerateRepos);
//vl _PhysScores._PhysicalScores[ score ].BaseRegenerateRepos = baseRegenerateRepos; //vl _PhysScores._PhysicalScores[ score ].BaseRegenerateRepos = baseRegenerateRepos;
//vl _PhysScores._PhysicalScores[ score ].BaseRegenerateAction = baseRegenerateAction; //vl _PhysScores._PhysicalScores[ score ].BaseRegenerateAction = baseRegenerateAction;
@ -17259,6 +17281,7 @@ void CCharacter::checkCharacAndScoresValues()
// compare // compare
if (_PhysCharacs._PhysicalCharacteristics[charac].Base != tvalue) if (_PhysCharacs._PhysicalCharacteristics[charac].Base != tvalue)
{ {
// TODO: What's this?
nlwarning("BADCHECK For player %s, for charac %s, player should have %u and he has %u !", _Id.toString().c_str(), CHARACTERISTICS::toString(charac).c_str(), tvalue,_PhysCharacs._PhysicalCharacteristics[charac].Base); nlwarning("BADCHECK For player %s, for charac %s, player should have %u and he has %u !", _Id.toString().c_str(), CHARACTERISTICS::toString(charac).c_str(), tvalue,_PhysCharacs._PhysicalCharacteristics[charac].Base);
//vl _PhysCharacs._PhysicalCharacteristics[charac].Base = tvalue; //vl _PhysCharacs._PhysicalCharacteristics[charac].Base = tvalue;
@ -19466,7 +19489,7 @@ void CCharacter::setStartupInstance(uint32 instanceId)
void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title ) void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title )
{ {
setNewTitle(CHARACTER_TITLE::toString(title)); _Title = title;
} }

@ -1203,11 +1203,13 @@ public:
/// get the number of faction point given a faction /// get the number of faction point given a faction
uint32 getFactionPoint(PVP_CLAN::TPVPClan clan); uint32 getFactionPoint(PVP_CLAN::TPVPClan clan);
#ifdef RYZOM_FORGE
/// set the number of pvp point /// set the number of pvp point
void setPvpPoint(uint32 nbPt); void setPvpPoint(uint32 nbPt);
/// get the number of pvp point given a faction /// get the number of pvp point given a faction
uint32 getPvpPoint(); uint32 getPvpPoint();
#endif
/// set the SDB path where player wins HoF points in PvP (if not empty) /// set the SDB path where player wins HoF points in PvP (if not empty)
void setSDBPvPPath(const std::string & sdbPvPPath); void setSDBPvPPath(const std::string & sdbPvPPath);
@ -1218,6 +1220,7 @@ public:
/// init faction point in client database /// init faction point in client database
void initFactionPointDb(); void initFactionPointDb();
#ifdef RYZOM_FORGE
/// init pvp point in client database /// init pvp point in client database
void initPvpPointDb(); void initPvpPointDb();
@ -1226,6 +1229,7 @@ public:
void setOrganizationStatus(uint32 status); void setOrganizationStatus(uint32 status);
void changeOrganizationStatus(sint32 status); void changeOrganizationStatus(sint32 status);
void changeOrganizationPoints(sint32 points); void changeOrganizationPoints(sint32 points);
#endif
/// send faction point gain phrase to the client /// send faction point gain phrase to the client
void sendFactionPointGainMessage(PVP_CLAN::TPVPClan clan, uint32 fpGain); void sendFactionPointGainMessage(PVP_CLAN::TPVPClan clan, uint32 fpGain);
@ -1560,8 +1564,10 @@ public:
/// client (in)validate melee combat /// client (in)validate melee combat
void validateMeleeCombat(bool flag); void validateMeleeCombat(bool flag);
#ifdef RYZOM_FORGE
/// check is player can spawn npc group in here position /// check is player can spawn npc group in here position
bool isSpawnValid(bool inVillage, bool inOutpost, bool inStable, bool inAtys); bool isSpawnValid(bool inVillage, bool inOutpost, bool inStable, bool inAtys);
#endif
/// memorize a phrase /// memorize a phrase
void memorize(uint8 memorizationSet, uint8 index, uint16 phraseId, const std::vector<NLMISC::CSheetId> &bricks); void memorize(uint8 memorizationSet, uint8 index, uint16 phraseId, const std::vector<NLMISC::CSheetId> &bricks);
@ -1681,6 +1687,7 @@ public:
/// get ammo item /// get ammo item
virtual CGameItemPtr getAmmoItem() const; virtual CGameItemPtr getAmmoItem() const;
#ifdef RYZOM_FORGE
/// send dynamic message /// send dynamic message
void sendDynamicMessage(const std::string &phrase, const std::string &message); void sendDynamicMessage(const std::string &phrase, const std::string &message);
@ -1701,6 +1708,7 @@ public:
/// validate dynamic mission step sending url /// validate dynamic mission step sending url
void validateDynamicMissionStep(const std::string &url); void validateDynamicMissionStep(const std::string &url);
#endif
#ifdef RYZOM_FORGE #ifdef RYZOM_FORGE
/// add web command validation check /// add web command validation check
@ -1966,6 +1974,7 @@ public:
void removePlayerFromFriendListByContactId(uint32 contactId); void removePlayerFromFriendListByContactId(uint32 contactId);
void removePlayerFromFriendListByEntityId(const NLMISC::CEntityId &id); void removePlayerFromFriendListByEntityId(const NLMISC::CEntityId &id);
#ifdef RYZOM_FORGE_ROOM
void setInRoomOfPlayer(const NLMISC::CEntityId &id); void setInRoomOfPlayer(const NLMISC::CEntityId &id);
const NLMISC::CEntityId& getInRoomOfPlayer(); const NLMISC::CEntityId& getInRoomOfPlayer();
@ -1977,6 +1986,7 @@ public:
/// remove room acces to player /// remove room acces to player
void removeRoomAccesToPlayer(const NLMISC::CEntityId &id, bool kick); void removeRoomAccesToPlayer(const NLMISC::CEntityId &id, bool kick);
#endif
/// remove player from league list /// remove player from league list
void removePlayerFromLeagueListByContactId(uint32 contactId); void removePlayerFromLeagueListByContactId(uint32 contactId);
@ -2385,10 +2395,12 @@ public:
void setPvPSafeZoneActive(); void setPvPSafeZoneActive();
/// clear pvp zone safe flag /// clear pvp zone safe flag
void clearSafeInPvPSafeZone(); void clearSafeInPvPSafeZone();
#ifdef RYZOM_FORGE
/// get pvp fames allies /// get pvp fames allies
TYPE_PVP_CLAN getPVPFamesAllies(); TYPE_PVP_CLAN getPVPFamesAllies();
/// get pvp fames ennemys /// get pvp fames ennemys
TYPE_PVP_CLAN getPVPFamesEnemies(); TYPE_PVP_CLAN getPVPFamesEnemies();
#endif
/// update the clan in visuale property /// update the clan in visuale property
void updatePVPClanVP() const; void updatePVPClanVP() const;
//@} //@}
@ -2425,6 +2437,7 @@ public:
uint32 getLastConnectedDate() const; uint32 getLastConnectedDate() const;
uint32 getPlayedTime() const; uint32 getPlayedTime() const;
#ifdef RYZOM_FORGE
const std::string& getLangChannel() const; const std::string& getLangChannel() const;
void setLangChannel(const std::string &lang); void setLangChannel(const std::string &lang);
@ -2432,7 +2445,9 @@ public:
void setNewTitle(const std::string &title); void setNewTitle(const std::string &title);
std::string getFullTitle() const; std::string getFullTitle() const;
#endif
#ifdef RYZOM_FORGE
std::string getTagA() const; std::string getTagA() const;
void setTagA(const std::string &tag); void setTagA(const std::string &tag);
@ -2444,9 +2459,13 @@ public:
std::string getTagPvPB() const; std::string getTagPvPB() const;
void setTagPvPB(const std::string &tag); void setTagPvPB(const std::string &tag);
#endif
#ifdef RYZOM_FORGE
uint32 getOrganization() const; uint32 getOrganization() const;
uint32 getOrganizationStatus() const; uint32 getOrganizationStatus() const;
#endif
const std::list<TCharacterLogTime>& getLastLogStats() const; const std::list<TCharacterLogTime>& getLastLogStats() const;
void updateConnexionStat(); void updateConnexionStat();
void setDisconnexionTime(); void setDisconnexionTime();
@ -3079,19 +3098,28 @@ private:
uint32 _FactionPoint[PVP_CLAN::EndClans-PVP_CLAN::BeginClans+1]; uint32 _FactionPoint[PVP_CLAN::EndClans-PVP_CLAN::BeginClans+1];
#ifdef RYZOM_FORGE
uint32 _PvpPoint; uint32 _PvpPoint;
#endif
#ifdef RYZOM_FORGE
uint32 _Organization; uint32 _Organization;
uint32 _OrganizationStatus; uint32 _OrganizationStatus;
uint32 _OrganizationPoints; uint32 _OrganizationPoints;
#endif
#ifdef RYZOM_FORGE
std::string _LangChannel; std::string _LangChannel;
std::string _NewTitle; std::string _NewTitle;
#endif
#ifdef RYZOM_FORGE
std::string _TagPvPA; std::string _TagPvPA;
std::string _TagPvPB; std::string _TagPvPB;
std::string _TagA; std::string _TagA;
std::string _TagB; std::string _TagB;
#endif
/// SDB path where player wins HoF points in PvP (if not empty) /// SDB path where player wins HoF points in PvP (if not empty)
std::string _SDBPvPPath; std::string _SDBPvPPath;
@ -3347,6 +3375,7 @@ private:
/// nb of users channels /// nb of users channels
uint8 _NbUserChannels; uint8 _NbUserChannels;
#ifdef RYZOM_FORGE
/// last webcommand index /// last webcommand index
uint32 _LastWebCommandIndex; uint32 _LastWebCommandIndex;
@ -3354,6 +3383,7 @@ private:
uint32 _LastUrlIndex; uint32 _LastUrlIndex;
std::map<std::string, std::string> _CustomMissionsParams; std::map<std::string, std::string> _CustomMissionsParams;
#endif
// for a power/combat event, stores start and end ticks // for a power/combat event, stores start and end ticks
struct CFlagTickRange { struct CFlagTickRange {
@ -3415,8 +3445,10 @@ private:
}; };
uint32 _ContactIdPool; uint32 _ContactIdPool;
#ifdef RYZOM_FORGE_ROOM
std::vector<NLMISC::CEntityId> _RoomersList; // Players who have acces to player's room std::vector<NLMISC::CEntityId> _RoomersList; // Players who have acces to player's room
NLMISC::CEntityId _inRoomOfPlayer; NLMISC::CEntityId _inRoomOfPlayer;
#endif
// friends list // friends list
std::vector<CContactId> _FriendsList; std::vector<CContactId> _FriendsList;
@ -3753,8 +3785,10 @@ private:
/// keep the Ids of the mission queues in which is this player /// keep the Ids of the mission queues in which is this player
std::vector<uint32> _MissionsQueues; std::vector<uint32> _MissionsQueues;
#ifdef RYZOM_FORGE
/// keep the validated web commandes /// keep the validated web commandes
std::set<uint32> _ValideWebCommandIndex; std::set<uint32> _ValideWebCommandIndex;
#endif
/// keep here the queue for which this player currently has an enter critical zone proposal /// keep here the queue for which this player currently has an enter critical zone proposal
uint32 _EnterCriticalZoneProposalQueueId; uint32 _EnterCriticalZoneProposalQueueId;
@ -3818,7 +3852,7 @@ private:
/// General god flag for persistence /// General god flag for persistence
bool _GodModeSave; bool _GodModeSave;
public: public:
#ifdef RYZOM_FORGE
void setWebCommandIndex(uint32 index) { _LastWebCommandIndex = index;} void setWebCommandIndex(uint32 index) { _LastWebCommandIndex = index;}
uint32 getWebCommandIndex() const { return _LastWebCommandIndex;} uint32 getWebCommandIndex() const { return _LastWebCommandIndex;}
@ -3827,6 +3861,7 @@ public:
void setUrlIndex(uint32 index) { _LastUrlIndex = index;} void setUrlIndex(uint32 index) { _LastUrlIndex = index;}
uint32 getUrlIndex() const { return _LastUrlIndex;} uint32 getUrlIndex() const { return _LastUrlIndex;}
#endif
bool getInvisibility() const { return _Invisibility;} bool getInvisibility() const { return _Invisibility;}
/// Set the invisibility flag, NB : just for persistence, do not change nothing. /// Set the invisibility flag, NB : just for persistence, do not change nothing.

@ -904,6 +904,7 @@ inline uint32 CCharacter::getPlayedTime() const
return _PlayedTime; return _PlayedTime;
} }
#ifdef RYZOM_FORGE
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline const std::string& CCharacter::getLangChannel() const inline const std::string& CCharacter::getLangChannel() const
@ -917,7 +918,9 @@ inline const std::string& CCharacter::getNewTitle() const
{ {
return _NewTitle; return _NewTitle;
} }
#endif
#ifdef RYZOM_FORGE
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline std::string CCharacter::getTagA() const inline std::string CCharacter::getTagA() const
@ -954,8 +957,9 @@ inline std::string CCharacter::getTagPvPB() const
return "_"; return "_";
return _TagPvPB; return _TagPvPB;
} }
#endif
#ifdef RYZOM_FORGE
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline std::string CCharacter::getFullTitle() const inline std::string CCharacter::getFullTitle() const
{ {
@ -964,7 +968,9 @@ inline std::string CCharacter::getFullTitle() const
else else
return _NewTitle; return _NewTitle;
} }
#endif
#ifdef RYZOM_FORGE
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
inline uint32 CCharacter::getOrganization() const inline uint32 CCharacter::getOrganization() const
@ -977,7 +983,7 @@ inline uint32 CCharacter::getOrganizationStatus() const
{ {
return _OrganizationStatus; return _OrganizationStatus;
} }
#endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

@ -414,11 +414,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
_FactionPoint[i],\ _FactionPoint[i],\
PVP_CLAN::TPVPClan k=PVP_CLAN::fromString(key); if ((k>=PVP_CLAN::BeginClans) && (k<=PVP_CLAN::EndClans)) _FactionPoint[k-PVP_CLAN::BeginClans]=val)\ PVP_CLAN::TPVPClan k=PVP_CLAN::fromString(key); if ((k>=PVP_CLAN::BeginClans) && (k<=PVP_CLAN::EndClans)) _FactionPoint[k-PVP_CLAN::BeginClans]=val)\
\ \
PROP(uint32,_PvpPoint)\ /*PROP(uint32,_PvpPoint)*/\
PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)\ /*PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)*/\
PROP(uint32,_Organization)\ /*PROP(uint32,_Organization)*/\
PROP(uint32,_OrganizationStatus)\ /*PROP(uint32,_OrganizationStatus)*/\
PROP(uint32,_OrganizationPoints)\ /*PROP(uint32,_OrganizationPoints)*/\
PROP2(DeclaredCult,string,PVP_CLAN::toString(_DeclaredCult),_DeclaredCult=PVP_CLAN::fromString(val))\ PROP2(DeclaredCult,string,PVP_CLAN::toString(_DeclaredCult),_DeclaredCult=PVP_CLAN::fromString(val))\
PROP2(DeclaredCiv,string,PVP_CLAN::toString(_DeclaredCiv),_DeclaredCiv=PVP_CLAN::fromString(val))\ PROP2(DeclaredCiv,string,PVP_CLAN::toString(_DeclaredCiv),_DeclaredCiv=PVP_CLAN::fromString(val))\
\ \
@ -439,11 +439,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\ PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\
PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\ PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\
PROP2(_Title, string, CHARACTER_TITLE::toString(getTitle()), setTitle(CHARACTER_TITLE::toCharacterTitle(val)))\ PROP2(_Title, string, CHARACTER_TITLE::toString(getTitle()), setTitle(CHARACTER_TITLE::toCharacterTitle(val)))\
PROP2(_NewTitle, string, _NewTitle, _NewTitle=val)\ /*PROP2(_NewTitle, string, _NewTitle, _NewTitle=val)*/\
PROP2(_TagPvPA, string, _TagPvPA, _TagPvPA=val)\ /*PROP2(_TagPvPA, string, _TagPvPA, _TagPvPA=val)*/\
PROP2(_TagPvPB, string, _TagPvPB, _TagPvPB=val)\ /*PROP2(_TagPvPB, string, _TagPvPB, _TagPvPB=val)*/\
PROP2(_TagA, string, _TagA, _TagA=val)\ /*PROP2(_TagA, string, _TagA, _TagA=val)*/\
PROP2(_TagB, string, _TagB, _TagB=val)\ /*PROP2(_TagB, string, _TagB, _TagB=val)*/\
\ \
/* Visual Properties */\ /* Visual Properties */\
PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\ PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\
@ -507,7 +507,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
STRUCT_VECT(_Pact)\ STRUCT_VECT(_Pact)\
STRUCT_VECT(_KnownPhrases)\ STRUCT_VECT(_KnownPhrases)\
STRUCT_MAP(TAIAlias, TMissionHistory, _MissionHistories)\ STRUCT_MAP(TAIAlias, TMissionHistory, _MissionHistories)\
PROP_MAP(string, string, _CustomMissionsParams)\ /*PROP_MAP(string, string, _CustomMissionsParams)*/\
LSTRUCT(_WelcomeMissionDesc, if (_WelcomeMissionDesc.isValid()))\ LSTRUCT(_WelcomeMissionDesc, if (_WelcomeMissionDesc.isValid()))\
STRUCT_ARRAY(_PlayerPets,_PlayerPets.size())\ STRUCT_ARRAY(_PlayerPets,_PlayerPets.size())\
\ \

@ -460,7 +460,9 @@ void CPlayerManager::addClientCallback()
{ "SET_PLAYER_SEASON", cbSetPlayerSeason }, // from DSS { "SET_PLAYER_SEASON", cbSetPlayerSeason }, // from DSS
{ "TELEPORT_PLAYER", cbTeleportPlayer }, // from AIS { "TELEPORT_PLAYER", cbTeleportPlayer }, // from AIS
#ifdef RYZOM_FORGE
{ "TRIGGER_WEBIG", cbTriggerWebig }, // from AIS { "TRIGGER_WEBIG", cbTriggerWebig }, // from AIS
#endif
{ "SET_CHAR_AIINSTANCE", cbSetCharacterAIInstance}, { "SET_CHAR_AIINSTANCE", cbSetCharacterAIInstance},
@ -2252,7 +2254,7 @@ bool CPlayerManager::hasBetterCSRGrade( CPlayer* p1, CPlayer *p2, bool devIsNorm
if ( p2->havePriv(":SGM:") ) if ( p2->havePriv(":SGM:") )
return ( p1->havePriv(":SGM:") ); return ( p1->havePriv(":SGM:") );
if ( p2->havePriv(":EM:") ) if ( p2->havePriv(":EM:") )
return ( p1->havePriv(":SGM:EM:GM:") ); return ( p1->havePriv(":SGM:EM:") );
if ( p2->havePriv(":GM:") ) if ( p2->havePriv(":GM:") )
return ( p1->havePriv(":SGM:EM:GM:") ); return ( p1->havePriv(":SGM:EM:GM:") );
if ( p2->havePriv(":EG:") ) if ( p2->havePriv(":EG:") )

@ -588,12 +588,12 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R
} }
// in any case, generate a mission event // in any case, generate a mission event
//#pragma message (NL_LOC_WRN "give the correct scenario tag") #pragma message (NL_LOC_WRN "give the correct scenario tag")
// TODO: give the correct scenario tag // TODO: give the correct scenario tag
CMissionEventTaggedRingScenarioDone event("blabla"); CMissionEventTaggedRingScenarioDone event("blabla");
_ParentCharacter->processMissionEvent(event); _ParentCharacter->processMissionEvent(event);
//#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") #pragma message (NL_LOC_WRN "Implements 'rare' item reward generation")
// TODO: Implements 'rare' item reward generation // TODO: Implements 'rare' item reward generation
// make sure the reward level is valid // make sure the reward level is valid
BOMB_IF(rewardLevel>R2::TSessionLevel::last_enum_item,"Ignoring attempting to generate reward of invalid level for character "<<_ParentCharacter->getId().toString(),return CRingRewardPoints::grr_invalid); BOMB_IF(rewardLevel>R2::TSessionLevel::last_enum_item,"Ignoring attempting to generate reward of invalid level for character "<<_ParentCharacter->getId().toString(),return CRingRewardPoints::grr_invalid);
@ -615,8 +615,8 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R
*/ */
/* *** todo *** */ /* *** todo *** */
//#pragma message (NL_LOC_WRN "Implements mission step validation") #pragma message (NL_LOC_WRN "Implements mission step validation")
//#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") #pragma message (NL_LOC_WRN "Implements 'rare' item reward generation")
// TODO: Implements mission step validation and 'rare' item reward generation // TODO: Implements mission step validation and 'rare' item reward generation
// NB : need to return grr_ok_rare if rare item were gained // NB : need to return grr_ok_rare if rare item were gained
@ -687,7 +687,7 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R
/* /*
This is where we add some code to validate the mission step if player is in newbyland and has the 'complete a ring scenario' mission This is where we add some code to validate the mission step if player is in newbyland and has the 'complete a ring scenario' mission
*/ */
//#pragma message (NL_LOC_WRN "Implements mission step validation") #pragma message (NL_LOC_WRN "Implements mission step validation")
// TODO: Implements mission step validation // TODO: Implements mission step validation
/* *** todo *** */ /* *** todo *** */
@ -781,7 +781,7 @@ CRingRewardPoints::TGenerateRewardResult CRingRewardPointsImpl::generateReward(R
} }
// NB : need to return grr_ok_rare if rare item were gained // NB : need to return grr_ok_rare if rare item were gained
//#pragma message (NL_LOC_WRN "Implements 'rare' item reward generation") #pragma message (NL_LOC_WRN "Implements 'rare' item reward generation")
// TODO: Implements 'rare' item reward generation // TODO: Implements 'rare' item reward generation
} }

@ -1232,6 +1232,7 @@ void CDamageScoreManager::playerDeath(CCharacter * victimChar, const CCharacter
if (winnerGainFactionPoints) if (winnerGainFactionPoints)
{ {
#ifdef RYZOM_FORGE
// Compute Fames delta // Compute Fames delta
sint32 fameFactor = 0; sint32 fameFactor = 0;
for (uint8 fameIdx = 0; fameIdx < 7; fameIdx++) for (uint8 fameIdx = 0; fameIdx < 7; fameIdx++)
@ -1253,6 +1254,11 @@ void CDamageScoreManager::playerDeath(CCharacter * victimChar, const CCharacter
// player gains faction points // player gains faction points
changePlayerPvpPoints(winnerChar, sint32(fpPerPlayer) * fameFactor); changePlayerPvpPoints(winnerChar, sint32(fpPerPlayer) * fameFactor);
winnerChar->sendFactionPointGainKillMessage(winnerFaction, fpPerPlayer * fameFactor, victimChar->getId()); winnerChar->sendFactionPointGainKillMessage(winnerFaction, fpPerPlayer * fameFactor, victimChar->getId());
#elif defined(RYZOM_EPISODE2_REACTIVATE)
// player gains faction points
changePlayerFactionPoints(winnerChar, winnerFaction, sint32(fpPerPlayer));
winnerChar->sendFactionPointGainKillMessage(winnerFaction, fpPerPlayer, victimChar->getId());
#endif
} }
// player gains HoF points // player gains HoF points
@ -1260,14 +1266,15 @@ void CDamageScoreManager::playerDeath(CCharacter * victimChar, const CCharacter
// and a way for known if an episode occurs (and specs for known if other episode pemrti to win HoF point...) // and a way for known if an episode occurs (and specs for known if other episode pemrti to win HoF point...)
//changePlayerHoFPoints(winnerChar, sint32(hofpPerPlayer)); //changePlayerHoFPoints(winnerChar, sint32(hofpPerPlayer));
/* #ifdef RYZOM_EPISODE2_REACTIVATE
// PvP faction winner HOF reward // PvP faction winner HOF reward
CPVPManager2::getInstance()->characterKillerInPvPFaction( winnerChar, winnerFaction, (sint32)fpPerPlayer ); CPVPManager2::getInstance()->characterKillerInPvPFaction( winnerChar, winnerFaction, (sint32)fpPerPlayer );
if( finalBlower == winnerChar ) if( finalBlower == winnerChar )
{ {
CPVPManager2::getInstance()->finalBlowerKillerInPvPFaction( winnerChar, winnerFaction, victimChar ); CPVPManager2::getInstance()->finalBlowerKillerInPvPFaction( winnerChar, winnerFaction, victimChar );
} }
*/ #endif
rewardedKillers.push_back(winnerChar->getId()); rewardedKillers.push_back(winnerChar->getId());
nbRewardedMembers++; nbRewardedMembers++;
} }
@ -1856,6 +1863,7 @@ sint32 CDamageScoreManager::changePlayerFactionPoints(CCharacter * playerChar, P
return fpDelta; return fpDelta;
} }
#ifdef RYZOM_FORGE
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
sint32 CDamageScoreManager::changePlayerPvpPoints(CCharacter * playerChar, sint32 fpDelta) sint32 CDamageScoreManager::changePlayerPvpPoints(CCharacter * playerChar, sint32 fpDelta)
{ {
@ -1876,7 +1884,7 @@ sint32 CDamageScoreManager::changePlayerPvpPoints(CCharacter * playerChar, sint3
return fpDelta; return fpDelta;
} }
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CDamageScoreManager::changePlayerHoFPoints(CCharacter * playerChar, sint32 hofpDelta) void CDamageScoreManager::changePlayerHoFPoints(CCharacter * playerChar, sint32 hofpDelta)

@ -359,9 +359,11 @@ private:
/// \return the applied delta (a negative delta may have been modified up to zero to keep faction points positive) /// \return the applied delta (a negative delta may have been modified up to zero to keep faction points positive)
sint32 changePlayerFactionPoints(CCharacter * playerChar, PVP_CLAN::TPVPClan faction, sint32 fpDelta); sint32 changePlayerFactionPoints(CCharacter * playerChar, PVP_CLAN::TPVPClan faction, sint32 fpDelta);
#ifdef RYZOM_FORGE
/// add/remove pvp points to a player /// add/remove pvp points to a player
/// \return the applied delta (a negative delta may have been modified up to zero to keep pvp points positive) /// \return the applied delta (a negative delta may have been modified up to zero to keep pvp points positive)
sint32 changePlayerPvpPoints(CCharacter * playerChar, sint32 fpDelta); sint32 changePlayerPvpPoints(CCharacter * playerChar, sint32 fpDelta);
#endif
/// add/remove HoF points to a player and his guild if his SDB PvP path is defined /// add/remove HoF points to a player and his guild if his SDB PvP path is defined
void changePlayerHoFPoints(CCharacter * playerChar, sint32 hofpDelta); void changePlayerHoFPoints(CCharacter * playerChar, sint32 hofpDelta);

@ -72,6 +72,11 @@ void CPVPManager2::init()
IPVPInterface * pvpFaction = new CPVPFaction(); IPVPInterface * pvpFaction = new CPVPFaction();
BOMB_IF(pvpFaction == 0, "Can't allocate CPVPFaction", nlstop ); BOMB_IF(pvpFaction == 0, "Can't allocate CPVPFaction", nlstop );
_Instance->_PVPInterface.push_back(pvpFaction); _Instance->_PVPInterface.push_back(pvpFaction);
#ifdef RYZOM_EPISODE2_REACTIVATE
// add war between kami and karavan faction (must be controled by GM tools later
_Instance->addFactionWar(PVP_CLAN::Kami, PVP_CLAN::Karavan);
#endif
// instantiate pvp duel class // instantiate pvp duel class
IPVPInterface * pvpDuel = new CPVPDuel(); IPVPInterface * pvpDuel = new CPVPDuel();
BOMB_IF(pvpDuel == 0, "Can't allocate CPVPDuel", nlstop ); BOMB_IF(pvpDuel == 0, "Can't allocate CPVPDuel", nlstop );
@ -210,6 +215,9 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
std::vector<TChanID> result; std::vector<TChanID> result;
result.clear(); result.clear();
// NOTE: It's better to just rely on user-made channels. -Kaetemi
#ifdef RYZOM_FORGE
// Add lang channel, should be first. // Add lang channel, should be first.
if (!user->getLangChannel().empty()) if (!user->getLangChannel().empty())
{ {
@ -232,14 +240,19 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
result.push_back((*it).second); result.push_back((*it).second);
} }
} }
#endif
#ifdef RYZOM_FORGE
PVP_CLAN::TPVPClan faction = user->getAllegiance().first; PVP_CLAN::TPVPClan faction = user->getAllegiance().first;
if( faction != PVP_CLAN::Neutral ) if( faction != PVP_CLAN::Neutral )
{ {
TMAPFactionChannel::iterator it = _FactionChannel.find(faction); if (isFactionInWar(faction))
if( it != _FactionChannel.end() )
{ {
result.push_back((*it).second); TMAPFactionChannel::iterator it = _FactionChannel.find(faction);
if (it != _FactionChannel.end())
{
result.push_back((*it).second);
}
} }
} }
@ -252,6 +265,7 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
result.push_back((*it).second); result.push_back((*it).second);
} }
} }
#endif
/* /*
bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000; bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000;

Loading…
Cancel
Save