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

Read mobtypes.txt and handle standard and custom creatures animations #1266

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ffea0a7
Started rework of timed object ticking system (trying to change the d…
cbnolok Jun 14, 2024
d98a2d2
Merge branch 'dev' of https://github.com/cbnolok/Source-X into HEAD
cbnolok Jun 17, 2024
eeb2f27
Commented out debug code for new CWorldTicker containers management.
cbnolok Jun 18, 2024
f0eb033
Moved CWorldSearch class into its own cpp/h files.
cbnolok Jun 18, 2024
14258cf
Optimized CWorldSearch. Since it's used very, very often, instead of …
cbnolok Jun 20, 2024
32c2e03
More speed optimizations.
cbnolok Jun 20, 2024
b9dcbb3
Improved how triggers are interrogated, reducing CPU load.
cbnolok Jun 20, 2024
f707127
- Improvement: optimized various C++ core subsystems, resulting in a …
cbnolok Jun 21, 2024
c414145
Fixed: LASTUSED, LASTDISCONNECTED, TIMESTAMP being interpreted as a n…
cbnolok Jun 25, 2024
6e7ea8f
Updated gh workflow names and badges in README.
Jun 25, 2024
147dda9
Updated README.md
Jun 26, 2024
b55c3d9
Fix CMakeDetectArch for x86
Jun 26, 2024
32c3a0e
Add reference on @NpcRestock (#1254)
Jhobean Jun 26, 2024
c9665c2
Blocked spelleffect on ridden chars if the spell has field or area fl…
DavideRei Jul 20, 2024
cdbff70
Add .clang.format, update .editorconfig and .gitattributes
Jul 2, 2024
5844627
Update .gitignore
Jul 20, 2024
e550fe5
Added error message when trying to set a stat to an invalid value.
Jul 20, 2024
321b9c7
Read mobtypes.txt and handle standard and custom creatures animations
DavideRei Jul 20, 2024
f1c37ed
Merge branch 'Sphereserver:dev' into dev
DavideRei Jul 20, 2024
30d505b
updated changelog
DavideRei Jul 20, 2024
092011f
added missing info
DavideRei Jul 20, 2024
4876caa
missing info
DavideRei Jul 20, 2024
e2d0cc1
Added sphere.ini option to use Mobtypes.txt
DavideRei Aug 8, 2024
475ca6c
Merge remote-tracking branch 'upstream/dev' into dev
DavideRei Aug 8, 2024
1cd07e2
Fix CCharAct error
DavideRei Aug 8, 2024
913e7cf
Added safety check on mobtypes loading entries
DavideRei Aug 9, 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
49 changes: 49 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3803,6 +3803,55 @@ Added: 'H' shortcut for variables to get the value as hexadecimal.
20-07-2024, Nolok
- Changed: When trying to set/modify a STAT to reach a value < 0, print an error and default that stat to 0. Nevertheless, remember to check for underflows or overflows in your scripts before passing the value to the core! This update is a safety net but you can expect bugs anyways if you don't check the math in the scripts.

20-07-2024, DavideRei
- Added: read mobtypes.txt (if available among mul files) and cache it to check animations type when using creatures animations
- Added: alert anim on NPCs when they start combat, pillage anim when they loot something (items on ground or in bodies) and "summon" anim when they are summoned or added
- Modified: now standard anims (SEA_MONSTER, ANIMAL, MONSTER) and UOP anims are handled correctly depending on which actions anim they have on anim files (checked on last client version).
Please note that some actions are handled by the client (for example walk, run, fly, getHit while flying, die) and they could not work depending on which client you are using.
- Added: missing/new actions to be used with .ANIM command.
ANIM_ALERT = 35,
ANIM_THROW = 36,
ANIM_PILLAGE = 37,
ANIM_STOMP = 38,
ANIM_FLY = 39,
ANIM_LAND = 40,
ANIM_GETHIT_AIR = 41,
ANIM_SUMMON = 42,
ANIM_SPECIAL = 43, //UOP anims
ANIM_BOSS_SPECIAL_1 = 44, //Only few UOP anims: Order Variant, Chaos Variant, Stygian Dragon, Scalis
ANIM_BOSS_SPECIAL_2 = 45, //Only few UOP anims: Order Variant, Chaos Variant, Stygian Dragon, Scalis
- Modified: now custom anims can be handled by scripts using ANIM command under CHARDEF, to set which anim actions they have/don't have, using the following flags.

MONSTER (H slot) default configuration is with actions: 0 (Walk), 1 (Stand), 2 (Die1), 3 (Die2), 4 (Attack1), 5 (Attack2), 6 (Attack3), 10 (GetHit), 11 (Pillage), 15 (Block Right), 16 (Block Left), 17 (Idle), 18 (Fidget)
No DIE2 action = 01,
No ATTACK1 action = 02,
No ATTACK2 action = 04,
No ATTACK3 action = 08,
No GETHIT action = 010,
No PILLAGE action = 020,
STOMP action = 040,
CAST2 action = 080,
CAST3 action = 0100,
No BLOCKR action = 0200,
No BLOCKL action = 0400,
No FIDGET1 action = 0800,
No FIDGET2 action = 01000,
FLY action = 02000,
Anims with Attacks 1-2-3 in actions 9,10,11 and with GetHit in action 20 (there are many custom WOW anims with this configuration) = 0x10000

ANIMAL (L slot) default configuration is with all actions: 1 - 12
No EAT action = 01,
No ALERT action = 02,
No ATTACK2 action = 04,
No GETHIT action = 08,
No FIDGET1 action = 010,
No FIDGET2 action = 020,
No LIEDOWN action = 040,
No DIE2 action = 080

So for example if you have a MONSTER (H slot) flying custom anim, with Cast2 action but not Pillage action you can set ANIM=020A0
If you have a custom anim with default configuration, you don't need to set ANIM=

06-08-2024, Gladie
- Fixed: changed value of some recent spellflags, since the previous values waere too big to be stored in a standard numerical variable.
New values:
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeSources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ src/game/uo_files/CUOMapList.h
src/game/uo_files/CUOMapList.cpp
src/game/uo_files/CUOMapMeter.h
src/game/uo_files/CUOMapMeter.cpp
src/game/uo_files/CUOMobtypes.h
src/game/uo_files/CUOMobtypes.cpp
src/game/uo_files/CUOMultiItemRec.h
src/game/uo_files/CUOMultiItemRec.cpp
src/game/uo_files/CUOStaticItemRec.h
Expand Down
5 changes: 5 additions & 0 deletions src/common/CUOInstall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ VERFILE_TYPE CUOInstall::OpenFiles( ullong ullMask )

m_tiledata.Load();

if (g_Cfg.m_fUseMobTypes)
{
m_mobtypes.Load();
}

return (VERFILE_TYPE)i;
}

Expand Down
3 changes: 3 additions & 0 deletions src/common/CUOInstall.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "../game/uo_files/CUOTiledata.h"
#include "../game/uo_files/CUOIndexRec.h"
#include "../game/uo_files/CUOMapList.h"
#include "../game/uo_files/CUOMobtypes.h"
#include "sphere_library/CSFile.h"
#include "CSVFile.h"

Expand Down Expand Up @@ -52,6 +53,8 @@ extern struct CUOInstall

CSVFile m_CsvFiles[8]; // doors.txt, stairs.txt (x2), roof.txt, misc.txt, teleprts.txt, floors.txt, walls.txt

CUOMobTypes m_mobtypes;

public:
CSString GetFullExePath( lpctstr pszName = nullptr ) const;
CSString GetFullCDPath( lpctstr pszName = nullptr ) const;
Expand Down
3 changes: 3 additions & 0 deletions src/game/CServerConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ CServerConfig::CServerConfig()
_iMapCacheTime = 2ll * 60 * MSECS_PER_SEC;
_iSectorSleepDelay = 10ll * 60 * MSECS_PER_SEC;
m_fUseMapDiffs = false;
m_fUseMobTypes = false;

m_iDebugFlags = 0; //DEBUGF_NPC_EMOTE
m_fSecure = true;
Expand Down Expand Up @@ -707,6 +708,7 @@ enum RC_TYPE
RC_USEEXTRABUFFER, // m_fUseExtraBuffer
RC_USEHTTP, // m_fUseHTTP
RC_USEMAPDIFFS, // m_fUseMapDiffs
RC_USEMOBTYPES, // m_fUseMobTypes
RC_USENOCRYPT, // m_Usenocrypt
RC_USEPACKETPRIORITY, // m_fUsePacketPriorities
RC_VENDORMARKUP, // m_iVendorMarkup
Expand Down Expand Up @@ -992,6 +994,7 @@ const CAssocReg CServerConfig::sm_szLoadKeys[RC_QTY + 1]
{ "USEEXTRABUFFER", { ELEM_BOOL, static_cast<uint>OFFSETOF(CServerConfig,m_fUseExtraBuffer) }},
{ "USEHTTP", { ELEM_INT, static_cast<uint>OFFSETOF(CServerConfig,m_fUseHTTP) }},
{ "USEMAPDIFFS", { ELEM_BOOL, static_cast<uint>OFFSETOF(CServerConfig,m_fUseMapDiffs) }},
{ "USEMOBTYPES", { ELEM_BOOL, static_cast<uint>OFFSETOF(CServerConfig,m_fUseMobTypes) } },
{ "USENOCRYPT", { ELEM_BOOL, static_cast<uint>OFFSETOF(CServerConfig,m_fUsenocrypt) }}, // we don't want no-crypt clients
{ "USEPACKETPRIORITY", { ELEM_BOOL, static_cast<uint>OFFSETOF(CServerConfig,m_fUsePacketPriorities) }},
{ "VENDORMARKUP", { ELEM_INT, static_cast<uint>OFFSETOF(CServerConfig,m_iVendorMarkup) }},
Expand Down
1 change: 1 addition & 0 deletions src/game/CServerConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ extern class CServerConfig : public CResourceHolder
int64 _iMapCacheTime; // Time in sec to keep unused map data..
int64 _iSectorSleepDelay; // The mask for how long sectors will sleep.
bool m_fUseMapDiffs; // Whether or not to use map diff files.
bool m_fUseMobTypes; // Whether or not to use mobtypes.txt file.

CSString m_sWorldBaseDir; // save\" = world files go here.
CSString m_sAcctBaseDir; // Where do the account files go/come from ?
Expand Down
Loading