I've come up with an idea that I think, in theory, could accomplish this simply with mob & object programs. I'd like to get some feedback on this approach.
General Outline
The familiar "vendor" would start the wizard on a quest, depending what type of familiar the wizard wants. The specifics of the ritual to find and befriend the familiar creature could vary by familiar. Upon completion of the quest, the vendor would give the wizard a "familiar bond", an object like a charm, pendant, etc. marked to the wizard that summons the familiar.
The familiar bond would have a particular keyword that would check if the user is its owner and if the user has no pets. If both checks pass, it summons an instance of the familiar and sets the user as the mob's master.
The familiar would intercept the "dismiss" keyword and vanish instead of simply being left unattended. It would also vanish in reaction to death (or perhaps combat in general). When it vanishes, it will remove/drop everything worn and/or carried, allowing wizards to give their familiars little things like a named collar (for example).
Some Considerations
Unlike the regular pet system, there's no way to name these familiars. It might be possible to create a mob that sells custom collars with names? I'm not positive if you can trigger a program to sell restrung objects with something like "buycollar Raki".
The "dismiss" intercept would only work if the familiar is in the same room. Currently you can dismiss pets from afar, and that would not cause the familiar to vanish.
A global qbit should probably be set to indicate that the wizard has purchased a familiar, preventing them from accumulating more. This could be reset by turning over the familiar bond in order to bond with a different familiar. Because there would be several different types of familiar bonds, the vendor should not check vnums; instead, the vendor could check for a particular code in the unused object values to indicate that the object is a familiar bond.
Here's some proposed code, based on the documentation in the builder lessons. Does this seem viable? Any other concerns I'm missing?
Code: Select all
#QQ11
tiny fluffy owl~
{80}A tiny fluffy owl~
{80}A tiny fluffy owl has found a perch here.~
{80}This owl is about the size of an orc's fist, with dark fluffy feathers
{80}and large liquid eyes that seem to see the world with unusual insight.~
S 5 CLASS_MONSTER RACE_OWL SEX_MALE POS_STANDING DEITY_NONE
ACT_PET
LANG_ANIMAL
LANG_ANIMAL
>intercept_prog dismiss~
if stringprefix($1) == tiny
or stringprefix($1) == fluffy
or stringprefix($1) == owl
mpechoat $n {60}You dismiss {80}a tiny, fluffy owl and it vanishes.
mpechoaround {60}$n dismisses {80}a tiny, fluffy owl and it vanishes.
mpquiet on
remove all
give all $n
drop all
mpquiet off
mppurge $i
else
mpunintercept
endif
~
>death_prog 100~
smote vanishes back to its home plane.
mpquiet on
remove all
give all $n
drop all
mpquiet off
mppurge $i
~
Code: Select all
#QQ04
scratched owl pendant~
{70}A scratched owl pendant~
{70}A scratched owl pendant lies on the ground here.~
~
ITEM_TYPE_TREASURE
FLAG_MAGIC|FLAG_RESIZE|FLAG_ANTI_ROGUE|FLAG_ANTI_WARRIOR|FLAG_ANTI_PRIEST|FLAG_TRANSPARENT
CAN_WEAR_NECK
QUALITY_AVERAGE MATERIAL_SILVER COND_VERY_GOOD SIZE_MEDIUM
0 0 0 0 LAYER_OVER 0
E
scratched owl pendant~
{70}A crude bit of silver has been worked into the rough shape of an owl
{70}and set with an owl talon. {30}It dangles from a thin cord of rough twine.
~I
This token encapsulates the magical bond between wizard and familiar. OOC: Use "summonowl"
~
>intercept_prog summonowl~
if ownsmark($n)
if haspet($n)
mpechoat $n You already have a pet.
else
mpmload QQ11
mpforce mQQ11 follow $n
mpforce mQQ11 mpmset self master $n
mpecho {80}A tiny, fluffy owl answers $n's call.
mpforce mQQ11 smote circles down to $n.
endif
else
mpechoat $n {80}The familiar does not recognize you as its master!
mpechoat $n {70}The pendant slips from you and falls to the ground.
mpechoaround $n The pendant slips from $n and falls to the ground.
mpforce $n remove $o
mpforce $n drop $o
endif
~