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
➜ spell affects
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Hatespyware
(10 posts) Bio
|
Date
| Fri 03 Jan 2003 03:35 PM (UTC) |
Message
| Hi, all
I'm interested in adding a sustain spell to the code. The spell should fill a person up, and prevent them from getting hungry or thirsty for its duration. Unfortunately, the mental-state stuff isn't quite clear to me yet.
The changes I have made so far are outlined below. It doesn't seem to be working. A hungry character, after being sustained, remains hungry (and possibly gets more hungry). The spell, when cast, shows up under aff but not aff by (unlike the sanctuary affect I modeled it after). Any help would be warmly appreciated.
Here is what I have done so far...
to Mud.h - added:
AFF_SUSTAIN
to the affected_by_types enum in mud.h
to char_update in update.c, inside the if ( !IS_NPC(ch) && ch->level < LEVEL_IMMORTAL ) condition:
if ( IS_AFFECTED(ch, AFF_SUSTAIN) )
{
if(ch->pcdata->condition[COND_THIRST] < 20)
{
gain_condition( ch, COND_THIRST, 20);
}
if(ch->pcdata->condition[COND_FULL] < 20)
{
gain_condition( ch, COND_FULL, 20);
}
}
and added to skills.dat:
#SKILL
Name sustain~
Type Spell
Info 0
Flags 0
Target 2
Minpos 112
Slot 36
Mana 15
Rounds 12
Code spell_smaug
Dammsg ~
Wearoff sustain wears off.~
Hitchar $N appears satiated.~
Hitvict You feel sustained.~
Hitroom $N appears satiated.~
Affect '(l*10)' 26 'sustain' 37
Minlevel 13
End
| Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #1 on Fri 03 Jan 2003 04:28 PM (UTC) |
Message
| Visit Kyndig.com and grab the quench/sate spell snipet. They do exactly what you're looking for and are extremely easy to port from their original ROM. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Hatespyware
(10 posts) Bio
|
Date
| Reply #2 on Fri 03 Jan 2003 04:55 PM (UTC) |
Message
| No... Those doesn't prevent the victom from getting hungry. | Top |
|
Posted by
| Hatespyware
(10 posts) Bio
|
Date
| Reply #3 on Fri 03 Jan 2003 05:41 PM (UTC) |
Message
| OK... more careful testing shows that the original code was in fact working, but the spell was taking some time to "kick in." So, my new question is, is there an simple way to have a function called upon casting while using the spell_smaug type? Or, how should I fill the player up at the time of casting? | Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #4 on Fri 03 Jan 2003 05:53 PM (UTC) |
Message
| Quench and sate take a diff approach to reach the same goal, magical elimination of hunger and thirst. They also do so without the delayed effect you are being plagued by. Perhaps looking at function rather than form and taking a closer look at the snipet might not be such a bad idea. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Hatespyware
(10 posts) Bio
|
Date
| Reply #5 on Fri 03 Jan 2003 06:56 PM (UTC) |
Message
| ummm... whatever, dude.
I ended up just putting a blurb in the successful_cast function of magic.c, which does a one-shot fill-up. That, in addition to the code in update.c, meets my requirements. I hate to put the kludge in magic.c, though. Seems like it defeats the purpose of the spell_smaug construct. I sure wish the engine had better documentation.
| Top |
|
Posted by
| Kris
USA (198 posts) Bio
|
Date
| Reply #6 on Sat 04 Jan 2003 09:14 AM (UTC) |
Message
| Heh the stock SMAUG skills/spells system made me decide to write a better one; highly customizeable, with no need to manually edit the source code. At the rate that's going, it should be done within the next several years or so hehe :)
| Top |
|
Posted by
| Mesonil
(3 posts) Bio
|
Date
| Reply #7 on Thu 10 Jul 2003 12:27 PM (UTC) |
Message
| Hey Hatespyware,
I am also working on a new spell that uses a aff_by flag, and I was wondering how did you add it to the affect list? I'm using cygwin to compile a mud. and When I added my spell to the end of the list and recomiled it I got nothing.
Actually I logged to the mud and setup the spell on line and when I placed the affected name on it said unknown bitvector.
Sorry for posting twice about the same thing but I thought I might have been clear of what was happening.
as you can tell I'm a newbie coder.
thanks in advance.
| Top |
|
Posted by
| Hatespyware
(10 posts) Bio
|
Date
| Reply #8 on Sat 01 Nov 2003 11:46 AM (UTC) |
Message
| Sorry for taking so long to reply, Mesonil. I haven't been following this forum regularly. This probably pretty closely mimics the info. in the supplied documentation, but according to my notes, I think I did something like this:
sustain spell:
Mud.h:
added:
to the affected_by_types enum in mud.h
added:
if ( IS_AFFECTED(ch, AFF_SUSTAIN) )
{
if(ch->pcdata->condition[COND_THIRST] < 20)
{
gain_condition( ch, COND_THIRST, 20);
}
if(ch->pcdata->condition[COND_FULL] < 20)
{
gain_condition( ch, COND_FULL, 20);
}
}
to char_update in update.c, inside the if ( !IS_NPC(ch) && ch->level < LEVEL_IMMORTAL ) condition
added:
if(!strcmp("sustain", skill->name))
{
victim->pcdata->condition[COND_THIRST] = 40;
victim->pcdata->condition[COND_FULL] = 40;
}
to magic.c anywhere in successful_casting()
added:
#SKILL
Name sustain~
Type Spell
Info 0
Flags 0
Target 2
Minpos 112
Slot 36
Mana 15
Rounds 12
Code spell_smaug
Dammsg ~
Wearoff You feel your digestive processes return to normal.~
Hitchar $N appears satiated.~
Hitvict You feel as though you will not need to eat or drink for quite some time.~
Hitroom $N appears satiated.~
Affect '(l*10)' 26 'sustain' 37
Minlevel 13
End
to skills.dat
Hope this helps.
| 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.
25,843 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top