New Spells and Skills

Posted by Rok on Tue 16 Oct 2001 03:54 AM — 3 posts, 17,454 views.

#0
Cool... A new catagory. I feel so special! =)

Oh! anyway, I am going to be re-writing some of the skills and spells and adding new ones. I treid this before and I think I missed something. So my quesiton is where all do you need to put info to change a spell. This is where I know of:

commands.dat(However I'm not sure how that works but I'll address that later)
magic.c
skills.c
skills2.c
fight.c
mud.h
special.c
tables.c

That's all I could find. Is there anymore you can think of? Or do I even need all that? Uhh... Now I'm confusing myself.

In commands.dat You have:

#COMMAND
Name at~
Code do_at <---- What is the Code? Is it what you set?
Position 100 <---- Same with the position?
Level 52
Log 0
End

Any help would be much appritiated
Australia Forum Administrator #1
Quote:

In commands.dat You have:

#COMMAND
Name at~
Code do_at <---- What is the Code? Is it what you set?
Position 100 <---- Same with the position?
Level 52
Log 0
End


First, to answer this. The "code" is the name of the code handler that gets called. eg. if you type "at" it calls the function "do_at" in the C code.

Thus you could have multiple commands call the same code (eg. "say" and the quote symbol).

What you probably want if you want to add more skills/spells is to simply edit skills.dat. Here is an example entry:


#SKILL
Name Wrath of Dominus~
Type Spell
Info 0
Flags 33792
Target 2
Minpos 109
Slot 246
Mana 10
Code spell_smaug
Dammsg ~
Affect '10' 13 '-75' -1
Affect '10' 31 '-3' -1
Minlevel 51
End


A lot of spells are implemented with the code "spell_smaug" which handles things like multiple affects applying to a spell.

In this case this spell decreases hit (13) by 75 (-75) for a duration of 10. It also decreases luck (31) by 3 (-3) for a duration of 10.


USA #2
Also,


The Position is the minimum position your char has to be to execute the command. 100 being POS_DEAD, 101 POS_MORTAL, (Just look at Mud.h) for them. If you are in a position less then the one stated, the command wont work.

heres the code


/*
 * Positions.
 */
typedef enum
{
  POS_DEAD, POS_MORTAL, POS_INCAP, POS_STUNNED, POS_SLEEPING, POS_BERSERK,
  POS_RESTING, POS_AGGRESSIVE, POS_SITTING, POS_FIGHTING, POS_DEFENSIVE,
  POS_EVASIVE, POS_STANDING, POS_MOUNTED, POS_SHOVE, POS_DRAG
} positions;



Also, as Nick has already stated, the code is the void function thats called to execute the command. In the case of a spell, it pulls void spell_smaug. In the case of a skill or command, it just pulls the void function in either skills.c or act_move.c (or anywhere really).


-Kelsid