Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Potions

Potions

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


Posted by Kalados   (17 posts)  Bio
Date Tue 17 Nov 2009 05:14 PM (UTC)
Message
Trying to make Potions, and according to the help files and Herne's guide

the values, v0 is spell level, v1 is sn1, v2 sn2, and v3 is sn3

What do these mean?

What would be the proper syntax for creating a potion that heals 20 hp or mana?

and yes I've set the item type to potion.

Thanks :)
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 17 Nov 2009 05:44 PM (UTC)
Message
If I remember correctly -- it's been a while -- potions "cast spells" when you drink them. So, you can set skill/spell numbers in the sn1, sn2 and sn3 slots, and set the level at which the spell is being cast (as if it were being cast by a character) using v0.

So if you want to heal 20 hp, find a spell that heals about that much as use its number as sn1.

But again, it's been quite a while since I've used these, so take the above with a grain of salt...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Hanaisse   Canada  (114 posts)  Bio
Date Reply #2 on Tue 17 Nov 2009 10:21 PM (UTC)
Message
SN = spell number

You can use slookup <spellname> to find out what it's sn is, then;

oset (your potion name) value0 <min level to use>
oset (your potion name) value1 59 -- (this is sn of cure critical or you could use cure light, cure serious, whatever suits your needs)
oset (your potion name) value2 203 -- (this is sn of restore mana)

You don't need to use value3 unless you want to put a third spell on it.

aka: Hana
Owner in Training of: Fury of the Gods
alm-dev.org:4000
Top

Posted by Kalados   (17 posts)  Bio
Date Reply #3 on Wed 18 Nov 2009 01:43 PM (UTC)
Message
What would I set the potion to so a shopkeeper would sell an unlimited number of it?
Top

Posted by Hanaisse   Canada  (114 posts)  Bio
Date Reply #4 on Wed 18 Nov 2009 04:43 PM (UTC)
Message
oset potion flags inventory

aka: Hana
Owner in Training of: Fury of the Gods
alm-dev.org:4000
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Wed 18 Nov 2009 05:12 PM (UTC)
Message
Don't forget you can also create use progs on items, which is more flexible as opposed to obj spells.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Kalados   (17 posts)  Bio
Date Reply #6 on Thu 19 Nov 2009 10:51 AM (UTC)
Message
So for the object prog it would be

opedit potion add use, got that

But what would be the program syntax for setting the hp/mana restore values and action on use?
Top

Posted by Hanaisse   Canada  (114 posts)  Bio
Date Reply #7 on Thu 19 Nov 2009 01:51 PM (UTC)
Message
Yeah, you could use a use program. I don't see the benefit of one over the other though but it does allow you to get fancy with the use message.

opedit potion add use 100 (requires the % of the time it will trigger)
mpechoat $n You feel instant relief as you quaff a violet potion <--- overrides standard use messages
mprestore $n 20 <--- amount to restore

I suppose it works for a simple heal potion but won't work for potions with other spells (there's no mpcast command).

aka: Hana
Owner in Training of: Fury of the Gods
alm-dev.org:4000
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #8 on Thu 19 Nov 2009 02:03 PM (UTC)
Message
Programs are more flexible than standard SMAUG spells, but then again a spell can always be implemented in C as well. Using programs would prevent putting a lot of "potion spells" in the spell list, if you don't like the clutter. Personally I prefer avoiding the clutter; the potion effect is usually quite specific to the potion it's on.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


26,409 views.

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

Go to topic:           Search the forum


[Go to top] top

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