@ -408,6 +408,10 @@ void StatsFunctions::SetAttributeBase(unsigned short pid, unsigned short attribu
return ;
return ;
player - > creatureStats . mAttributes [ attributeId ] . mBase = value ;
player - > creatureStats . mAttributes [ attributeId ] . mBase = value ;
if ( std : : find ( player - > attributeChanges . attributeIndexes . begin ( ) , player - > attributeChanges . attributeIndexes . end ( ) , attributeId ) = =
player - > attributeChanges . attributeIndexes . end ( ) )
player - > attributeChanges . attributeIndexes . push_back ( attributeId ) ;
}
}
void StatsFunctions : : ClearAttributeModifier ( unsigned short pid , unsigned short attributeId ) noexcept
void StatsFunctions : : ClearAttributeModifier ( unsigned short pid , unsigned short attributeId ) noexcept
@ -419,6 +423,10 @@ void StatsFunctions::ClearAttributeModifier(unsigned short pid, unsigned short a
return ;
return ;
player - > creatureStats . mAttributes [ attributeId ] . mMod = 0 ;
player - > creatureStats . mAttributes [ attributeId ] . mMod = 0 ;
if ( std : : find ( player - > attributeChanges . attributeIndexes . begin ( ) , player - > attributeChanges . attributeIndexes . end ( ) , attributeId ) = =
player - > attributeChanges . attributeIndexes . end ( ) )
player - > attributeChanges . attributeIndexes . push_back ( attributeId ) ;
}
}
void StatsFunctions : : SetSkillBase ( unsigned short pid , unsigned short skillId , int value ) noexcept
void StatsFunctions : : SetSkillBase ( unsigned short pid , unsigned short skillId , int value ) noexcept
@ -469,6 +477,10 @@ void StatsFunctions::SetSkillIncrease(unsigned short pid, unsigned int attribute
return ;
return ;
player - > npcStats . mSkillIncrease [ attributeId ] = value ;
player - > npcStats . mSkillIncrease [ attributeId ] = value ;
if ( std : : find ( player - > attributeChanges . attributeIndexes . begin ( ) , player - > attributeChanges . attributeIndexes . end ( ) , attributeId ) = =
player - > attributeChanges . attributeIndexes . end ( ) )
player - > attributeChanges . attributeIndexes . push_back ( attributeId ) ;
}
}
void StatsFunctions : : SetBounty ( unsigned short pid , int value ) noexcept
void StatsFunctions : : SetBounty ( unsigned short pid , int value ) noexcept
@ -520,6 +532,8 @@ void StatsFunctions::SendAttributes(unsigned short pid) noexcept
mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) - > GetPacket ( ID_PLAYER_ATTRIBUTE ) - > setPlayer ( player ) ;
mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) - > GetPacket ( ID_PLAYER_ATTRIBUTE ) - > setPlayer ( player ) ;
mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) - > GetPacket ( ID_PLAYER_ATTRIBUTE ) - > Send ( false ) ;
mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) - > GetPacket ( ID_PLAYER_ATTRIBUTE ) - > Send ( false ) ;
mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) - > GetPacket ( ID_PLAYER_ATTRIBUTE ) - > Send ( true ) ;
mwmp : : Networking : : get ( ) . getPlayerPacketController ( ) - > GetPacket ( ID_PLAYER_ATTRIBUTE ) - > Send ( true ) ;
player - > attributeChanges . attributeIndexes . clear ( ) ;
}
}
void StatsFunctions : : SendSkills ( unsigned short pid ) noexcept
void StatsFunctions : : SendSkills ( unsigned short pid ) noexcept