Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registration of Packet 0x2D #1336

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f9f12ec
New trigger @HitReactive
canerksk Oct 25, 2024
670a6c3
Added NOREJOIN tag for corpses
canerksk Oct 25, 2024
9a72c16
New optionflag OF_PetBehaviorOwnerNeutral
canerksk Oct 25, 2024
0cfc874
Added more server function
canerksk Oct 25, 2024
f3f9955
Added more server (maria db) function
canerksk Oct 25, 2024
7fea3e8
Logout trigger for NPCs
canerksk Oct 25, 2024
7e10a2c
missing scope added.
canerksk Oct 25, 2024
14667f9
oldstyle movement optional added
canerksk Oct 26, 2024
6960982
Event definitions in Sphere.ini have been made more extensive.
canerksk Oct 26, 2024
3136816
sphere.ini file updated
canerksk Oct 26, 2024
c6d66fd
New @Deposit/@ItemDeposit trigger
canerksk Oct 26, 2024
c3692c1
Added new local variable in WOPSYSTEM LOCAL.WOPTalkMode and ini setti…
canerksk Oct 26, 2024
f93d918
Memory OnTick link char if not, the skill will not fail.
canerksk Oct 26, 2024
67de95e
The entity was jumping frames in flooded pet commands (come, guard)
canerksk Oct 26, 2024
505ff98
New client function CLOSECONTAINER and CLOSEVENDORMENU
canerksk Oct 26, 2024
2f88779
Merge branch 'cli-comma' into jaharia
canerksk Nov 6, 2024
7be29c1
Merge branch 'corpse-norejoin' into jaharia
canerksk Nov 6, 2024
75bb413
Merge branch 'hitreactive' into jaharia
canerksk Nov 6, 2024
492a730
Merge branch 'mini-fixes' into jaharia
canerksk Nov 6, 2024
6a3d67d
Merge branch 'npc-logout' into jaharia
canerksk Nov 6, 2024
64f026e
Merge branch 'jaharia' into npc-movement
canerksk Nov 6, 2024
98d4760
Merge branch 'ondb-funcs' into jaharia
canerksk Nov 6, 2024
d5ce391
Merge branch 'onserv-funcs' into jaharia
canerksk Nov 6, 2024
5a99416
Merge branch 'pet-own-noto' into jaharia
canerksk Nov 6, 2024
e923507
Merge branch 'seperated-events' into jaharia
canerksk Nov 6, 2024
fe93d02
Merge branch 'trig-deposit' into jaharia
canerksk Nov 6, 2024
c09cb75
Merge branch 'wop-talkmode' into jaharia
canerksk Nov 6, 2024
92a5296
Merge branch 'npc-movement' into jaharia
canerksk Nov 6, 2024
6d847ac
bank hear fix
canerksk Nov 7, 2024
938fba1
Merge branch 'bnk-hear' into jaharia
canerksk Nov 7, 2024
6d27afb
ITEMMEMORYEQUIP is not triggered in many default memories.
canerksk Nov 8, 2024
6178920
Merge branch 'mini-fixes' into jaharia
canerksk Nov 8, 2024
83ec654
Added NOTOTITLE function
canerksk Nov 10, 2024
9e7eb4c
Merge branch 'noto-title' into jaharia
canerksk Nov 10, 2024
cb3d36f
@Eat trigger stat increases are not disabled
canerksk Nov 11, 2024
3dbb948
Merge branch 'eat-trig' into jaharia
canerksk Nov 11, 2024
bff12f8
MapWaypoint was added to a lower client version.
canerksk Nov 15, 2024
ee2e60d
Registration of Packet 0x2D
canerksk Nov 15, 2024
50d6eaa
Merge branch '02d-packet' into jaharia
canerksk Nov 15, 2024
8d94583
merge fix
canerksk Nov 15, 2024
da82936
copy paste error fix :\
canerksk Nov 16, 2024
03a04a1
f_onaccount_login added argn2 for PacketLoginError packet number
canerksk Nov 19, 2024
b74865c
re-named functions
canerksk Nov 20, 2024
c0328de
Merge branch 'ondb-funcs' into jaharia
canerksk Nov 20, 2024
5456ee9
naming conventions regulation update
canerksk Nov 26, 2024
3c1b822
Merge branch '02d-packet' into jaharia
canerksk Nov 26, 2024
1a71566
naming conventions regulation fix
canerksk Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3914,3 +3914,6 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.

13-10-2024, Jhobean
- Added: @PetRelease trigger work like @petdesert and return 1 to prevent the pet from being released.

15-11-2024, canerksk
- Added: Registration of Packet 0x2D MobileAttributes Update packet
1 change: 1 addition & 0 deletions src/common/sphereproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum XCMD_TYPE // XCMD_* messages are unique in both directions.
XCMD_DropRejected = 0x28,
XCMD_DropAccepted = 0x29,
XCMD_DeathMenu = 0x2c,
XCMD_MobileAttributes = 0x2d,
XCMD_ItemEquip = 0x2e,
XCMD_Fight = 0x2f,
// 0x30
Expand Down
2 changes: 1 addition & 1 deletion src/game/chars/CCharFight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ int CChar::OnTakeDamage( int iDmg, CChar * pSrc, DAMAGE_TYPE uiType, int iDmgPhy
SoundChar(CRESND_GETHIT);
UpdateStatVal( STAT_STR, -iDmg);
if ( pSrc->IsClientActive() )
pSrc->GetClientActive()->addHitsUpdate( this ); // always send updates to src
pSrc->GetClientActive()->addHitsUpdate( this, true ); // always send updates to src

if ( IsAosFlagEnabled( FEATURE_AOS_DAMAGE ) )
{
Expand Down
7 changes: 4 additions & 3 deletions src/game/clients/CClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,10 @@ class CClient : public CSObjListRec, public CScriptObj, public CChatChanMember,
bool addBookOpen( CItem * pBook ) const;
void addBookPage( const CItem * pBook, word wPage, word wCount ) const;
void addStatusWindow( CObjBase * pObj, bool fRequested = false ); // Opens the status window
void addHitsUpdate( CChar * pChar );
void addManaUpdate( CChar * pChar );
void addStamUpdate( CChar * pChar );
void addHitsUpdate(CChar *pChar, bool bFull = false);
void addManaUpdate(CChar *pChar, bool bFull = false);
void addStamUpdate(CChar *pChar, bool bFull = false);
void addAttributesUpdate(CChar *pChar);
void addHealthBarUpdate( const CChar * pChar ) const;
void addBondedStatus( const CChar * pChar, bool fIsDead ) const;
void addSkillWindow(SKILL_TYPE skill, bool fFromInfo = false) const; // Opens the skills list
Expand Down
32 changes: 26 additions & 6 deletions src/game/clients/CClientMsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2157,20 +2157,21 @@ void CClient::UpdateStats()
{
if ( m_fUpdateStats & SF_UPDATE_HITS )
{
addHitsUpdate( m_pChar);
addHitsUpdate(m_pChar, false);
m_fUpdateStats &= ~SF_UPDATE_HITS;
}
if ( m_fUpdateStats & SF_UPDATE_MANA )
{
addManaUpdate( m_pChar );
addManaUpdate(m_pChar, false);
m_fUpdateStats &= ~SF_UPDATE_MANA;
}

if ( m_fUpdateStats & SF_UPDATE_STAM )
{
addStamUpdate( m_pChar );
addStamUpdate(m_pChar, false);
m_fUpdateStats &= ~SF_UPDATE_STAM;
}
addAttributesUpdate(m_pChar);
}
}

Expand All @@ -2197,17 +2198,20 @@ void CClient::addStatusWindow( CObjBase *pObj, bool fRequested ) // Opens the st
}
}

void CClient::addHitsUpdate( CChar *pChar )
void CClient::addHitsUpdate( CChar *pChar, bool bFull )
{
ADDTOCALLSTACK("CClient::addHitsUpdate");
if ( !pChar )
return;

PacketHealthUpdate cmd(pChar, pChar == m_pChar);
cmd.send(this);

if (bFull)
addAttributesUpdate(pChar);
}

void CClient::addManaUpdate( CChar *pChar )
void CClient::addManaUpdate(CChar *pChar, bool bFull)
{
ADDTOCALLSTACK("CClient::addManaUpdate");
if ( !pChar )
Expand All @@ -2221,9 +2225,12 @@ void CClient::addManaUpdate( CChar *pChar )
PacketManaUpdate cmd2(pChar, false);
pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
}

if (bFull)
addAttributesUpdate(pChar);
}

void CClient::addStamUpdate( CChar *pChar )
void CClient::addStamUpdate(CChar *pChar, bool bFull)
{
ADDTOCALLSTACK("CClient::addStamUpdate");
if ( !pChar )
Expand All @@ -2237,6 +2244,9 @@ void CClient::addStamUpdate( CChar *pChar )
PacketStaminaUpdate cmd2(pChar, false);
pChar->m_pParty->AddStatsUpdate(pChar, &cmd2);
}

if (bFull)
addAttributesUpdate(pChar);
}

void CClient::addHealthBarUpdate( const CChar * pChar ) const
Expand All @@ -2252,6 +2262,16 @@ void CClient::addHealthBarUpdate( const CChar * pChar ) const
new PacketHealthBarUpdate(this, pChar);
}

void CClient::addAttributesUpdate(CChar *pChar)
{
ADDTOCALLSTACK("CClient::addAttributesUpdate");
if (!pChar)
return;

PacketMobileAttributes cmd(pChar);
cmd.send(this);
}

void CClient::addBondedStatus( const CChar * pChar, bool bIsDead ) const
{
ADDTOCALLSTACK("CClient::addBondedStatus");
Expand Down
23 changes: 23 additions & 0 deletions src/network/send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,29 @@ PacketDeathMenu::PacketDeathMenu(const CClient* target, Mode mode) : PacketSend(
push(target);
}

/***************************************************************************
*
*
* Packet 0x2d : PacketMobileAttributes Sends all stat (NORMAL)
*
*
***************************************************************************/
PacketMobileAttributes::PacketMobileAttributes(const CChar *character) : PacketSend(XCMD_MobileAttributes, 17, PRI_NORMAL)
{
ADDTOCALLSTACK("PacketDeathMenu::PacketDeathMenu");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy paster error


writeInt32(character->GetUID());

writeInt16((word)(character->Stat_GetMaxAdjusted(STAT_STR)));
writeInt16((word)(character->Stat_GetVal(STAT_STR)));

writeInt16((word)(character->Stat_GetMaxAdjusted(STAT_INT)));
writeInt16((word)(character->Stat_GetVal(STAT_INT)));

writeInt16((word)(character->Stat_GetMaxAdjusted(STAT_DEX)));
writeInt16((word)(character->Stat_GetVal(STAT_DEX)));
}


/***************************************************************************
*
Expand Down
13 changes: 13 additions & 0 deletions src/network/send.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,19 @@ class PacketDeathMenu : public PacketSend
PacketDeathMenu(const CClient* target, Mode mode);
};

/***************************************************************************
*
*
* Packet 0x2D : PacketMobileAttributes Sends all stat (NORMAL)
*
*
***************************************************************************/
class PacketMobileAttributes : public PacketSend {
public:
PacketMobileAttributes(const CChar *character);
};


/***************************************************************************
*
*
Expand Down