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

RESOURCETYPE RES_SPAWN Problem #1359

Open
xMirroRx opened this issue Dec 20, 2024 · 3 comments
Open

RESOURCETYPE RES_SPAWN Problem #1359

xMirroRx opened this issue Dec 20, 2024 · 3 comments

Comments

@xMirroRx
Copy link

xMirroRx commented Dec 20, 2024

  • Added: , which gets the resource type (RES_ITEMDEF, RES_SPAWN, etc) from the defname. The list of the resource type numbers is in the X scriptpack in core/defs.scp.
[DEFNAME serv_resource_types]
RES_ACCOUNT			= 1		// Define an account instance.
RES_AREA			= 3		// Complex region. (w/extra tags)
RES_BOOK			= 5		// A book or a page from a book.
RES_CHAMPION		= 6		// A Champion definition.
RES_CHARDEF			= 7		// Define a char type. (overlap with RES_SPAWN)
RES_DIALOG			= 10	// A scriptable gump dialog, text or handler block.
RES_ITEMDEF			= 15	// Define an item type. (overlap with RES_TEMPLATE)
RES_MENU			= 18	// General scriptable menus.
RES_NAMES			= 20	// A block of possible names for a NPC type. (read as needed)
RES_NEWBIE			= 21	// Triggers to execute on Player creation (based on skills selected)
RES_REGIONRESOURCE	= 25	// Define an Ore type.
RES_REGIONTYPE		= 26	// Triggers etc. that can be assinged to a RES_AREA
RES_ROOM			= 29	// Non-complex region. (no extra tags)
RES_SCROLL			= 31	// SCROLL_GUEST=message scroll sent to player at guest login. SCROLL_MOTD, SCROLL_NEWBIE
RES_SKILL			= 34	// Define attributes for a skill (how fast it raises etc)
RES_SKILLCLASS		= 35	// Define specifics for a char with this skill class. (ex. skill caps)
RES_SKILLMENU		= 36	// A menu that is attached to a skill. special arguments over other menus.
RES_SPAWN			= 37	// Define a list of NPC's and how often they may spawn.
RES_SPEECH			= 38	// A speech block with ON=*blah* in it.
RES_SPELL			= 39	// Define a magic spell. (0-64 are reserved)
RES_TEMPLATE		= 45	// Define lists of items. (for filling loot etc)
RES_TIP				= 47	// Tips (similar to RES_SCROLL) that can come up at startup.
RES_TYPEDEF			= 48	// Define a trigger block for a RES_WORLDITEM m_type.
RES_WEBPAGE			= 51	// Define a web page template.
//--
RESTYPE_BIT_SHIFT	= 20
[SPAWN s_creatures_group_1]
CATEGORY=Spawn Groups
SUBSECTION=Level 1
DESCRIPTION=All Creatures
ID=c_headless
ID=c_orc
ID=c_harpy
ID=c_lizardman
[FUNCTION Test]
IF (  <RESOURCETYPE s_creatures_group_1> == RES_SPAWN )
RETURN 1
ENDIF
RETURN 0

The test result will always be 0 because, for RESOURCETYPE [SPAWN xxx], hval gives 026, and eval gives 38. As shown in the Defname table above, it gives 37 for res_spawn, so equality can never be achieved. Therefore, the value will always return 0.

Sphere Build: Master-Rev 3888

@xMirroRx
Copy link
Author

I can also say that the functions at https://wiki.spherecommunity.net/index.php?title=SPAWN do not work for X.

@DavideRei
Copy link
Contributor

Your defs.scp file is not updated

https://github.com/Sphereserver/Scripts-X/blob/main/core/defs.scp#L619C30-L620C1

@xMirroRx
Copy link
Author

xMirroRx commented Dec 20, 2024

I don't know exactly how I missed this update or whatever happened but thank you very much.
The issue of spawn functions not working on the wiki is still valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants