Merge branch 'new_features' into main/atys-live

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

@ -476,6 +476,8 @@ bool CMissionTemplate::build(const NLLIGO::IPrimitive* prim,CMissionGlobalParsin
ret = parseItemList( i+1, ";",script, Prerequisits.Wear , missionData.ChatParams) && ret;
else if ( script[0] == "req_item" )
ret = parseItemList( i+1, ";",script, Prerequisits.Own , missionData.ChatParams) && ret;
else if ( script[0] == "req_item_quality" )
ret = parseQualityList( i+1, ";",script, Prerequisits.OwnQuality , missionData.ChatParams) && ret;
else if ( script[0] == "req_guild" )
Prerequisits.Guild = true;
else if ( script[0] == "req_title" )
@ -1886,13 +1888,21 @@ uint32 CMissionTemplate::testPrerequisits( CCharacter * user, CPrerequisitInfos
{
// if( equip[j] != NULL && equip[j]->getSheetId() == Prerequisits.Own[i] )
if( equip->getItem(j) != NULL && equip->getItem(j)->getSheetId() == Prerequisits.Own[i] )
break;
{
if (Prerequisits.OwnQuality.size() > i)
{
if (equip->getItem(j)->quality() >= Prerequisits.OwnQuality[i])
break;
}
else
break;
}
}
if ( j == equip->getSlotCount() )
{
if (logOnFail)
MISDBG("%s Require bag item at %uth req_item line", sDebugPrefix.c_str(), i);
if (returnValue == MISSION_DESC::PreReqSuccess)
{
if (!fillPrereqInfos)
@ -2690,6 +2700,29 @@ bool CMissionTemplate::parseItemList(uint32 line, const std::string & separator
}
}// CMissionTemplate parseItemList
bool CMissionTemplate::parseQualityList(uint32 line, const std::string & separator, const std::vector< std::string > & script, std::vector< float > & ret, std::vector< std::pair< std::string, STRING_MANAGER::TParamType > > & chatParams )
{
if ( script.size() != 2 )
{
MISLOGSYNTAXERROR1("<quality>*[%s<quality>]", separator.c_str());
return false;
}
else
{
std::vector< std::string > args;
NLMISC::splitString(script[1],separator,args);
for ( uint j = 0; j < args.size(); j++ )
{
float value;
NLMISC::fromString(args[j], value);
ret.push_back( value );
}
return true;
}
}// CMissionTemplate parseQualityList
bool CMissionTemplate::parseTitlePrereq(uint32 line, const std::vector< std::string > & script )
{
if ( script.size() != 2 )

@ -234,6 +234,8 @@ public:
std::vector< NLMISC::CSheetId > Wear;
/// item that must be owned
std::vector< NLMISC::CSheetId > Own;
/// item quality that must be owned
std::vector< float > OwnQuality;
/// title that must be displayed by the player
CHARACTER_TITLE::ECharacterTitle Title;
/// fame prerequisits
@ -398,6 +400,7 @@ private:
// bool parseChatParamList( const std::string & separator, const std::vector< std::string > & preparsedParams, TVectorParamCheck & ret );
/// parse a list of items
bool parseItemList(uint32 line, const std::string & separator, const std::vector< std::string > & preparsedParams, std::vector< NLMISC::CSheetId > & ret, std::vector< std::pair< std::string, STRING_MANAGER::TParamType > > & chatParams );
bool parseQualityList(uint32 line, const std::string & separator, const std::vector< std::string > & script, std::vector< float > & ret, std::vector< std::pair< std::string, STRING_MANAGER::TParamType > > & chatParams );
/// parse player title prereq
bool parseTitlePrereq(uint32 line, const std::vector< std::string > & preparsedParams );
/// parse the minimum fame

@ -801,6 +801,7 @@ NLMISC_COMMAND(getItemList, "get list of items of character by filter", "<uid> [
inventories.push_back(selectedInv);
}
} else {
inventories.push_back(INVENTORIES::temporary);
inventories.push_back(INVENTORIES::handling);
inventories.push_back(INVENTORIES::equipment);
inventories.push_back(INVENTORIES::bag);
@ -2962,11 +2963,13 @@ NLMISC_COMMAND(spawnArkMission,"spawn Mission","<uid> <bot_name> <mission_name>"
uint8 result = CMissionManager::getInstance()->instanciateMission(c, missionAlias, giverAlias, eventList);
if (!result)
{
c->processMissionEventList(eventList,true, CAIAliasTranslator::Invalid);
c->processMissionEventList(eventList,true, CAIAliasTranslator::Invalid);
log.displayNL("OK");
}
else
{
log.displayNL("ERR: %d", result);
}
return true;
}

Loading…
Cancel
Save