Index: sql/item_latents.sql =================================================================== --- sql/item_latents.sql (revision 3803) +++ sql/item_latents.sql (working copy) @@ -534,4 +534,13 @@ INSERT INTO `item_latents` VALUES(18346, 59, 9, 48, 0); INSERT INTO `item_latents` VALUES(15067, 1, 21, 48, 0); INSERT INTO `item_latents` VALUES(15068, 1, 6, 48, 0); -INSERT INTO `item_latents` VALUES(15069, 385, 200, 48, 0); \ No newline at end of file +INSERT INTO `item_latents` VALUES(15069, 385, 200, 48, 0); +-- Chocobo Shirt +INSERT INTO `item_latents` VALUES(10293, 25, 50, 49, 31); -- 50 acc +INSERT INTO `item_latents` VALUES(10293, 26, 50, 49, 31); -- 50 racc +INSERT INTO `item_latents` VALUES(10293, 30, 50, 49, 31); -- 50 macc +-- Destrier Beret +INSERT INTO `item_latents` VALUES(11811, 169, 12, 49, 31); -- 12% movement +INSERT INTO `item_latents` VALUES(11811, 370, 1, 49, 31); -- 1 regen +INSERT INTO `item_latents` VALUES(11811, 369, 1, 49, 31); -- 1 refresh +INSERT INTO `item_latents` VALUES(11811, 411, 1, 49, 31); -- reraise 1 Index: src/map/latent_effect.h =================================================================== --- src/map/latent_effect.h (revision 3803) +++ src/map/latent_effect.h (working copy) @@ -67,7 +67,8 @@ LATENT_JOB_LEVEL_EVEN = 42, LATENT_WEAPON_DRAWN_HP_UNDER = 43, //PARAM: HP PERCENT LATENT_WEAPON_BROKEN = 47, - LATENT_IN_DYNAMIS = 48 + LATENT_IN_DYNAMIS = 48, + LATENT_LEVEL_UNDER = 49 //PARAM: Level which player must be under (level < X) }; #define MAX_LATENTEFFECTID 50 Index: src/map/latent_effect_container.cpp =================================================================== --- src/map/latent_effect_container.cpp (revision 3803) +++ src/map/latent_effect_container.cpp (working copy) @@ -428,6 +428,14 @@ m_LatentEffectList.at(i)->Deactivate(); } break; + case LATENT_LEVEL_UNDER: + uint8 level = ( m_POwner->m_LevelRestriction != 0 && m_POwner->m_LevelRestriction < m_POwner->GetMLevel() ) ? m_POwner->m_LevelRestriction : m_POwner->GetMLevel(); + if( level < m_LatentEffectList.at(i)->GetConditionsValue() ){ + m_LatentEffectList.at(i)->Activate(); + }else{ + m_LatentEffectList.at(i)->Deactivate(); + } + break; } } } @@ -748,4 +756,26 @@ break; } } -} \ No newline at end of file +} + +/************************************************************************ +* * +* Checks all latents regarding current level * +* * +************************************************************************/ + +void CLatentEffectContainer::CheckLatentsLevel( uint8 level ){ + for( uint16 i = 0; i < m_LatentEffectList.size(); i++ ){ + switch( m_LatentEffectList.at(i)->GetConditionsID() ){ + case LATENT_LEVEL_UNDER: + if( m_LatentEffectList.at(i)->GetConditionsValue() > level ){ + m_LatentEffectList.at(i)->Activate(); + }else{ + m_LatentEffectList.at(i)->Deactivate(); + } + break; + default: + break; + } + } +} Index: src/map/utils/charutils.cpp =================================================================== --- src/map/utils/charutils.cpp (revision 3803) +++ src/map/utils/charutils.cpp (working copy) @@ -3075,6 +3075,8 @@ { PChar->SetMLevel(PChar->jobs.job[PChar->GetMJob()]); PChar->SetSLevel(PChar->jobs.job[PChar->GetSJob()]); + + PChar->PLatentEffectContainer->CheckLatentsLevel(PChar->GetMLevel()); } BuildingCharSkillsTable(PChar); @@ -3260,6 +3262,7 @@ BuildingCharAbilityTable(PChar); BuildingCharTraitsTable(PChar); BuildingCharWeaponSkills(PChar); + PChar->PLatentEffectContainer->CheckLatentsLevel(PChar->GetMLevel()); } PChar->UpdateHealth(); Index: src/map/latent_effect_container.h =================================================================== --- src/map/latent_effect_container.h (revision 3803) +++ src/map/latent_effect_container.h (working copy) @@ -57,6 +57,7 @@ void CheckLatentsTime(); void CheckLatentsWeaponBreak(uint8 slot); void CheckLatentsZone(); + void CheckLatentsLevel(uint8 level); void AddLatentEffect(CLatentEffect* LatentEffect); void AddLatentEffects(std::vector *latentList, uint8 slot);