mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
HP/MP/TP Regeneration following new rules;
Bumped level cap up to 70; Additional checks for autoattacking; Using auto-attack damage from weapon;
This commit is contained in:
parent
3634ccdb4e
commit
d7c97491c3
7 changed files with 56 additions and 24 deletions
|
@ -425,6 +425,7 @@ boost::shared_ptr< Core::Data::ItemInfo >
|
|||
info->is_hqable = getField< bool >( row, 20 );
|
||||
info->model_primary = getField< uint64_t >( row, 45 );
|
||||
info->model_secondary = getField< uint64_t >( row, 46 );
|
||||
info->physical_damage = getField< uint16_t >( row, 49 );
|
||||
info->delayMs = getField< uint16_t >( row, 51 );
|
||||
info->is_unique = getField< int16_t >( row, 64 ) != 0 ? true : false;
|
||||
info->is_untradeable = getField< uint8_t >( row, 65 ) != 0 ? true : false;
|
||||
|
|
|
@ -201,20 +201,21 @@ namespace Core {
|
|||
struct ItemInfo
|
||||
{
|
||||
uint32_t id;
|
||||
std::string name; //0
|
||||
uint16_t item_level;//11
|
||||
uint8_t required_level;//12
|
||||
uint32_t stack_size;//19
|
||||
uint16_t unknown_category;//15
|
||||
uint16_t ui_category;//17
|
||||
bool is_hqable;//20
|
||||
uint64_t model_primary;//28
|
||||
uint64_t model_secondary;//29
|
||||
uint32_t class_job_requirement;//58
|
||||
uint16_t delayMs; //59
|
||||
bool is_unique;//72
|
||||
bool is_untradeable;//73
|
||||
uint32_t class_job_index;//86
|
||||
std::string name; //0
|
||||
uint16_t item_level; //11
|
||||
uint8_t required_level; //12
|
||||
uint16_t unknown_category; //15
|
||||
uint16_t ui_category; //17
|
||||
uint32_t stack_size; //19
|
||||
bool is_hqable; //20
|
||||
uint64_t model_primary; //28
|
||||
uint64_t model_secondary; //29
|
||||
uint16_t physical_damage; //49
|
||||
uint32_t class_job_requirement; //58
|
||||
uint16_t delayMs; //59
|
||||
bool is_unique; //72
|
||||
bool is_untradeable; //73
|
||||
uint32_t class_job_index; //86
|
||||
};
|
||||
|
||||
struct ActionInfo
|
||||
|
|
|
@ -26,6 +26,8 @@ Core::Item::Item( uint64_t uId, uint32_t catalogId, uint64_t model1, uint64_t mo
|
|||
{
|
||||
auto itemInfo = g_exdData.getItemInfo( catalogId );
|
||||
m_delayMs = itemInfo->delayMs;
|
||||
m_physicalDmg = itemInfo->physical_damage;
|
||||
m_autoAttackDmg = float(m_physicalDmg * m_delayMs) / 3000;
|
||||
}
|
||||
|
||||
Core::Item::~Item()
|
||||
|
@ -33,11 +35,21 @@ Core::Item::~Item()
|
|||
|
||||
}
|
||||
|
||||
float Core::Item::getAutoAttackDmg() const
|
||||
{
|
||||
return m_autoAttackDmg;
|
||||
}
|
||||
|
||||
uint16_t Core::Item::getDelay() const
|
||||
{
|
||||
return m_delayMs;
|
||||
}
|
||||
|
||||
uint16_t Core::Item::getPhysicalDmg() const
|
||||
{
|
||||
return m_physicalDmg;
|
||||
}
|
||||
|
||||
uint32_t Core::Item::getId() const
|
||||
{
|
||||
return m_id;
|
||||
|
|
|
@ -39,8 +39,13 @@ public:
|
|||
bool isHq() const;
|
||||
|
||||
void setHq( bool isHq );
|
||||
|
||||
uint16_t getDelay() const;
|
||||
|
||||
uint16_t getPhysicalDmg() const;
|
||||
|
||||
float getAutoAttackDmg() const;
|
||||
|
||||
|
||||
protected:
|
||||
uint32_t m_id;
|
||||
|
@ -58,6 +63,8 @@ protected:
|
|||
bool m_isHq;
|
||||
|
||||
uint16_t m_delayMs;
|
||||
uint16_t m_physicalDmg;
|
||||
float m_autoAttackDmg;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -798,10 +798,13 @@ void Core::Network::GameConnection::actionHandler( Core::Network::Packets::GameP
|
|||
{
|
||||
case 0x01:
|
||||
{
|
||||
if( param11 == 1 )
|
||||
pPlayer->setStance( Entity::Actor::Stance::Active );
|
||||
if (param11 == 1)
|
||||
pPlayer->setStance(Entity::Actor::Stance::Active);
|
||||
else
|
||||
pPlayer->setStance( Entity::Actor::Stance::Passive );
|
||||
{
|
||||
pPlayer->setStance(Entity::Actor::Stance::Passive);
|
||||
pPlayer->setAutoattack(false);
|
||||
}
|
||||
|
||||
pPlayer->sendToInRangeSet( ActorControlPacket142( pPlayer->getId(), 0, param11, 1 ) );
|
||||
|
||||
|
@ -810,7 +813,10 @@ void Core::Network::GameConnection::actionHandler( Core::Network::Packets::GameP
|
|||
case 0x02:
|
||||
{
|
||||
if (param11 == 1)
|
||||
{
|
||||
pPlayer->setAutoattack( true );
|
||||
pPlayer->setStance(Entity::Actor::Stance::Active);
|
||||
}
|
||||
else
|
||||
pPlayer->setAutoattack( false );
|
||||
|
||||
|
|
|
@ -615,7 +615,7 @@ void Core::Entity::Player::gainExp( uint32_t amount )
|
|||
|
||||
queuePacket( ActorControlPacket143( getId(), GainExpMsg, static_cast< uint8_t >( getClass() ), amount ) );
|
||||
|
||||
if( level >= 60 ) // temporary fix for leveling over levelcap
|
||||
if( level >= 70 ) // temporary fix for leveling over levelcap
|
||||
{
|
||||
queuePacket( ActorControlPacket143( getId(), UpdateUiExp, static_cast< uint8_t >( getClass() ), amount ) );
|
||||
return;
|
||||
|
@ -1085,7 +1085,9 @@ void Core::Entity::Player::update( int64_t currTime )
|
|||
if( isAutoattackOn() &&
|
||||
actor->getId() == m_targetId &&
|
||||
actor->isAlive() &&
|
||||
mainWeap )
|
||||
mainWeap &&
|
||||
m_currentStance == Entity::Actor::Stance::Active
|
||||
)
|
||||
{
|
||||
// default autoattack range
|
||||
// TODO make this dependant on bnpc size
|
||||
|
@ -1430,11 +1432,13 @@ void Core::Entity::Player::setIsLogin( bool bIsLogin )
|
|||
void Core::Entity::Player::autoAttack( ActorPtr pTarget )
|
||||
{
|
||||
|
||||
auto mainWeap = m_pInventory->getItemAt(Inventory::GearSet0, Inventory::EquipSlot::MainHand);
|
||||
|
||||
pTarget->onActionHostile( shared_from_this() );
|
||||
//uint64_t tick = Util::getTimeMs();
|
||||
|
||||
//srand(static_cast< uint32_t >(tick));
|
||||
uint32_t damage = 10 + rand() % 12;
|
||||
|
||||
uint32_t damage = mainWeap->getAutoAttackDmg() + rand() % 12;
|
||||
uint32_t variation = 0 + rand() % 3;
|
||||
|
||||
if( getClass() == 5 || getClass() == 23 || getClass() == 31 )
|
||||
|
|
|
@ -263,12 +263,14 @@ void Core::Entity::Player::onTick()
|
|||
return;
|
||||
|
||||
int32_t addHp = getMaxHp() * 0.1f + 1;
|
||||
int32_t addMp = 8 * 0.1f + 1;
|
||||
int32_t addMp = getMaxMp() * 0.06f + 1;
|
||||
int32_t addTp = 100;
|
||||
|
||||
if( !m_actorIdTohateSlotMap.empty() )
|
||||
{
|
||||
addHp = getMaxHp() * 0.01f + 1;
|
||||
addMp = getMaxHp() * 0.01f + 1;
|
||||
addMp = getMaxHp() * 0.02f + 1;
|
||||
addTp = 60;
|
||||
}
|
||||
|
||||
if( m_hp < getMaxHp() )
|
||||
|
@ -295,7 +297,6 @@ void Core::Entity::Player::onTick()
|
|||
|
||||
if( m_tp < 1000 )
|
||||
{
|
||||
int32_t addTp = 100;
|
||||
if( m_tp + addTp < 1000 )
|
||||
m_tp += addTp;
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue