A little better of a question (Familiar spell)

Posted by Halomantis on Mon 26 May 2003 05:00 AM — 6 posts, 20,199 views.

#0
I was following some instructions on how to set up a familiar spell. The directions are straight foward enough except for one part. Step 5 has me a little confused. If you want the whole code goto http://www.kyndig.com/codes/diku/merc/smaug/snippets/more9.html.

Install:

Step 1:
Include this file (familiar.c) in your make file or project

Step 2:
Add to tables.c around line 793:
if ( spell == spell_familiar ) return "spell_familiar"; // familiar

Step 3:
Add to tables.c around line 101, under case 'f':
if ( !str_cmp( name, "spell_familiar" )) return spell_familiar; // familiar

Step 4:
Add to mud.h around line 3896:
DECLARE_SPELL_FUN( spell_familiar ); // familiar

Add to mud.h around line 1409:
#define MOB_VNUM_FAMILIAR 6 // familiar snippet
The above line should be changed to a generic mob that you need to
create in one of your areas (preferably limbo.are).

Step 5:
Add summon familiar to your skills.dat and .class files as appropriate.
(Suggested: code: spell_familiar, mana: 40, beats: 14)


And please don't burn me I tried to word this the best I could and have included as much info as I have been asked.
#1
I might have figured it out. We shall see. I just did a whole slew of sset commands.

sset familiar code; typespell; acttype; powertype; flag; value; target; min pos; beats; mana
#2
Ok everything works fine but how can I make it so the code check your class changing what creatures are casted. Like having stuff like bears and such answer a druid or demons and such answering a vampire and such.
USA #3
I'm not sure exactly what the syntax is, but a check like this or something similar would probably do:

if (summon->demon && ch->class->vampire )
{
Summon code for the demon...
}
if (summon->bear && ch->class->druid )
{
Summon code for bear...
}

If that doesn't help in any shape or form (note I haven't spent much time coding smaug, I'm an SWR person all the way) then just post and say so. I'll download the snippet and give you some code that you can stick right into your .c files.
#4
Hey that is perfect.. I could not figure out what kind of check to use. Thanks!
USA #5
So it worked alright? I read through the posts again and it looks like I did it backwords in a way, but hey, if it works for you then all is good.

Happy Coding.