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 :)
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...
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.
What would I set the potion to so a shopkeeper would sell an unlimited number of it?
oset potion flags inventory
Don't forget you can also create use progs on items, which is more flexible as opposed to obj spells.
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?
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).
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.