Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ New Spells and Skills
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Rok
(41 posts) Bio
|
Date
| Tue 16 Oct 2001 03:54 AM (UTC) |
Message
| 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
|
The always thankful
~ROK~
(~Hey you~) | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Tue 16 Oct 2001 06:39 AM (UTC) |
Message
|
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.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Kelsid
USA (35 posts) Bio
|
Date
| Reply #2 on Tue 16 Oct 2001 03:02 PM (UTC) |
Message
| 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
|
-Kelsid | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,636 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top