Login
User Name:

Password:



Register

Forgot your password?
IPv6
Jan 25, 2025 10:45 pm
By Samson
mudstrlcpy and mudstrlcat
Jan 18, 2025 5:23 pm
By Samson
I3 and IMC
Jan 17, 2025 9:35 pm
By Samson
AFKMud 2.5.1
Jan 17, 2025 2:22 pm
By Samson
Array out of bounds ?
Jan 16, 2025 4:48 am
By Remcon
SmaugFUSS 1.9.7
Author: Various
Submitted by: Samson
AFKMud 2.5.1
Author: AFKMud Team
Submitted by: Samson
Kayle's Weather Code for AFKMud
Author: Kayle
Submitted by: Samson
AFKMud 2.5.0
Author: AFKMud Team
Submitted by: Samson
SWFotEFUSS 1.5.2
Author: Various
Submitted by: Samson
Users Online
Anthropic, GPTBot, AhrefsBot, Bytespider, Bing

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
503
3,811
19,714
589
xhuul

» SmaugMuds » Codebases » AFKMud Support & Development » How do I add a new coded spel...
Forum Rules | Mark all | Recent Posts

How do I add a new coded spell?
< Newer Topic :: Older Topic > Mini-guide

Pages:<< prev 1 next >>
Post is unread #1 Jan 7, 2004 1:00 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,706
JoinedJan 1, 2002

 
This is a guide for how to create a new coded spell in AFKMud.

Coded spells ( those not simply created using sset ) usually require the following steps in Smaug:

1. The code for the spell itself.
2. A DECLARE_SPELL_FUN statement in mud.h.
3. 2 entries to the spell tables in tables.c.

AFKMud does not require steps 2 and 3, but step one must be handled differently. For a coded spell to work, it must be of type SPELLF.

Smaug example:

ch_ret some_magic( int sn, int level, CHAR_DATA *ch, void *vo )

AFKMud example:

SPELLF some_magic( int sn, int level, CHAR_DATA *ch, void *vo )

The main difference is in the use of the SPELLF macro. This was necessary in order to get g++ to accept the use of the dlsym code while also retaining compatibility with plain gcc for those who prefer that. The details aren't terribly important to know.

Converting spell snippets from Smaug to AFKMud will need to keep these changes in mind for those spells to work.

Pages:<< prev 1 next >>