mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
Handle title on player spawn;
This commit is contained in:
parent
20daf4cdc2
commit
f97aa2d7d6
3 changed files with 18 additions and 5 deletions
|
@ -1425,6 +1425,11 @@ uint8_t * Core::Entity::Player::getTitleList()
|
||||||
return m_titleList;
|
return m_titleList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t Core::Entity::Player::getTitle()
|
||||||
|
{
|
||||||
|
return m_title;
|
||||||
|
}
|
||||||
|
|
||||||
void Core::Entity::Player::addTitle( uint16_t titleId )
|
void Core::Entity::Player::addTitle( uint16_t titleId )
|
||||||
{
|
{
|
||||||
uint16_t index;
|
uint16_t index;
|
||||||
|
|
|
@ -330,6 +330,8 @@ public:
|
||||||
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadoutTime = 0, uint16_t animation = 0 );
|
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadoutTime = 0, uint16_t animation = 0 );
|
||||||
/*! get player's title list (available titles) */
|
/*! get player's title list (available titles) */
|
||||||
uint8_t * getTitleList();
|
uint8_t * getTitleList();
|
||||||
|
/*! get player's active title */
|
||||||
|
uint16_t Core::Entity::Player::getTitle();
|
||||||
/*! add title to player title list */
|
/*! add title to player title list */
|
||||||
void addTitle( uint16_t titleId );
|
void addTitle( uint16_t titleId );
|
||||||
/*! change player's title */
|
/*! change player's title */
|
||||||
|
|
|
@ -36,36 +36,42 @@ namespace Server {
|
||||||
// TODO: temporary gm rank
|
// TODO: temporary gm rank
|
||||||
//m_data.gmRank = 0xff;
|
//m_data.gmRank = 0xff;
|
||||||
|
|
||||||
|
|
||||||
m_data.currentMount = 0;
|
|
||||||
m_data.classJob = pPlayer->getClass();
|
m_data.classJob = pPlayer->getClass();
|
||||||
//m_data.status = static_cast< uint8_t >( pPlayer->getStatus() );
|
//m_data.status = static_cast< uint8_t >( pPlayer->getStatus() );
|
||||||
|
|
||||||
m_data.hPCurr = pPlayer->getHp();
|
m_data.hPCurr = pPlayer->getHp();
|
||||||
m_data.mPCurr = pPlayer->getMp();
|
m_data.mPCurr = pPlayer->getMp();
|
||||||
m_data.tPCurr = pPlayer->getTp();
|
m_data.tPCurr = pPlayer->getTp();
|
||||||
m_data.hPMax = pPlayer->getMaxHp();
|
m_data.hPMax = pPlayer->getMaxHp();
|
||||||
m_data.mPMax = pPlayer->getMaxMp();
|
m_data.mPMax = pPlayer->getMaxMp();
|
||||||
m_data.gmRank = pPlayer->getGmRank();
|
|
||||||
//m_data.tPMax = 3000;
|
//m_data.tPMax = 3000;
|
||||||
m_data.level = pPlayer->getLevel();
|
m_data.level = pPlayer->getLevel();
|
||||||
|
m_data.gmRank = pPlayer->getGmRank();
|
||||||
memcpy( m_data.look, pPlayer->getLookArray(), 26 );
|
memcpy( m_data.look, pPlayer->getLookArray(), 26 );
|
||||||
|
|
||||||
auto item = pPlayer->getInventory()->getItemAt( Inventory::GearSet0, Inventory::EquipSlot::MainHand );
|
auto item = pPlayer->getInventory()->getItemAt( Inventory::GearSet0, Inventory::EquipSlot::MainHand );
|
||||||
if( item )
|
if( item )
|
||||||
m_data.mainWeaponModel = item->getModelId1();
|
m_data.mainWeaponModel = item->getModelId1();
|
||||||
m_data.secWeaponModel = pPlayer->getModelSubWeapon();
|
m_data.secWeaponModel = pPlayer->getModelSubWeapon();
|
||||||
|
|
||||||
m_data.models[0] = pPlayer->getModelForSlot( Inventory::EquipSlot::Head );
|
m_data.models[0] = pPlayer->getModelForSlot( Inventory::EquipSlot::Head );
|
||||||
m_data.models[1] = pPlayer->getModelForSlot( Inventory::EquipSlot::Body );
|
m_data.models[1] = pPlayer->getModelForSlot( Inventory::EquipSlot::Body );
|
||||||
m_data.models[2] = pPlayer->getModelForSlot( Inventory::EquipSlot::Hands );
|
m_data.models[2] = pPlayer->getModelForSlot( Inventory::EquipSlot::Hands );
|
||||||
m_data.models[3] = pPlayer->getModelForSlot( Inventory::EquipSlot::Legs );
|
m_data.models[3] = pPlayer->getModelForSlot( Inventory::EquipSlot::Legs );
|
||||||
m_data.models[4] = pPlayer->getModelForSlot( Inventory::EquipSlot::Feet );
|
m_data.models[4] = pPlayer->getModelForSlot( Inventory::EquipSlot::Feet );
|
||||||
strcpy( m_data.name, pPlayer->getName().c_str() );
|
strcpy( m_data.name, pPlayer->getName().c_str() );
|
||||||
|
|
||||||
m_data.pos.x = pPlayer->getPos().x;
|
m_data.pos.x = pPlayer->getPos().x;
|
||||||
m_data.pos.y = pPlayer->getPos().y;
|
m_data.pos.y = pPlayer->getPos().y;
|
||||||
m_data.pos.z = pPlayer->getPos().z;
|
m_data.pos.z = pPlayer->getPos().z;
|
||||||
m_data.voice = pPlayer->getVoiceId();
|
|
||||||
|
|
||||||
m_data.rotation = Math::Util::floatToUInt16Rot( pPlayer->getRotation() );
|
m_data.rotation = Math::Util::floatToUInt16Rot( pPlayer->getRotation() );
|
||||||
|
|
||||||
|
|
||||||
|
m_data.title = pPlayer->getTitle();
|
||||||
|
m_data.voice = pPlayer->getVoiceId();
|
||||||
|
m_data.currentMount = 0;
|
||||||
|
|
||||||
m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() );
|
m_data.onlineStatus = static_cast< uint8_t >( pPlayer->getOnlineStatus() );
|
||||||
|
|
||||||
//m_data.u23 = 0x04;
|
//m_data.u23 = 0x04;
|
||||||
|
|
Loading…
Add table
Reference in a new issue