From ae685b3d68d471dc53a8f0b61892b842cd4ff927 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Thu, 9 Apr 2020 19:03:32 +0200 Subject: [PATCH] Merge branch 'ark' --- .../egs_sheets/egs_static_brick.cpp | 292 +++++++-------- .../egs_sheets/egs_static_brick.cpp.h | 258 ++++++------- .../mission_manager/missions_commands.cpp | 349 +++++++++++------- .../player_manager/character.cpp | 146 +++++--- .../player_manager/character.h | 1 + .../player_manager/character_inlines.h | 291 ++++++++------- 6 files changed, 736 insertions(+), 601 deletions(-) diff --git a/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp b/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp index fade8142d..d176ceba1 100644 --- a/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp +++ b/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp @@ -53,7 +53,7 @@ map< pair, CSheetId > CStaticBrick::_Bricks; NL_INSTANCE_COUNTER_IMPL(CFaber); //-------------------------------------------------------------- -// constructor +// constructor //-------------------------------------------------------------- CStaticBrick::CStaticBrick() { @@ -79,7 +79,7 @@ CStaticBrick::CStaticBrick() //-------------------------------------------------------------- -// destructor +// destructor //-------------------------------------------------------------- CStaticBrick::~CStaticBrick() { @@ -88,7 +88,7 @@ CStaticBrick::~CStaticBrick() //-------------------------------------------------------------- -// serial() +// serial() //-------------------------------------------------------------- void CStaticBrick::serial(class NLMISC::IStream &f) { @@ -104,7 +104,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) f.serial(MinCastTime); f.serial(MaxCastTime); f.serial(MinRange); - f.serial(MaxRange); + f.serial(MaxRange); f.serialCont( StringParams ); f.serial(ForbiddenDef); f.serial(ForbiddenExclude); @@ -137,11 +137,11 @@ void CStaticBrick::serial(class NLMISC::IStream &f) addParam(StringParams[i], Params); } - // Grammar + // Grammar // mandatory f.serial(size); for ( uint16 i = 0 ; i < size ; ++i) - { + { f.serial(str); BRICK_FAMILIES::TBrickFamily family = BRICK_FAMILIES::toSBrickFamily(str); @@ -156,7 +156,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // optional f.serial(size); for ( uint16 i = 0 ; i < size ; ++i) - { + { f.serial(str); BRICK_FAMILIES::TBrickFamily family = BRICK_FAMILIES::toSBrickFamily(str); @@ -171,7 +171,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // credit f.serial(size); for ( uint16 i = 0 ; i < size ; ++i) - { + { f.serial(str); BRICK_FAMILIES::TBrickFamily family = BRICK_FAMILIES::toSBrickFamily(str); @@ -217,7 +217,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) } } else - { + { // family string str = BRICK_FAMILIES::toString(Family); f.serial( str ); @@ -225,7 +225,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) // localisation str = SLOT_EQUIPMENT::toString(ForcedLocalisation); f.serial( str ); - + // params // nothing to do -> keep params and only serialize the param as strings @@ -292,7 +292,7 @@ void CStaticBrick::serial(class NLMISC::IStream &f) //-------------------------------------------------------------- -// readGeorges() +// readGeorges() //-------------------------------------------------------------- void CStaticBrick::readGeorges (const NLMISC::CSmartPtr &form, const NLMISC::CSheetId &sheetId) { @@ -324,11 +324,11 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS // FamilyId //if( root.getValueByName (value, "Basics.FamilyId") ) //{ - //Family = BRICK_FAMILIES::toSBrickFamily( sheetName.substr( 0, sheetName.size() - NB_LETTERS_AFTER_FAMILY ) ); + //Family = BRICK_FAMILIES::toSBrickFamily( sheetName.substr( 0, sheetName.size() - NB_LETTERS_AFTER_FAMILY ) ); //} if( root.getValueByName (value, "Basics.FamilyId") ) { - Family = BRICK_FAMILIES::toSBrickFamily( value ); + Family = BRICK_FAMILIES::toSBrickFamily( value ); if(Family==BRICK_FAMILIES::Unknown) nlwarning("CStaticBrick::readStaticBrick: Unknown Family %s in sheet %s", value.c_str(), sheetId.toString().c_str()); /* @@ -344,7 +344,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS */ } else - { + { nlwarning(" can't get the value 'FamilyId' for sheet %s", sheetId.toString().c_str() ); } @@ -374,7 +374,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS { nlwarning(" can't get the value 'Skill' for sheet %s", sheetId.toString().c_str() ); } - + // SabrinaValue root.getValueByName (SabrinaValue, "Basics.SabrinaCost"); @@ -387,9 +387,9 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS // power value root.getValueByName (PowerValue, "Basics.PowerValue"); - + // IndexInFamily - if( ! root.getValueByName (IndexInFamily, "Basics.IndexInFamily") ) + if( ! root.getValueByName (IndexInFamily, "Basics.IndexInFamily") ) { nlwarning(" can't get the value 'IndexInFamily' for sheet %s", sheetId.toString().c_str() ); } @@ -403,7 +403,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS { nlwarning(" can't get the value 'ForcedLocalisation' for sheet %s", sheetId.toString().c_str() ); } - + // LearnRequiresOneOfSkills if ( ! root.getValueByName (value, "Basics.LearnRequiresOneOfSkills") ) { @@ -464,7 +464,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS brickSheet += string(".sbrick"); } } - + CSheetId brickSheetId( NLMISC::strlwr( brickSheet ) ); if ( brickSheetId == CSheetId::Unknown ) nlwarning( " LearnRequireBricks: unknown sheet %s in %s", brickSheet.c_str(), sheetId.toString().c_str() ); @@ -513,7 +513,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS { addParam(StringParams[i], Params); } - + // Load Faber tools if( Family >= BRICK_FAMILIES::BeginFaberRoot && Family <= BRICK_FAMILIES::EndFaberRoot ) { @@ -521,7 +521,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS } // crafting duration - if ( !root.getValueByName(CraftingDuration , "faber.Crafting Duration" ) ) + if ( !root.getValueByName(CraftingDuration , "faber.Crafting Duration" ) ) { nlwarning(" can't get the value 'faber.Crafting Duration' for sheet %s", sheetId.toString().c_str() ); } @@ -564,7 +564,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS nlwarning("Unknown Mandatory family %s",value.c_str()); } } - + // Optional families OptionalFamilies.clear(); for( uint i = 0 ; i < SBRICK_MAX_OPTIONAL ; ++i ) @@ -580,7 +580,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS nlwarning("Unknown optional family %s",value.c_str()); } } - + // Parameter families // ParameterFamilies.clear(); for( uint i = 0 ; i < SBRICK_MAX_PARAMETER ; ++i ) @@ -596,7 +596,7 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS nlwarning("Unknown Parameter family %s",value.c_str()); } } - + // Credit families CreditFamilies.clear(); for( uint i = 0 ; i < SBRICK_MAX_CREDIT ; ++i ) @@ -610,12 +610,12 @@ void CStaticBrick::readStaticBrick( const NLGEORGES::UFormElm &root, const NLMIS CreditFamilies.insert( bf ); } } - + root.getValueByName (ForbiddenDef, "Basics.ForbiddenDef" ); root.getValueByName (ForbiddenExclude, "Basics.ForbiddenExclude" ); root.getValueByName (UsableWithEmptyHands, "Basics.UsableWithEmptyHands"); - + } // readStaticBrick // @@ -648,7 +648,7 @@ bool CPlayerSkill::initFromString( const string& skillAndValue ) // string if the brick properties. // //-------------------------------------------------------------- -// addParam() +// addParam() //-------------------------------------------------------------- void addParam(const std::string ¶mStr, std::vector &Params) { @@ -665,52 +665,52 @@ void addParam(const std::string ¶mStr, std::vector &Par case TBrickParam::SAP: // $*STRUCT CSBrickParamSap TBrickParam::SAP // $*-i unsigned Sap=0 // quantity of SAP to use - Params.push_back(new CSBrickParamSap(tail)); + Params.push_back(new CSBrickParamSap(tail)); break; case TBrickParam::HP: // $*STRUCT CSBrickParamHp TBrickParam::HP // $*-i unsigned Hp=0 // quantity of HP to use - Params.push_back(new CSBrickParamHp(tail)); + Params.push_back(new CSBrickParamHp(tail)); break; case TBrickParam::STA: // $*STRUCT CSBrickParamSta TBrickParam::STA // $*-i unsigned Sta=0 // quantity of STA to use - Params.push_back(new CSBrickParamSta(tail)); + Params.push_back(new CSBrickParamSta(tail)); break; case TBrickParam::STA_WEIGHT_FACTOR: // $*STRUCT CSBrickParamStaWeightFactor TBrickParam::STA_WEIGHT_FACTOR // $*-i float StaFactor=0 // quantity of STA FACTOR of WEIGHT to use // $*-i unsigned StaConst=0 // quantity of STA Constante to use, used STA = StaFactor * (weight of equipped weapons) + StaConst - Params.push_back(new CSBrickParamStaWeightFactor(tail)); + Params.push_back(new CSBrickParamStaWeightFactor(tail)); break; case TBrickParam::FOCUS: // $*STRUCT CSBrickParamFocus TBrickParam::FOCUS // $*-i unsigned Focus=0 // quantity of FOCUS to use - Params.push_back(new CSBrickParamFocus(tail)); + Params.push_back(new CSBrickParamFocus(tail)); break; case TBrickParam::SET_BEHAVIOUR: // $*STRUCT CSBrickParamSetBehaviour TBrickParam::SET_BEHAVIOUR // $*-s std::string Behaviour // the new behaviour to use - Params.push_back(new CSBrickParamSetBehaviour(tail)); + Params.push_back(new CSBrickParamSetBehaviour(tail)); break; case TBrickParam::DEFINE_FLAG: // $*STRUCT CSBrickParamDefineFlag TBrickParam::DEFINE_FLAG // $*-s std::string Flag // the defined flag - Params.push_back(new CSBrickParamDefineFlag(tail)); + Params.push_back(new CSBrickParamDefineFlag(tail)); break; case TBrickParam::BYPASS_CHECK: // $*STRUCT CSBrickParamBypassCheck TBrickParam::BYPASS_CHECK // $*-s std::string FlagType // the check flag to bypass - Params.push_back(new CSBrickParamBypassCheck(tail)); + Params.push_back(new CSBrickParamBypassCheck(tail)); break; - + /************************************************************************/ /* COMBAT Params */ /************************************************************************/ @@ -719,7 +719,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamLatencyFactor TBrickParam::LATENCY_FACTOR // $*-f float MinLatencyFactor = 1 // min factor on weapon latency // $*-f float MaxLatencyFactor = 0.5 // max factor on weapon latency - Params.push_back(new CSBrickParamLatencyFactor(tail)); + Params.push_back(new CSBrickParamLatencyFactor(tail)); } break; @@ -739,16 +739,16 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration = 0.0 // duration in seconds // $*-f float MinFactor = 0.0 // min factor of regen debuff // $*-f float MaxFactor = 0.0 // max factor of regen debuff - Params.push_back(new CSBrickParamDebuffRegen(tail)); + Params.push_back(new CSBrickParamDebuffRegen(tail)); } break; - + case TBrickParam::SAP_LOSS_FACTOR: { // $*STRUCT CSBrickParamSapLossFactor TBrickParam::SAP_LOSS_FACTOR // $*-f float MinFactor = 0.0 // min factor of damage also applied to sap // $*-f float MaxFactor = 0.0 // max factor of damage also applied to sap - Params.push_back(new CSBrickParamSapLossFactor(tail)); + Params.push_back(new CSBrickParamSapLossFactor(tail)); } break; @@ -757,7 +757,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamAim TBrickParam::AIM // $*-s std::string BodyType // Homin, kitin (=land kitin), bird, flying_kitin....(see body.h) // $*-s std::string AimedSlot // head, body, arms... (see slot_equipment.cpp) - Params.push_back(new CSBrickParamAim(tail)); + Params.push_back(new CSBrickParamAim(tail)); } break; @@ -784,7 +784,7 @@ void addParam(const std::string ¶mStr, std::vector &Par { // $*STRUCT CSBrickParamThrowOffBalance TBrickParam::THROW_OFF_BALANCE // $*-f float MinDuration = 0.0f // effect min duration - // $*-f float MaxDuration = 5.0f // effect max duration + // $*-f float MaxDuration = 5.0f // effect max duration Params.push_back(new CSBrickParamThrowOffBalance(tail)); } break; @@ -794,7 +794,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamIncreaseDamage TBrickParam::INC_DMG // $*-f float MinFactor = 1.0f //min factor on damage // $*-f float MaxFactor = 2.0f //max factor on damage - Params.push_back(new CSBrickParamIncreaseDamage(tail)); + Params.push_back(new CSBrickParamIncreaseDamage(tail)); } break; @@ -803,7 +803,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamIncDmgTypeRestriction TBrickParam::INC_DMG_TYPE_RSTR // $*-s std::string TypeRestriction //type restriction // $*-f float FactorModifier = 0.0f //bonus on damage factor - Params.push_back(new CSBrickParamIncDmgTypeRestriction(tail)); + Params.push_back(new CSBrickParamIncDmgTypeRestriction(tail)); } break; @@ -812,7 +812,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamIncDmgRaceRestriction TBrickParam::INC_DMG_RACE_RSTR // $*-s std::string RaceRestriction //race restriction // $*-f float FactorModifier = 0.0f //bonus on damage factor - Params.push_back(new CSBrickParamIncDmgRaceRestriction(tail)); + Params.push_back(new CSBrickParamIncDmgRaceRestriction(tail)); } break; @@ -821,7 +821,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamIncDmgEcosystemRestriction TBrickParam::INC_DMG_ECOS_RSTR // $*-s std::string EcosystemRestriction //Ecosystem restriction // $*-f float FactorModifier = 0.0f //bonus on damage factor - Params.push_back(new CSBrickParamIncDmgEcosystemRestriction(tail)); + Params.push_back(new CSBrickParamIncDmgEcosystemRestriction(tail)); } break; @@ -830,7 +830,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamIncDmgSeasonRestriction TBrickParam::INC_DMG_SEASON_RSTR // $*-s std::string SeasonRestriction //Season restriction // $*-f float FactorModifier = 0.0f //bonus on damage factor - Params.push_back(new CSBrickParamIncDmgSeasonRestriction(tail)); + Params.push_back(new CSBrickParamIncDmgSeasonRestriction(tail)); } break; @@ -840,7 +840,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-s std::string DamageType // damage type // $*-f float MinFactor = 0.0f //min factor of damage // $*-f float MaxFactor = 1.0f //max factor of damage - Params.push_back(new CSBrickParamSpecialDamage(tail)); + Params.push_back(new CSBrickParamSpecialDamage(tail)); } break; @@ -850,7 +850,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-s std::string ArmorType // affected armor type (light, medium, heavy, kitin etc..) // $*-f float MinFactor = 1.0f //max factor applied on armor absorption // $*-f float MaxFactor = 0.5f //max factor applied on armor absorption (< min as smaller is better) - Params.push_back(new CSBrickParamArmorMod(tail)); + Params.push_back(new CSBrickParamArmorMod(tail)); } break; @@ -861,16 +861,16 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration of the slow in seconds // $*-f float MinFactor = 1.0f // min factor applied on cast time // $*-f float MaxFactor = 2.0f // max factor applied on cast time - Params.push_back(new CSBrickParamSlowCast(tail)); + Params.push_back(new CSBrickParamSlowCast(tail)); } break; - + case TBrickParam::OPENING_1: { // $*STRUCT CSBrickParamOpening1 TBrickParam::OPENING_1 // $*-s std::string EventFlag - Params.push_back(new CSBrickParamOpening1(tail)); + Params.push_back(new CSBrickParamOpening1(tail)); } break; @@ -879,7 +879,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamOpening2 TBrickParam::OPENING_2 // $*-s std::string EventFlag1 // $*-s std::string EventFlag2 - Params.push_back(new CSBrickParamOpening2(tail)); + Params.push_back(new CSBrickParamOpening2(tail)); } break; @@ -889,7 +889,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-s std::string EventFlag1 // $*-s std::string EventFlag2 // $*-s std::string EventFlag3 - Params.push_back(new CSBrickParamOpening3(tail)); + Params.push_back(new CSBrickParamOpening3(tail)); } break; @@ -899,7 +899,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration of the effect in seconds // $*-i sint32 MinFactor // min factor applied on target attack latency (+50 = +50%) // $*-i sint32 MaxFactor // max factor applied on target attack latency (+50 = +50%) - Params.push_back(new CSBrickParamCombatSlowAttack(tail)); + Params.push_back(new CSBrickParamCombatSlowAttack(tail)); break; case TBrickParam::COMBAT_SLOW: @@ -907,46 +907,46 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration of the effect in seconds // $*-i sint32 MinFactor // min factor applied on target attack latency or casting time (+50 = +50%) // $*-i sint32 MaxFactor // max factor applied on target attack latency or casting time (+50 = +50%) - Params.push_back(new CSBrickParamCombatSlow(tail)); + Params.push_back(new CSBrickParamCombatSlow(tail)); break; - + case TBrickParam::BLEED_FACTOR: // $*STRUCT CSBrickParamBleedFactor TBrickParam::BLEED_FACTOR // $*-f float Duration // duration of the effect in seconds // $*-f float MinFactor // min factor of dealt damage also lost in bleed // $*-f float MaxFactor // max factor of dealt damage also lost in bleed - Params.push_back(new CSBrickParamBleedFactor(tail)); + Params.push_back(new CSBrickParamBleedFactor(tail)); break; case TBrickParam::SPECIAL_HIT: // $*STRUCT CSBrickParamSpecialHit TBrickParam::SPECIAL_HIT // no param - Params.push_back(new CSBrickParamSpecialHit(tail)); + Params.push_back(new CSBrickParamSpecialHit(tail)); break; case TBrickParam::HIT_ALL_AGGRESSORS: // $*STRUCT CSBrickParamHitAllAggressors TBrickParam::HIT_ALL_AGGRESSORS // $*-f float MinFactor // min factor on dealt damage (total damage divided among targets) // $*-f float MaxFactor // max factor on dealt damage (total damage divided among targets) - Params.push_back(new CSBrickParamHitAllAggressors(tail)); + Params.push_back(new CSBrickParamHitAllAggressors(tail)); break; case TBrickParam::WEAPON_WEAR_MOD: // $*STRUCT CSBrickParamWeaponWearMod TBrickParam::WEAPON_WEAR_MOD // $*-f float MinModifier // min weapon wear modifier // $*-f float MaxModifier // max weapon wear modifier - Params.push_back(new CSBrickParamWeaponWearMod(tail)); + Params.push_back(new CSBrickParamWeaponWearMod(tail)); break; case TBrickParam::CRITICAL_HIT_MOD: // $*STRUCT CSBrickParamCriticalHitMod TBrickParam::CRITICAL_HIT_MOD // $*-i uint8 MinModifier // min critical hit chance modifier // $*-i uint8 MaxModifier // max critical hit chance modifier - Params.push_back(new CSBrickParamCriticalHitMod(tail)); + Params.push_back(new CSBrickParamCriticalHitMod(tail)); break; - - - + + + /************************************************************************/ /* MAGIC params */ /************************************************************************/ @@ -954,50 +954,50 @@ void addParam(const std::string ¶mStr, std::vector &Par case TBrickParam::MA: // $*STRUCT CSBrickParamMaType TBrickParam::MA // $*-s std::string Type // type name - Params.push_back(new CSBrickParamMaType(tail)); + Params.push_back(new CSBrickParamMaType(tail)); break; case TBrickParam::MA_END: // $*STRUCT CSBrickParamMaEnd TBrickParam::MA_END - Params.push_back(new CSBrickParamMaEnd(tail)); + Params.push_back(new CSBrickParamMaEnd(tail)); break; case TBrickParam::MA_EFFECT: // $*STRUCT CSBrickParamMagicEffect TBrickParam::MA_EFFECT // $*-s std::string Effect // effect name - Params.push_back(new CSBrickParamMagicEffect(tail)); + Params.push_back(new CSBrickParamMagicEffect(tail)); break; - + case TBrickParam::MA_STAT: // $*STRUCT CSBrickParamMagicStat TBrickParam::MA_STAT // $*-s std::string Stat // affected stat // $*-s std::string Type // affected stat type - Params.push_back(new CSBrickParamMagicStat(tail)); + Params.push_back(new CSBrickParamMagicStat(tail)); break; - + case TBrickParam::MA_EFFECT_MOD: // $*STRUCT CSBrickParamMagicEffectMod TBrickParam::MA_EFFECT_MOD // $*-i sint32 EffectMod // effect modifier - Params.push_back(new CSBrickParamMagicEffectMod(tail)); + Params.push_back(new CSBrickParamMagicEffectMod(tail)); break; case TBrickParam::MA_EFFECT_MULT: // $*STRUCT CSBrickParamMagicEffectMult TBrickParam::MA_EFFECT_MULT // $*-f float EffectMult // effect modifier - Params.push_back(new CSBrickParamMagicEffectMult(tail)); + Params.push_back(new CSBrickParamMagicEffectMult(tail)); break; - + case TBrickParam::MA_CASTING_TIME: // $*STRUCT CSBrickParamCastingTime TBrickParam::MA_CASTING_TIME // $*-f float CastingTime= 0 // casting modifier in seconds - Params.push_back(new CSBrickParamCastingTime(tail)); + Params.push_back(new CSBrickParamCastingTime(tail)); break; case TBrickParam::MA_DMG_TYPE: // $*STRUCT CSBrickParamMagicDmgType TBrickParam::MA_DMG_TYPE // $*-s std::string DmgType // magic damage type - Params.push_back(new CSBrickParamMagicDmgType(tail)); + Params.push_back(new CSBrickParamMagicDmgType(tail)); break; case TBrickParam::MA_DMG: @@ -1005,62 +1005,62 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-i sint32 Hp = 0 // fixed modifier on energy // $*-i sint32 Sap = 0 // fixed modifier on energy // $*-i sint32 Sta = 0 // fixed modifier on energy - Params.push_back(new CSBrickParamMagicDmg(tail)); + Params.push_back(new CSBrickParamMagicDmg(tail)); break; case TBrickParam::MA_HEAL: // $*STRUCT CSBrickParamMagicHeal TBrickParam::MA_HEAL // $*-i sint32 Hp = 0 // fixed modifier on energy // $*-i sint32 Sap = 0 // fixed modifier on energy // $*-i sint32 Sta = 0 // fixed modifier on energy - Params.push_back(new CSBrickParamMagicHeal(tail)); + Params.push_back(new CSBrickParamMagicHeal(tail)); break; case TBrickParam::MA_RANGE: // $*STRUCT CSBrickParamMagicRanges TBrickParam::MA_RANGE // $*-i sint8 RangeIndex - Params.push_back(new CSBrickParamMagicRanges(tail)); + Params.push_back(new CSBrickParamMagicRanges(tail)); break; case TBrickParam::MA_LINK_COST: // $*STRUCT CSBrickParamMagicLinkCost TBrickParam::MA_LINK_COST // $*-i sint32 Cost - Params.push_back(new CSBrickParamMagicLinkCost(tail)); + Params.push_back(new CSBrickParamMagicLinkCost(tail)); break; case TBrickParam::MA_LINK_PERIOD: // $*STRUCT CSBrickParamMagicLinkPeriod TBrickParam::MA_LINK_PERIOD // $*-i uint32 Period - Params.push_back(new CSBrickParamMagicLinkPeriod(tail)); + Params.push_back(new CSBrickParamMagicLinkPeriod(tail)); break; case TBrickParam::MA_CURE: // $*STRUCT CSBrickParamMagicCure TBrickParam::MA_CURE // $*-s std::string Cure - Params.push_back(new CSBrickParamMagicCure(tail)); + Params.push_back(new CSBrickParamMagicCure(tail)); break; case TBrickParam::MA_LINK_POWER: // $*STRUCT CSBrickParamMagicLinkPower TBrickParam::MA_LINK_POWER // $*-i uint16 Power - Params.push_back(new CSBrickParamMagicLinkPower(tail)); + Params.push_back(new CSBrickParamMagicLinkPower(tail)); break; case TBrickParam::MA_BREAK_RES: // $*STRUCT CSBrickParamMagicBreakResist TBrickParam::MA_BREAK_RES // $*-i uint16 BreakResist // $*-i uint16 BreakResistPower - Params.push_back(new CSBrickParamMagicBreakResist(tail)); + Params.push_back(new CSBrickParamMagicBreakResist(tail)); break; case TBrickParam::MA_ARMOR_COMP: // $*STRUCT CSBrickParamMagicArmorComp TBrickParam::MA_ARMOR_COMP // $*-i uint16 ArmorComp - Params.push_back(new CSBrickParamMagicArmorComp(tail)); + Params.push_back(new CSBrickParamMagicArmorComp(tail)); break; case TBrickParam::MA_VAMPIRISE: // $*STRUCT CSBrickParamMagicVampirise TBrickParam::MA_VAMPIRISE // $*-i sint32 Vampirise - Params.push_back(new CSBrickParamMagicVampirise(tail)); + Params.push_back(new CSBrickParamMagicVampirise(tail)); break; case TBrickParam::MA_VAMPIRISE_RATIO: // $*STRUCT CSBrickParamMagicVampiriseRatio TBrickParam::MA_VAMPIRISE_RATIO // $*-f float VampiriseRatio - Params.push_back(new CSBrickParamMagicVampiriseRatio(tail)); + Params.push_back(new CSBrickParamMagicVampiriseRatio(tail)); break; /************************************************************************/ @@ -1070,67 +1070,67 @@ void addParam(const std::string ¶mStr, std::vector &Par case TBrickParam::CR_RECOMMENDED: // $*STRUCT CSBrickParamCraftRecommended TBrickParam::CR_RECOMMENDED // $*-i uint32 Recommended - Params.push_back(new CSBrickParamCraftRecommended(tail)); + Params.push_back(new CSBrickParamCraftRecommended(tail)); break; case TBrickParam::CR_HP: // $*STRUCT CSBrickParamCraftHP TBrickParam::CR_HP // $*-i sint32 HitPoint - Params.push_back(new CSBrickParamCraftHP(tail)); + Params.push_back(new CSBrickParamCraftHP(tail)); break; case TBrickParam::CR_SAP: // $*STRUCT CSBrickParamCraftSap TBrickParam::CR_SAP // $*-i sint32 Sap - Params.push_back(new CSBrickParamCraftSap(tail)); + Params.push_back(new CSBrickParamCraftSap(tail)); break; case TBrickParam::CR_STA: // $*STRUCT CSBrickParamCraftSta TBrickParam::CR_STA // $*-i sint32 Stamina - Params.push_back(new CSBrickParamCraftSta(tail)); + Params.push_back(new CSBrickParamCraftSta(tail)); break; case TBrickParam::CR_FOCUS: // $*STRUCT CSBrickParamCraftFocus TBrickParam::CR_FOCUS // $*-i uint32 Focus - Params.push_back(new CSBrickParamCraftFocus(tail)); + Params.push_back(new CSBrickParamCraftFocus(tail)); break; case TBrickParam::CR_QUALITY: // $*STRUCT CSBrickParamCraftQuality TBrickParam::CR_QUALITY // $*-i sint32 Quality - Params.push_back(new CSBrickParamCraftQuality(tail)); + Params.push_back(new CSBrickParamCraftQuality(tail)); break; case TBrickParam::CR_DURABILITY: // $*STRUCT CSBrickParamCraftDurability TBrickParam::CR_DURABILITY // $*-f float Durability - Params.push_back(new CSBrickParamCraftDurability(tail)); + Params.push_back(new CSBrickParamCraftDurability(tail)); break; case TBrickParam::CR_DAMAGE: // $*STRUCT CSBrickParamCraftDamage TBrickParam::CR_DAMAGE // $*-f float Damage - Params.push_back(new CSBrickParamCraftDamage(tail)); + Params.push_back(new CSBrickParamCraftDamage(tail)); break; case TBrickParam::CR_HITRATE: // $*STRUCT CSBrickParamCraftHitRate TBrickParam::CR_HITRATE // $*-f float HitRate - Params.push_back(new CSBrickParamCraftHitRate(tail)); + Params.push_back(new CSBrickParamCraftHitRate(tail)); break; case TBrickParam::CR_RANGE: // $*STRUCT CSBrickParamCraftRange TBrickParam::CR_RANGE // $*-f float Range - Params.push_back(new CSBrickParamCraftRange(tail)); + Params.push_back(new CSBrickParamCraftRange(tail)); break; case TBrickParam::CR_DMG_PROTECTION: // $*STRUCT CSBrickParamCraftDmgProtection TBrickParam::CR_DMG_PROTECTION // $*-f float DmgProtection - Params.push_back(new CSBrickParamCraftDmgProtection(tail)); + Params.push_back(new CSBrickParamCraftDmgProtection(tail)); break; case TBrickParam::CR_SAPLOAD: // $*STRUCT CSBrickParamCraftSapload TBrickParam::CR_SAPLOAD // $*-f float Sapload - Params.push_back(new CSBrickParamCraftSapload(tail)); + Params.push_back(new CSBrickParamCraftSapload(tail)); break; case TBrickParam::CR_WEIGHT: // $*STRUCT CSBrickParamCraftWeight TBrickParam::CR_WEIGHT // $*-f float Weight - Params.push_back(new CSBrickParamCraftWeight(tail)); + Params.push_back(new CSBrickParamCraftWeight(tail)); break; /************************************************************************/ @@ -1301,7 +1301,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-i uint16 TauntPower // entities of higher level cannot be taunt // $*-f float Range // effective range in meters // $*-f float DisableTime // disable taunt powers for x seconds - Params.push_back(new CSBrickParamPowerTaunt(tail)); + Params.push_back(new CSBrickParamPowerTaunt(tail)); break; case TBrickParam::SP_SHIELDING: @@ -1313,8 +1313,8 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-i uint8 ShieldProtectionFactor // granted protection in % with a shield // $*-i uint16 ShieldProtectionMax // max protection with a shield // $*-f float Duration // power duration - // $*-f float DisableTime // disable power for x seconds - Params.push_back(new CSBrickParamShielding(tail)); + // $*-f float DisableTime // disable power for x seconds + Params.push_back(new CSBrickParamShielding(tail)); break; case TBrickParam::SP_LIFE_AURA: @@ -1324,7 +1324,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Radius // aura radius in meters // $*-f float TargetDisableTime // disable life aura for x seconds on targets // $*-f float UserDisableTime // disable life aura for x seconds on user - Params.push_back(new CSBrickParamLifeAura(tail)); + Params.push_back(new CSBrickParamLifeAura(tail)); break; case TBrickParam::SP_LIFE_AURA2: @@ -1344,7 +1344,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Radius // aura radius in meters // $*-f float TargetDisableTime // disable life aura for x seconds on targets // $*-f float UserDisableTime // disable life aura for x seconds on user - Params.push_back(new CSBrickParamStaminaAura(tail)); + Params.push_back(new CSBrickParamStaminaAura(tail)); break; case TBrickParam::SP_STAMINA_AURA2: @@ -1354,7 +1354,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Radius // aura radius in meters // $*-f float TargetDisableTime // disable life aura for x seconds on targets // $*-f float UserDisableTime // disable life aura for x seconds on user - Params.push_back(new CSBrickParamStaminaAura2(tail)); + Params.push_back(new CSBrickParamStaminaAura2(tail)); break; case TBrickParam::SP_SAP_AURA: @@ -1364,7 +1364,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Radius // aura radius in meters // $*-f float TargetDisableTime // disable life aura for x seconds on targets // $*-f float UserDisableTime // disable life aura for x seconds on user - Params.push_back(new CSBrickParamSapAura(tail)); + Params.push_back(new CSBrickParamSapAura(tail)); break; case TBrickParam::SP_SAP_AURA2: @@ -1374,21 +1374,21 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Radius // aura radius in meters // $*-f float TargetDisableTime // disable life aura for x seconds on targets // $*-f float UserDisableTime // disable life aura for x seconds on user - Params.push_back(new CSBrickParamSapAura2(tail)); + Params.push_back(new CSBrickParamSapAura2(tail)); break; case TBrickParam::SP_SPEEDING_UP: // $*STRUCT CSBrickParamSpeedingUp TBrickParam::SP_SPEEDING_UP // $*-i uint16 SpeedMod // speed modifier (in %) // $*-f float Duration // duration in seconds - // $*-f float DisableTime // disable power for x seconds - Params.push_back(new CSBrickParamSpeedingUp(tail)); + // $*-f float DisableTime // disable power for x seconds + Params.push_back(new CSBrickParamSpeedingUp(tail)); break; case TBrickParam::SP_INVULNERABILITY: // $*STRUCT CSBrickParamInvulnerability TBrickParam::SP_INVULNERABILITY // $*-f float Duration // duration in seconds - // $*-f float DisableTime // disable power for x seconds + // $*-f float DisableTime // disable power for x seconds Params.push_back(new CSBrickParamInvulnerability(tail)); break; @@ -1435,7 +1435,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration in seconds // $*-f float TargetDisableTime // disable aura for x seconds on targets // $*-f float UserDisableTime // disable aura for x seconds on user - // $*-i sint16 Damage // damage + // $*-i sint16 Damage // damage Params.push_back(new CSBrickParamFireWall(tail)); break; @@ -1445,7 +1445,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration in seconds // $*-f float TargetDisableTime // disable aura for x seconds on targets // $*-f float UserDisableTime // disable aura for x seconds on user - // $*-i sint16 Damage // damage + // $*-i sint16 Damage // damage Params.push_back(new CSBrickParamThornWall(tail)); break; @@ -1455,7 +1455,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration in seconds // $*-f float TargetDisableTime // disable aura for x seconds on targets // $*-f float UserDisableTime // disable aura for x seconds on user - // $*-i sint16 Damage // damage + // $*-i sint16 Damage // damage Params.push_back(new CSBrickParamWaterWall(tail)); break; @@ -1465,7 +1465,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float Duration // duration in seconds // $*-f float TargetDisableTime // disable aura for x seconds on targets // $*-f float UserDisableTime // disable aura for x seconds on user - // $*-i sint16 Damage // damage + // $*-i sint16 Damage // damage Params.push_back(new CSBrickParamLightningWall(tail)); break; @@ -1478,7 +1478,7 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-i uint16 DamageBonus // damage bonus (20 = +20 damage points before success factor) Params.push_back(new CSBrickParamBerserk(tail)); break; - + case TBrickParam::SP_ENCHANT_WEAPON: // $*STRUCT CSBrickParamEnchantWeapon TBrickParam::SP_ENCHANT_WEAPON // $*-f float DisableTime // disable berserker power for x seconds @@ -1497,25 +1497,25 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-f float DisableTime // duration in seconds Params.push_back(new CSBrickParamCalmAnimal(tail)); break; - + case TBrickParam::NEEDED_BRICK_FLAG: // $*STRUCT CSBrickParamNeededBrickFlag TBrickParam::NEEDED_BRICK_FLAG // $*-s std::string Flag - Params.push_back(new CSBrickParamNeededBrickFlag(tail)); + Params.push_back(new CSBrickParamNeededBrickFlag(tail)); break; case TBrickParam::SP_BALANCE: // $*STRUCT CSBrickParamBalance TBrickParam::SP_BALANCE // $*-f float DisableTime // disable power for x seconds - // $*-s std::string AffectedScore // affected score + // $*-s std::string AffectedScore // affected score // $*-f float Range // power range // $*-f float LossFactor // score loss factor in % Params.push_back(new CSBrickParamBalance(tail)); break; - + case TBrickParam::SP_HEAL: // $*STRUCT CSBrickParamHeal TBrickParam::SP_HEAL - // $*-s std::string AffectedScore // affected score + // $*-s std::string AffectedScore // affected score // $*-i sint32 HealValue // value added to affected score // $*-f float HealFactorValue // value added to affected score in % of max target score // $*-f float DisableTime // disable power for x seconds @@ -1626,27 +1626,27 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamAreaBomb TBrickParam::AREA_BOMB // $*-f float Radius // Radius // $*-f float MinFactor // MinFactor when we are at extreme range - Params.push_back(new CSBrickParamAreaBomb(tail)); + Params.push_back(new CSBrickParamAreaBomb(tail)); break; case TBrickParam::AREA_SPRAY: // $*STRUCT CSBrickParamAreaSpray TBrickParam::AREA_SPRAY // $*-i uint8 Angle // angle in degree // $*-f float Height // height of the trapezoid // $*-f float Base // little base length - Params.push_back(new CSBrickParamAreaSpray(tail)); + Params.push_back(new CSBrickParamAreaSpray(tail)); break; case TBrickParam::AREA_CHAIN: // $*STRUCT CSBrickParamAreaChain TBrickParam::AREA_CHAIN // $*-f float Range // range between 2 targets // $*-i uint8 MaxTargets // max nb targets // $*-f float Factor // damage factor - Params.push_back(new CSBrickParamAreaChain(tail)); + Params.push_back(new CSBrickParamAreaChain(tail)); break; case TBrickParam::AREA_TARGETS: // $*STRUCT CSBrickParamAreaTargets TBrickParam::AREA_TARGETS // $*-f float TargetFactor // each target count as 'TargetFactor' for damage or heal division among targets // $*-i uint8 MaxTargets // max nb targets - Params.push_back(new CSBrickParamAreaTargets(tail)); + Params.push_back(new CSBrickParamAreaTargets(tail)); break; /************************************************************************/ @@ -1655,7 +1655,7 @@ void addParam(const std::string ¶mStr, std::vector &Par case TBrickParam::MA_RECHARGE: // $*STRUCT CSBrickParamMagicRecharge TBrickParam::MA_RECHARGE // $*-i uint32 SapLoad // sap load - Params.push_back(new CSBrickParamMagicRecharge(tail)); + Params.push_back(new CSBrickParamMagicRecharge(tail)); break; /************************************************************************/ @@ -1665,14 +1665,14 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*STRUCT CSBrickParamCharacUpgrade TBrickParam::CHARAC_UPGRADE // $*-s std::string Characteristic // affected characteristic // $*-i uint32 Modifier // bonus on charac - Params.push_back(new CSBrickParamCharacUpgrade(tail)); + Params.push_back(new CSBrickParamCharacUpgrade(tail)); break; - + case TBrickParam::SCORE_UPGRADE: // $*STRUCT CSBrickParamScoreUpgrade TBrickParam::SCORE_UPGRADE // $*-s std::string Score // affected score // $*-i sint32 Modifier // modifier on score - Params.push_back(new CSBrickParamScoreUpgrade(tail)); + Params.push_back(new CSBrickParamScoreUpgrade(tail)); break; /************************************************************************/ @@ -1680,27 +1680,27 @@ void addParam(const std::string ¶mStr, std::vector &Par /************************************************************************/ case TBrickParam::TA_TELEPORT: // $*STRUCT CSBrickParamTeleport TBrickParam::TA_TELEPORT - Params.push_back(new CSBrickParamTeleport(tail)); + Params.push_back(new CSBrickParamTeleport(tail)); break; case TBrickParam::TA_DISCONNECT: // $*STRUCT CSBrickParamDisconnect TBrickParam::TA_DISCONNECT - Params.push_back(new CSBrickParamDisconnect(tail)); + Params.push_back(new CSBrickParamDisconnect(tail)); break; case TBrickParam::TA_MOUNT: // $*STRUCT CSBrickParamMount TBrickParam::TA_MOUNT - Params.push_back(new CSBrickParamMount(tail)); + Params.push_back(new CSBrickParamMount(tail)); break; case TBrickParam::TA_UNMOUNT: // $*STRUCT CSBrickParamUnmount TBrickParam::TA_UNMOUNT - Params.push_back(new CSBrickParamUnmount(tail)); + Params.push_back(new CSBrickParamUnmount(tail)); break; case TBrickParam::TA_CONSUME: // $*STRUCT CSBrickParamConsumeItem TBrickParam::TA_CONSUME - Params.push_back(new CSBrickParamConsumeItem(tail)); + Params.push_back(new CSBrickParamConsumeItem(tail)); break; case TBrickParam::JEWEL_ATTRS: @@ -1708,26 +1708,28 @@ void addParam(const std::string ¶mStr, std::vector &Par // $*-s std::string Attribute // attribute name // $*-s std::string Value // attribute value // $*-i uint32 Charge // initial charge of sapload - // $*-i uint32 Modifier // onus on attribute - Params.push_back(new CSBrickParamJewelAttrs(tail)); + // $*-i uint32 Modifier // Bonus on attribute + // $*-i uint32 Faction // Required faction + // $*-i uint32 Fame // Required fame in faction (if fame >= 30, require the rite too) + Params.push_back(new CSBrickParamJewelAttrs(tail)); break; } } // addParam // //-------------------------------------------------------------- -// loadFaber() +// loadFaber() //-------------------------------------------------------------- void CStaticBrick::loadFaber( const UFormElm &root, const CSheetId &sheetId ) { if ( Faber == NULL) Faber = new CFaber(); - + const UFormElm *faber = NULL; - + string value; string groupFamily; string propName; uint16 quantity = 0; - + root.getValueByName( value, "faber.Create.Crafted Item" ); Faber->CraftedItem = CSheetId(value); @@ -1777,12 +1779,12 @@ void CStaticBrick::loadFaber( const UFormElm &root, const CSheetId &sheetId ) root.getValueByName( Faber->FocusBonusPerLevel, "faber.FocusBonusPerLevel" ); root.getValueByName( Faber->AllowPartialSuccess, "faber.AllowPartialSuccess" ); - + for (uint i = 1 ; i <= 5 ; ++i) { propName = "faber.Create.MP "+toString(i); if (root.getValueByName( value, propName.c_str() ) && !value.empty() ) - { + { propName = "faber.Create.Quantity "+toString(i); if ( root.getValueByName( quantity, propName.c_str() ) && quantity > 0) { @@ -1798,9 +1800,9 @@ void CStaticBrick::loadFaber( const UFormElm &root, const CSheetId &sheetId ) { propName = "faber.Create.MP formula "+toString(i); if (root.getValueByName( value, propName.c_str() ) && !value.empty() ) - { + { propName = "faber.Create.Quantity formula "+toString(i); - if( root.getValueByName( quantity, propName.c_str() ) && quantity > 0) + if( root.getValueByName( quantity, propName.c_str() ) && quantity > 0) { CFaber::TRawMaterialFormula mpFormula; mpFormula.MpType = CSheetId(value); @@ -1813,7 +1815,7 @@ void CStaticBrick::loadFaber( const UFormElm &root, const CSheetId &sheetId ) //-------------------------------------------------------------- -// getBrickFromFamilyIndex() +// getBrickFromFamilyIndex() //-------------------------------------------------------------- const CStaticBrick *CStaticBrick::getBrickFromFamilyIndex(uint16 family, uint16 index) { diff --git a/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp.h b/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp.h index 2f06d7982..b400b9c7c 100644 --- a/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp.h +++ b/ryzom/server/src/entities_game_service/egs_sheets/egs_static_brick.cpp.h @@ -306,7 +306,7 @@ public: if (copyOfStr=="sp_life_aura2") {_Value=SP_LIFE_AURA2; return *this;} if (copyOfStr=="sp_stamina_aura") {_Value=SP_STAMINA_AURA; return *this;} if (copyOfStr=="sp_stamina_aura2") {_Value=SP_STAMINA_AURA2; return *this;} - if (copyOfStr=="sp_sap_aura") {_Value=SP_SAP_AURA; return *this;} + if (copyOfStr=="sp_sap_aura") {_Value=SP_SAP_AURA; return *this;} if (copyOfStr=="sp_sap_aura2") {_Value=SP_SAP_AURA2; return *this;} if (copyOfStr=="sp_speeding_up") {_Value=SP_SPEEDING_UP; return *this;} if (copyOfStr=="sp_invulnerability") {_Value=SP_INVULNERABILITY; return *this;} @@ -492,25 +492,25 @@ struct CSBrickParamStaWeightFactor : public TBrickParam::IId { _Id = TBrickParam::STA_WEIGHT_FACTOR; } - + CSBrickParamStaWeightFactor(const std::string&str) { *this=CSBrickParamStaWeightFactor(); *this=str; } - + const CSBrickParamStaWeightFactor& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()!=2) return *this; - + ParsedOk=true; StaFactor=(float)atof(args[0].c_str()); NLMISC::fromString(args[1], StaConst); - + return *this; } }; @@ -919,7 +919,7 @@ struct CSBrickParamThrowOffBalance : public TBrickParam::IId { // effect min duration float MinDuration; - // effect max duration + // effect max duration float MaxDuration; CSBrickParamThrowOffBalance(): @@ -1262,7 +1262,7 @@ struct CSBrickParamSlowCast : public TBrickParam::IId struct CSBrickParamOpening1 : public TBrickParam::IId { - + std::string EventFlag; CSBrickParamOpening1(): @@ -1295,9 +1295,9 @@ struct CSBrickParamOpening1 : public TBrickParam::IId struct CSBrickParamOpening2 : public TBrickParam::IId { - + std::string EventFlag1; - + std::string EventFlag2; CSBrickParamOpening2(): @@ -1332,11 +1332,11 @@ struct CSBrickParamOpening2 : public TBrickParam::IId struct CSBrickParamOpening3 : public TBrickParam::IId { - + std::string EventFlag1; - + std::string EventFlag2; - + std::string EventFlag3; CSBrickParamOpening3(): @@ -1982,7 +1982,7 @@ struct CSBrickParamMagicHeal : public TBrickParam::IId struct CSBrickParamMagicRanges : public TBrickParam::IId { - + sint8 RangeIndex; CSBrickParamMagicRanges(): @@ -2015,7 +2015,7 @@ struct CSBrickParamMagicRanges : public TBrickParam::IId struct CSBrickParamMagicLinkCost : public TBrickParam::IId { - + sint32 Cost; CSBrickParamMagicLinkCost(): @@ -2048,7 +2048,7 @@ struct CSBrickParamMagicLinkCost : public TBrickParam::IId struct CSBrickParamMagicLinkPeriod : public TBrickParam::IId { - + uint32 Period; CSBrickParamMagicLinkPeriod(): @@ -2081,7 +2081,7 @@ struct CSBrickParamMagicLinkPeriod : public TBrickParam::IId struct CSBrickParamMagicCure : public TBrickParam::IId { - + std::string Cure; CSBrickParamMagicCure(): @@ -2114,7 +2114,7 @@ struct CSBrickParamMagicCure : public TBrickParam::IId struct CSBrickParamMagicLinkPower : public TBrickParam::IId { - + uint16 Power; CSBrickParamMagicLinkPower(): @@ -2147,9 +2147,9 @@ struct CSBrickParamMagicLinkPower : public TBrickParam::IId struct CSBrickParamMagicBreakResist : public TBrickParam::IId { - + uint16 BreakResist; - + uint16 BreakResistPower; CSBrickParamMagicBreakResist(): @@ -2184,7 +2184,7 @@ struct CSBrickParamMagicBreakResist : public TBrickParam::IId struct CSBrickParamMagicArmorComp : public TBrickParam::IId { - + uint16 ArmorComp; CSBrickParamMagicArmorComp(): @@ -2217,7 +2217,7 @@ struct CSBrickParamMagicArmorComp : public TBrickParam::IId struct CSBrickParamMagicVampirise : public TBrickParam::IId { - + sint32 Vampirise; CSBrickParamMagicVampirise(): @@ -2250,7 +2250,7 @@ struct CSBrickParamMagicVampirise : public TBrickParam::IId struct CSBrickParamMagicVampiriseRatio : public TBrickParam::IId { - + float VampiriseRatio; CSBrickParamMagicVampiriseRatio(): @@ -2283,7 +2283,7 @@ struct CSBrickParamMagicVampiriseRatio : public TBrickParam::IId struct CSBrickParamCraftRecommended : public TBrickParam::IId { - + uint32 Recommended; CSBrickParamCraftRecommended(): @@ -2316,7 +2316,7 @@ struct CSBrickParamCraftRecommended : public TBrickParam::IId struct CSBrickParamCraftHP : public TBrickParam::IId { - + sint32 HitPoint; CSBrickParamCraftHP(): @@ -2349,7 +2349,7 @@ struct CSBrickParamCraftHP : public TBrickParam::IId struct CSBrickParamCraftSap : public TBrickParam::IId { - + sint32 Sap; CSBrickParamCraftSap(): @@ -2382,7 +2382,7 @@ struct CSBrickParamCraftSap : public TBrickParam::IId struct CSBrickParamCraftSta : public TBrickParam::IId { - + sint32 Stamina; CSBrickParamCraftSta(): @@ -2415,7 +2415,7 @@ struct CSBrickParamCraftSta : public TBrickParam::IId struct CSBrickParamCraftFocus : public TBrickParam::IId { - + uint32 Focus; CSBrickParamCraftFocus(): @@ -2448,7 +2448,7 @@ struct CSBrickParamCraftFocus : public TBrickParam::IId struct CSBrickParamCraftQuality : public TBrickParam::IId { - + sint32 Quality; CSBrickParamCraftQuality(): @@ -2481,7 +2481,7 @@ struct CSBrickParamCraftQuality : public TBrickParam::IId struct CSBrickParamCraftDurability : public TBrickParam::IId { - + float Durability; CSBrickParamCraftDurability(): @@ -2514,7 +2514,7 @@ struct CSBrickParamCraftDurability : public TBrickParam::IId struct CSBrickParamCraftDamage : public TBrickParam::IId { - + float Damage; CSBrickParamCraftDamage(): @@ -2547,7 +2547,7 @@ struct CSBrickParamCraftDamage : public TBrickParam::IId struct CSBrickParamCraftHitRate : public TBrickParam::IId { - + float HitRate; CSBrickParamCraftHitRate(): @@ -2580,7 +2580,7 @@ struct CSBrickParamCraftHitRate : public TBrickParam::IId struct CSBrickParamCraftRange : public TBrickParam::IId { - + float Range; CSBrickParamCraftRange(): @@ -2613,7 +2613,7 @@ struct CSBrickParamCraftRange : public TBrickParam::IId struct CSBrickParamCraftDmgProtection : public TBrickParam::IId { - + float DmgProtection; CSBrickParamCraftDmgProtection(): @@ -2646,7 +2646,7 @@ struct CSBrickParamCraftDmgProtection : public TBrickParam::IId struct CSBrickParamCraftSapload : public TBrickParam::IId { - + float Sapload; CSBrickParamCraftSapload(): @@ -2679,7 +2679,7 @@ struct CSBrickParamCraftSapload : public TBrickParam::IId struct CSBrickParamCraftWeight : public TBrickParam::IId { - + float Weight; CSBrickParamCraftWeight(): @@ -2712,7 +2712,7 @@ struct CSBrickParamCraftWeight : public TBrickParam::IId struct CSBrickParamForageRange : public TBrickParam::IId { - + float Range; CSBrickParamForageRange(): @@ -2745,7 +2745,7 @@ struct CSBrickParamForageRange : public TBrickParam::IId struct CSBrickParamForageLocateDepositRange : public TBrickParam::IId { - + float Range; CSBrickParamForageLocateDepositRange(): @@ -2778,7 +2778,7 @@ struct CSBrickParamForageLocateDepositRange : public TBrickParam::IId struct CSBrickParamForageAngle : public TBrickParam::IId { - + uint32 Angle; CSBrickParamForageAngle(): @@ -2811,7 +2811,7 @@ struct CSBrickParamForageAngle : public TBrickParam::IId struct CSBrickParamForageMulti : public TBrickParam::IId { - + uint32 Limit; CSBrickParamForageMulti(): @@ -2844,7 +2844,7 @@ struct CSBrickParamForageMulti : public TBrickParam::IId struct CSBrickParamForageKnowledge : public TBrickParam::IId { - + uint8 Know; CSBrickParamForageKnowledge(): @@ -2877,7 +2877,7 @@ struct CSBrickParamForageKnowledge : public TBrickParam::IId struct CSBrickParamForageTime : public TBrickParam::IId { - + float Time; CSBrickParamForageTime(): @@ -2910,7 +2910,7 @@ struct CSBrickParamForageTime : public TBrickParam::IId struct CSBrickParamForageSourceTime : public TBrickParam::IId { - + float Time; CSBrickParamForageSourceTime(): @@ -2943,7 +2943,7 @@ struct CSBrickParamForageSourceTime : public TBrickParam::IId struct CSBrickParamForageStatEnergy : public TBrickParam::IId { - + float StatEnergy; CSBrickParamForageStatEnergy(): @@ -2976,7 +2976,7 @@ struct CSBrickParamForageStatEnergy : public TBrickParam::IId struct CSBrickParamStatEnergyOnly : public TBrickParam::IId { - + uint8 StatEnergyExact; CSBrickParamStatEnergyOnly(): @@ -3009,7 +3009,7 @@ struct CSBrickParamStatEnergyOnly : public TBrickParam::IId struct CSBrickParamForageVisDist : public TBrickParam::IId { - + float Dist; CSBrickParamForageVisDist(): @@ -3042,7 +3042,7 @@ struct CSBrickParamForageVisDist : public TBrickParam::IId struct CSBrickParamForageVisStealth : public TBrickParam::IId { - + uint8 Mode; CSBrickParamForageVisStealth(): @@ -3075,7 +3075,7 @@ struct CSBrickParamForageVisStealth : public TBrickParam::IId struct CSBrickParamForageSourceLocator : public TBrickParam::IId { - + uint8 Flag; CSBrickParamForageSourceLocator(): @@ -3108,7 +3108,7 @@ struct CSBrickParamForageSourceLocator : public TBrickParam::IId struct CSBrickParamForageAttempts : public TBrickParam::IId { - + uint16 Nb; CSBrickParamForageAttempts(): @@ -3141,7 +3141,7 @@ struct CSBrickParamForageAttempts : public TBrickParam::IId struct CSBrickParamForageAbsorptionS : public TBrickParam::IId { - + float Absorption; CSBrickParamForageAbsorptionS(): @@ -3174,7 +3174,7 @@ struct CSBrickParamForageAbsorptionS : public TBrickParam::IId struct CSBrickParamForageAbsorptionA : public TBrickParam::IId { - + float Absorption; CSBrickParamForageAbsorptionA(): @@ -3207,7 +3207,7 @@ struct CSBrickParamForageAbsorptionA : public TBrickParam::IId struct CSBrickParamForageAbsorptionQ : public TBrickParam::IId { - + float Absorption; CSBrickParamForageAbsorptionQ(): @@ -3240,7 +3240,7 @@ struct CSBrickParamForageAbsorptionQ : public TBrickParam::IId struct CSBrickParamForagePeriod : public TBrickParam::IId { - + float Period; CSBrickParamForagePeriod(): @@ -3273,7 +3273,7 @@ struct CSBrickParamForagePeriod : public TBrickParam::IId struct CSBrickParamForageAperture : public TBrickParam::IId { - + float Aperture; CSBrickParamForageAperture(): @@ -3306,7 +3306,7 @@ struct CSBrickParamForageAperture : public TBrickParam::IId struct CSBrickParamForageQuality : public TBrickParam::IId { - + float Quality; CSBrickParamForageQuality(): @@ -3339,7 +3339,7 @@ struct CSBrickParamForageQuality : public TBrickParam::IId struct CSBrickParamForagePreservation : public TBrickParam::IId { - + float Pres; CSBrickParamForagePreservation(): @@ -3372,7 +3372,7 @@ struct CSBrickParamForagePreservation : public TBrickParam::IId struct CSBrickParamForageStability : public TBrickParam::IId { - + float Stab; CSBrickParamForageStability(): @@ -3405,7 +3405,7 @@ struct CSBrickParamForageStability : public TBrickParam::IId struct CSBrickParamForageCreatureStealth : public TBrickParam::IId { - + float Stealth; CSBrickParamForageCreatureStealth(): @@ -3438,7 +3438,7 @@ struct CSBrickParamForageCreatureStealth : public TBrickParam::IId struct CSBrickParamForageAbsorbSourceDmg : public TBrickParam::IId { - + uint8 Percent; CSBrickParamForageAbsorbSourceDmg(): @@ -3471,7 +3471,7 @@ struct CSBrickParamForageAbsorbSourceDmg : public TBrickParam::IId struct CSBrickParamKamiOffering : public TBrickParam::IId { - + uint32 Num; CSBrickParamKamiOffering(): @@ -3504,7 +3504,7 @@ struct CSBrickParamKamiOffering : public TBrickParam::IId struct CSBrickParamKamiAngerDecrease : public TBrickParam::IId { - + float Delta; CSBrickParamKamiAngerDecrease(): @@ -3537,7 +3537,7 @@ struct CSBrickParamKamiAngerDecrease : public TBrickParam::IId struct CSBrickParamForageReduceDamage : public TBrickParam::IId { - + float Ratio; CSBrickParamForageReduceDamage(): @@ -3570,7 +3570,7 @@ struct CSBrickParamForageReduceDamage : public TBrickParam::IId struct CSBrickParamForageEcotypeSpec : public TBrickParam::IId { - + std::string Ecotype; CSBrickParamForageEcotypeSpec(): @@ -3603,7 +3603,7 @@ struct CSBrickParamForageEcotypeSpec : public TBrickParam::IId struct CSBrickParamForageRMGroupFilter : public TBrickParam::IId { - + uint32 Value; CSBrickParamForageRMGroupFilter(): @@ -3636,7 +3636,7 @@ struct CSBrickParamForageRMGroupFilter : public TBrickParam::IId struct CSBrickParamForageRMFamilyFilter : public TBrickParam::IId { - + uint32 Value; CSBrickParamForageRMFamilyFilter(): @@ -3669,7 +3669,7 @@ struct CSBrickParamForageRMFamilyFilter : public TBrickParam::IId struct CSBrickParamForageItemPartFilter : public TBrickParam::IId { - + uint32 ItemPartIndex; CSBrickParamForageItemPartFilter(): @@ -3757,7 +3757,7 @@ struct CSBrickParamShielding : public TBrickParam::IId uint16 ShieldProtectionMax; // power duration float Duration; - // disable power for x seconds + // disable power for x seconds float DisableTime; CSBrickParamShielding(): @@ -4095,7 +4095,7 @@ struct CSBrickParamSpeedingUp : public TBrickParam::IId uint16 SpeedMod; // duration in seconds float Duration; - // disable power for x seconds + // disable power for x seconds float DisableTime; CSBrickParamSpeedingUp(): @@ -4134,7 +4134,7 @@ struct CSBrickParamInvulnerability : public TBrickParam::IId { // duration in seconds float Duration; - // disable power for x seconds + // disable power for x seconds float DisableTime; CSBrickParamInvulnerability(): @@ -4361,7 +4361,7 @@ struct CSBrickParamFireWall : public TBrickParam::IId float TargetDisableTime; // disable aura for x seconds on user float UserDisableTime; - // damage + // damage sint16 Damage; CSBrickParamFireWall(): @@ -4410,7 +4410,7 @@ struct CSBrickParamThornWall : public TBrickParam::IId float TargetDisableTime; // disable aura for x seconds on user float UserDisableTime; - // damage + // damage sint16 Damage; CSBrickParamThornWall(): @@ -4459,7 +4459,7 @@ struct CSBrickParamWaterWall : public TBrickParam::IId float TargetDisableTime; // disable aura for x seconds on user float UserDisableTime; - // damage + // damage sint16 Damage; CSBrickParamWaterWall(): @@ -4508,7 +4508,7 @@ struct CSBrickParamLightningWall : public TBrickParam::IId float TargetDisableTime; // disable aura for x seconds on user float UserDisableTime; - // damage + // damage sint16 Damage; CSBrickParamLightningWall(): @@ -4688,7 +4688,7 @@ struct CSBrickParamCalmAnimal : public TBrickParam::IId struct CSBrickParamNeededBrickFlag : public TBrickParam::IId { - + std::string Flag; CSBrickParamNeededBrickFlag(): @@ -4723,7 +4723,7 @@ struct CSBrickParamBalance : public TBrickParam::IId { // disable power for x seconds float DisableTime; - // affected score + // affected score std::string AffectedScore; // power range float Range; @@ -4766,7 +4766,7 @@ struct CSBrickParamBalance : public TBrickParam::IId struct CSBrickParamHeal : public TBrickParam::IId { - // affected score + // affected score std::string AffectedScore; // value added to affected score sint32 HealValue; @@ -4848,7 +4848,7 @@ struct CSBrickParamRecastTime : public TBrickParam::IId struct CSBrickParamBonusFgExtractionTimeGC : public TBrickParam::IId { - + float AdditionalTimeGC; CSBrickParamBonusFgExtractionTimeGC(): @@ -4881,7 +4881,7 @@ struct CSBrickParamBonusFgExtractionTimeGC : public TBrickParam::IId struct CSBrickParamBonusCrDurability : public TBrickParam::IId { - + float Bonus; CSBrickParamBonusCrDurability(): @@ -4914,7 +4914,7 @@ struct CSBrickParamBonusCrDurability : public TBrickParam::IId struct CSBrickParamBonusLandmarkNumber : public TBrickParam::IId { - + float Nb; CSBrickParamBonusLandmarkNumber(): @@ -5188,14 +5188,17 @@ struct CSBrickParamJewelAttrs : public TBrickParam::IId uint32 Modifier; // required Faction std::string RequiredFaction; + // required Fame + sint32 RequiredFame; CSBrickParamJewelAttrs(): Attribute(), Value(), Charge(), Modifier(), - RequiredFaction() - + RequiredFaction(), + RequiredFame() + { _Id = TBrickParam::JEWEL_ATTRS; } @@ -5223,7 +5226,12 @@ struct CSBrickParamJewelAttrs : public TBrickParam::IId RequiredFaction = args[4].c_str(); else RequiredFaction = ""; - + + if (!RequiredFaction.empty() && args.size() > 5) + NLMISC::fromString(args[5], RequiredFame); + else + RequiredFame = -200; + return *this; } }; @@ -5413,7 +5421,7 @@ struct CSBrickParamConsumeItem : public TBrickParam::IId struct CSBrickParamChgCharac : public TBrickParam::IId { - // affected characteristic + // affected characteristic std::string AffectedCharac; // coefficient to modify characteristic proportionally to item level float ModifierCoefficient; @@ -5421,7 +5429,7 @@ struct CSBrickParamChgCharac : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamChgCharac(): AffectedCharac(), ModifierCoefficient(), @@ -5430,21 +5438,21 @@ struct CSBrickParamChgCharac : public TBrickParam::IId { _Id = TBrickParam::SP_CHG_CHARAC; } - + CSBrickParamChgCharac(const std::string&str) { *this=CSBrickParamChgCharac(); *this=str; } - + const CSBrickParamChgCharac& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()!=4 && args.size()!=5) return *this; - + ParsedOk=true; AffectedCharac=args[0].c_str(); ModifierCoefficient=(float)atof(args[1].c_str()); @@ -5466,7 +5474,7 @@ struct CSBrickParamModDefense : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamModDefense(): DefenseMode(), ModifierCoefficient(), @@ -5475,21 +5483,21 @@ struct CSBrickParamModDefense : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_DEFENSE; } - + CSBrickParamModDefense(const std::string&str) { *this=CSBrickParamModDefense(); *this=str; } - + const CSBrickParamModDefense& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()<4) return *this; - + ParsedOk=true; DefenseMode=args[0].c_str(); ModifierCoefficient=(float)atof(args[1].c_str()); @@ -5509,7 +5517,7 @@ struct CSBrickParamModCraftSuccess : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamModCraftSuccess(): ModifierCoefficient(), ModifierConstant(), @@ -5517,21 +5525,21 @@ struct CSBrickParamModCraftSuccess : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_CRAFT_SUCCESS; } - + CSBrickParamModCraftSuccess(const std::string&str) { *this=CSBrickParamModCraftSuccess(); *this=str; } - + const CSBrickParamModCraftSuccess& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()<3) return *this; - + ParsedOk=true; ModifierCoefficient=(float)atof(args[0].c_str()); ModifierConstant=(float)atof(args[1].c_str()); @@ -5550,7 +5558,7 @@ struct CSBrickParamModMeleeSuccess : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamModMeleeSuccess(): ModifierCoefficient(), ModifierConstant(), @@ -5558,21 +5566,21 @@ struct CSBrickParamModMeleeSuccess : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_MELEE_SUCCESS; } - + CSBrickParamModMeleeSuccess(const std::string&str) { *this=CSBrickParamModMeleeSuccess(); *this=str; } - + const CSBrickParamModMeleeSuccess& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()<3) return *this; - + ParsedOk=true; ModifierCoefficient=(float)atof(args[0].c_str()); ModifierConstant=(float)atof(args[1].c_str()); @@ -5591,7 +5599,7 @@ struct CSBrickParamModRangeSuccess : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamModRangeSuccess(): ModifierCoefficient(), ModifierConstant(), @@ -5599,21 +5607,21 @@ struct CSBrickParamModRangeSuccess : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_RANGE_SUCCESS; } - + CSBrickParamModRangeSuccess(const std::string&str) { *this=CSBrickParamModRangeSuccess(); *this=str; } - + const CSBrickParamModRangeSuccess& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()<3) return *this; - + ParsedOk=true; ModifierCoefficient=(float)atof(args[0].c_str()); ModifierConstant=(float)atof(args[1].c_str()); @@ -5632,7 +5640,7 @@ struct CSBrickParamModMagicSuccess : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamModMagicSuccess(): ModifierCoefficient(), ModifierConstant(), @@ -5640,21 +5648,21 @@ struct CSBrickParamModMagicSuccess : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_MAGIC_SUCCESS; } - + CSBrickParamModMagicSuccess(const std::string&str) { *this=CSBrickParamModMagicSuccess(); *this=str; } - + const CSBrickParamModMagicSuccess& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()<3) return *this; - + ParsedOk=true; ModifierCoefficient=(float)atof(args[0].c_str()); ModifierConstant=(float)atof(args[1].c_str()); @@ -5676,7 +5684,7 @@ struct CSBrickParamModForageSuccess : public TBrickParam::IId float ModifierConstant; // duration in seconds float Duration; - + CSBrickParamModForageSuccess(): Ecosystem(), ModifierCoefficient(), @@ -5685,21 +5693,21 @@ struct CSBrickParamModForageSuccess : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_FORAGE_SUCCESS; } - + CSBrickParamModForageSuccess(const std::string&str) { *this=CSBrickParamModForageSuccess(); *this=str; } - + const CSBrickParamModForageSuccess& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()<4) return *this; - + ParsedOk=true; Ecosystem=args[0].c_str(); ModifierCoefficient=(float)atof(args[1].c_str()); @@ -5713,7 +5721,7 @@ struct CSBrickParamModForageSuccess : public TBrickParam::IId struct CSBrickParamModMagicProtection : public TBrickParam::IId { - // affected magic protection + // affected magic protection std::string AffectedProtection; // coefficient to modify protection proportionally to item level float ModifierCoefficient; @@ -5722,7 +5730,7 @@ struct CSBrickParamModMagicProtection : public TBrickParam::IId // duration in seconds float Duration; - + CSBrickParamModMagicProtection(): AffectedProtection(), ModifierCoefficient(), @@ -5731,27 +5739,27 @@ struct CSBrickParamModMagicProtection : public TBrickParam::IId { _Id = TBrickParam::SP_MOD_MAGIC_PROTECTION; } - + CSBrickParamModMagicProtection(const std::string&str) { *this=CSBrickParamModMagicProtection(); *this=str; } - + const CSBrickParamModMagicProtection& operator=(const std::string& input) { std::vector args; convertInput(args, input); - + if (args.size()!=4) return *this; - + ParsedOk=true; AffectedProtection=args[0].c_str(); ModifierCoefficient=(float)atof(args[1].c_str()); ModifierConstant=(float)atof(args[2].c_str()); Duration=(float)atof(args[3].c_str()); - + return *this; } }; diff --git a/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp b/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp index e8eb2a9a8..be44a4c94 100644 --- a/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp +++ b/ryzom/server/src/entities_game_service/mission_manager/missions_commands.cpp @@ -188,7 +188,7 @@ NLMISC_COMMAND(addSuccessfulMission,"add a successful mission to the player","

unknown character '%s'", id.toString().c_str()); return false; } - + c->clearSuccessfullMission(); return true; } @@ -345,7 +345,7 @@ NLMISC_COMMAND(simAISMAction, "simulate an AI action.", " *[params] else if (args[0] == "fail") { bool exit = false; - + // get instance currently in escort step for (uint i = 0; (i < templ->Instances.size()) && !exit ; ++i) { @@ -355,16 +355,16 @@ NLMISC_COMMAND(simAISMAction, "simulate an AI action.", " *[params] for (map::const_iterator itStep = templ->Instances[i]->getStepsBegin(); itStep != templ->Instances[i]->getStepsEnd(); ++itStep) { nlassert(uint((*itStep).second.getIndexInTemplate() - 1) < templ->Steps.size()); - + CMissionStepEscort *escortStep = dynamic_cast (templ->Steps[ (*itStep).second.getIndexInTemplate() - 1 ]); if (escortStep != NULL) { templ->Instances[i]->onFailure(false); - + exit = true; break; } - } + } } else nlwarning(" *fail* mission %s has a NULL instance ",args[1].c_str()); @@ -409,7 +409,7 @@ NLMISC_COMMAND(failMissionCategory,"fail all missions of a specified category fo { if (args.size() != 1) return false; - + string sMissCat = strlwr(args[0]); CMissionManager *pMM = CMissionManager::getInstance(); @@ -434,7 +434,7 @@ NLMISC_COMMAND(failMissionCategory,"fail all missions of a specified category fo CMission *pMiss = itMiss->second; if (pMiss != NULL) - { + { CMissionTemplate *pMissTemplate; bool bFailed = false; // Check the mission template category @@ -447,7 +447,7 @@ NLMISC_COMMAND(failMissionCategory,"fail all missions of a specified category fo } // and the main mission template category - if (!bFailed) // do not fail a mission twice + if (!bFailed) // do not fail a mission twice { pMissTemplate = pMM->getTemplate(pMiss->getMainMissionTemplateId()); if (pMissTemplate != NULL) @@ -507,7 +507,7 @@ NLMISC_COMMAND(removeMission,"Remove mission of character"," getMissionNameFromUniqueId(missionAlias).c_str(), - missionAlias, + missionAlias, args[0].c_str()); return true; @@ -522,23 +522,23 @@ NLMISC_COMMAND(addMission,"Add mission to character", " endBotChat(); c->setAfkState(false); - + std::list< CMissionEvent* > eventList; CMissionManager::getInstance()->instanciateMission(c, missionAlias, giverAlias, eventList); c->processMissionEventList(eventList,true, CAIAliasTranslator::Invalid); log.displayNL("Mission '%s' \t(alias %10u) added to character %s", CAIAliasTranslator::getInstance()->getMissionNameFromUniqueId(missionAlias).c_str(), - missionAlias, + missionAlias, args[0].c_str()); return true; @@ -616,7 +616,7 @@ NLMISC_COMMAND(spawnItem, "Spawn a new Item", " < { GET_ACTIVE_CHARACTER - + if (args.size() < 6) return false; @@ -681,7 +681,7 @@ NLMISC_COMMAND(spawnItem, "Spawn a new Item", " < if (args.size() == 7) params += ":"+args[6]; - + std::vector< std::string > script; NLMISC::splitString(params, ":", script); @@ -698,14 +698,14 @@ NLMISC_COMMAND(spawnItem, "Spawn a new Item", " < NLMISC::fromString(quality_params[1], recommended); finalItem->recommended(recommended); } - + log.displayNL("OK"); return true; } finalItem.deleteItem(); } } - + log.displayNL("ERR: adding item"); return true; } @@ -714,7 +714,7 @@ NLMISC_COMMAND(spawnItem, "Spawn a new Item", " < NLMISC_COMMAND(spawnNamedItem, "Spawn a named Item", " ") { GET_ACTIVE_CHARACTER - + if (args.size() < 4) return false; @@ -737,7 +737,7 @@ NLMISC_COMMAND(spawnNamedItem, "Spawn a named Item", " ,[ ...]") +NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", " ,[ ...] []") { if (args.size () < 3) { @@ -1027,20 +1027,28 @@ NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", " sheet_names; - NLMISC::splitString(args[2], ",", sheet_names); - std::vector sheets; - for (uint32 i=0; i sheet_names; + NLMISC::splitString(args[2], ",", sheet_names); + for (uint32 i=0; igetItem(INVENTORIES::equipment, SLOT_EQUIPMENT::stringToSlotEquipment(selected_slot)); if (itemPtr != NULL) { itemPtr->applyEnchantment(sheets); c->updateJewelsTags(false); + + if (args.size() > 3) + { + float maxSapLoad; + fromString(args[3], maxSapLoad); + itemPtr->setMaxSapLoad(maxSapLoad); + } + log.displayNL("OK"); return true; } @@ -1048,7 +1056,72 @@ NLMISC_COMMAND(enchantEquipedItem, "enchantEquipedItem", " ") +{ + if (args.size () < 2) + { + log.displayNL("ERR: Invalid number of parameters. Parameters: "); + return false; + } + + GET_ACTIVE_CHARACTER + string selected_slot = args[1]; + + CGameItemPtr itemPtr = c->getItem(INVENTORIES::equipment, SLOT_EQUIPMENT::stringToSlotEquipment(selected_slot)); + if (itemPtr != NULL) + { + const std::vector &sheets = itemPtr->getEnchantment(); + for (uint32 i=0; i []") +{ + + if (args.size () < 2) + { + log.displayNL("ERR: invalid arg count"); + return false; + } + + GET_ACTIVE_CHARACTER + + string selected_slot = args[1]; + + CGameItemPtr itemPtr = c->getItem(INVENTORIES::equipment, SLOT_EQUIPMENT::stringToSlotEquipment(selected_slot)); + if (itemPtr != NULL) + { + if (args.size() >= 3) + { + string quant = args[2]; + uint32 quantity; + if (quant[0] == '-') + { + if (quant.size() > 1) + { + fromString(quant.substr(1), quantity); + itemPtr->consumeSapLoad(quantity); + } + } + else + { + fromString(quant, quantity); + itemPtr->reloadSapLoad(quantity); + } + } + + uint32 sapLoad = itemPtr->sapLoad(); + uint32 max = itemPtr->maxSapLoad(); + log.displayNL("%u / %u", sapLoad, max); + } + + return true; +} //---------------------------------------------------------------------------- @@ -1142,7 +1215,7 @@ NLMISC_COMMAND(getBotPosition,"get_bot_position"," ") } } } - else + else { vector aliases; CAIAliasTranslator::getInstance()->getNPCAliasesFromName(args[1], aliases); @@ -1189,7 +1262,7 @@ NLMISC_COMMAND(getFame, "get/set fame of player", " [] [ faction1,faction2,faction log.displayNL("ERR: invalid arg count"); return false; } - + GET_ACTIVE_CHARACTER string sfames; @@ -1257,7 +1330,7 @@ NLMISC_COMMAND(getFames, "get fames of player", " faction1,faction2,faction NLMISC::splitString(args[1], ",", fames); for (uint32 i=0; i") GET_ACTIVE_CHARACTER string msg = c->getTargetInfos(); - + log.displayNL("%s", msg.c_str()); return true; @@ -1501,7 +1574,7 @@ NLMISC_COMMAND(setOrg, "set the organization of player", " ") log.displayNL("ERR: invalid arg count"); return true; } - + uint32 org; fromString(args[1], org); c->setOrganization(org); @@ -1543,7 +1616,7 @@ NLMISC_COMMAND(accessPowo, "give access to the powo", " [playername] [insta { if (args.size() < 2) return false; - + GET_ACTIVE_CHARACTER IBuildingPhysical *building; @@ -1581,7 +1654,7 @@ NLMISC_COMMAND(accessPowo, "give access to the powo", " [playername] [insta c->setPowoCell(cell); if (args.size() > 6) c->setPowoScope(args[6]); - + c->setPowoFlag("xp", powoFlags[0] == '1'); c->setPowoFlag("dead", powoFlags[1] == '1'); c->setPowoFlag("teleport", powoFlags[2] == '1'); @@ -1627,7 +1700,7 @@ NLMISC_COMMAND(accessPowo, "give access to the powo", " [playername] [insta c->setBuildingExitZone(building->getDefaultExitSpawn()); } } - + log.displayNL("%d", cell); } else { log.displayNL("ERR: invalid cell"); @@ -1656,9 +1729,9 @@ NLMISC_COMMAND(slide, "slide to the powo", " x y cell [z] [h]") } GET_ACTIVE_CHARACTER - + string value = args[1]; - + sint32 x; sint32 y; sint32 cell = c->getPowoCell(); @@ -1722,7 +1795,7 @@ NLMISC_COMMAND(kickPlayersFromPowo, "kick players from powo", " players; NLMISC::splitString(args[0], ",", players); - + for (uint32 i=0; i < players.size(); i++) { CCharacter * player = PlayerManager.getCharacterByName(players[i]); @@ -1803,7 +1876,7 @@ NLMISC_COMMAND(teleportMe, "teleport", " [x,y,z,h|player name|bot name] tel // Checks : PvP Flag, PvP Tag, Sitting, Water, Mount, Fear, Sleep, Invu, Stun if (args.size () > 3) { - bool pvpFlagValid = (c->getPvPRecentActionFlag() == false || c->getPVPFlag() == false); + bool pvpFlagValid = (c->getPvPRecentActionFlag() == false || c->getPVPFlag() == false); if (args[3][0] == '1' && !pvpFlagValid) { CCharacter::sendDynamicSystemMessage(c->getEntityRowId(), "PVP_TP_FORBIDEN"); log.displayNL("ERR: PVP_FLAG"); @@ -1841,7 +1914,7 @@ NLMISC_COMMAND(teleportMe, "teleport", " [x,y,z,h|player name|bot name] tel } string value = args[1]; - + vector res; sint32 x = 0, y = 0, z = 0; float h = 0; @@ -1960,7 +2033,7 @@ NLMISC_COMMAND(teleportMe, "teleport", " [x,y,z,h|player name|bot name] tel if (allowPetTp) c->allowNearPetTp(); else - c->forbidNearPetTp(); + c->forbidNearPetTp(); // Respawn player if dead if (c->isDead()) @@ -1983,14 +2056,14 @@ NLMISC_COMMAND(teleportMe, "teleport", " [x,y,z,h|player name|bot name] tel log.displayNL("ERR: NO_POWO_FLAG"); return true; } - + c->teleportCharacter(x,y,z,allowPetTp,true,h,0xFF,cell); if (cont) { c->getRespawnPoints().addDefaultRespawnPoint(CONTINENT::TContinent(cont->getId())); } - + // cancel any previous static action c->cancelStaticActionInProgress(); @@ -2009,11 +2082,11 @@ NLMISC_COMMAND(checkActionFlags,"Check Action Flags"," [pvp_flag, pvp_tag, log.displayNL("ERR: invalid arg count"); return false; } - + GET_ACTIVE_CHARACTER // Checks : PvP Flag, PvP Tag, Sitting, Water, Mount, Fear, Sleep, Invu, Stun bool pvpFlagValid = (c->getPvPRecentActionFlag() == false || c->getPVPFlag() == false); - if (args[1][0] == '1' && !pvpFlagValid) + if (args[1][0] == '1' && !pvpFlagValid) { CCharacter::sendDynamicSystemMessage(c->getEntityRowId(), "NO_ACTION_WHILE_PVP"); log.displayNL("ERR: PVP_FLAG"); @@ -2063,21 +2136,21 @@ NLMISC_COMMAND(setRespawn, "set respawn point for the player", " x y cell") } GET_ACTIVE_CHARACTER - + sint32 x; sint32 y; uint32 cell; - + fromString(args[1], x); x *= 1000; - + fromString(args[2], y); y *= 1000; fromString(args[3], cell); - + c->getRespawnPoints().setArkRespawnpoint(x, y, cell); - + return true; } @@ -2091,14 +2164,14 @@ NLMISC_COMMAND(addRespawnPoint,"Add re-spawn point"," log.displayNL("ERR: invalid arg count"); return false; } - + GET_ACTIVE_CHARACTER CCharacterRespawnPoints::TRespawnPoint respawnPoint = CZoneManager::getInstance().getTpSpawnZoneIdByName(args[1]); if (respawnPoint == InvalidSpawnZoneId) return false; - + c->getRespawnPoints().addRespawnPoint(respawnPoint); return true; } @@ -2113,7 +2186,7 @@ NLMISC_COMMAND(respawnPlayer,"Respawn the player at position"," < log.displayNL("ERR: invalid arg count"); return false; } - + GET_ACTIVE_CHARACTER bool withDp = false; @@ -2163,9 +2236,9 @@ NLMISC_COMMAND(killPlayer,"Kill a player","") log.displayNL("ERR: invalid arg count"); return false; } - + GET_ACTIVE_CHARACTER - + c->killMe(); return true; } @@ -2181,7 +2254,7 @@ NLMISC_COMMAND(spawn, "spawn entity", " quantity sheet dispersion spawnbot } CCharacter *c = NULL; - + bool isChar = false; if (args[0] != "*") { GET_ACTIVE_CHARACTER2 @@ -2233,7 +2306,7 @@ NLMISC_COMMAND(spawn, "spawn entity", " quantity sheet dispersion spawnbot } string botsName = args[6]; - + float userX; NLMISC::fromString(args[7], userX); x = (sint32)(userX * 1000.0); @@ -2272,7 +2345,7 @@ NLMISC_COMMAND(spawn, "spawn entity", " quantity sheet dispersion spawnbot log.displayNL("ERR: invalid continent"); return false; } - + uint32 aiInstance = CUsedContinent::instance().getInstanceForContinent((CONTINENT::TContinent)continent->getId()); if (aiInstance == ~0) @@ -2317,7 +2390,7 @@ NLMISC_COMMAND(grpScript, "executes a script on an event npc group", " ::max()) { @@ -2373,7 +2446,7 @@ NLMISC_COMMAND(setUrl, "changes the url of a bot", " [] [< GET_ACTIVE_CHARACTER uint32 instanceNumber = c->getInstanceNumber(); - + string groupname = args[1]; if (! getAIInstanceFromGroupName(groupname, instanceNumber)) { @@ -2476,7 +2549,7 @@ NLMISC_COMMAND(getArkMissions,"dump character ark missions","") //----------------------------------------------- NLMISC_COMMAND(getPlayerStats,"get player stats"," ") { - + if (args.size() <= 1) return false; @@ -2485,7 +2558,7 @@ NLMISC_COMMAND(getPlayerStats,"get player stats"," ") std::vector< std::string > stats; NLMISC::splitString(args[1],",",stats); uint32 i=0; - + const CInventoryPtr & userBag = c->getInventory(INVENTORIES::bag); if (i < stats.size() && stats[i] == "wmal") // wear malus @@ -2536,12 +2609,12 @@ NLMISC_COMMAND(getPlayerStats,"get player stats"," ") //----------------------------------------------- NLMISC_COMMAND(getServerStats,"get server stats"," [] []") { - + if (args.size() <= 1) return false; CCharacter *c = NULL; - + if (args[0] != "*") { GET_ACTIVE_CHARACTER2 } @@ -2549,7 +2622,7 @@ NLMISC_COMMAND(getServerStats,"get server stats"," [< std::vector< std::string > stats; NLMISC::splitString(args[1],",",stats); uint32 i=0; - + for (i = 0; i < stats.size(); i++) { if (stats[i] == "time") // Atys time @@ -2665,7 +2738,7 @@ NLMISC_COMMAND(finishArkMission,"finish Mission"," ") return false; GET_ACTIVE_CHARACTER; - + TAIAlias missionAlias = CAIAliasTranslator::getInstance()->getMissionUniqueIdFromName(args[1]); c->removeMission(missionAlias, 0, true); c->removeMissionFromHistories(missionAlias); @@ -2680,7 +2753,7 @@ NLMISC_COMMAND(resetArkMission,"reset Mission"," ") return false; GET_ACTIVE_CHARACTER; - + TAIAlias missionAlias = CAIAliasTranslator::getInstance()->getMissionUniqueIdFromName(args[1]); c->resetMissionSuccessfull(missionAlias); @@ -2830,22 +2903,22 @@ NLMISC_COMMAND(getPlayerVar, "get the value of a variable of player"," getValue("Base"+args[1], value)) log.displayNL("%s", value.c_str()); else log.displayNL("ERR: Variable not found"); - + if (c->getValue("Max"+args[1], value)) log.displayNL("%s", value.c_str()); - + if (c->getValue("Current"+args[1], value)) log.displayNL("%s", value.c_str()); - + if (c->getValue("Modifier"+args[1], value)) log.displayNL("%s", value.c_str()); @@ -2857,9 +2930,9 @@ NLMISC_COMMAND(setPlayerVar, "set the value of a variable of player"," setValue(args[1], args[2])) log.displayNL("OK"); else @@ -2873,7 +2946,7 @@ NLMISC_COMMAND(addPlayerVar, "add to the value of a variable of player"," < { if (args.size() != 3) return false; - + GET_ACTIVE_CHARACTER; if (c->modifyValue(args[1], args[2])) @@ -2889,7 +2962,7 @@ NLMISC_COMMAND(getTeam, "get the team of a player","") { if (args.size() != 1) return false; - + GET_ACTIVE_CHARACTER; CTeam* pTeam = TeamManager.getRealTeam(c->getTeamId()); @@ -2902,7 +2975,7 @@ NLMISC_COMMAND(getTeam, "get the team of a player","") CEntityIdTranslator::removeShardFromName(name); log.displayNL("%" NL_I64 "u|%s", (*it).asUint64(), name.toUtf8().c_str()); } - } else + } else log.displayNL("-1"); return true; } @@ -2915,7 +2988,7 @@ NLMISC_COMMAND(setTrigger, "set a custom trigger", " [] [setCustomTrigger(triggerId, args[1]+" "+args[2]); else @@ -2981,7 +3054,7 @@ NLMISC_COMMAND(sendUrlToUser, "send an url to a user", " sendUrl(args[1]+" "+args[2]); log.displayNL("OK"); return true; @@ -3067,7 +3140,7 @@ NLMISC_COMMAND(addPlayerPet, "add a pet to player", " [size] [nam ucstring customName; if (args.size() == 4) customName.fromUtf8(args[3]); - + if (ticket != CSheetId::Unknown) { CGameItemPtr item = c->createItemInInventoryFreeSlot(INVENTORIES::bag, 1, 1, ticket); @@ -3096,9 +3169,9 @@ NLMISC_COMMAND(setPlayerPetSheetid, "change the sheetid of a player pet", " { if (args.size() < 3) return false; - + GET_ACTIVE_CHARACTER - + uint8 index; fromString(args[1], index); CSheetId sheet = CSheetId(args[2].c_str()); @@ -3137,7 +3210,7 @@ NLMISC_COMMAND(getPlayerPets, "get player pets", "") GET_ACTIVE_CHARACTER string pets = c->getPets(); - + log.displayNL("%s", pets.c_str()); return true; } @@ -3148,7 +3221,7 @@ NLMISC_COMMAND(spawnPlayerPet, "spawn player pet", " ") { if (args.size() < 2) return false; - + GET_ACTIVE_CHARACTER uint32 index; @@ -3168,7 +3241,7 @@ NLMISC_COMMAND(setPlayerPetName, "change the name of a player pet", " [ return false; GET_ACTIVE_CHARACTER; - + std::vector< std::string > props; NLMISC::splitString(args[1], ",", props); @@ -3200,7 +3273,7 @@ NLMISC_COMMAND(setPlayerVisual, "get visual of a player", " [ uint32 i=0; - + for (i = 0; i < props.size(); i++) { if (props[i] == "haircut" || props[i] == "wig") @@ -3213,7 +3286,7 @@ NLMISC_COMMAND(setPlayerVisual, "get visual of a player", " [ log.displayNL("ERR: sheet unknown '%s'", sheetId.toString().c_str()); return true; } - + uint32 hairValue = CVisualSlotManager::getInstance()->sheet2Index(sheetId, SLOTTYPE::HEAD_SLOT); if (!c->setHair(hairValue, props[i] == "wig", false)) { @@ -3282,15 +3355,15 @@ NLMISC_COMMAND(scaleEntity, "change the size of an entity", " log.displayNL("ERR: invalid eid"); return true; } - + TDataSetRow row = TheDataset.getDataSetRow(entityId); uint32 scale; fromString(args[2], scale); - + if (scale>255) scale = 0; - + CMirrorPropValue< SAltLookProp2, CPropLocationPacked<2> > visualPropertyB(TheDataset, row, DSPropertyVPB); SET_STRUCT_MEMBER(visualPropertyB, PropertySubData.Scale, scale); @@ -3303,7 +3376,7 @@ NLMISC_COMMAND(setPlayerPetSize, "change the size of a player pet", " <[vpx1,vpx2,vpx3 string name = vpx[i]; uint32 value; fromString(values[i], value); - + if (name == "Sex") { SET_STRUCT_MEMBER(c->getVisualPropertyA(), PropertySubData.Sex, value); @@ -3614,7 +3687,7 @@ NLMISC_COMMAND(removeDp, "Update the DP", " ") c->getDeathPenalties().addDeathXP(c, dpToGain); } log.displayNL("%d", dpToGain); - + return true; } @@ -3655,7 +3728,7 @@ NLMISC_COMMAND(execAiAction, "Exec Ai Action", " ") CSheetId ActionId(args[1]); TDataSetRow TargetRowId; - + if (ActionId == CSheetId::Unknown) { log.displayNL("ERR: sheetId is Unknown"); @@ -3665,7 +3738,7 @@ NLMISC_COMMAND(execAiAction, "Exec Ai Action", " ") if (args.size() > 2) { const CEntityId &target = c->getTarget(); - + string error; if (target == CEntityId::Unknown) error = "unknown"; @@ -3701,7 +3774,7 @@ NLMISC_COMMAND(spawnToxic, "Spawn a toxic cloud", " getX() / 1000.f; float y = (float)c->getY() / 1000.f; @@ -3732,7 +3805,7 @@ NLMISC_COMMAND(spawnToxic, "Spawn a toxic cloud", " 6) { affectedScore = SCORES::toScore(args[6]); - + if (args.size() > 7) { NLMISC::fromString(args[7], updateFrequency); @@ -3744,7 +3817,7 @@ NLMISC_COMMAND(spawnToxic, "Spawn a toxic cloud", " init(cloudPos, radius, dmgPerHit, updateFrequency, lifetime, affectedScore); @@ -3774,7 +3847,7 @@ NLMISC_COMMAND(searchEntity, "Search an Entity (Player, Creature or Npc)", "getX() / 1000.f; float y = (float)c->getY() / 1000.f; - + if ( args[1] == "creature" ) { CSheetId creatureSheetId1; @@ -3792,7 +3865,7 @@ NLMISC_COMMAND(searchEntity, "Search an Entity (Player, Creature or Npc)", "getType(); - + if( sheetId == creatureSheetId1 || creatureSheetId2 == creatureSheetId1 || creatureSheetId3 == creatureSheetId1 || creatureSheetId4 == creatureSheetId1 ) { double distance = PHRASE_UTILITIES::getDistance( c->getEntityRowId(), (*it).second->getEntityRowId() ); @@ -3823,7 +3896,7 @@ NLMISC_COMMAND(searchEntity, "Search an Entity (Player, Creature or Npc)", "getType(); - + if( sheetId == creatureSheetId1 ) { double distance = PHRASE_UTILITIES::getDistance( c->getEntityRowId(), (*it).second->getEntityRowId() ); @@ -3835,7 +3908,7 @@ NLMISC_COMMAND(searchEntity, "Search an Entity (Player, Creature or Npc)", " [ 2 && args[2] == "target") { id = c->getTarget(); @@ -3974,11 +4047,11 @@ NLMISC_COMMAND(setBehaviour," change entity behaviour"," [ []") CEntityId id; CEntityBase *e = NULL; - + bool isChar = false; if (args[0] != "*") { @@ -4030,11 +4103,11 @@ NLMISC_COMMAND(getBehaviour," get entity behaviour"," []") { if ( args.size() < 2 ) return false; - + id.fromString( args[2].c_str() ); e = CreatureManager.getCreature(id); } - + if (e) { log.displayNL("%s", toString( e->getBehaviour() ).c_str() ); @@ -4055,7 +4128,7 @@ NLMISC_COMMAND(stopMoveBot,"stop move of a bot"," []") TDataSetRow TargetRowId; CEntityBase *e = NULL; - + bool isChar = false; if (args[0] != "*") { @@ -4070,12 +4143,12 @@ NLMISC_COMMAND(stopMoveBot,"stop move of a bot"," []") log.displayNL("ERR: target"); return true; } - + TargetRowId = TheDataset.getDataSetRow(target); TDataSetRow stoppedNpc = c->getStoppedNpc(); if (stoppedNpc == TargetRowId) return true; - + if (TheDataset.isAccessible(stoppedNpc)) { CharacterBotChatBeginEnd.BotChatEnd.push_back(c->getEntityRowId()); @@ -4095,7 +4168,7 @@ NLMISC_COMMAND(stopMoveBot,"stop move of a bot"," []") { if ( args.size() < 2 ) return false; - + CEntityId target; target.fromString( args[2].c_str() ); if (target == CEntityId::Unknown) @@ -4103,7 +4176,7 @@ NLMISC_COMMAND(stopMoveBot,"stop move of a bot"," []") log.displayNL("ERR: target"); return true; } - + TargetRowId = TheDataset.getDataSetRow(target); } @@ -4118,7 +4191,7 @@ NLMISC_COMMAND(startMoveBot,"start move bot or previous stopped bot"," [< TDataSetRow TargetRowId; CEntityBase *e = NULL; - + bool isChar = false; if (args[0] != "*") { @@ -4141,7 +4214,7 @@ NLMISC_COMMAND(startMoveBot,"start move bot or previous stopped bot"," [< { if ( args.size() < 2 ) return false; - + CEntityId target; target.fromString( args[2].c_str() ); if (target == CEntityId::Unknown) @@ -4149,7 +4222,7 @@ NLMISC_COMMAND(startMoveBot,"start move bot or previous stopped bot"," [< log.displayNL("ERR: target"); return true; } - + TargetRowId = TheDataset.getDataSetRow(target); } @@ -4167,21 +4240,21 @@ NLMISC_COMMAND(closeDynChat, "close DynChat", " ") bool processMissions = true; if (args.size() >= 2 && (args[1] == "false" || args[1] == "0")) processMissions = false; - + c->endBotChat(false, false, processMissions); return true; } -NLMISC_COMMAND(manageBuilding, "Manage a building", " ") +NLMISC_COMMAND(manageBuilding, "Manage a building", " ") { - if (args.size() < 2) return false; + if (args.size() < 3) return false; GET_ACTIVE_CHARACTER string action = args[1]; // trigger_in, trigger_out, add_guild_room, add_player_room - - if (action == "trigger_in" && args.size() == 3) + + if (action == "trigger_in") { uint32 liftId; NLMISC::fromString(args[2], liftId); @@ -4190,9 +4263,9 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", " ") else if (action == "trigger_out") { CBuildingManager::getInstance()->removeTriggerRequest(c->getEntityRowId()); - + } - else if (action == "add_guild_room" && args.size() == 3) + else if (action == "add_guild_room") { CBuildingPhysicalGuild * building = dynamic_cast(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2])); if (building) @@ -4203,7 +4276,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", " ") return true; } } - else if (action == "add_player_room" && args.size () == 3) + else if (action == "add_player_room") { CBuildingPhysicalPlayer * building = dynamic_cast(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2])); if (building) @@ -4214,7 +4287,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", " ") return true; } } - else if (action == "buy_guild_room" && args.size () == 3) + else if (action == "buy_guild_room") { CBuildingPhysicalGuild * building = dynamic_cast(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2])); if (building) @@ -4229,7 +4302,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", " ") } } } - else if (action == "buy_player_room" && args.size () == 3) + else if (action == "buy_player_room") { CBuildingPhysicalPlayer * building = dynamic_cast(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2])); if ( building ) @@ -4240,7 +4313,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", " ") return true; } } - else if (action == "set_player_room" && args.size () == 3) + else if (action == "set_player_room") { /* CBuildingPhysicalPlayer * building = dynamic_cast(CBuildingManager::getInstance()->getBuildingPhysicalsByName(args[2])); if ( building ) @@ -4254,7 +4327,7 @@ NLMISC_COMMAND(manageBuilding, "Manage a building", " ") return true; }*/ } - else if (action == "get_access_room" && args.size () == 3) + else if (action == "get_access_room") { CCharacter *owner = PlayerManager.getCharacterByName(CShardNames::getInstance().makeFullNameFromRelative(c->getHomeMainlandSessionId(), args[2])); diff --git a/ryzom/server/src/entities_game_service/player_manager/character.cpp b/ryzom/server/src/entities_game_service/player_manager/character.cpp index fc6e5f63f..7f7625f79 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -1631,7 +1631,7 @@ uint32 CCharacter::tickUpdate() _LastTickNpcStopped = 0; setStoppedNpc(TDataSetRow()); } - + return nextUpdate; } // tickUpdate // @@ -2030,7 +2030,7 @@ void CCharacter::applyRespawnEffects(bool applyDP) resetNextDeathPenaltyFactor(); } - + _PhysScores._PhysicalScores[SCORES::hit_points].Current = _PhysScores._PhysicalScores[SCORES::hit_points].Base / 10; _PhysScores._PhysicalScores[SCORES::stamina].Current = _PhysScores._PhysicalScores[SCORES::stamina].Base / 10; _PhysScores._PhysicalScores[SCORES::sap].Current = _PhysScores._PhysicalScores[SCORES::sap].Base / 10; @@ -5693,7 +5693,7 @@ void CCharacter::teleportCharacter(sint32 x, sint32 y, sint32 z, bool teleportWi inCell = true; } } - + // Teleport as well pets that are following or mounted or a pet and in the neighbourhood or... in a Powo/indoor if ((((isNearPetTpIsAllowed() || form->Type == ITEM_TYPE::ANIMAL_TICKET) && (_PlayerPets[i].IsFollowing || _PlayerPets[i].IsMounted) && squareDistance <= 50.0f * 50.0f)) || inCell) @@ -5715,7 +5715,7 @@ void CCharacter::teleportCharacter(sint32 x, sint32 y, sint32 z, bool teleportWi if (_IntangibleEndDate != ~0 && !fromVortex) // Don't save Last Tp Tick if player respawns or teleport from Vortex _LastTpTick = CTickEventHandler::getGameCycle(); - + _TpCoordinate.X = x; _TpCoordinate.Y = y; _TpCoordinate.Z = z; @@ -5917,7 +5917,7 @@ string CCharacter::getPets() pets += "P"; else if (form->Type == ITEM_TYPE::ANIMAL_TICKET) pets += "A"; - + CPetAnimal::TStatus status = _PlayerPets[i].PetStatus; if (status != CPetAnimal::db_unknown) pets += toString("%d", (uint32)(status)); @@ -6451,7 +6451,7 @@ void CCharacter::onAnimalSpawned(CPetSpawnConfirmationMsg::TSpawnError SpawnStat CMirrorPropValue< SAltLookProp2, CPropLocationPacked<2> > visualPropertyB( TheDataset, PetMirrorRow, DSPropertyVPB ); SET_STRUCT_MEMBER( visualPropertyB, PropertySubData.Scale, animal.Size ); } - + } if (animal.PetStatus != CPetAnimal::death) @@ -7246,7 +7246,7 @@ void CCharacter::removePetCharacterAfterDeath(uint32 index) const CStaticItem* form = _PlayerPets[index].ItemPtr->getStaticForm(); if (form && form->Type == ITEM_TYPE::MEKTOUB_MOUNT_TICKET) _LastFreeMount = CTickEventHandler::getGameCycle(); - + uint32 slot = _PlayerPets[index].ItemPtr->getInventorySlot(); // release our ref before we destroy the item _PlayerPets[index].ItemPtr = 0; @@ -7623,7 +7623,7 @@ void CCharacter::sendAnimalCommand(uint8 petIndexCode, uint8 command) _PlayerPets[petIndex].IsInBag = false; // no petCommand setup here so continue instead of break continue; - + case ANIMALS_ORDERS::ENTER_STABLE: if (_PlayerPets[petIndex].IsMounted) continue; @@ -7888,11 +7888,11 @@ double CCharacter::addXpToSkillInternal(double XpGain, const std::string &ContSk string skillInitial = SKILLS::toString(skillEnum).substr(1, 1); - //// GUILDS POINTS + //// GUILDS POINTS CGuild* guild = CGuildManager::getInstance()->getGuildFromId(_GuildId); if (EnableGuildPoints.get() && guild) { - + uint32 guildpoints = 0; if (skill->MaxLvlReached >= 250) // when max level : quantity of points is different for each skill { @@ -8312,7 +8312,7 @@ double CCharacter::addXpToSkillInternal(double XpGain, const std::string &ContSk _BaseParryLevel = skill->Base; if (p->isTrialPlayer() && _BaseParryLevel > 125) _BaseParryLevel = 125; - + _CurrentParryLevel = max(sint32(0), _BaseParryLevel + _ParryModifier); // _PropertyDatabase.setProp(_DataIndexReminder->CHARACTER_INFO.ParryBase, //_BaseParryLevel); @@ -11674,30 +11674,29 @@ void CCharacter::setNewTitle(const string &title) } //----------------------------------------------------------------------------- -void CCharacter::setTagPvPA(const string &tag) +void CCharacter::setTagA(const string &tag) { - _TagPvPA = tag; + _TagA = tag; } //----------------------------------------------------------------------------- -void CCharacter::setTagPvPB(const string &tag) +void CCharacter::setTagB(const string &tag) { - _TagPvPB = tag; + _TagB = tag; } //----------------------------------------------------------------------------- -void CCharacter::setTagA(const string &tag) +void CCharacter::setTagPvPA(const string &tag) { - _TagA = tag; + _TagPvPA = tag; } //----------------------------------------------------------------------------- -void CCharacter::setTagB(const string &tag) +void CCharacter::setTagPvPB(const string &tag) { - _TagB = tag; + _TagPvPB = tag; } - //----------------------------------------------------------------------------- void CCharacter::setDontTranslate(const string &langs) { @@ -11708,7 +11707,7 @@ void CCharacter::setDontTranslate(const string &langs) //----------------------------------------------------------------------------- CSBrickParamJewelAttrs *CCharacter::getJewelAttrs(const string &attribute, SLOT_EQUIPMENT::TSlotEquipment slot) { - + CInventoryPtr inv = getInventory(INVENTORIES::equipment); if (inv) { @@ -11731,8 +11730,14 @@ CSBrickParamJewelAttrs *CCharacter::getJewelAttrs(const string &attribute, SLOT_ CSBrickParamJewelAttrs *sbrickParam = (CSBrickParamJewelAttrs*)param; if (param->id() == TBrickParam::JEWEL_ATTRS && sbrickParam->Attribute == attribute) { - if (checkRequiredFaction(sbrickParam->RequiredFaction)) { - return sbrickParam; + // Check required fame (if no required faction, check are ok) + if (checkRequiredFame(sbrickParam->RequiredFaction, sbrickParam->RequiredFame)) + { + // Require a faction/nation/org only for fame up to 30 + if (sbrickParam->RequiredFame < 30 || checkRequiredFaction(sbrickParam->RequiredFaction)) + { + return sbrickParam; + } } } } @@ -11758,8 +11763,14 @@ CSBrickParamJewelAttrs *CCharacter::getJewelAttrs(const string &attribute, SLOT_ CSBrickParamJewelAttrs *sbrickParam = (CSBrickParamJewelAttrs*)param; if (param->id() == TBrickParam::JEWEL_ATTRS && sbrickParam->Attribute == attribute) { - if (checkRequiredFaction(sbrickParam->RequiredFaction)) { - return sbrickParam; + // Check required fame (if no required faction, check are ok) + if (checkRequiredFame(sbrickParam->RequiredFaction, sbrickParam->RequiredFame)) + { + // Require a faction/nation/org only for fame up to 30 + if (sbrickParam->RequiredFame < 30 || checkRequiredFaction(sbrickParam->RequiredFaction)) + { + return sbrickParam; + } } } } @@ -11768,7 +11779,7 @@ CSBrickParamJewelAttrs *CCharacter::getJewelAttrs(const string &attribute, SLOT_ } } } - + return NULL; } @@ -12550,7 +12561,7 @@ void CCharacter::acceptExchange(uint8 exchangeId) nlwarning("CCharacter::acceptExchange : character %s -> no exchangeView", _Id.toString().c_str()); return; } - + removeExchangeItems(vect, exchangePlayerPets); if (mission) @@ -12919,7 +12930,7 @@ void CCharacter::removeExchangeItems(vector &itemRemoved, vectorType == ITEM_TYPE::MEKTOUB_MOUNT_TICKET) _LastExchangeMount = CTickEventHandler::getGameCycle(); - + for (uint p = 0; p < _PlayerPets.size(); p++) { if (_PlayerPets[p].ItemPtr == item) @@ -13003,11 +13014,11 @@ void CCharacter::addExchangeItems( if (item == NULL) continue; - + const CStaticItem* form = CSheets::getForm(item->getSheetId()); if (form && form->Type == ITEM_TYPE::MEKTOUB_MOUNT_TICKET) _LastExchangeMount = CTickEventHandler::getGameCycle(); - + if (!addItemToInventory(INVENTORIES::bag, itemToAdd[i]) && !addItemToInventory(INVENTORIES::temporary, itemToAdd[i])) { @@ -13402,7 +13413,7 @@ void CCharacter::removeMission(TAIAlias alias, /*TMissionResult*/ uint32 result, } CMissionTemplate* tpl = CMissionManager::getInstance()->getTemplate(mission->getTemplateId()); - + if (mission->getFinished()) { if (mission->getMissionSuccess()) @@ -14927,7 +14938,7 @@ string CCharacter::getTargetInfos() double h = cTarget->getState().Heading; double dist = sqrt((p_x-x)*(p_x-x)+(p_y-y)*(p_y-y)); - + TDataSetRow dsr = cTarget->getEntityRowId(); CMirrorPropValueRO srcCell(TheDataset, dsr, DSPropertyCELL); sint32 cell = srcCell; @@ -14943,7 +14954,7 @@ string CCharacter::getTargetInfos() float x = source->pos().x; float y = source->pos().y; double dist = sqrt((p_x-x)*(p_x-x)+(p_y-y)*(p_y-y)); - + msg += toString("%.2f|%.2f|%.2f|", dist, x, y)+source->materialSheet().toString()+"|"+toString("%.2f|%.2f|%.2f|%u|", source->quantity(), source->quality(), source->maxQuality(), source->timeToLive()); if (source->wasProspected()) msg += "1"; @@ -14968,14 +14979,14 @@ string CCharacter::getTargetInfos() string pets = getPets(); msg += toString("PET#%d:%s|", petSlot, pets.c_str()); } - + double x = cTarget->getState().X / 1000.; double y = cTarget->getState().Y / 1000.; double z = cTarget->getState().Z / 1000.; double h = cTarget->getState().Heading; double dist = sqrt((p_x-x)*(p_x-x)+(p_y-y)*(p_y-y)); - + TDataSetRow dsr = cTarget->getEntityRowId(); CMirrorPropValueRO srcCell(TheDataset, dsr, DSPropertyCELL); sint32 cell = srcCell; @@ -14983,7 +14994,7 @@ string CCharacter::getTargetInfos() msg += toString("%.2f|%.2f|%.2f|%.2f|%.4f|%d|", dist, x, y, z, h, cell)+cTarget->getType().toString()+"|"+EGSPD::CPeople::toString(cTarget->getRace())+"|"+toString("%d", cTarget->getGender()); } } - + return msg; } @@ -15675,8 +15686,23 @@ void CCharacter::sendUrl(const string &url) string targetInfos = getTargetInfos(); string serverInfos = getServerInfos(getState().X / 1000., getState().Y / 1000.); strFindReplace(targetInfos, " ", "%20"); - - string final_url = url + toString("&urlidx=%d", getUrlIndex())+"&player_pos="+playerPos+"&target_infos="+targetInfos+"&server_infos="+serverInfos; + string final_url; + + if (url.find("$(") != string::npos ) + { + final_url = url; + strFindReplace(final_url, "$(pos)", playerPos); + strFindReplace(final_url, "$(target)", targetInfos); + strFindReplace(final_url, "$(server)", serverInfos); + strFindReplace(final_url, "$(hands)", getEquipementInfos(INVENTORIES::handling)); + strFindReplace(final_url, "$(equiped)", getEquipementInfos(INVENTORIES::equipment)); + final_url += toString("&urlidx=%d", getUrlIndex()); + } + else + { + final_url = url + toString("&urlidx=%d", getUrlIndex())+"&player_pos="+playerPos+"&target_infos="+targetInfos+"&server_infos="+serverInfos; + } + control = "&hmac="+ getHMacSHA1((uint8*)&final_url[0], (uint32)final_url.size(), (uint8*)&salt[0], (uint32)salt.size()).toString(); uint32 userId = PlayerManager.getPlayerId(getId()); @@ -16400,7 +16426,7 @@ void CCharacter::setFameValuePlayer(uint32 factionIndex, sint32 playerFame, sint { if (fameIdx == marauderIdx) continue; - + sint32 fame = CFameInterface::getInstance().getFameIndexed(_Id, fameIdx); if (fame > maxOtherfame) @@ -16414,7 +16440,7 @@ void CCharacter::setFameValuePlayer(uint32 factionIndex, sint32 playerFame, sint CFameManager::getInstance().setEntityFame(_Id, marauderIdx, maxOtherfame, false); } } - + // _PropertyDatabase.setProp( toString("FAME:PLAYER%d:VALUE", fameIndexInDatabase), // sint64(float(playerFame)/FameAbsoluteMax*100) ); CBankAccessor_PLR::getFAME() @@ -16928,9 +16954,9 @@ bool CCharacter::removeSabrinaEffect(CSEffect* effect, bool activateSleepingEffe uint32 CCharacter::getCarriedWeight() { // CarriedWeight is bag Weight + all pets in bag - + uint32 total = _Inventory[INVENTORIES::bag]->getInventoryWeight(); - + for (uint i = 0; i != _PlayerPets.size(); ++i) { if (_PlayerPets[i].IsInBag) // Add 5kg + Weight of Inventory @@ -18017,7 +18043,7 @@ void CCharacter::clearIgnoreList() void CCharacter::online(bool onlineStatus) { _AreOnline = onlineStatus; - + // send contact list init if goind online if (onlineStatus) sendContactListInit(); @@ -18078,7 +18104,7 @@ void CCharacter::online(bool onlineStatus) msgout.serial(langs); CUnifiedNetwork::getInstance()->send("IOS", msgout); } - + } // online // //-------------------------------------------------------------- @@ -19288,7 +19314,7 @@ void CCharacter::checkCharacAndScoresValues() } } } - + { H_AUTO(CheckCharacteristics); // check caracs @@ -19308,7 +19334,7 @@ void CCharacter::checkCharacAndScoresValues() if (player != NULL && player->isTrialPlayer() && bvalue > 140) bvalue = 140; - + // compare if (_PhysCharacs._PhysicalCharacteristics[charac].Base != tvalue) { @@ -19330,7 +19356,7 @@ void CCharacter::checkCharacAndScoresValues() } } } - + { H_AUTO(CheckScores); // Check Scores @@ -19710,7 +19736,7 @@ bool CCharacter::setHairColor(uint32 colorValue, bool sendMessage) CCharacter::sendDynamicSystemMessage(_Id, "EGS_COSMETIC_USE_WIG"); return false; } - + if (colorValue == _HairColor) { if (sendMessage) @@ -21223,31 +21249,41 @@ void CCharacter::updateJewelsTags(bool remove, bool update) string tagA = getTagA(); string tagB = getTagB(); + string tagPvPA = getTagPvPA(); + string tagPvPB = getTagPvPB(); setTagA(""); setTagB(""); + setTagPvPA(""); + setTagPvPB(""); if (remove) return; CSBrickParamJewelAttrs *sbrickParam = getJewelAttrs("tag", SLOT_EQUIPMENT::HEADDRESS); if (sbrickParam) - { setTagA(sbrickParam->Value); - } sbrickParam = getJewelAttrs("tag", SLOT_EQUIPMENT::NECKLACE); if (sbrickParam) - { setTagB(sbrickParam->Value); - } + + sbrickParam = getJewelAttrs("tag", SLOT_EQUIPMENT::EARL); + if (sbrickParam) + setTagPvPA(sbrickParam->Value); + + sbrickParam = getJewelAttrs("tag", SLOT_EQUIPMENT::EARR); + if (sbrickParam) + setTagPvPB(sbrickParam->Value); + if (!update) return; - if (getTagA() != tagA || getTagB() != tagB) { + if (getTagA() != tagA || getTagB() != tagB || getTagPvPA() != tagPvPA || getTagPvPB() != tagPvPB) + { registerName(); -} + } } //---------------------------------------------------------------------------- @@ -23411,5 +23447,5 @@ bool CCharacter::initPetInventory(uint8 index) void CCharacter::killMe() { - kill(_EntityRowId); + kill(_EntityRowId); } diff --git a/ryzom/server/src/entities_game_service/player_manager/character.h b/ryzom/server/src/entities_game_service/player_manager/character.h index 62b8ed34e..f4a8bf049 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/ryzom/server/src/entities_game_service/player_manager/character.h @@ -2592,6 +2592,7 @@ public: std::string getFullTitle() const; bool checkRequiredFaction(std::string faction) const; + bool checkRequiredFame(std::string faction, sint32 fame) const; std::string getTagA() const; void setTagA(const std::string &tag); diff --git a/ryzom/server/src/entities_game_service/player_manager/character_inlines.h b/ryzom/server/src/entities_game_service/player_manager/character_inlines.h index 8354017f6..bb89e5dc5 100644 --- a/ryzom/server/src/entities_game_service/player_manager/character_inlines.h +++ b/ryzom/server/src/entities_game_service/player_manager/character_inlines.h @@ -26,28 +26,28 @@ inline uint16 CCharacter::getCurrentVersion() { - return 69; + return 69; } //------------------------------------------------------------------------------ inline uint16 CCharacter::getSavedVersion() { - return _SavedVersion; + return _SavedVersion; } //------------------------------------------------------------------------------ inline const NLMISC::CEntityId& CCharacter::getCharId() const { - return CEntityBase::getId(); + return CEntityBase::getId(); } //------------------------------------------------------------------------------ inline const NLMISC::CEntityId& CCharacter::getId() const { - return CEntityBase::getId(); + return CEntityBase::getId(); } @@ -55,48 +55,48 @@ inline const NLMISC::CEntityId& CCharacter::getId() const inline uint32 CCharacter::getStartupInstance() { - return _StartupInstance; + return _StartupInstance; } //------------------------------------------------------------------------------ inline CHARACTER_TITLE::ECharacterTitle CCharacter::getTitle() const { - return _Title; + return _Title; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getScorePermanentModifiers(SCORES::TScores score) const { - return _ScorePermanentModifiers[score]; + return _ScorePermanentModifiers[score]; } inline void CCharacter::setScorePermanentModifiers(SCORES::TScores score, uint32 value) { - _ScorePermanentModifiers[score] = value; + _ScorePermanentModifiers[score] = value; } inline bool CCharacter::getEnterFlag() const { - return _Enter; + return _Enter; } inline bool CCharacter::getOnLineStatus() const { - return _AreOnline; + return _AreOnline; } //------------------------------------------------------------------------------ //inline CEntityState& CCharacter::getState() //{ -// return CEntityBase::getState(); +// return CEntityBase::getState(); //} // //inline const CEntityState& CCharacter::getState() const //{ -// return CEntityBase::getState(); +// return CEntityBase::getState(); //} //------------------------------------------------------------------------------ @@ -104,34 +104,34 @@ inline bool CCharacter::getOnLineStatus() const inline bool CCharacter::isDead() const { return CEntityBase::isDead(); -} +} //------------------------------------------------------------------------------ inline const std::set &CCharacter::getKnownBricks() const { - return _KnownBricks; + return _KnownBricks; } //------------------------------------------------------------------------------ inline CMirrorPropValueAlice< SPropVisualA, CPropLocationPacked<2> >& CCharacter::getVisualPropertyA() { - return _VisualPropertyA; + return _VisualPropertyA; } //------------------------------------------------------------------------------ inline CMirrorPropValueAlice< SPropVisualB, CPropLocationPacked<2> >& CCharacter::getVisualPropertyB() { - return _VisualPropertyB; + return _VisualPropertyB; } //------------------------------------------------------------------------------ inline CMirrorPropValueAlice< SPropVisualC, CPropLocationPacked<2> >& CCharacter::getVisualPropertyC() { - return _VisualPropertyC; + return _VisualPropertyC; } //------------------------------------------------------------------------------ @@ -145,42 +145,42 @@ inline uint16 CCharacter::getTeamId() const inline const NLMISC::CEntityId & CCharacter::getTeamInvitor() const { - return _TeamInvitor; + return _TeamInvitor; } //------------------------------------------------------------------------------ inline const NLMISC::CEntityId & CCharacter::getLeagueInvitor() const { - return _LeagueInvitor; + return _LeagueInvitor; } //------------------------------------------------------------------------------ inline const NLMISC::CEntityId &CCharacter::harvestedEntity() const { - return _MpSourceId; + return _MpSourceId; } //------------------------------------------------------------------------------ inline const NLMISC::CSheetId &CCharacter::harvestedEntitySheetId() const { - return _MpSourceSheetId; + return _MpSourceSheetId; } //------------------------------------------------------------------------------ inline uint8 CCharacter::harvestedMpIndex() const { - return _MpIndex; + return _MpIndex; } //------------------------------------------------------------------------------ inline uint16 CCharacter::harvestedMpQuantity() const { - return _HarvestedQuantity; + return _HarvestedQuantity; } //------------------------------------------------------------------------------ @@ -193,21 +193,21 @@ inline HARVEST_INFOS::CHarvestInfos& CCharacter::getHarvestInfos() //------------------------------------------------------------------------------ inline CForageProgress *CCharacter::forageProgress() -{ +{ return _ForageProgress; } //------------------------------------------------------------------------------ inline CSEffectPtr CCharacter::getProspectionLocateDepositEffect() const -{ +{ return _ProspectionLocateDepositEffect; } //------------------------------------------------------------------------------ -inline NLMISC::TGameCycle CCharacter::forageBonusExtractionTime() const -{ +inline NLMISC::TGameCycle CCharacter::forageBonusExtractionTime() const +{ return _ForageBonusExtractionTime; } @@ -222,28 +222,28 @@ inline NLMISC::TGameTime& CCharacter::getTimeOfDeath() inline bool CCharacter::isNearPetTpIsAllowed() const { - return NearPetTpAllowed; + return NearPetTpAllowed; } //------------------------------------------------------------------------------ inline uint8 CCharacter::getNbPact() { - return (uint8)_Pact.size(); + return (uint8)_Pact.size(); } //------------------------------------------------------------------------------ inline bool CCharacter::isExchanging() const { - return (_ExchangeView != NULL); + return (_ExchangeView != NULL); } //------------------------------------------------------------------------------ inline uint8 CCharacter::getBotChatType()const { - return _CurrentBotChatType; + return _CurrentBotChatType; } //------------------------------------------------------------------------------ @@ -251,41 +251,41 @@ inline uint8 CCharacter::getBotChatType()const inline uint8 CCharacter::getCurrentBotChatListPage() { return _CurrentBotChatListPage; -} +} //------------------------------------------------------------------------------ inline const SGameCoordinate& CCharacter::getTpCoordinate() const { - return _TpCoordinate; + return _TpCoordinate; } //------------------------------------------------------------------------------ inline const uint64 & CCharacter::getMoney() { - return _Money; + return _Money; } //------------------------------------------------------------------------------ inline const NLMISC::CEntityId & CCharacter::getCurrentInterlocutor() { - return _CurrentInterlocutor; + return _CurrentInterlocutor; } //------------------------------------------------------------------------------ inline CExchangeView * CCharacter::getExchangeView() { - return _ExchangeView; + return _ExchangeView; } //------------------------------------------------------------------------------ inline const uint64 & CCharacter::getExchangeMoney() const { - return _ExchangeMoney; + return _ExchangeMoney; } //------------------------------------------------------------------------------ @@ -300,90 +300,90 @@ inline CInventoryPtr CCharacter::getLootContainer() inline bool CCharacter::staticActionInProgress() const { return _StaticActionInProgress; -} +} //------------------------------------------------------------------------------ inline uint32 CCharacter::getSaveDate() { - return _SaveDate; + return _SaveDate; } //------------------------------------------------------------------------------ inline const std::map< TAIAlias, TMissionHistory >& CCharacter::getMissionHistories() { - return _MissionHistories; + return _MissionHistories; } //------------------------------------------------------------------------------ inline const std::vector & CCharacter::getCurrentMissionList() { - return _CurrentMissionList; + return _CurrentMissionList; } //------------------------------------------------------------------------------ inline std::vector & CCharacter::currentPhrasesTradeList() { - return _CurrentPhrasesTradeList; + return _CurrentPhrasesTradeList; } //------------------------------------------------------------------------------ inline RM_FABER_TYPE::TRMFType CCharacter::getRawMaterialItemPartFilter() const { - return _RawMaterialItemPartFilter; + return _RawMaterialItemPartFilter; } //------------------------------------------------------------------------------ inline ITEM_TYPE::TItemType CCharacter::getItemTypeFilter() const { - return _ItemTypeFilter; + return _ItemTypeFilter; } //------------------------------------------------------------------------------ inline RM_CLASS_TYPE::TRMClassType CCharacter::getMinClassItemFilter() const { - return _MinClass; + return _MinClass; } //------------------------------------------------------------------------------ inline RM_CLASS_TYPE::TRMClassType CCharacter::getMaxClassItemFilter() const { - return _MaxClass; + return _MaxClass; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getMinQualityFilter() const { - return _MinQualityFilter; + return _MinQualityFilter; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getMaxQualityFilter() const { - return _MaxQualityFilter; + return _MaxQualityFilter; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getMinPriceFilter() const { - return _MinPriceFilter; + return _MinPriceFilter; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getMaxPriceFilter() const { - return _MaxPriceFilter; + return _MaxPriceFilter; } //------------------------------------------------------------------------------ @@ -397,139 +397,139 @@ inline uint16 CCharacter::getCurrentTradeSession() const inline uint8 CCharacter::trainMaxSize() const { - return _TrainMaxSize; + return _TrainMaxSize; } //------------------------------------------------------------------------------ inline const std::vector &CCharacter::beastTrain() const { - return _BeastTrain; + return _BeastTrain; } //------------------------------------------------------------------------------ inline uint8 CCharacter::actionCounter() const { - return _ActionCounter; + return _ActionCounter; } //------------------------------------------------------------------------------ inline uint8 CCharacter::interfaceCounter() const { - return _InterfaceCounter; + return _InterfaceCounter; } //------------------------------------------------------------------------------ inline CONTINENT::TContinent CCharacter::getCurrentContinent() { - return _CurrentContinent; + return _CurrentContinent; } //------------------------------------------------------------------------------ inline uint16 CCharacter::getCurrentRegion() { - return _CurrentRegion; + return _CurrentRegion; } //------------------------------------------------------------------------------ inline const std::vector & CCharacter::getPlaces() -{ - return _Places; +{ + return _Places; } //------------------------------------------------------------------------------ inline uint16 CCharacter::getCurrentStable() { - return _CurrentStable; + return _CurrentStable; } //------------------------------------------------------------------------------ inline bool CCharacter::meleeCombatIsValid() const { - return _MeleeCombatIsValid; + return _MeleeCombatIsValid; } //------------------------------------------------------------------------------ inline const std::vector &CCharacter::getFaberRms() { - return _RmSelectedForFaber; + return _RmSelectedForFaber; } //------------------------------------------------------------------------------ inline const std::vector &CCharacter::getFaberRmsFormula() { - return _RmFormulaSelectedForFaber; + return _RmFormulaSelectedForFaber; } //------------------------------------------------------------------------------ inline NLMISC::CSheetId CCharacter::getCraftPlan() const { - return _CraftPlan; + return _CraftPlan; } //------------------------------------------------------------------------------ inline std::vector &CCharacter::getFaberRmsNoConst() { - return _RmSelectedForFaber; + return _RmSelectedForFaber; } //------------------------------------------------------------------------------ inline std::vector &CCharacter::getFaberRmsFormulaNoConst() { - return _RmFormulaSelectedForFaber; + return _RmFormulaSelectedForFaber; } //------------------------------------------------------------------------------ inline const std::vector& CCharacter::getKnownPhrases() { - return _KnownPhrases; + return _KnownPhrases; } //------------------------------------------------------------------------------ inline uint8 CCharacter::cycleCounter() const { - return _CycleCounter; + return _CycleCounter; } //------------------------------------------------------------------------------ inline uint8 CCharacter::nextCounter() const { - return _NextCounter; + return _NextCounter; } //------------------------------------------------------------------------------ inline bool CCharacter::dodgeAsDefense() const { - return _DodgeAsDefense; + return _DodgeAsDefense; } //------------------------------------------------------------------------------ inline sint32 CCharacter::parrySuccessModifier() const -{ +{ return _ParrySuccessModifier; } //------------------------------------------------------------------------------ inline sint32 CCharacter::dodgeSuccessModifier() const -{ +{ return _DodgeSuccessModifier; } @@ -588,28 +588,28 @@ inline sint32 CCharacter::forageSuccessModifier( ECOSYSTEM::EECosystem eco) cons inline SLOT_EQUIPMENT::TSlotEquipment CCharacter::protectedSlot() const { - return _ProtectedSlot; + return _ProtectedSlot; } //------------------------------------------------------------------------------ inline NLMISC::TGameCycle CCharacter::dateOfNextAllowedAction() { - return _DateOfNextAllowedAction; + return _DateOfNextAllowedAction; } //------------------------------------------------------------------------------ -inline NLMISC::TGameCycle CCharacter::getForbidAuraUseEndDate() const -{ - return _ForbidAuraUseEndDate; +inline NLMISC::TGameCycle CCharacter::getForbidAuraUseEndDate() const +{ + return _ForbidAuraUseEndDate; } //------------------------------------------------------------------------------ inline uint8 CCharacter::nbAuras() const { - return _NbAuras; + return _NbAuras; } //------------------------------------------------------------------------------ @@ -637,154 +637,154 @@ inline bool CCharacter::isCombatEventFlagActive(BRICK_FLAGS::TBrickFlag flag) co inline float CCharacter::wearMalus() { - return _WearEquipmentMalus; + return _WearEquipmentMalus; } //------------------------------------------------------------------------------ inline sint32 CCharacter::adversaryDodgeModifier() { - return _AdversaryDodgeModifier; + return _AdversaryDodgeModifier; } //------------------------------------------------------------------------------ inline sint32 CCharacter::adversaryParryModifier() { - return _AdversaryParryModifier; + return _AdversaryParryModifier; } //------------------------------------------------------------------------------ inline const std::vector< CPetAnimal >& CCharacter::getPlayerPets() { - return _PlayerPets; + return _PlayerPets; } //------------------------------------------------------------------------------ inline sint32 CCharacter::getLastPosXInDB() const { - return _LastPosXInDB; + return _LastPosXInDB; } //------------------------------------------------------------------------------ inline sint32 CCharacter::getLastPosYInDB() const { - return _LastPosYInDB; + return _LastPosYInDB; } //------------------------------------------------------------------------------ inline CSkills& CCharacter::getSkills() { - return _Skills; + return _Skills; } //------------------------------------------------------------------------------ inline SKILLS::ESkills CCharacter::getBestSkill() const { - return _BestSkill; + return _BestSkill; } //------------------------------------------------------------------------------ inline SKILLS::ESkills CCharacter::getSkillUsedForDodge() const { - return _SkillUsedForDodge; + return _SkillUsedForDodge; } //------------------------------------------------------------------------------ inline sint32 CCharacter::getCurrentDodgeLevel() const { - return _CurrentDodgeLevel; + return _CurrentDodgeLevel; } //------------------------------------------------------------------------------ inline sint32 CCharacter::getCurrentParryLevel() const { - return _CurrentParryLevel; + return _CurrentParryLevel; } //------------------------------------------------------------------------------ inline sint32 CCharacter::getBaseDodgeLevel() const { - return _BaseDodgeLevel; + return _BaseDodgeLevel; } //------------------------------------------------------------------------------ inline sint32 CCharacter::getBaseParryLevel() const { - return _BaseParryLevel; + return _BaseParryLevel; } //------------------------------------------------------------------------------ inline NLMISC::TGameCycle CCharacter::getIntangibleEndDate() const { - return _IntangibleEndDate; + return _IntangibleEndDate; } //------------------------------------------------------------------------------ inline const uint64 &CCharacter::whoSeesMeBeforeTP() const { - return _WhoSeesMeBeforeTP; + return _WhoSeesMeBeforeTP; } //------------------------------------------------------------------------------ inline const TDataSetRow& CCharacter::getMonitoringCSR() { - return _MonitoringCSR; + return _MonitoringCSR; } //------------------------------------------------------------------------------ inline const TDataSetRow& CCharacter::getStoppedNpc() { - return _StoppedNpc; + return _StoppedNpc; } //------------------------------------------------------------------------------ inline float CCharacter::nextDeathPenaltyFactor() const { - return _NextDeathPenaltyFactor; + return _NextDeathPenaltyFactor; } //------------------------------------------------------------------------------ inline std::vector & CCharacter::getPersistentItemServices() { - return _PersistentItemServices; + return _PersistentItemServices; } //------------------------------------------------------------------------------ inline EGSPD::CFameContainerPD &CCharacter::getPlayerFamesContainer() { - return *_Fames; + return *_Fames; } //------------------------------------------------------------------------------ inline bool CCharacter::logXpGain() const { - return _LogXpGain; + return _LogXpGain; } //------------------------------------------------------------------------------ inline uint8 CCharacter::getAggroCount() { - return _AggroCount; + return _AggroCount; } //------------------------------------------------------------------------------ @@ -798,7 +798,7 @@ inline uint32 CCharacter::getGuildId() const inline uint32 CCharacter::getTpTicketSlot() const { - return _TpTicketSlot; + return _TpTicketSlot; } //------------------------------------------------------------------------------ @@ -827,7 +827,7 @@ inline uint8 CCharacter::getHairColor() const inline uint8 CCharacter::getHair() const { - return _HairType; + return _HairType; } @@ -835,68 +835,68 @@ inline uint8 CCharacter::getHair() const inline bool CCharacter::getHairCutDiscount() const { - return _HairCuteDiscount; + return _HairCuteDiscount; } //------------------------------------------------------------------------------ inline const std::vector &CCharacter::getMissionQueues() const { - return _MissionsQueues; + return _MissionsQueues; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getEnterCriticalZoneProposalQueueId() const { - return _EnterCriticalZoneProposalQueueId; + return _EnterCriticalZoneProposalQueueId; } //------------------------------------------------------------------------------ inline uint8 CCharacter::getNbNonNullClassificationTypesSkillMod() const { - return _NbNonNullClassificationTypesSkillMod; + return _NbNonNullClassificationTypesSkillMod; } //------------------------------------------------------------------------------ inline CPVPInterface &CCharacter::getPVPInterface() { - return *_PVPInterface; + return *_PVPInterface; } //------------------------------------------------------------------------------ inline const CPVPInterface & CCharacter::getPVPInterface() const { - return *_PVPInterface; + return *_PVPInterface; } //------------------------------------------------------------------------------ inline bool CCharacter::priviledgePVP() { - return _PriviledgePvp; + return _PriviledgePvp; } //------------------------------------------------------------------------------ inline TAIAlias CCharacter::getCurrentPVPZone() const { - return _CurrentPVPZone; + return _CurrentPVPZone; } //------------------------------------------------------------------------------ inline TAIAlias CCharacter::getCurrentOutpostZone() const { - return _CurrentOutpostZone; + return _CurrentOutpostZone; } inline OUTPOSTENUMS::TOutpostState CCharacter::getCurrentOutpostState() const { - return _CurrentOutpostState; + return _CurrentOutpostState; } @@ -904,56 +904,56 @@ inline OUTPOSTENUMS::TOutpostState CCharacter::getCurrentOutpostState() const inline uint16 CCharacter::getKilledPvPRegion() { - return _RegionKilledInPvp; + return _RegionKilledInPvp; } //------------------------------------------------------------------------------ inline bool CCharacter::getSafeInPvPSafeZone() const { - return _PvPSafeZoneActive; + return _PvPSafeZoneActive; } //------------------------------------------------------------------------------ inline CCharacter * CCharacter::getDuelOpponent() const { - return _DuelOpponent; + return _DuelOpponent; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getFirstConnectedTime() const { - return _FirstConnectedTime; + return _FirstConnectedTime; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getLastConnectedTime() const { - return _LastConnectedTime; + return _LastConnectedTime; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getLastConnectedDate() const { - return _LastConnectedDate; + return _LastConnectedDate; } //------------------------------------------------------------------------------ inline uint32 CCharacter::getPlayedTime() const { - return _PlayedTime; + return _PlayedTime; } //------------------------------------------------------------------------------ inline const std::string& CCharacter::getLangChannel() const { - return _LangChannel; + return _LangChannel; } //------------------------------------------------------------------------------ @@ -1026,7 +1026,7 @@ inline bool CCharacter::checkRequiredFaction(std::string faction) const std::pair allegeance = getAllegiance(); bool neutralcult = (allegeance.first == PVP_CLAN::Neutral || allegeance.first == PVP_CLAN::None); bool neutralciv = (allegeance.second == PVP_CLAN::Neutral || allegeance.second == PVP_CLAN::None); - + return ((faction == "kami" && allegeance.first == PVP_CLAN::Kami && getOrganization() == 0) || (faction == "karavan" && allegeance.first == PVP_CLAN::Karavan && getOrganization() == 0) || (faction == "marauder" && neutralcult && neutralciv && getOrganization() == 5) || @@ -1040,47 +1040,62 @@ inline bool CCharacter::checkRequiredFaction(std::string faction) const (faction == "zorai" && allegeance.second == PVP_CLAN::Zorai && getOrganization() == 0)); } +inline bool CCharacter::checkRequiredFame(std::string faction, sint32 fame) const +{ + if (faction == "") + return true; + + uint32 fameIdx = PVP_CLAN::getFactionIndex(PVP_CLAN::fromString(faction)); + + sint32 playerFame = CFameInterface::getInstance().getFameIndexed(_Id, fameIdx); + + if (fame == NO_FAME) + return false; + + return playerFame >= (fame * 6000); +} + //------------------------------------------------------------------------------ inline uint32 CCharacter::getOrganization() const { - return _Organization; + return _Organization; } inline uint32 CCharacter::getOrganizationStatus() const { - return _OrganizationStatus; + return _OrganizationStatus; } inline uint32 CCharacter::getLastTpTick() const { - return _LastTpTick; + return _LastTpTick; } inline uint32 CCharacter::getLastOverSpeedTick() const { - return _LastOverSpeedTick; + return _LastOverSpeedTick; } inline uint32 CCharacter::getLastMountTick() const { - return _LastMountTick; + return _LastMountTick; } inline uint32 CCharacter::getLastUnMountTick() const { - return _LastUnMountTick; + return _LastUnMountTick; } inline uint32 CCharacter::getLastFreeMount() const { - return _LastFreeMount; + return _LastFreeMount; } inline uint32 CCharacter::getLastExchangeMount() const { - return _LastExchangeMount; + return _LastExchangeMount; } inline bool CCharacter::getRespawnMainLandInTown() const @@ -1088,7 +1103,7 @@ inline bool CCharacter::getRespawnMainLandInTown() const return _RespawnMainLandInTown; } -inline void CCharacter::setRespawnMainLandInTown(bool status) +inline void CCharacter::setRespawnMainLandInTown(bool status) { _RespawnMainLandInTown = status; } @@ -1096,14 +1111,14 @@ inline void CCharacter::setRespawnMainLandInTown(bool status) inline const std::list& CCharacter::getLastLogStats() const { - return _LastLogStats; + return _LastLogStats; } //------------------------------------------------------------------------------ inline bool CCharacter::isChannelAdded() const { - return _ChannelAdded; + return _ChannelAdded; } //------------------------------------------------------------------------------ @@ -1121,35 +1136,35 @@ inline bool CCharacter::showFactionChannelsMode(TChanID channel) const inline CFarPositionStack& CCharacter::getPositionStack() { - return PositionStack; + return PositionStack; } //------------------------------------------------------------------------------ inline const CFarPositionStack& CCharacter::getPositionStack() const { - return PositionStack; + return PositionStack; } //------------------------------------------------------------------------------ inline R2::TUserRole CCharacter::sessionUserRole() const { - return _SessionUserRole; + return _SessionUserRole; } //------------------------------------------------------------------------------ inline TSessionId CCharacter::sessionId() const { - return _SessionId; + return _SessionId; } //------------------------------------------------------------------------------ inline TSessionId CCharacter::currentSessionId() const { - return _CurrentSessionId; + return _CurrentSessionId; } // Store the current active animation session returned by SU after char synchronisation. @@ -1167,7 +1182,7 @@ inline TSessionId CCharacter::getActiveAnimSessionId() inline TAIAlias CCharacter::getSelectedOutpost() const { - return _SelectedOutpost; + return _SelectedOutpost; } // return true if character has moved @@ -1180,7 +1195,7 @@ inline bool CCharacter::hasMoved() //inline CCharacter::CCharacterDbReminder* CCharacter::getDataIndexReminder() //{ -// return _DataIndexReminder; +// return _DataIndexReminder; //} //------------------------------------------------------------------------------