mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-05 23:09:04 +00:00
Changed: Synchronization with SVN
This commit is contained in:
parent
af4ed15c36
commit
e4e12ff6c4
19 changed files with 475 additions and 133 deletions
|
@ -532,7 +532,10 @@ static CMessage getFileClassImp( CMessage& msgin)
|
|||
|
||||
for (uint j=0; j<classes[i].size(); ++j)
|
||||
{
|
||||
std::string rfile = getBackupFileName(classes[i][j].File);
|
||||
std::string rfile = classes[i][j].File;
|
||||
// if there's wildcard, the file is already full so we don't need to add again the backup path or we ll have "save_shard/save_shard/..." that is not valid
|
||||
if (!CFile::isExists(rfile))
|
||||
rfile = getBackupFileName(classes[i][j].File);
|
||||
fdc.addFile(classes[i][j].File, CFile::getFileModificationDate(rfile),CFile::getFileSize(rfile));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,6 +181,7 @@ AdminCommandsInit[] =
|
|||
"validateRespawnPoint", true,
|
||||
"summonPet", true,
|
||||
"connectUserChannel", true,
|
||||
"connectLangChannel", true,
|
||||
"updateTarget", true,
|
||||
"resetName", true,
|
||||
"showOnline", true,
|
||||
|
@ -1126,6 +1127,8 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
|
|||
vector<string> res;
|
||||
|
||||
sint32 x = 0, y = 0, z = 0;
|
||||
sint32 cell = 0;
|
||||
|
||||
if (get)
|
||||
{
|
||||
x = e->getState().X() / 1000;
|
||||
|
@ -1229,6 +1232,10 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
|
|||
x = entityBase->getState().X + sint32 (cos (entityBase->getState ().Heading) * 2000);
|
||||
y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000);
|
||||
z = entityBase->getState().Z;
|
||||
|
||||
TDataSetRow dsr = entityBase->getEntityRowId();
|
||||
CMirrorPropValueRO<TYPE_CELL> mirrorCell( TheDataset, dsr, DSPropertyCELL );
|
||||
cell = mirrorCell;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1258,11 +1265,11 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
|
|||
// season included
|
||||
uint8 season;
|
||||
NLMISC::fromString(res[3], season);
|
||||
c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, 0, season);
|
||||
c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell, season);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->teleportCharacter(x,y,z,true);
|
||||
c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell);
|
||||
}
|
||||
|
||||
if ( cont )
|
||||
|
@ -3780,7 +3787,7 @@ NLMISC_COMMAND( monitorMissions, "monitor a player missions", "<CSR id><player n
|
|||
CHECK_RIGHT( c,target );
|
||||
|
||||
// CSR must have no missions to monitor a player
|
||||
if ( c->getMissionsBegin() == c->getMissionsEnd() )
|
||||
if ( c->getMissionsBegin() != c->getMissionsEnd() )
|
||||
{
|
||||
CCharacter::sendDynamicSystemMessage( c->getEntityRowId() , "CSR_HAS_MISSION" );
|
||||
return true;
|
||||
|
@ -4014,8 +4021,6 @@ NLMISC_COMMAND (unmuteUniverse, "unmute the univers chat", "<csr id><player name
|
|||
//----------------------------------------------------------------------------
|
||||
NLMISC_COMMAND (setGMGuild, "set the current GM guild", "")
|
||||
{
|
||||
if ( args.size() != 1 )
|
||||
return false;
|
||||
GET_CHARACTER;
|
||||
uint32 guildId = c->getGuildId();
|
||||
CGuildManager::getInstance()->setGMGuild( guildId );
|
||||
|
@ -4450,8 +4455,8 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
|
|||
CPVPManager2 *inst = CPVPManager2::getInstance();
|
||||
|
||||
string pass;
|
||||
string name = args[1];
|
||||
TChanID channel = CPVPManager2::getInstance()->getUserDynChannel(name);
|
||||
string name = toLower(args[1]);
|
||||
TChanID channel = inst->getUserDynChannel(name);
|
||||
|
||||
if (args.size() < 3)
|
||||
pass = toLower(name);
|
||||
|
@ -4499,6 +4504,38 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
|
|||
|
||||
}
|
||||
|
||||
NLMISC_COMMAND (connectLangChannel, "Connect to lang channel", "<user id> <lang>")
|
||||
{
|
||||
if ((args.size() < 2) || (args.size() > 3))
|
||||
return false;
|
||||
GET_CHARACTER
|
||||
|
||||
CPVPManager2 *inst = CPVPManager2::getInstance();
|
||||
|
||||
string action;
|
||||
string lang = args[1];
|
||||
if (lang != "en" && lang != "fr" && lang != "de" && lang != "ru" && lang != "es")
|
||||
return false;
|
||||
|
||||
TChanID channel = inst->getFactionDynChannel(lang);
|
||||
|
||||
if (channel != DYN_CHAT_INVALID_CHAN)
|
||||
{
|
||||
if (!c->getLangChannel().empty()) {
|
||||
TChanID current_channel = inst->getFactionDynChannel(c->getLangChannel());
|
||||
inst->removeFactionChannelForCharacter(current_channel, c);
|
||||
}
|
||||
inst->addFactionChannelToCharacter(channel, c, true);
|
||||
c->setLangChannel(lang);
|
||||
return true;
|
||||
}
|
||||
|
||||
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
|
||||
params[0].Literal = lang;
|
||||
CCharacter::sendDynamicSystemMessage( eid, "EGS_CHANNEL_INVALID_NAME", params );
|
||||
return false;
|
||||
}
|
||||
|
||||
NLMISC_COMMAND (updateTarget, "Update current target", "<user id>")
|
||||
{
|
||||
GET_CHARACTER
|
||||
|
@ -4601,9 +4638,15 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
GET_CHARACTER
|
||||
|
||||
bool new_check = false;
|
||||
if (args.size() >= 6 && args[5] == "1")
|
||||
bool new_separator = false;
|
||||
// New check using HMagic
|
||||
if (args.size() >= 6 && (args[5] == "1" || args[5] == "3"))
|
||||
new_check = true;
|
||||
|
||||
// New separator "|"
|
||||
if (args.size() >= 6 && (args[5] == "2" || args[5] == "3"))
|
||||
new_separator = true;
|
||||
|
||||
bool next_step = false;
|
||||
if (args.size() >= 7 && args[6] == "1")
|
||||
next_step = true;
|
||||
|
@ -4680,7 +4723,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
}
|
||||
|
||||
std::vector<std::string> command_args;
|
||||
NLMISC::splitString(command, "!", command_args);
|
||||
if (new_separator)
|
||||
NLMISC::splitString(command, "|", command_args);
|
||||
else
|
||||
NLMISC::splitString(command, "!", command_args);
|
||||
if (command_args.empty())
|
||||
return false;
|
||||
|
||||
|
@ -5317,8 +5363,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
|
||||
uint32 value;
|
||||
fromString(command_args[2], value);
|
||||
|
||||
target->setHairColor(value);
|
||||
if (target)
|
||||
target->setHairColor(value);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
//*************************************************
|
||||
|
@ -5468,12 +5516,35 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
//*************************************************
|
||||
//***************** set_title
|
||||
//*************************************************
|
||||
|
||||
// /a webExecCommand debug 1 set_title!toto hmac 0
|
||||
else if (command_args[0] == "set_title")
|
||||
{
|
||||
if (command_args.size () != 2) return false;
|
||||
TDataSetRow row = c->getEntityRowId();
|
||||
ucstring name = ucstring(c->getName().toString()+"$"+command_args[1]+"$");
|
||||
c->setNewTitle(command_args[1]);
|
||||
string fullname = c->getName().toString()+"$"+command_args[1]+"#"+c->getTagPvPA()+"#"+c->getTagPvPB()+"#"+c->getTagA()+"#"+c->getTagB()+"$";
|
||||
ucstring name;
|
||||
name.fromUtf8(fullname);
|
||||
NLNET::CMessage msgout("CHARACTER_NAME");
|
||||
msgout.serial(row);
|
||||
msgout.serial(name);
|
||||
sendMessageViaMirror("IOS", msgout);
|
||||
}
|
||||
|
||||
//*************************************************
|
||||
//***************** set_tag
|
||||
//*************************************************
|
||||
|
||||
else if (command_args[0] == "set_tag") {
|
||||
if (command_args.size () != 3) return false;
|
||||
TDataSetRow row = c->getEntityRowId();
|
||||
if (command_args[1] == "pvpA") c->setTagPvPA(command_args[2]);
|
||||
if (command_args[1] == "pvpB") c->setTagPvPB(command_args[2]);
|
||||
if (command_args[1] == "A") c->setTagA(command_args[2]);
|
||||
if (command_args[1] == "B") c->setTagB(command_args[2]);
|
||||
string fullname = c->getName().toString()+"$"+c->getNewTitle()+"#"+c->getTagPvPA()+"#"+c->getTagPvPB()+"#"+c->getTagA()+"#"+c->getTagB()+"$";
|
||||
ucstring name;
|
||||
name.fromUtf8(fullname);
|
||||
NLNET::CMessage msgout("CHARACTER_NAME");
|
||||
msgout.serial(row);
|
||||
msgout.serial(name);
|
||||
|
@ -5500,6 +5571,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
vector<string> res;
|
||||
sint32 x = 0, y = 0, z = 0;
|
||||
float h = 0;
|
||||
sint32 cell;
|
||||
if ( value.find(',') != string::npos ) // Position x,y,z,a
|
||||
{
|
||||
explode (value, string(","), res);
|
||||
|
@ -5591,6 +5663,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000);
|
||||
z = entityBase->getState().Z;
|
||||
h = entityBase->getState().Heading;
|
||||
|
||||
TDataSetRow dsr = entityBase->getEntityRowId();
|
||||
CMirrorPropValueRO<TYPE_CELL> mirrorCell( TheDataset, dsr, DSPropertyCELL );
|
||||
cell = mirrorCell;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5620,7 +5696,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
c->applyRespawnEffects();
|
||||
}
|
||||
|
||||
c->teleportCharacter(x,y,z,allowPetTp,true,h);
|
||||
c->teleportCharacter(x,y,z,allowPetTp,true,h,0xFF,cell);
|
||||
|
||||
if ( cont )
|
||||
{
|
||||
|
@ -5903,6 +5979,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
{
|
||||
if (send_url)
|
||||
c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_faction_points", getSalt());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (action=="set")
|
||||
|
@ -5941,6 +6018,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
{
|
||||
if (send_url)
|
||||
c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_pvp_points", getSalt());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (action=="set")
|
||||
|
@ -5957,6 +6035,51 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
|
|||
}
|
||||
}
|
||||
|
||||
//*************************************************
|
||||
//***************** ios
|
||||
//*************************************************
|
||||
|
||||
else if (command_args[0] == "ios")
|
||||
{
|
||||
|
||||
if (command_args.size() < 4)
|
||||
return false;
|
||||
|
||||
string action = command_args[1]; // single_phrase
|
||||
|
||||
if (action == "single_phrase")
|
||||
{
|
||||
string phraseName = command_args[2];
|
||||
ucstring phraseContent = phraseName;
|
||||
ucstring phraseText;
|
||||
phraseText.fromUtf8(command_args[3]);
|
||||
phraseContent += "(){[";
|
||||
phraseContent += phraseText;
|
||||
phraseContent += "]}";
|
||||
|
||||
string msgname = "SET_PHRASE";
|
||||
bool withLang = false;
|
||||
string lang = "";
|
||||
if (command_args.size() == 5)
|
||||
{
|
||||
lang = command_args[3];
|
||||
if (lang != "all")
|
||||
{
|
||||
withLang = true;
|
||||
msgname = "SET_PHRASE_LANG";
|
||||
}
|
||||
}
|
||||
|
||||
NLNET::CMessage msgout(msgname);
|
||||
msgout.serial(phraseName);
|
||||
msgout.serial(phraseContent);
|
||||
if (withLang)
|
||||
msgout.serial(lang);
|
||||
sendMessageViaMirror("IOS", msgout);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************
|
||||
//***************** missions
|
||||
//*************************************************
|
||||
|
@ -6921,7 +7044,7 @@ NLMISC_COMMAND(setChanHistoricSize, "Set size of the historic for a localized ch
|
|||
// add a client to a channel
|
||||
NLMISC_COMMAND(addChanClient, "add a client to a channel", "<client name or user id><string name of the channel localized name>[1=Read/Write,0=ReadOnly(default)]")
|
||||
{
|
||||
if (args.size() != 2) return false;
|
||||
if (args.size() < 2 || args.size() > 3) return false;
|
||||
GET_CHARACTER
|
||||
TChanID chanID = DynChatEGS.getChanIDFromName(args[1]);
|
||||
if (chanID == DYN_CHAT_INVALID_CHAN)
|
||||
|
|
|
@ -89,7 +89,15 @@ bool IBuildingPhysical::addUser(CCharacter * user, uint16 roomIdx, uint16 ownerI
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (user->currentHp() <= 0 )
|
||||
{
|
||||
nlwarning("<BUILDING>user %s is dead",user->getId().toString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
CCharacter *owner;
|
||||
|
||||
if (ownerIdx < _Players.size())
|
||||
{
|
||||
owner = PlayerManager.getChar(_Players[ownerIdx] );
|
||||
|
|
|
@ -2078,7 +2078,7 @@ void cbClientSit( NLNET::CMessage& msgin, const std::string &serviceName, NLNET:
|
|||
}
|
||||
|
||||
|
||||
// client send a command to chang guild motd
|
||||
// client send a command to change guild motd
|
||||
void cbClientGuildMotd( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
|
||||
{
|
||||
H_AUTO(cbClientGuildMotd);
|
||||
|
@ -2737,7 +2737,7 @@ void cbClientSetCharacterTitle( NLNET::CMessage& msgin, const std::string & serv
|
|||
}
|
||||
|
||||
// kxu: TODO: check validity of title chosen by player
|
||||
c->setTitle( (CHARACTER_TITLE::ECharacterTitle) title );
|
||||
c->setNewTitle(CHARACTER_TITLE::toString((CHARACTER_TITLE::ECharacterTitle)title));
|
||||
c->registerName();
|
||||
}
|
||||
|
||||
|
|
|
@ -4321,41 +4321,7 @@ NLMISC_COMMAND(setAllSkillsToValue,"set all skills to value","<entity id(id:type
|
|||
if( e )
|
||||
{
|
||||
log.displayNL("Player %s skills are all set to value %u", id.toString().c_str(), value);
|
||||
// get pointer on static skills tree definition
|
||||
|
||||
CSheetId sheet("skills.skill_tree");
|
||||
const CStaticSkillsTree * SkillsTree = CSheets::getSkillsTreeForm( sheet );
|
||||
nlassert( SkillsTree );
|
||||
|
||||
|
||||
for(int i = 0; i < SKILLS::NUM_SKILLS; ++i )
|
||||
{
|
||||
CSkills &skills = e->getSkills();
|
||||
skills._Skills[ i ].Base = min( value, (sint32)SkillsTree->SkillsTree[ i ].MaxSkillValue );
|
||||
skills._Skills[ i ].Current = skills._Skills[ i ].Base;
|
||||
skills._Skills[ i ].MaxLvlReached = skills._Skills[ i ].Base;
|
||||
|
||||
// update all parent skill with new max children
|
||||
SKILLS::ESkills skillUpdated = (SKILLS::ESkills)i;
|
||||
while( SkillsTree->SkillsTree[ skillUpdated ].ParentSkill != SKILLS::unknown )
|
||||
{
|
||||
if( skills._Skills[ i ].Base > skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached )
|
||||
{
|
||||
skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached = skills._Skills[ i ].Base;
|
||||
skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].Base = min( skills._Skills[ skillUpdated ].Base, (sint32)SkillsTree->SkillsTree[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxSkillValue );
|
||||
skillUpdated = SkillsTree->SkillsTree[ skillUpdated ].ParentSkill;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// e->_PropertyDatabase.x_setProp( string("CHARACTER_INFO:SKILLS:") + NLMISC::toStringEnum( i ) + string(":SKILL"), skills._Skills[ i ].Base );
|
||||
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(e->_PropertyDatabase, checkedCast<uint16>(skills._Skills[ i ].Base) );
|
||||
// e->_PropertyDatabase.x_setProp( string("CHARACTER_INFO:SKILLS:") + NLMISC::toStringEnum( i ) + string(":BaseSKILL"), skills._Skills[ i ].Base );
|
||||
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(e->_PropertyDatabase, checkedCast<uint16>(skills._Skills[ i ].Base) );
|
||||
}
|
||||
e->setSkillsToValue(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -237,6 +237,16 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId)
|
|||
nlwarning("<CGuildMemberModule::setMOTD>%s invalid member id %s",eId.toString().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if ( motd == "?" )
|
||||
{
|
||||
// Show the old MOTD
|
||||
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
|
||||
params[0].Literal= _MessageOfTheDay;
|
||||
CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params);
|
||||
return;
|
||||
}
|
||||
|
||||
EGSPD::CGuildGrade::TGuildGrade memberGrade = member->getGrade();
|
||||
if( memberGrade >= EGSPD::CGuildGrade::Member)
|
||||
{
|
||||
|
@ -255,9 +265,10 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId)
|
|||
|
||||
if(!_MessageOfTheDay.empty())
|
||||
{
|
||||
// Show new MOTD to all members
|
||||
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
|
||||
params[0].Literal= _MessageOfTheDay;
|
||||
CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params);
|
||||
sendMessageToGuildChat("GMOTD", params);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1408,6 +1419,25 @@ void CGuild::sendMessageToGuildMembers( const std::string & msg, const TVectorP
|
|||
IGuildUnifier::getInstance()->sendMessageToGuildMembers(this, msg, params);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void CGuild::sendMessageToGuildChat( const std::string & msg, const TVectorParamCheck & params )const
|
||||
{
|
||||
for ( std::map< EGSPD::TCharacterId, EGSPD::CGuildMemberPD*>::const_iterator it = getMembersBegin(); it != getMembersEnd(); ++it )
|
||||
{
|
||||
CGuildMember * member = EGS_PD_CAST<CGuildMember*>( (*it).second );
|
||||
EGS_PD_AST( member );
|
||||
|
||||
// continue if the player is offline
|
||||
CGuildMemberModule * module = NULL;
|
||||
if ( member->getReferencingModule(module) )
|
||||
{
|
||||
CGuildCharProxy proxy;
|
||||
module->getProxy(proxy);
|
||||
proxy.sendDynamicMessageToChatGroup(msg, CChatGroup::guild, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void CGuild::setMemberClientDB( CGuildMember* member )
|
||||
{
|
||||
|
|
|
@ -165,6 +165,8 @@ public:
|
|||
void addMemberToGuildChat(CGuildMember *member);
|
||||
/// send a message to all members
|
||||
void sendMessageToGuildMembers( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const;
|
||||
/// send a message to all members in guild chat
|
||||
void sendMessageToGuildChat( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const;
|
||||
/// set information relative to a member in the guild client database
|
||||
void setMemberClientDB( CGuildMember* member );
|
||||
/// return the best online user
|
||||
|
|
|
@ -215,9 +215,7 @@ class CMissionStepKillFauna : public IMissionStepTemplate
|
|||
ret.clear();
|
||||
ret.resize( _SubSteps.size() );
|
||||
for ( uint i = 0; i < _SubSteps.size(); i++ )
|
||||
{
|
||||
ret[i] = _SubSteps[i].Quantity;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void getTextParams( uint & nbSubSteps,const std::string* & textPtr,TVectorParamCheck& retParams, const std::vector<uint32>& subStepStates)
|
||||
|
|
|
@ -121,7 +121,7 @@ NLMISC_COMMAND(outpostSimulateTimer0End, "", "<outpost_id> [<absolute end time>
|
|||
if (args.size()>1)
|
||||
{
|
||||
NLMISC::fromString(args[1], endTime);
|
||||
if (args[1][0]=='+')
|
||||
if (args[1].find('+')==0)
|
||||
endTime += CTime::getSecondsSince1970();
|
||||
}
|
||||
if (endTime==0) endTime = 1;
|
||||
|
@ -144,7 +144,7 @@ NLMISC_COMMAND(outpostSimulateTimer1End, "", "<outpost_id> [<absolute end time>
|
|||
if (args.size()>1)
|
||||
{
|
||||
NLMISC::fromString(args[1], endTime);
|
||||
if (args[1][0]=='+')
|
||||
if (args[1].find('+')==0)
|
||||
endTime += CTime::getSecondsSince1970();
|
||||
}
|
||||
if (endTime==0) endTime = 1;
|
||||
|
@ -167,7 +167,7 @@ NLMISC_COMMAND(outpostSimulateTimer2End, "", "<outpost_id> [<absolute end time>
|
|||
if (args.size()>1)
|
||||
{
|
||||
NLMISC::fromString(args[1], endTime);
|
||||
if (args[1][0]=='+')
|
||||
if (args[1].find('+')==0)
|
||||
endTime += CTime::getSecondsSince1970();
|
||||
}
|
||||
if (endTime==0) endTime = 1;
|
||||
|
|
|
@ -281,7 +281,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
c->wearRightHandItem();
|
||||
c->wearRightHandItem(phrase->getMps().size()/10);
|
||||
|
||||
// report Xp Gain unless used tool is worned
|
||||
PROGRESSIONPVE::CCharacterProgressionPVE::getInstance()->actionReport( report, true, false );
|
||||
|
|
|
@ -54,7 +54,7 @@ CFaberPhrase::CFaberPhrase()
|
|||
_CraftedItemStaticForm = 0;
|
||||
_RootFaberBricks = false;
|
||||
_RootFaberPlan = 0;
|
||||
|
||||
|
||||
// recommended skill level for using crafted item
|
||||
_Recommended = 0;
|
||||
|
||||
|
@ -67,13 +67,13 @@ CFaberPhrase::CFaberPhrase()
|
|||
_MBORange = 0.0f;
|
||||
_MBOProtection = 0.0f;
|
||||
_MBOSapLoad = 0.0f;
|
||||
|
||||
|
||||
// energy buff on item
|
||||
_MBOHitPoint = 0;
|
||||
_MBOSap = 0;
|
||||
_MBOStamina = 0;
|
||||
_MBOFocus = 0;
|
||||
|
||||
|
||||
_IsStatic = true;
|
||||
_PhraseType = BRICK_TYPE::FABER;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ CFaberPhrase::CFaberPhrase()
|
|||
bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute )
|
||||
{
|
||||
H_AUTO(CFaberPhrase_build);
|
||||
|
||||
|
||||
// we are sure there is at least one brick and that there are non NULL;
|
||||
nlassert( !bricks.empty() );
|
||||
|
||||
|
@ -112,7 +112,7 @@ bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< con
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else*/ if( ( brick.Family >= BRICK_FAMILIES::BeginFaberOption && brick.Family <= BRICK_FAMILIES::EndFaberOption )
|
||||
else*/ if( ( brick.Family >= BRICK_FAMILIES::BeginFaberOption && brick.Family <= BRICK_FAMILIES::EndFaberOption )
|
||||
|| ( brick.Family >= BRICK_FAMILIES::BeginFaberCredit && brick.Family <= BRICK_FAMILIES::EndFaberCredit ) )
|
||||
{
|
||||
for ( uint j = 0 ; j < brick.Params.size() ; ++j)
|
||||
|
@ -120,7 +120,7 @@ bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< con
|
|||
const TBrickParam::IId* param = brick.Params[j];
|
||||
|
||||
switch(param->id())
|
||||
{
|
||||
{
|
||||
case TBrickParam::FOCUS:
|
||||
INFOLOG("FOCUS: %i",((CSBrickParamCraftFocus *)param)->Focus);
|
||||
_FocusCost += ((CSBrickParamCraftFocus *)param)->Focus;
|
||||
|
@ -217,10 +217,10 @@ bool CFaberPhrase::evaluate()
|
|||
bool CFaberPhrase::validate()
|
||||
{
|
||||
H_AUTO(CFaberPhrase_validate);
|
||||
|
||||
|
||||
if ( !CraftSystemEnabled )
|
||||
return false;
|
||||
|
||||
|
||||
CCharacter * c = (CCharacter *) CEntityBaseManager::getEntityBasePtr( _ActorRowId );
|
||||
if( c == 0 )
|
||||
{
|
||||
|
@ -234,7 +234,7 @@ bool CFaberPhrase::validate()
|
|||
return false;
|
||||
}
|
||||
|
||||
// check right hand item is a crafting tool
|
||||
// check right hand item is a crafting tool
|
||||
CGameItemPtr rightHandItem = c->getRightHandItem();
|
||||
if (rightHandItem == NULL || rightHandItem->getStaticForm() == NULL || rightHandItem->getStaticForm()->Family != ITEMFAMILY::CRAFTING_TOOL)
|
||||
{
|
||||
|
@ -249,8 +249,16 @@ bool CFaberPhrase::validate()
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
// check quality of right hand item (need be >= Recommended (level of item))
|
||||
if (rightHandItem->recommended()+49 < _Recommended)
|
||||
{
|
||||
PHRASE_UTILITIES::sendDynamicSystemMessage(_ActorRowId, "CRAFT_NEED_RECOMMENDED_CRAFTING_TOOL");
|
||||
return false;
|
||||
}
|
||||
|
||||
// entities cant craft if in combat
|
||||
/* commented as test of right hand item is now made...
|
||||
/* commented as test of right hand item is now made...
|
||||
TDataSetRow entityRowId = CPhraseManager::getInstance().getEntityEngagedMeleeBy( _ActorRowId );
|
||||
if (TheDataset.isAccessible(entityRowId))
|
||||
{
|
||||
|
@ -258,7 +266,7 @@ bool CFaberPhrase::validate()
|
|||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
const sint32 focus = c->getScores()._PhysicalScores[ SCORES::focus ].Current;
|
||||
if ( focus < _FocusCost )
|
||||
{
|
||||
|
@ -318,7 +326,7 @@ bool CFaberPhrase::update()
|
|||
void CFaberPhrase::execute()
|
||||
{
|
||||
H_AUTO(CFaberPhrase_execute);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar(_ActorRowId);
|
||||
if (!player)
|
||||
return;
|
||||
|
@ -336,13 +344,13 @@ void CFaberPhrase::execute()
|
|||
_FaberTime = (NLMISC::TGameCycle)(plan->CraftingDuration * 10);
|
||||
}
|
||||
nldebug("CFaberPhrase::execute> _FaberTime = %d",_FaberTime);
|
||||
|
||||
|
||||
const NLMISC::TGameCycle time = CTickEventHandler::getGameCycle();
|
||||
|
||||
|
||||
_ExecutionEndDate = time + _FaberTime ;
|
||||
|
||||
player->setCurrentAction(CLIENT_ACTION_TYPE::Faber,_ExecutionEndDate);
|
||||
player->staticActionInProgress(true);
|
||||
player->staticActionInProgress(true);
|
||||
|
||||
// set behaviour
|
||||
PHRASE_UTILITIES::sendUpdateBehaviour( _ActorRowId, MBEHAV::FABER );
|
||||
|
@ -366,7 +374,7 @@ bool CFaberPhrase::launch()
|
|||
void CFaberPhrase::apply()
|
||||
{
|
||||
H_AUTO(CFaberPhrase_apply);
|
||||
|
||||
|
||||
CCharacter * c = dynamic_cast< CCharacter * > ( CEntityBaseManager::getEntityBasePtr( _ActorRowId ) );
|
||||
if( c == 0 )
|
||||
{
|
||||
|
@ -410,7 +418,7 @@ void CFaberPhrase::apply()
|
|||
}
|
||||
|
||||
nbMp = (sint32)_MpsFormula.size();
|
||||
|
||||
|
||||
uint32 nbMpForumulaNeedeInPlan = 0;
|
||||
neededMp = (uint32)_RootFaberPlan->Faber->NeededMpsFormula.size();
|
||||
for( uint mp = 0; mp < neededMp; ++mp )
|
||||
|
@ -418,7 +426,7 @@ void CFaberPhrase::apply()
|
|||
//for each type of Mp needed
|
||||
nbMpForumulaNeedeInPlan += _RootFaberPlan->Faber->NeededMpsFormula[ mp ].Quantity;
|
||||
}
|
||||
|
||||
|
||||
if( nbMpForumulaNeedeInPlan != _MpsFormula.size() )
|
||||
{
|
||||
nlwarning("<CFaberPhrase::apply> Craft plan %s need %d Raw Material Formula and client send %d Raw Material Formula", c->getCraftPlan().toString().c_str(), _RootFaberPlan->Faber->NeededMpsFormula.size(), _MpsFormula.size() );
|
||||
|
@ -453,7 +461,7 @@ void CFaberPhrase::apply()
|
|||
stop();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
neededMp = (uint32)_RootFaberPlan->Faber->NeededMps.size();
|
||||
EGSPD::CPeople::TPeople civRestriction = _RootFaberPlan->CivRestriction;
|
||||
uint32 usedMp=0;
|
||||
|
@ -469,7 +477,7 @@ void CFaberPhrase::apply()
|
|||
{
|
||||
// for each Mp of one type (we have Quantity by type)
|
||||
uint32 NumMpParameters = (uint32)usedMps[u_mp]->Mp->MpFaberParameters.size();
|
||||
|
||||
|
||||
// for each Faber parameters in Mp
|
||||
for( uint j = 0; j < NumMpParameters; ++j )
|
||||
{
|
||||
|
@ -571,7 +579,7 @@ void CFaberPhrase::apply()
|
|||
CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const std::vector< NLMISC::CSheetId >& Mp, const std::vector< NLMISC::CSheetId >& MpFormula )
|
||||
{
|
||||
H_AUTO(CFaberPhrase_systemCraftItem);
|
||||
|
||||
|
||||
std::vector< const CStaticBrick* > bricks;
|
||||
_RootFaberPlan = CSheets::getSBrickForm( sheet );
|
||||
const CStaticBrick * rootFaberBricks = CSheets::getSBrickForm( CSheetId("bcpa01.sbrick") );
|
||||
|
@ -586,7 +594,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
|
|||
}
|
||||
|
||||
CGameItemPtr craftedItem = 0;
|
||||
|
||||
|
||||
if( _RootFaberPlan && _RootFaberPlan->Faber )
|
||||
{
|
||||
_CraftedItemStaticForm = CSheets::getForm( _RootFaberPlan->Faber->CraftedItem );
|
||||
|
@ -597,7 +605,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
|
|||
|
||||
bricks.push_back( rootFaberBricks );
|
||||
bricks.push_back( _RootFaberPlan );
|
||||
|
||||
|
||||
for( vector< NLMISC::CSheetId >::const_iterator it = Mp.begin(); it != Mp.end(); ++it )
|
||||
{
|
||||
const CStaticItem * mp = CSheets::getForm( (*it) );
|
||||
|
@ -626,7 +634,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
|
|||
}
|
||||
_MpsFormula.push_back( mp );
|
||||
}
|
||||
|
||||
|
||||
// Check quantity of gived Mps formula
|
||||
if( _RootFaberPlan->Faber->NeededMpsFormula.size() > _MpsFormula.size() )
|
||||
{
|
||||
|
@ -658,7 +666,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
|
|||
void CFaberPhrase::end()
|
||||
{
|
||||
H_AUTO(CFaberPhrase_end);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar(_ActorRowId);
|
||||
if (!player)
|
||||
return;
|
||||
|
@ -679,7 +687,7 @@ void CFaberPhrase::end()
|
|||
void CFaberPhrase::stop()
|
||||
{
|
||||
H_AUTO(CFaberPhrase_stop);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar(_ActorRowId);
|
||||
if (!player)
|
||||
return;
|
||||
|
@ -697,11 +705,11 @@ void CFaberPhrase::stop()
|
|||
} // stop //
|
||||
|
||||
|
||||
NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilités de reusir un item","<Nb simulations><level skill><item quality>")
|
||||
NLMISC_COMMAND(simuCraft, "Craft simulation to verify probabilities to succesfully craft an item","<Nb simulations><level skill><item quality>")
|
||||
{
|
||||
if (args.size() != 3)
|
||||
return false;
|
||||
|
||||
|
||||
uint32 nbSimu, skillLevel, itemQuality;
|
||||
NLMISC::fromString(args[0], nbSimu);
|
||||
NLMISC::fromString(args[1], skillLevel);
|
||||
|
@ -733,7 +741,7 @@ NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilit
|
|||
if(sf == 1.0f)
|
||||
{
|
||||
++nbFullSuccess;
|
||||
XpGain += CStaticSuccessTable::getXPGain(SUCCESS_TABLE_TYPE::Craft, deltaLvlXp);
|
||||
XpGain += CStaticSuccessTable::getXPGain(SUCCESS_TABLE_TYPE::Craft, deltaLvlXp);
|
||||
}
|
||||
else if( sf > 0.0f)
|
||||
{
|
||||
|
@ -747,7 +755,7 @@ NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilit
|
|||
nlinfo("FaberSimu: Results after %d roll: Sucess: %d (%.2f%%), partial sucess: %d (%.2f%%), Miss: %d (%.2f%%), Xp Gain %d",
|
||||
nbSimu,
|
||||
nbFullSuccess, 100.0f*nbFullSuccess/nbSimu,
|
||||
nbPartialSuccess, 100.0f*nbPartialSuccess/nbSimu,
|
||||
nbPartialSuccess, 100.0f*nbPartialSuccess/nbSimu,
|
||||
nbMiss, 100.0f*nbMiss/nbSimu,
|
||||
uint32(1000.f*XpGain / (nbSimu-nbMiss/2) ) );
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ CFgExtractionPhrase::CFgExtractionPhrase()
|
|||
bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute )
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_build);
|
||||
|
||||
|
||||
_ActorRowId = actorRowId;
|
||||
|
||||
// Check grammar
|
||||
|
@ -120,7 +120,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect
|
|||
for (std::vector<const CStaticBrick*>::const_iterator ib=bricks.begin(); ib!=bricks.end(); ++ib )
|
||||
{
|
||||
const CStaticBrick& brick = *(*ib);
|
||||
|
||||
|
||||
// Compute Sabrina credit and cost)
|
||||
if ( brick.SabrinaValue > 0 )
|
||||
sabrinaCost += brick.SabrinaValue;
|
||||
|
@ -156,7 +156,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect
|
|||
break;
|
||||
case TBrickParam::FG_SRC_PRD:
|
||||
INFOLOG("FG_SRC_PRD: %g",((CSBrickParamForagePeriod *)param)->Period);
|
||||
if ( ((CSBrickParamForagePeriod *)param)->Period != 0 )
|
||||
if ( ((CSBrickParamForagePeriod *)param)->Period != 0 )
|
||||
_RequestedProps[CHarvestSource::S] = 1.0f / (((CSBrickParamForagePeriod *)param)->Period * 10.0f); // period converted from second to tick
|
||||
else
|
||||
_RequestedProps[CHarvestSource::S] = 1.0f;
|
||||
|
@ -231,7 +231,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect
|
|||
|
||||
//nlerror( "TODO: Families" );
|
||||
//if ( brick.Family >= BRICK_FAMILIES::BeginForage
|
||||
|
||||
|
||||
//insertProgressingSkill( brick.Skill, brick.SheetId );
|
||||
}
|
||||
|
||||
|
@ -432,7 +432,7 @@ bool CFgExtractionPhrase::evaluate()
|
|||
bool CFgExtractionPhrase::validate()
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_validate);
|
||||
|
||||
|
||||
if ( ! HarvestSystemEnabled )
|
||||
return false;
|
||||
|
||||
|
@ -544,6 +544,15 @@ bool CFgExtractionPhrase::validate()
|
|||
return false; // has disappeared
|
||||
}
|
||||
|
||||
// test if tool have enough quality
|
||||
sint depositQ = (sint)harvestSource->forageSite()->deposit()->maxQuality();
|
||||
|
||||
if ((depositQ > 0) && (item->recommended()+49 < depositQ))
|
||||
{
|
||||
PHRASE_UTILITIES::sendDynamicSystemMessage(_ActorRowId, "FORAGE_TOOL_QUALITY_TOO_LOW");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check the distance from the player to the source (ignoring Z because for tunnel case, player couldn't target the source)
|
||||
const CEntityState& state = player->getState();
|
||||
CVector2f playerPos( (float)state.X / 1000.0f, (float)state.Y / 1000.0f );
|
||||
|
@ -589,7 +598,7 @@ bool CFgExtractionPhrase::validate()
|
|||
bool CFgExtractionPhrase::update()
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_update);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar( _ActorRowId );
|
||||
if ( ! player )
|
||||
return false;
|
||||
|
@ -600,7 +609,7 @@ bool CFgExtractionPhrase::update()
|
|||
if( idle() )
|
||||
{
|
||||
idle(false);
|
||||
|
||||
|
||||
// check if actor can use action
|
||||
CBypassCheckFlags bypassCheckFlags = CBypassCheckFlags::NoFlags;
|
||||
if (player->canEntityUseAction(bypassCheckFlags,false) == false)
|
||||
|
@ -633,7 +642,7 @@ bool CFgExtractionPhrase::update()
|
|||
void CFgExtractionPhrase::execute()
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_execute);
|
||||
|
||||
|
||||
// Get character
|
||||
CCharacter* player = PlayerManager.getChar( _ActorRowId );
|
||||
if (!player)
|
||||
|
@ -676,7 +685,7 @@ void CFgExtractionPhrase::execute()
|
|||
void CFgExtractionPhrase::end()
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_end);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar(_ActorRowId);
|
||||
if (!player)
|
||||
return;
|
||||
|
@ -694,7 +703,7 @@ void CFgExtractionPhrase::end()
|
|||
void CFgExtractionPhrase::stop()
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_stop);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar(_ActorRowId);
|
||||
if (!player)
|
||||
return;
|
||||
|
@ -742,7 +751,7 @@ bool CFgExtractionPhrase::launch()
|
|||
void CFgExtractionPhrase::apply()
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_apply);
|
||||
|
||||
|
||||
CCharacter* player = PlayerManager.getChar( _ActorRowId );
|
||||
if (!player)
|
||||
return;
|
||||
|
@ -778,7 +787,7 @@ void CFgExtractionPhrase::apply()
|
|||
void CFgExtractionPhrase::applyExtraction( CCharacter *player, float successFactor )
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_applyExtraction);
|
||||
|
||||
|
||||
nlassert( _Source );
|
||||
if ( ! player->forageProgress() )
|
||||
return;
|
||||
|
@ -801,7 +810,7 @@ void CFgExtractionPhrase::applyExtraction( CCharacter *player, float successFact
|
|||
player->forageProgress()->fillFromExtraction( _Props.Extraction.ObtainedProps[CHarvestSource::A], _Props.Extraction.ObtainedProps[CHarvestSource::Q], player );
|
||||
else
|
||||
return;
|
||||
|
||||
|
||||
// Report result of action
|
||||
if ( propDrop != CHarvestSource::NoDrop )
|
||||
{
|
||||
|
@ -864,7 +873,7 @@ struct CNonNullGameItemPtrPred : std::unary_function<CGameItemPtr,bool>
|
|||
void CFgExtractionPhrase::doKamiOffering( CCharacter *player )
|
||||
{
|
||||
H_AUTO(CFgExtractionPhrase_doKamiOffering);
|
||||
|
||||
|
||||
// Count the number of non empty slots
|
||||
// const vector<CGameItemPtr> &theBag = player->getInventory()[INVENTORIES::bag]()->getChildren();
|
||||
CInventoryPtr theBag = player->getInventory(INVENTORIES::bag);
|
||||
|
@ -912,7 +921,7 @@ void CFgExtractionPhrase::doKamiOffering( CCharacter *player )
|
|||
(*ib)->getSheetId().toString().c_str());
|
||||
*/
|
||||
// EGSPD::forageKamiItemOffering(player->getId(), _Source->depositForK()->name(), _Source->depositForK()->kamiAnger(), _Props.Care.KamiAngerDec[CHarvestSource::KamiAngerDec], item->getSheetId().toString());
|
||||
|
||||
|
||||
// TODO: quantity, filter, etc.
|
||||
// player->destroyItem( INVENTORIES::bag, ib-theBag.begin(), 1/*(*ib).quantity()*/, false );
|
||||
theBag->deleteItem(i);
|
||||
|
|
|
@ -675,6 +675,9 @@ CCharacter::CCharacter(): CEntityBase(false),
|
|||
|
||||
_FriendVisibility = VisibleToAll;
|
||||
|
||||
_LangChannel = "en";
|
||||
_NewTitle = "Refugee";
|
||||
|
||||
initDatabase();
|
||||
} // CCharacter //
|
||||
|
||||
|
@ -699,6 +702,7 @@ void CCharacter::clear()
|
|||
_ForbidAuraUseStartDate=0;
|
||||
_ForbidAuraUseEndDate=0;
|
||||
_Title= CHARACTER_TITLE::Refugee;
|
||||
_NewTitle = "Refugee";
|
||||
|
||||
SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,0);
|
||||
SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatColor,0);
|
||||
|
@ -3851,9 +3855,9 @@ void CCharacter::sendBetaTesterStatus()
|
|||
|
||||
sendReservedTitleStatus( CHARACTER_TITLE::FBT, p->isBetaTester() );
|
||||
|
||||
if (!p->isBetaTester() && _Title == CHARACTER_TITLE::FBT)
|
||||
if (!p->isBetaTester() && _NewTitle == "FBT")
|
||||
{
|
||||
_Title = CHARACTER_TITLE::Refugee;
|
||||
_NewTitle = "Refugee";
|
||||
registerName();
|
||||
}
|
||||
}
|
||||
|
@ -3869,9 +3873,9 @@ void CCharacter::sendWindermeerStatus()
|
|||
|
||||
sendReservedTitleStatus( CHARACTER_TITLE::WIND, p->isWindermeerCommunity() );
|
||||
|
||||
if ( !p->isWindermeerCommunity() && _Title == CHARACTER_TITLE::WIND)
|
||||
if ( !p->isWindermeerCommunity() && _NewTitle == "WIND")
|
||||
{
|
||||
_Title = CHARACTER_TITLE::Refugee;
|
||||
_NewTitle = "Refugee";
|
||||
registerName();
|
||||
}
|
||||
}
|
||||
|
@ -6963,11 +6967,11 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
|
|||
CBankAccessor_PLR::getCHARACTER_INFO().getRING_XP_CATALYSER().setCount(_PropertyDatabase, checkedCast<uint16>(ringCatalyserCount) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!p->isTrialPlayer())
|
||||
{
|
||||
xpBonus = XpGain;
|
||||
if (!p->isTrialPlayer())
|
||||
{
|
||||
xpBonus = XpGain;
|
||||
}
|
||||
}
|
||||
|
||||
XpGain += xpBonus + ringXpBonus;
|
||||
|
@ -7081,7 +7085,7 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
|
|||
SM_STATIC_PARAMS_3(paramsP, STRING_MANAGER::skill, STRING_MANAGER::integer, STRING_MANAGER::integer);
|
||||
paramsP[0].Enum = skillEnum;
|
||||
paramsP[1].Int = max((sint32)1, sint32(100*XpGain) );
|
||||
paramsP[2].Int = max((sint32)1, sint32(100*(XpGain - (xpBonus+ringXpBonus))) );
|
||||
paramsP[2].Int = max((sint32)1, sint32(100*(XpGain - xpBonus - ringXpBonus)));
|
||||
PHRASE_UTILITIES::sendDynamicSystemMessage(_EntityRowId, "XP_CATALYSER_PROGRESS_NORMAL_GAIN", paramsP);
|
||||
|
||||
if( xpBonus > 0 )
|
||||
|
@ -7329,11 +7333,18 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
|
|||
return XpGainRemainder;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------
|
||||
// CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill
|
||||
//-----------------------------------------------
|
||||
void CCharacter::setSkillsToMaxValue()
|
||||
{
|
||||
setSkillsToValue(-1);
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
// CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill
|
||||
//-----------------------------------------------
|
||||
void CCharacter::setSkillsToValue(const sint32& value)
|
||||
{
|
||||
// get pointer on static skills tree definition
|
||||
CSheetId sheet("skills.skill_tree");
|
||||
|
@ -7342,16 +7353,31 @@ void CCharacter::setSkillsToMaxValue()
|
|||
|
||||
for( uint i = 0; i < SKILLS::NUM_SKILLS; ++i )
|
||||
{
|
||||
_Skills._Skills[ i ].Base = SkillsTree->SkillsTree[ i ].MaxSkillValue;
|
||||
_Skills._Skills[ i ].Base = (value < 0) ? SkillsTree->SkillsTree[ i ].MaxSkillValue : min( value, (sint32)SkillsTree->SkillsTree[ i ].MaxSkillValue );
|
||||
_Skills._Skills[ i ].Current = SkillsTree->SkillsTree[ i ].MaxSkillValue + _Skills._Skills[ i ].Modifier;
|
||||
// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.Skill[i], _Skills._Skills[ i ].Current );
|
||||
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Current) );
|
||||
// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.BaseSkill[i], _Skills._Skills[ i ].Base );
|
||||
_Skills._Skills[ i ].MaxLvlReached = _Skills._Skills[ i ].Current;
|
||||
|
||||
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Base) );
|
||||
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Current) );
|
||||
|
||||
// update all parent skill with new max children
|
||||
SKILLS::ESkills skillUpdated = (SKILLS::ESkills)i;
|
||||
while( SkillsTree->SkillsTree[ skillUpdated ].ParentSkill != SKILLS::unknown )
|
||||
{
|
||||
if( _Skills._Skills[ i ].Base > _Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached )
|
||||
{
|
||||
_Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxLvlReached = _Skills._Skills[ i ].Base;
|
||||
_Skills._Skills[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].Base = min( _Skills._Skills[ skillUpdated ].Base, (sint32)SkillsTree->SkillsTree[ SkillsTree->SkillsTree[ skillUpdated ].ParentSkill ].MaxSkillValue );
|
||||
skillUpdated = SkillsTree->SkillsTree[ skillUpdated ].ParentSkill;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------
|
||||
// CCharacter::sendDynamicSystemMessage
|
||||
//-----------------------------------------------
|
||||
|
@ -7949,6 +7975,7 @@ void CCharacter::setStartStatistics( const CCreateCharMsg& createCharMsg )
|
|||
_Race = (EGSPD::CPeople::TPeople) createCharMsg.People;
|
||||
_Gender = createCharMsg.Sex;
|
||||
_Title = CHARACTER_TITLE::Refugee;
|
||||
_NewTitle = "Refugee";
|
||||
|
||||
// fame information
|
||||
// Players start out as Neutral in their declared clans
|
||||
|
@ -9787,7 +9814,7 @@ bool CCharacter::queryItemPrice( const CGameItemPtr item, uint32& price )
|
|||
quality = theItem->quality();
|
||||
if ( theItem->maxDurability() )
|
||||
wornFactor = float(theItem->durability()) / float(theItem->maxDurability());
|
||||
price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor );
|
||||
price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -10214,6 +10241,35 @@ void CCharacter::initPvpPointDb()
|
|||
CBankAccessor_PLR::getUSER().getRRPS_LEVELS(0).setVALUE(_PropertyDatabase, _PvpPoint );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setLangChannel(const string &lang) {
|
||||
_LangChannel = lang;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setNewTitle(const string &title) {
|
||||
_NewTitle = title;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setTagPvPA(const string &tag) {
|
||||
_TagPvPA = tag;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setTagPvPB(const string &tag) {
|
||||
_TagPvPB = tag;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setTagA(const string &tag) {
|
||||
_TagA = tag;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setTagB(const string &tag) {
|
||||
_TagB = tag;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCharacter::setOrganization(uint32 org)
|
||||
|
@ -12895,7 +12951,7 @@ void CCharacter::registerName(const ucstring &newName)
|
|||
CMessage msgName("CHARACTER_NAME_LANG");
|
||||
msgName.serial(_EntityRowId);
|
||||
|
||||
string sTitle = CHARACTER_TITLE::toString(_Title);
|
||||
string sTitle = getFullTitle();
|
||||
ucstring RegisteredName;
|
||||
if (newName.empty())
|
||||
RegisteredName = getName() + string("$") + sTitle + string("$");
|
||||
|
@ -16161,15 +16217,30 @@ void CCharacter::applyGooDamage( float gooDistance )
|
|||
if (hpLost < 1) hpLost = 1;
|
||||
if( hpLost > _PhysScores._PhysicalScores[ SCORES::hit_points ].Current )
|
||||
{
|
||||
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0;
|
||||
// send message to player for inform is dead by goo
|
||||
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO");
|
||||
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0;
|
||||
|
||||
// send message to player for inform is dead by goo or other
|
||||
if (_CurrentContinent == CONTINENT::FYROS)
|
||||
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_FIRE");
|
||||
else if (_CurrentContinent == CONTINENT::TRYKER)
|
||||
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_STEAM");
|
||||
else if (_CurrentContinent == CONTINENT::MATIS)
|
||||
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_POISON");
|
||||
else
|
||||
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO");
|
||||
}
|
||||
else
|
||||
{
|
||||
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = _PhysScores._PhysicalScores[ SCORES::hit_points ].Current - hpLost;
|
||||
// send message to player for inform is suffer goo damage
|
||||
sendDynamicSystemMessage(_EntityRowId, "SUFFER_GOO_DAMAGE");
|
||||
if (_CurrentContinent == CONTINENT::FYROS)
|
||||
sendDynamicSystemMessage(_EntityRowId, "SUFFER_FIRE_DAMAGE");
|
||||
else if (_CurrentContinent == CONTINENT::TRYKER)
|
||||
sendDynamicSystemMessage(_EntityRowId, "SUFFER_STEAM_DAMAGE");
|
||||
else if (_CurrentContinent == CONTINENT::MATIS)
|
||||
sendDynamicSystemMessage(_EntityRowId, "SUFFER_POISON_DAMAGE");
|
||||
else
|
||||
sendDynamicSystemMessage(_EntityRowId, "SUFFER_GOO_DAMAGE");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19057,7 +19128,7 @@ void CCharacter::setStartupInstance(uint32 instanceId)
|
|||
|
||||
void CCharacter::setTitle( CHARACTER_TITLE::ECharacterTitle title )
|
||||
{
|
||||
_Title = title;
|
||||
setNewTitle(CHARACTER_TITLE::toString(title));
|
||||
}
|
||||
|
||||
|
||||
|
@ -20736,4 +20807,4 @@ bool CCharacter::initPetInventory(uint8 index)
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -890,6 +890,9 @@ public:
|
|||
// Set skill tree of character to max value of each skill
|
||||
void setSkillsToMaxValue();
|
||||
|
||||
// Set skill tree of character to specified value
|
||||
void setSkillsToValue(const sint32& value);
|
||||
|
||||
// for respawn management, need to modify _TimeDeath in cbTpAcknownledge callback
|
||||
NLMISC::TGameTime& getTimeOfDeath();
|
||||
void setTimeOfDeath( NLMISC::TGameTime t);
|
||||
|
@ -2392,6 +2395,27 @@ public:
|
|||
uint32 getLastConnectedTime() const;
|
||||
uint32 getLastConnectedDate() const;
|
||||
uint32 getPlayedTime() const;
|
||||
|
||||
const std::string& getLangChannel() const;
|
||||
void setLangChannel(const std::string &lang);
|
||||
|
||||
const std::string& getNewTitle() const;
|
||||
void setNewTitle(const std::string &title);
|
||||
|
||||
std::string getFullTitle() const;
|
||||
|
||||
std::string getTagA() const;
|
||||
void setTagA(const std::string &tag);
|
||||
|
||||
std::string getTagB() const;
|
||||
void setTagB(const std::string &tag);
|
||||
|
||||
std::string getTagPvPA() const;
|
||||
void setTagPvPA(const std::string &tag);
|
||||
|
||||
std::string getTagPvPB() const;
|
||||
void setTagPvPB(const std::string &tag);
|
||||
|
||||
uint32 getOrganization() const;
|
||||
uint32 getOrganizationStatus() const;
|
||||
const std::list<TCharacterLogTime>& getLastLogStats() const;
|
||||
|
@ -3032,6 +3056,14 @@ private:
|
|||
uint32 _OrganizationStatus;
|
||||
uint32 _OrganizationPoints;
|
||||
|
||||
std::string _LangChannel;
|
||||
|
||||
std::string _NewTitle;
|
||||
std::string _TagPvPA;
|
||||
std::string _TagPvPB;
|
||||
std::string _TagA;
|
||||
std::string _TagB;
|
||||
|
||||
/// SDB path where player wins HoF points in PvP (if not empty)
|
||||
std::string _SDBPvPPath;
|
||||
|
||||
|
|
|
@ -894,6 +894,67 @@ inline uint32 CCharacter::getPlayedTime() const
|
|||
return _PlayedTime;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline const std::string& CCharacter::getLangChannel() const
|
||||
|
||||
{
|
||||
return _LangChannel;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline const std::string& CCharacter::getNewTitle() const
|
||||
|
||||
{
|
||||
return _NewTitle;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline std::string CCharacter::getTagA() const
|
||||
|
||||
{
|
||||
if (_TagA.empty())
|
||||
return "_";
|
||||
return _TagA;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline std::string CCharacter::getTagB() const
|
||||
|
||||
{
|
||||
if (_TagB.empty())
|
||||
return "_";
|
||||
return _TagB;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline std::string CCharacter::getTagPvPA() const
|
||||
|
||||
{
|
||||
if (_TagPvPA.empty())
|
||||
return "_";
|
||||
return _TagPvPA;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline std::string CCharacter::getTagPvPB() const
|
||||
|
||||
{
|
||||
if (_TagPvPB.empty())
|
||||
return "_";
|
||||
return _TagPvPB;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
inline std::string CCharacter::getFullTitle() const
|
||||
{
|
||||
if (!_TagA.empty() || !_TagB.empty() || !_TagPvPA.empty() || !_TagPvPB.empty())
|
||||
return _NewTitle+"#"+getTagPvPA()+"#"+getTagPvPB()+"#"+getTagA()+"#"+getTagB();
|
||||
else
|
||||
return _NewTitle;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
inline uint32 CCharacter::getOrganization() const
|
||||
|
|
|
@ -321,8 +321,8 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
|
|||
H_AUTO(CCharacterStore);\
|
||||
CFameManager::getInstance().savePlayerFame(_Id, const_cast<EGSPD::CFameContainerPD &>(*_Fames));\
|
||||
/* Update the current playing session duration */ \
|
||||
if (_LastLogStats.size() > 0) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime; \
|
||||
else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?"); \
|
||||
if (!_LastLogStats.empty()) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime;\
|
||||
else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?");\
|
||||
\
|
||||
/* Unless the top of the position stack is locked, */ \
|
||||
/* update the stored position stack with the current position */ \
|
||||
|
@ -415,6 +415,7 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
|
|||
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)\
|
||||
PROP2(_LangChannel,string,_LangChannel,_LangChannel=val)\
|
||||
PROP(uint32,_Organization)\
|
||||
PROP(uint32,_OrganizationStatus)\
|
||||
PROP(uint32,_OrganizationPoints)\
|
||||
|
@ -438,6 +439,11 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
|
|||
PROP_GAME_CYCLE_COMP(_ForbidAuraUseStartDate)\
|
||||
PROP_GAME_CYCLE_COMP(_ForbidAuraUseEndDate)\
|
||||
PROP2(_Title, string, CHARACTER_TITLE::toString(getTitle()), setTitle(CHARACTER_TITLE::toCharacterTitle(val)))\
|
||||
PROP2(_NewTitle, string, _NewTitle, _NewTitle=val)\
|
||||
PROP2(_TagPvPA, string, _TagPvPA, _TagPvPA=val)\
|
||||
PROP2(_TagPvPB, string, _TagPvPB, _TagPvPB=val)\
|
||||
PROP2(_TagA, string, _TagA, _TagA=val)\
|
||||
PROP2(_TagB, string, _TagB, _TagB=val)\
|
||||
\
|
||||
/* Visual Properties */\
|
||||
PROP2(HairType, uint8, _VisualPropertyA().PropertySubData.HatModel, SET_STRUCT_MEMBER(_VisualPropertyA,PropertySubData.HatModel,val))\
|
||||
|
|
|
@ -230,6 +230,22 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
|
|||
}
|
||||
}
|
||||
|
||||
// Add lang channel
|
||||
if (!user->getLangChannel().empty()) {
|
||||
TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find(user->getLangChannel());
|
||||
if (it != _ExtraFactionChannel.end())
|
||||
{
|
||||
result.push_back((*it).second);
|
||||
}
|
||||
} else {
|
||||
TMAPExtraFactionChannel::iterator it = _ExtraFactionChannel.find("en");
|
||||
if (it != _ExtraFactionChannel.end())
|
||||
{
|
||||
result.push_back((*it).second);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
bool matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000;
|
||||
bool fyros = CFameInterface::getInstance().getFameIndexed(user->getId(), 1) >= PVPFameRequired*6000;
|
||||
bool tryker = CFameInterface::getInstance().getFameIndexed(user->getId(), 2) >= PVPFameRequired*6000;
|
||||
|
@ -279,7 +295,7 @@ std::vector<TChanID> CPVPManager2::getCharacterChannels(CCharacter * user)
|
|||
result.push_back((*it).second);
|
||||
}
|
||||
}
|
||||
// }
|
||||
*/
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1088,10 +1104,19 @@ bool CPVPManager2::addFactionWar( PVP_CLAN::TPVPClan clan1, PVP_CLAN::TPVPClan c
|
|||
void CPVPManager2::onIOSMirrorUp()
|
||||
{
|
||||
// create extra factions channels
|
||||
/*
|
||||
createExtraFactionChannel("hominists");
|
||||
createExtraFactionChannel("urasies");
|
||||
createExtraFactionChannel("marauders");
|
||||
createExtraFactionChannel("agnos");
|
||||
*/
|
||||
|
||||
// Community Channels
|
||||
createExtraFactionChannel("en");
|
||||
createExtraFactionChannel("fr");
|
||||
createExtraFactionChannel("de");
|
||||
createExtraFactionChannel("ru");
|
||||
createExtraFactionChannel("es");
|
||||
|
||||
for (uint i = PVP_CLAN::BeginClans; i <= PVP_CLAN::EndClans; i++)
|
||||
{
|
||||
|
|
|
@ -1508,7 +1508,7 @@ bool CZoneManager::getPlace( sint32 x, sint32 y, float& gooDistance, const CPlac
|
|||
}
|
||||
for (uint k = 0; k < _Continents[i].getRegions()[j]->getPlaces().size(); k++ )
|
||||
{
|
||||
if( _Continents[i].getRegions()[j]->getPlaces()[k]->isGooPath() == false )
|
||||
if(!_Continents[i].getRegions()[j]->getPlaces()[k]->isGooActive())
|
||||
{
|
||||
if ( _Continents[i].getRegions()[j]->getPlaces()[k]->contains( vect ) )
|
||||
{
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
// TODO: check if good
|
||||
static bool exists( const TDataSetRow& entityIndex );
|
||||
static const NLMISC::CEntityId& getEntityId( const TDataSetRow& entityIndex );
|
||||
static const uint16 getTeamId(const TDataSetRow& entityIndex);
|
||||
static uint16 getTeamId(const TDataSetRow& entityIndex);
|
||||
|
||||
static CAICoord x( const TDataSetRow& entityIndex );
|
||||
static CAICoord y( const TDataSetRow& entityIndex );
|
||||
|
|
Loading…
Reference in a new issue