Posted Wednesday, August 12th @ 11:26:41 PM, by George Greer in the Skills dept.
Added Dec 4, 1996. Click the link below to read it or download it.
From: Todd Kegley <argon@shadow.csc.edu>
Subject: Dual Wield
There are just a couple of things you have to do, and none of them are
especially difficult. You need to declare the skill with all of the
others neat little declares, and then go into class.c and declare what
classes can use it. After that comes the only real work involved.
You'll need to get into fight.c, in the perform_violence routine. What
you should add should look something like this:
if (GET_SKILL(ch, DUAL_WIELD) && FIGHTING(ch))
{
struct obj_data *holding = GET_EQ(ch, WEAR_HOLD);
if (holding && GET_OBJ_TYPE == WEAPON)
{
percent = number(1, 101);
prob = GET_SKILL(ch, SKILL_DUAL_WIELD);
if percent > prob
{
holdhit (ch, FIGHTING(ch), TYPE_UNDEFINED);
if (MOB_FLAGGED(ch, MOB_SPEC) &&
mob_index[GET_MOB_RNUM(ch)].func != NULL)
(mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0 "");
}
}
}
I'm sure there's probably a minor problem in there somewhere, as I'm
writing from memory. The other thing you need to do is write holdhit.
The easy way to do this is get into fight.c and mimic the code for hit.
Unless things have been moved around lately it should be right before
perform_violence near the end of the file.
Hope this was of some help.
Argon
<< Drunk Language Code [by Haddixx] | Reply | View as text | Flattened | Eavesdrop Skill [by Siv] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|