Changed: Synchronization with SVN

This commit is contained in:
kervala 2012-10-05 14:57:05 +02:00
parent 0d382e9034
commit e8b1eedc97
19 changed files with 475 additions and 133 deletions

View file

@ -532,7 +532,10 @@ static CMessage getFileClassImp( CMessage& msgin)
for (uint j=0; j<classes[i].size(); ++j) 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)); fdc.addFile(classes[i][j].File, CFile::getFileModificationDate(rfile),CFile::getFileSize(rfile));
} }
} }

View file

@ -181,6 +181,7 @@ AdminCommandsInit[] =
"validateRespawnPoint", true, "validateRespawnPoint", true,
"summonPet", true, "summonPet", true,
"connectUserChannel", true, "connectUserChannel", true,
"connectLangChannel", true,
"updateTarget", true, "updateTarget", true,
"resetName", true, "resetName", true,
"showOnline", true, "showOnline", true,
@ -1126,6 +1127,8 @@ ENTITY_VARIABLE(Position, "Position of a player (in meter) <eid> <posx>,<posy>[,
vector<string> res; vector<string> res;
sint32 x = 0, y = 0, z = 0; sint32 x = 0, y = 0, z = 0;
sint32 cell = 0;
if (get) if (get)
{ {
x = e->getState().X() / 1000; 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); x = entityBase->getState().X + sint32 (cos (entityBase->getState ().Heading) * 2000);
y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000); y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000);
z = entityBase->getState().Z; 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 // season included
uint8 season; uint8 season;
NLMISC::fromString(res[3], 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 else
{ {
c->teleportCharacter(x,y,z,true); c->teleportCharacter(x,y,z,true, false, 0.f, 0xFF, cell);
} }
if ( cont ) if ( cont )
@ -3780,7 +3787,7 @@ NLMISC_COMMAND( monitorMissions, "monitor a player missions", "<CSR id><player n
CHECK_RIGHT( c,target ); CHECK_RIGHT( c,target );
// CSR must have no missions to monitor a player // 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" ); CCharacter::sendDynamicSystemMessage( c->getEntityRowId() , "CSR_HAS_MISSION" );
return true; 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", "") NLMISC_COMMAND (setGMGuild, "set the current GM guild", "")
{ {
if ( args.size() != 1 )
return false;
GET_CHARACTER; GET_CHARACTER;
uint32 guildId = c->getGuildId(); uint32 guildId = c->getGuildId();
CGuildManager::getInstance()->setGMGuild( guildId ); CGuildManager::getInstance()->setGMGuild( guildId );
@ -4450,8 +4455,8 @@ NLMISC_COMMAND (connectUserChannel, "Connect to user channels", "<user id> <chan
CPVPManager2 *inst = CPVPManager2::getInstance(); CPVPManager2 *inst = CPVPManager2::getInstance();
string pass; string pass;
string name = args[1]; string name = toLower(args[1]);
TChanID channel = CPVPManager2::getInstance()->getUserDynChannel(name); TChanID channel = inst->getUserDynChannel(name);
if (args.size() < 3) if (args.size() < 3)
pass = toLower(name); 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>") NLMISC_COMMAND (updateTarget, "Update current target", "<user id>")
{ {
GET_CHARACTER GET_CHARACTER
@ -4601,9 +4638,15 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
GET_CHARACTER GET_CHARACTER
bool new_check = false; 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_check = true;
// New separator "|"
if (args.size() >= 6 && (args[5] == "2" || args[5] == "3"))
new_separator = true;
bool next_step = false; bool next_step = false;
if (args.size() >= 7 && args[6] == "1") if (args.size() >= 7 && args[6] == "1")
next_step = true; 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; 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()) if (command_args.empty())
return false; return false;
@ -5317,8 +5363,10 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
uint32 value; uint32 value;
fromString(command_args[2], value); fromString(command_args[2], value);
if (target)
target->setHairColor(value); target->setHairColor(value);
else
return false;
} }
//************************************************* //*************************************************
@ -5468,12 +5516,35 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
//************************************************* //*************************************************
//***************** set_title //***************** set_title
//************************************************* //*************************************************
// /a webExecCommand debug 1 set_title!toto hmac 0
else if (command_args[0] == "set_title") else if (command_args[0] == "set_title")
{ {
if (command_args.size () != 2) return false; if (command_args.size () != 2) return false;
TDataSetRow row = c->getEntityRowId(); 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"); NLNET::CMessage msgout("CHARACTER_NAME");
msgout.serial(row); msgout.serial(row);
msgout.serial(name); msgout.serial(name);
@ -5500,6 +5571,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
vector<string> res; vector<string> res;
sint32 x = 0, y = 0, z = 0; sint32 x = 0, y = 0, z = 0;
float h = 0; float h = 0;
sint32 cell;
if ( value.find(',') != string::npos ) // Position x,y,z,a if ( value.find(',') != string::npos ) // Position x,y,z,a
{ {
explode (value, string(","), res); 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); y = entityBase->getState().Y + sint32 (sin (entityBase->getState ().Heading) * 2000);
z = entityBase->getState().Z; z = entityBase->getState().Z;
h = entityBase->getState().Heading; 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->applyRespawnEffects();
} }
c->teleportCharacter(x,y,z,allowPetTp,true,h); c->teleportCharacter(x,y,z,allowPetTp,true,h,0xFF,cell);
if ( cont ) if ( cont )
{ {
@ -5903,6 +5979,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
{ {
if (send_url) if (send_url)
c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_faction_points", getSalt()); c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_faction_points", getSalt());
return true;
} }
} }
else if (action=="set") else if (action=="set")
@ -5941,6 +6018,7 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", "<user id> <web_app_url
{ {
if (send_url) if (send_url)
c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_pvp_points", getSalt()); c->sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=no_enough_pvp_points", getSalt());
return true;
} }
} }
else if (action=="set") 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 //***************** missions
//************************************************* //*************************************************
@ -6921,7 +7044,7 @@ NLMISC_COMMAND(setChanHistoricSize, "Set size of the historic for a localized ch
// add a client to a channel // 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)]") 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 GET_CHARACTER
TChanID chanID = DynChatEGS.getChanIDFromName(args[1]); TChanID chanID = DynChatEGS.getChanIDFromName(args[1]);
if (chanID == DYN_CHAT_INVALID_CHAN) if (chanID == DYN_CHAT_INVALID_CHAN)

View file

@ -89,7 +89,15 @@ bool IBuildingPhysical::addUser(CCharacter * user, uint16 roomIdx, uint16 ownerI
return false; return false;
} }
if (user->currentHp() <= 0 )
{
nlwarning("<BUILDING>user %s is dead",user->getId().toString().c_str());
return false;
}
CCharacter *owner; CCharacter *owner;
if (ownerIdx < _Players.size()) if (ownerIdx < _Players.size())
{ {
owner = PlayerManager.getChar(_Players[ownerIdx] ); owner = PlayerManager.getChar(_Players[ownerIdx] );

View file

@ -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 ) void cbClientGuildMotd( NLNET::CMessage& msgin, const std::string &serviceName, NLNET::TServiceId serviceId )
{ {
H_AUTO(cbClientGuildMotd); 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 // 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(); c->registerName();
} }

View file

@ -4321,41 +4321,7 @@ NLMISC_COMMAND(setAllSkillsToValue,"set all skills to value","<entity id(id:type
if( e ) if( e )
{ {
log.displayNL("Player %s skills are all set to value %u", id.toString().c_str(), value); log.displayNL("Player %s skills are all set to value %u", id.toString().c_str(), value);
// get pointer on static skills tree definition e->setSkillsToValue(value);
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) );
}
} }
else else
{ {

View file

@ -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()); nlwarning("<CGuildMemberModule::setMOTD>%s invalid member id %s",eId.toString().c_str());
return; 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(); EGSPD::CGuildGrade::TGuildGrade memberGrade = member->getGrade();
if( memberGrade >= EGSPD::CGuildGrade::Member) if( memberGrade >= EGSPD::CGuildGrade::Member)
{ {
@ -255,9 +265,10 @@ void CGuild::setMOTD( const std::string& motd, const NLMISC::CEntityId& eId)
if(!_MessageOfTheDay.empty()) if(!_MessageOfTheDay.empty())
{ {
// Show new MOTD to all members
SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal); SM_STATIC_PARAMS_1(params, STRING_MANAGER::literal);
params[0].Literal= _MessageOfTheDay; params[0].Literal= _MessageOfTheDay;
CCharacter::sendDynamicMessageToChatGroup(user->getEntityRowId(), "GMOTD", CChatGroup::guild, params); sendMessageToGuildChat("GMOTD", params);
} }
} }
else else
@ -1408,6 +1419,25 @@ void CGuild::sendMessageToGuildMembers( const std::string & msg, const TVectorP
IGuildUnifier::getInstance()->sendMessageToGuildMembers(this, msg, params); 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 ) void CGuild::setMemberClientDB( CGuildMember* member )
{ {

View file

@ -165,6 +165,8 @@ public:
void addMemberToGuildChat(CGuildMember *member); void addMemberToGuildChat(CGuildMember *member);
/// send a message to all members /// send a message to all members
void sendMessageToGuildMembers( const std::string & msg, const TVectorParamCheck & params = TVectorParamCheck() )const; 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 /// set information relative to a member in the guild client database
void setMemberClientDB( CGuildMember* member ); void setMemberClientDB( CGuildMember* member );
/// return the best online user /// return the best online user

View file

@ -215,9 +215,7 @@ 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)

View file

@ -121,7 +121,7 @@ NLMISC_COMMAND(outpostSimulateTimer0End, "", "<outpost_id> [<absolute end time>
if (args.size()>1) if (args.size()>1)
{ {
NLMISC::fromString(args[1], endTime); NLMISC::fromString(args[1], endTime);
if (args[1][0]=='+') if (args[1].find('+')==0)
endTime += CTime::getSecondsSince1970(); endTime += CTime::getSecondsSince1970();
} }
if (endTime==0) endTime = 1; if (endTime==0) endTime = 1;
@ -144,7 +144,7 @@ NLMISC_COMMAND(outpostSimulateTimer1End, "", "<outpost_id> [<absolute end time>
if (args.size()>1) if (args.size()>1)
{ {
NLMISC::fromString(args[1], endTime); NLMISC::fromString(args[1], endTime);
if (args[1][0]=='+') if (args[1].find('+')==0)
endTime += CTime::getSecondsSince1970(); endTime += CTime::getSecondsSince1970();
} }
if (endTime==0) endTime = 1; if (endTime==0) endTime = 1;
@ -167,7 +167,7 @@ NLMISC_COMMAND(outpostSimulateTimer2End, "", "<outpost_id> [<absolute end time>
if (args.size()>1) if (args.size()>1)
{ {
NLMISC::fromString(args[1], endTime); NLMISC::fromString(args[1], endTime);
if (args[1][0]=='+') if (args[1].find('+')==0)
endTime += CTime::getSecondsSince1970(); endTime += CTime::getSecondsSince1970();
} }
if (endTime==0) endTime = 1; if (endTime==0) endTime = 1;

View file

@ -281,7 +281,7 @@ public:
} }
else else
{ {
c->wearRightHandItem(); c->wearRightHandItem(phrase->getMps().size()/10);
// report Xp Gain unless used tool is worned // report Xp Gain unless used tool is worned
PROGRESSIONPVE::CCharacterProgressionPVE::getInstance()->actionReport( report, true, false ); PROGRESSIONPVE::CCharacterProgressionPVE::getInstance()->actionReport( report, true, false );

View file

@ -54,7 +54,7 @@ CFaberPhrase::CFaberPhrase()
_CraftedItemStaticForm = 0; _CraftedItemStaticForm = 0;
_RootFaberBricks = false; _RootFaberBricks = false;
_RootFaberPlan = 0; _RootFaberPlan = 0;
// recommended skill level for using crafted item // recommended skill level for using crafted item
_Recommended = 0; _Recommended = 0;
@ -67,13 +67,13 @@ CFaberPhrase::CFaberPhrase()
_MBORange = 0.0f; _MBORange = 0.0f;
_MBOProtection = 0.0f; _MBOProtection = 0.0f;
_MBOSapLoad = 0.0f; _MBOSapLoad = 0.0f;
// energy buff on item // energy buff on item
_MBOHitPoint = 0; _MBOHitPoint = 0;
_MBOSap = 0; _MBOSap = 0;
_MBOStamina = 0; _MBOStamina = 0;
_MBOFocus = 0; _MBOFocus = 0;
_IsStatic = true; _IsStatic = true;
_PhraseType = BRICK_TYPE::FABER; _PhraseType = BRICK_TYPE::FABER;
} }
@ -85,7 +85,7 @@ CFaberPhrase::CFaberPhrase()
bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute ) bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute )
{ {
H_AUTO(CFaberPhrase_build); H_AUTO(CFaberPhrase_build);
// we are sure there is at least one brick and that there are non NULL; // we are sure there is at least one brick and that there are non NULL;
nlassert( !bricks.empty() ); nlassert( !bricks.empty() );
@ -112,7 +112,7 @@ bool CFaberPhrase::build( const TDataSetRow & actorRowId, const std::vector< con
return false; 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 ) ) || ( brick.Family >= BRICK_FAMILIES::BeginFaberCredit && brick.Family <= BRICK_FAMILIES::EndFaberCredit ) )
{ {
for ( uint j = 0 ; j < brick.Params.size() ; ++j) 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]; const TBrickParam::IId* param = brick.Params[j];
switch(param->id()) switch(param->id())
{ {
case TBrickParam::FOCUS: case TBrickParam::FOCUS:
INFOLOG("FOCUS: %i",((CSBrickParamCraftFocus *)param)->Focus); INFOLOG("FOCUS: %i",((CSBrickParamCraftFocus *)param)->Focus);
_FocusCost += ((CSBrickParamCraftFocus *)param)->Focus; _FocusCost += ((CSBrickParamCraftFocus *)param)->Focus;
@ -217,10 +217,10 @@ bool CFaberPhrase::evaluate()
bool CFaberPhrase::validate() bool CFaberPhrase::validate()
{ {
H_AUTO(CFaberPhrase_validate); H_AUTO(CFaberPhrase_validate);
if ( !CraftSystemEnabled ) if ( !CraftSystemEnabled )
return false; return false;
CCharacter * c = (CCharacter *) CEntityBaseManager::getEntityBasePtr( _ActorRowId ); CCharacter * c = (CCharacter *) CEntityBaseManager::getEntityBasePtr( _ActorRowId );
if( c == 0 ) if( c == 0 )
{ {
@ -234,7 +234,7 @@ bool CFaberPhrase::validate()
return false; return false;
} }
// check right hand item is a crafting tool // check right hand item is a crafting tool
CGameItemPtr rightHandItem = c->getRightHandItem(); CGameItemPtr rightHandItem = c->getRightHandItem();
if (rightHandItem == NULL || rightHandItem->getStaticForm() == NULL || rightHandItem->getStaticForm()->Family != ITEMFAMILY::CRAFTING_TOOL) if (rightHandItem == NULL || rightHandItem->getStaticForm() == NULL || rightHandItem->getStaticForm()->Family != ITEMFAMILY::CRAFTING_TOOL)
{ {
@ -249,8 +249,16 @@ bool CFaberPhrase::validate()
return false; 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 // 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 ); TDataSetRow entityRowId = CPhraseManager::getInstance().getEntityEngagedMeleeBy( _ActorRowId );
if (TheDataset.isAccessible(entityRowId)) if (TheDataset.isAccessible(entityRowId))
{ {
@ -258,7 +266,7 @@ bool CFaberPhrase::validate()
return false; return false;
} }
*/ */
const sint32 focus = c->getScores()._PhysicalScores[ SCORES::focus ].Current; const sint32 focus = c->getScores()._PhysicalScores[ SCORES::focus ].Current;
if ( focus < _FocusCost ) if ( focus < _FocusCost )
{ {
@ -318,7 +326,7 @@ bool CFaberPhrase::update()
void CFaberPhrase::execute() void CFaberPhrase::execute()
{ {
H_AUTO(CFaberPhrase_execute); H_AUTO(CFaberPhrase_execute);
CCharacter* player = PlayerManager.getChar(_ActorRowId); CCharacter* player = PlayerManager.getChar(_ActorRowId);
if (!player) if (!player)
return; return;
@ -336,13 +344,13 @@ void CFaberPhrase::execute()
_FaberTime = (NLMISC::TGameCycle)(plan->CraftingDuration * 10); _FaberTime = (NLMISC::TGameCycle)(plan->CraftingDuration * 10);
} }
nldebug("CFaberPhrase::execute> _FaberTime = %d",_FaberTime); nldebug("CFaberPhrase::execute> _FaberTime = %d",_FaberTime);
const NLMISC::TGameCycle time = CTickEventHandler::getGameCycle(); const NLMISC::TGameCycle time = CTickEventHandler::getGameCycle();
_ExecutionEndDate = time + _FaberTime ; _ExecutionEndDate = time + _FaberTime ;
player->setCurrentAction(CLIENT_ACTION_TYPE::Faber,_ExecutionEndDate); player->setCurrentAction(CLIENT_ACTION_TYPE::Faber,_ExecutionEndDate);
player->staticActionInProgress(true); player->staticActionInProgress(true);
// set behaviour // set behaviour
PHRASE_UTILITIES::sendUpdateBehaviour( _ActorRowId, MBEHAV::FABER ); PHRASE_UTILITIES::sendUpdateBehaviour( _ActorRowId, MBEHAV::FABER );
@ -366,7 +374,7 @@ bool CFaberPhrase::launch()
void CFaberPhrase::apply() void CFaberPhrase::apply()
{ {
H_AUTO(CFaberPhrase_apply); H_AUTO(CFaberPhrase_apply);
CCharacter * c = dynamic_cast< CCharacter * > ( CEntityBaseManager::getEntityBasePtr( _ActorRowId ) ); CCharacter * c = dynamic_cast< CCharacter * > ( CEntityBaseManager::getEntityBasePtr( _ActorRowId ) );
if( c == 0 ) if( c == 0 )
{ {
@ -410,7 +418,7 @@ void CFaberPhrase::apply()
} }
nbMp = (sint32)_MpsFormula.size(); nbMp = (sint32)_MpsFormula.size();
uint32 nbMpForumulaNeedeInPlan = 0; uint32 nbMpForumulaNeedeInPlan = 0;
neededMp = (uint32)_RootFaberPlan->Faber->NeededMpsFormula.size(); neededMp = (uint32)_RootFaberPlan->Faber->NeededMpsFormula.size();
for( uint mp = 0; mp < neededMp; ++mp ) for( uint mp = 0; mp < neededMp; ++mp )
@ -418,7 +426,7 @@ void CFaberPhrase::apply()
//for each type of Mp needed //for each type of Mp needed
nbMpForumulaNeedeInPlan += _RootFaberPlan->Faber->NeededMpsFormula[ mp ].Quantity; nbMpForumulaNeedeInPlan += _RootFaberPlan->Faber->NeededMpsFormula[ mp ].Quantity;
} }
if( nbMpForumulaNeedeInPlan != _MpsFormula.size() ) 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() ); 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(); stop();
return; return;
} }
neededMp = (uint32)_RootFaberPlan->Faber->NeededMps.size(); neededMp = (uint32)_RootFaberPlan->Faber->NeededMps.size();
EGSPD::CPeople::TPeople civRestriction = _RootFaberPlan->CivRestriction; EGSPD::CPeople::TPeople civRestriction = _RootFaberPlan->CivRestriction;
uint32 usedMp=0; uint32 usedMp=0;
@ -469,7 +477,7 @@ void CFaberPhrase::apply()
{ {
// for each Mp of one type (we have Quantity by type) // for each Mp of one type (we have Quantity by type)
uint32 NumMpParameters = (uint32)usedMps[u_mp]->Mp->MpFaberParameters.size(); uint32 NumMpParameters = (uint32)usedMps[u_mp]->Mp->MpFaberParameters.size();
// for each Faber parameters in Mp // for each Faber parameters in Mp
for( uint j = 0; j < NumMpParameters; ++j ) 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 ) CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const std::vector< NLMISC::CSheetId >& Mp, const std::vector< NLMISC::CSheetId >& MpFormula )
{ {
H_AUTO(CFaberPhrase_systemCraftItem); H_AUTO(CFaberPhrase_systemCraftItem);
std::vector< const CStaticBrick* > bricks; std::vector< const CStaticBrick* > bricks;
_RootFaberPlan = CSheets::getSBrickForm( sheet ); _RootFaberPlan = CSheets::getSBrickForm( sheet );
const CStaticBrick * rootFaberBricks = CSheets::getSBrickForm( CSheetId("bcpa01.sbrick") ); const CStaticBrick * rootFaberBricks = CSheets::getSBrickForm( CSheetId("bcpa01.sbrick") );
@ -586,7 +594,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
} }
CGameItemPtr craftedItem = 0; CGameItemPtr craftedItem = 0;
if( _RootFaberPlan && _RootFaberPlan->Faber ) if( _RootFaberPlan && _RootFaberPlan->Faber )
{ {
_CraftedItemStaticForm = CSheets::getForm( _RootFaberPlan->Faber->CraftedItem ); _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( rootFaberBricks );
bricks.push_back( _RootFaberPlan ); bricks.push_back( _RootFaberPlan );
for( vector< NLMISC::CSheetId >::const_iterator it = Mp.begin(); it != Mp.end(); ++it ) for( vector< NLMISC::CSheetId >::const_iterator it = Mp.begin(); it != Mp.end(); ++it )
{ {
const CStaticItem * mp = CSheets::getForm( (*it) ); const CStaticItem * mp = CSheets::getForm( (*it) );
@ -626,7 +634,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
} }
_MpsFormula.push_back( mp ); _MpsFormula.push_back( mp );
} }
// Check quantity of gived Mps formula // Check quantity of gived Mps formula
if( _RootFaberPlan->Faber->NeededMpsFormula.size() > _MpsFormula.size() ) if( _RootFaberPlan->Faber->NeededMpsFormula.size() > _MpsFormula.size() )
{ {
@ -658,7 +666,7 @@ CGameItemPtr CFaberPhrase::systemCraftItem( const NLMISC::CSheetId& sheet, const
void CFaberPhrase::end() void CFaberPhrase::end()
{ {
H_AUTO(CFaberPhrase_end); H_AUTO(CFaberPhrase_end);
CCharacter* player = PlayerManager.getChar(_ActorRowId); CCharacter* player = PlayerManager.getChar(_ActorRowId);
if (!player) if (!player)
return; return;
@ -679,7 +687,7 @@ void CFaberPhrase::end()
void CFaberPhrase::stop() void CFaberPhrase::stop()
{ {
H_AUTO(CFaberPhrase_stop); H_AUTO(CFaberPhrase_stop);
CCharacter* player = PlayerManager.getChar(_ActorRowId); CCharacter* player = PlayerManager.getChar(_ActorRowId);
if (!player) if (!player)
return; return;
@ -697,11 +705,11 @@ void CFaberPhrase::stop()
} // 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) if (args.size() != 3)
return false; return false;
uint32 nbSimu, skillLevel, itemQuality; uint32 nbSimu, skillLevel, itemQuality;
NLMISC::fromString(args[0], nbSimu); NLMISC::fromString(args[0], nbSimu);
NLMISC::fromString(args[1], skillLevel); NLMISC::fromString(args[1], skillLevel);
@ -733,7 +741,7 @@ NLMISC_COMMAND(simuCraft, "Simulation de craft pour verifier les probabilit
if(sf == 1.0f) if(sf == 1.0f)
{ {
++nbFullSuccess; ++nbFullSuccess;
XpGain += CStaticSuccessTable::getXPGain(SUCCESS_TABLE_TYPE::Craft, deltaLvlXp); XpGain += CStaticSuccessTable::getXPGain(SUCCESS_TABLE_TYPE::Craft, deltaLvlXp);
} }
else if( sf > 0.0f) 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", nlinfo("FaberSimu: Results after %d roll: Sucess: %d (%.2f%%), partial sucess: %d (%.2f%%), Miss: %d (%.2f%%), Xp Gain %d",
nbSimu, nbSimu,
nbFullSuccess, 100.0f*nbFullSuccess/nbSimu, nbFullSuccess, 100.0f*nbFullSuccess/nbSimu,
nbPartialSuccess, 100.0f*nbPartialSuccess/nbSimu, nbPartialSuccess, 100.0f*nbPartialSuccess/nbSimu,
nbMiss, 100.0f*nbMiss/nbSimu, nbMiss, 100.0f*nbMiss/nbSimu,
uint32(1000.f*XpGain / (nbSimu-nbMiss/2) ) ); uint32(1000.f*XpGain / (nbSimu-nbMiss/2) ) );

View file

@ -107,7 +107,7 @@ CFgExtractionPhrase::CFgExtractionPhrase()
bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute ) bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vector< const CStaticBrick* >& bricks, bool buildToExecute )
{ {
H_AUTO(CFgExtractionPhrase_build); H_AUTO(CFgExtractionPhrase_build);
_ActorRowId = actorRowId; _ActorRowId = actorRowId;
// Check grammar // 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 ) for (std::vector<const CStaticBrick*>::const_iterator ib=bricks.begin(); ib!=bricks.end(); ++ib )
{ {
const CStaticBrick& brick = *(*ib); const CStaticBrick& brick = *(*ib);
// Compute Sabrina credit and cost) // Compute Sabrina credit and cost)
if ( brick.SabrinaValue > 0 ) if ( brick.SabrinaValue > 0 )
sabrinaCost += brick.SabrinaValue; sabrinaCost += brick.SabrinaValue;
@ -156,7 +156,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect
break; break;
case TBrickParam::FG_SRC_PRD: case TBrickParam::FG_SRC_PRD:
INFOLOG("FG_SRC_PRD: %g",((CSBrickParamForagePeriod *)param)->Period); 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 _RequestedProps[CHarvestSource::S] = 1.0f / (((CSBrickParamForagePeriod *)param)->Period * 10.0f); // period converted from second to tick
else else
_RequestedProps[CHarvestSource::S] = 1.0f; _RequestedProps[CHarvestSource::S] = 1.0f;
@ -231,7 +231,7 @@ bool CFgExtractionPhrase::build( const TDataSetRow & actorRowId, const std::vect
//nlerror( "TODO: Families" ); //nlerror( "TODO: Families" );
//if ( brick.Family >= BRICK_FAMILIES::BeginForage //if ( brick.Family >= BRICK_FAMILIES::BeginForage
//insertProgressingSkill( brick.Skill, brick.SheetId ); //insertProgressingSkill( brick.Skill, brick.SheetId );
} }
@ -432,7 +432,7 @@ bool CFgExtractionPhrase::evaluate()
bool CFgExtractionPhrase::validate() bool CFgExtractionPhrase::validate()
{ {
H_AUTO(CFgExtractionPhrase_validate); H_AUTO(CFgExtractionPhrase_validate);
if ( ! HarvestSystemEnabled ) if ( ! HarvestSystemEnabled )
return false; return false;
@ -544,6 +544,15 @@ bool CFgExtractionPhrase::validate()
return false; // has disappeared 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) // 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(); const CEntityState& state = player->getState();
CVector2f playerPos( (float)state.X / 1000.0f, (float)state.Y / 1000.0f ); CVector2f playerPos( (float)state.X / 1000.0f, (float)state.Y / 1000.0f );
@ -589,7 +598,7 @@ bool CFgExtractionPhrase::validate()
bool CFgExtractionPhrase::update() bool CFgExtractionPhrase::update()
{ {
H_AUTO(CFgExtractionPhrase_update); H_AUTO(CFgExtractionPhrase_update);
CCharacter* player = PlayerManager.getChar( _ActorRowId ); CCharacter* player = PlayerManager.getChar( _ActorRowId );
if ( ! player ) if ( ! player )
return false; return false;
@ -600,7 +609,7 @@ bool CFgExtractionPhrase::update()
if( idle() ) if( idle() )
{ {
idle(false); idle(false);
// check if actor can use action // check if actor can use action
CBypassCheckFlags bypassCheckFlags = CBypassCheckFlags::NoFlags; CBypassCheckFlags bypassCheckFlags = CBypassCheckFlags::NoFlags;
if (player->canEntityUseAction(bypassCheckFlags,false) == false) if (player->canEntityUseAction(bypassCheckFlags,false) == false)
@ -633,7 +642,7 @@ bool CFgExtractionPhrase::update()
void CFgExtractionPhrase::execute() void CFgExtractionPhrase::execute()
{ {
H_AUTO(CFgExtractionPhrase_execute); H_AUTO(CFgExtractionPhrase_execute);
// Get character // Get character
CCharacter* player = PlayerManager.getChar( _ActorRowId ); CCharacter* player = PlayerManager.getChar( _ActorRowId );
if (!player) if (!player)
@ -676,7 +685,7 @@ void CFgExtractionPhrase::execute()
void CFgExtractionPhrase::end() void CFgExtractionPhrase::end()
{ {
H_AUTO(CFgExtractionPhrase_end); H_AUTO(CFgExtractionPhrase_end);
CCharacter* player = PlayerManager.getChar(_ActorRowId); CCharacter* player = PlayerManager.getChar(_ActorRowId);
if (!player) if (!player)
return; return;
@ -694,7 +703,7 @@ void CFgExtractionPhrase::end()
void CFgExtractionPhrase::stop() void CFgExtractionPhrase::stop()
{ {
H_AUTO(CFgExtractionPhrase_stop); H_AUTO(CFgExtractionPhrase_stop);
CCharacter* player = PlayerManager.getChar(_ActorRowId); CCharacter* player = PlayerManager.getChar(_ActorRowId);
if (!player) if (!player)
return; return;
@ -742,7 +751,7 @@ bool CFgExtractionPhrase::launch()
void CFgExtractionPhrase::apply() void CFgExtractionPhrase::apply()
{ {
H_AUTO(CFgExtractionPhrase_apply); H_AUTO(CFgExtractionPhrase_apply);
CCharacter* player = PlayerManager.getChar( _ActorRowId ); CCharacter* player = PlayerManager.getChar( _ActorRowId );
if (!player) if (!player)
return; return;
@ -778,7 +787,7 @@ void CFgExtractionPhrase::apply()
void CFgExtractionPhrase::applyExtraction( CCharacter *player, float successFactor ) void CFgExtractionPhrase::applyExtraction( CCharacter *player, float successFactor )
{ {
H_AUTO(CFgExtractionPhrase_applyExtraction); H_AUTO(CFgExtractionPhrase_applyExtraction);
nlassert( _Source ); nlassert( _Source );
if ( ! player->forageProgress() ) if ( ! player->forageProgress() )
return; 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 ); player->forageProgress()->fillFromExtraction( _Props.Extraction.ObtainedProps[CHarvestSource::A], _Props.Extraction.ObtainedProps[CHarvestSource::Q], player );
else else
return; return;
// Report result of action // Report result of action
if ( propDrop != CHarvestSource::NoDrop ) if ( propDrop != CHarvestSource::NoDrop )
{ {
@ -864,7 +873,7 @@ struct CNonNullGameItemPtrPred : std::unary_function<CGameItemPtr,bool>
void CFgExtractionPhrase::doKamiOffering( CCharacter *player ) void CFgExtractionPhrase::doKamiOffering( CCharacter *player )
{ {
H_AUTO(CFgExtractionPhrase_doKamiOffering); H_AUTO(CFgExtractionPhrase_doKamiOffering);
// Count the number of non empty slots // Count the number of non empty slots
// const vector<CGameItemPtr> &theBag = player->getInventory()[INVENTORIES::bag]()->getChildren(); // const vector<CGameItemPtr> &theBag = player->getInventory()[INVENTORIES::bag]()->getChildren();
CInventoryPtr theBag = player->getInventory(INVENTORIES::bag); CInventoryPtr theBag = player->getInventory(INVENTORIES::bag);
@ -912,7 +921,7 @@ void CFgExtractionPhrase::doKamiOffering( CCharacter *player )
(*ib)->getSheetId().toString().c_str()); (*ib)->getSheetId().toString().c_str());
*/ */
// EGSPD::forageKamiItemOffering(player->getId(), _Source->depositForK()->name(), _Source->depositForK()->kamiAnger(), _Props.Care.KamiAngerDec[CHarvestSource::KamiAngerDec], item->getSheetId().toString()); // EGSPD::forageKamiItemOffering(player->getId(), _Source->depositForK()->name(), _Source->depositForK()->kamiAnger(), _Props.Care.KamiAngerDec[CHarvestSource::KamiAngerDec], item->getSheetId().toString());
// TODO: quantity, filter, etc. // TODO: quantity, filter, etc.
// player->destroyItem( INVENTORIES::bag, ib-theBag.begin(), 1/*(*ib).quantity()*/, false ); // player->destroyItem( INVENTORIES::bag, ib-theBag.begin(), 1/*(*ib).quantity()*/, false );
theBag->deleteItem(i); theBag->deleteItem(i);

View file

@ -675,6 +675,9 @@ CCharacter::CCharacter(): CEntityBase(false),
_FriendVisibility = VisibleToAll; _FriendVisibility = VisibleToAll;
_LangChannel = "en";
_NewTitle = "Refugee";
initDatabase(); initDatabase();
} // CCharacter // } // CCharacter //
@ -699,6 +702,7 @@ void CCharacter::clear()
_ForbidAuraUseStartDate=0; _ForbidAuraUseStartDate=0;
_ForbidAuraUseEndDate=0; _ForbidAuraUseEndDate=0;
_Title= CHARACTER_TITLE::Refugee; _Title= CHARACTER_TITLE::Refugee;
_NewTitle = "Refugee";
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);
@ -3851,9 +3855,9 @@ 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() && _NewTitle == "FBT")
{ {
_Title = CHARACTER_TITLE::Refugee; _NewTitle = "Refugee";
registerName(); registerName();
} }
} }
@ -3869,9 +3873,9 @@ 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() && _NewTitle == "WIND")
{ {
_Title = CHARACTER_TITLE::Refugee; _NewTitle = "Refugee";
registerName(); 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) ); CBankAccessor_PLR::getCHARACTER_INFO().getRING_XP_CATALYSER().setCount(_PropertyDatabase, checkedCast<uint16>(ringCatalyserCount) );
} }
} }
}
if (!p->isTrialPlayer()) if (!p->isTrialPlayer())
{ {
xpBonus = XpGain; xpBonus = XpGain;
}
} }
XpGain += xpBonus + ringXpBonus; 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); SM_STATIC_PARAMS_3(paramsP, STRING_MANAGER::skill, STRING_MANAGER::integer, STRING_MANAGER::integer);
paramsP[0].Enum = skillEnum; paramsP[0].Enum = skillEnum;
paramsP[1].Int = max((sint32)1, sint32(100*XpGain) ); 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); PHRASE_UTILITIES::sendDynamicSystemMessage(_EntityRowId, "XP_CATALYSER_PROGRESS_NORMAL_GAIN", paramsP);
if( xpBonus > 0 ) if( xpBonus > 0 )
@ -7329,11 +7333,18 @@ double CCharacter::addXpToSkillInternal( double XpGain, const std::string& ContS
return XpGainRemainder; return XpGainRemainder;
} }
//----------------------------------------------- //-----------------------------------------------
// CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill // CCharacter::setSkillTreeToMaxValue Set skill tree of character to max value of each skill
//----------------------------------------------- //-----------------------------------------------
void CCharacter::setSkillsToMaxValue() 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 // get pointer on static skills tree definition
CSheetId sheet("skills.skill_tree"); CSheetId sheet("skills.skill_tree");
@ -7342,16 +7353,31 @@ void CCharacter::setSkillsToMaxValue()
for( uint i = 0; i < SKILLS::NUM_SKILLS; ++i ) 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; _Skills._Skills[ i ].Current = SkillsTree->SkillsTree[ i ].MaxSkillValue + _Skills._Skills[ i ].Modifier;
// _PropertyDatabase.setProp( _DataIndexReminder->CHARACTER_INFO.SKILLS.Skill[i], _Skills._Skills[ i ].Current ); _Skills._Skills[ i ].MaxLvlReached = _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 );
CBankAccessor_PLR::getCHARACTER_INFO().getSKILLS().getArray(i).setBaseSKILL(_PropertyDatabase, checkedCast<uint16>(_Skills._Skills[ i ].Base) ); 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 // CCharacter::sendDynamicSystemMessage
//----------------------------------------------- //-----------------------------------------------
@ -7949,6 +7975,7 @@ 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;
_NewTitle = "Refugee";
// fame information // fame information
// Players start out as Neutral in their declared clans // Players start out as Neutral in their declared clans
@ -9787,7 +9814,7 @@ 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());
price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor ); price = (uint32) ( CShopTypeManager::computeBasePrice( theItem, quality ) * wornFactor * 0.02 );
return true; return true;
} }
@ -10214,6 +10241,35 @@ void CCharacter::initPvpPointDb()
CBankAccessor_PLR::getUSER().getRRPS_LEVELS(0).setVALUE(_PropertyDatabase, _PvpPoint ); 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) void CCharacter::setOrganization(uint32 org)
@ -12895,7 +12951,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 = CHARACTER_TITLE::toString(_Title); string sTitle = getFullTitle();
ucstring RegisteredName; ucstring RegisteredName;
if (newName.empty()) if (newName.empty())
RegisteredName = getName() + string("$") + sTitle + string("$"); RegisteredName = getName() + string("$") + sTitle + string("$");
@ -16161,15 +16217,30 @@ void CCharacter::applyGooDamage( float gooDistance )
if (hpLost < 1) hpLost = 1; if (hpLost < 1) hpLost = 1;
if( hpLost > _PhysScores._PhysicalScores[ SCORES::hit_points ].Current ) if( hpLost > _PhysScores._PhysicalScores[ SCORES::hit_points ].Current )
{ {
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0; _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = 0;
// send message to player for inform is dead by goo
sendDynamicSystemMessage(_EntityRowId, "KILLED_BY_GOO"); // 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 else
{ {
_PhysScores._PhysicalScores[ SCORES::hit_points ].Current = _PhysScores._PhysicalScores[ SCORES::hit_points ].Current - hpLost; _PhysScores._PhysicalScores[ SCORES::hit_points ].Current = _PhysScores._PhysicalScores[ SCORES::hit_points ].Current - hpLost;
// send message to player for inform is suffer goo damage // 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 ) 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 true;
} }
return false; return false;
} }

View file

@ -890,6 +890,9 @@ public:
// Set skill tree of character to max value of each skill // Set skill tree of character to max value of each skill
void setSkillsToMaxValue(); 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 // for respawn management, need to modify _TimeDeath in cbTpAcknownledge callback
NLMISC::TGameTime& getTimeOfDeath(); NLMISC::TGameTime& getTimeOfDeath();
void setTimeOfDeath( NLMISC::TGameTime t); void setTimeOfDeath( NLMISC::TGameTime t);
@ -2392,6 +2395,27 @@ public:
uint32 getLastConnectedTime() const; uint32 getLastConnectedTime() const;
uint32 getLastConnectedDate() const; uint32 getLastConnectedDate() const;
uint32 getPlayedTime() 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 getOrganization() const;
uint32 getOrganizationStatus() const; uint32 getOrganizationStatus() const;
const std::list<TCharacterLogTime>& getLastLogStats() const; const std::list<TCharacterLogTime>& getLastLogStats() const;
@ -3032,6 +3056,14 @@ private:
uint32 _OrganizationStatus; uint32 _OrganizationStatus;
uint32 _OrganizationPoints; 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) /// SDB path where player wins HoF points in PvP (if not empty)
std::string _SDBPvPPath; std::string _SDBPvPPath;

View file

@ -894,6 +894,67 @@ inline uint32 CCharacter::getPlayedTime() const
return _PlayedTime; 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 inline uint32 CCharacter::getOrganization() const

View file

@ -321,8 +321,8 @@ static void prepareCharacterPositionForStore ( COfflineEntityState & state, cons
H_AUTO(CCharacterStore);\ H_AUTO(CCharacterStore);\
CFameManager::getInstance().savePlayerFame(_Id, const_cast<EGSPD::CFameContainerPD &>(*_Fames));\ CFameManager::getInstance().savePlayerFame(_Id, const_cast<EGSPD::CFameContainerPD &>(*_Fames));\
/* Update the current playing session duration */ \ /* Update the current playing session duration */ \
if (_LastLogStats.size() > 0) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime; \ if (!_LastLogStats.empty()) _LastLogStats.begin()->Duration = CTime::getSecondsSince1970() - _LastLogStats.begin()->LoginTime;\
else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?"); \ else nlwarning("Cannot update play session duration, _LastLogStats is empty, new character?");\
\ \
/* Unless the top of the position stack is locked, */ \ /* Unless the top of the position stack is locked, */ \
/* update the stored position stack with the current position */ \ /* 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)\ 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)\
PROP(uint32,_Organization)\ PROP(uint32,_Organization)\
PROP(uint32,_OrganizationStatus)\ PROP(uint32,_OrganizationStatus)\
PROP(uint32,_OrganizationPoints)\ PROP(uint32,_OrganizationPoints)\
@ -438,6 +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(_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 */\ /* 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))\

View file

@ -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 matis = CFameInterface::getInstance().getFameIndexed(user->getId(), 0) >= PVPFameRequired*6000;
bool fyros = CFameInterface::getInstance().getFameIndexed(user->getId(), 1) >= PVPFameRequired*6000; bool fyros = CFameInterface::getInstance().getFameIndexed(user->getId(), 1) >= PVPFameRequired*6000;
bool tryker = CFameInterface::getInstance().getFameIndexed(user->getId(), 2) >= 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); result.push_back((*it).second);
} }
} }
// } */
return result; return result;
} }
@ -1088,10 +1104,19 @@ bool CPVPManager2::addFactionWar( PVP_CLAN::TPVPClan clan1, PVP_CLAN::TPVPClan c
void CPVPManager2::onIOSMirrorUp() void CPVPManager2::onIOSMirrorUp()
{ {
// create extra factions channels // create extra factions channels
/*
createExtraFactionChannel("hominists"); createExtraFactionChannel("hominists");
createExtraFactionChannel("urasies"); createExtraFactionChannel("urasies");
createExtraFactionChannel("marauders"); createExtraFactionChannel("marauders");
createExtraFactionChannel("agnos"); 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++) for (uint i = PVP_CLAN::BeginClans; i <= PVP_CLAN::EndClans; i++)
{ {

View file

@ -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++ ) 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 ) ) if ( _Continents[i].getRegions()[j]->getPlaces()[k]->contains( vect ) )
{ {

View file

@ -47,7 +47,7 @@ public:
// TODO: check if good // TODO: check if good
static bool exists( const TDataSetRow& entityIndex ); static bool exists( const TDataSetRow& entityIndex );
static const NLMISC::CEntityId& getEntityId( 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 x( const TDataSetRow& entityIndex );
static CAICoord y( const TDataSetRow& entityIndex ); static CAICoord y( const TDataSetRow& entityIndex );