[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  New Spells and Skills

New Spells and Skills

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Rok   (41 posts)  [Biography] 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~)
[Go to top] top

Posted by Nick Gammon   Australia  (23,001 posts)  [Biography] 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
[Go to top] top

Posted by Kelsid   USA  (35 posts)  [Biography] 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
[Go to top] 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.


12,350 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]