Re: spec_pro question

From: Skylar (skylar@ifconfig.intserv.com)
Date: 07/07/96


On Sat, 6 Jul 1996, Mud Admin wrote:

> I am trying to write a cleric spec_pro so they cast in combat, I based it 
> on the magic_user spec_pro that I just rewrote. The magic_user spec_proc 
> works great, but clerics will not cast in combat.

Make sure the mob you assigned this special to has the MOB_SPEC flag set.
I tested yer code out on a stock pl11, assigned the special to puff, and
she casted a few spells.  The castings are rare because you make a random
check for spells, then if that is made, inside that it checks the level, and
sometimes for some other condition ... ie IS_EVIL or affected by and whatnot,
so a low or medium level mob will have a fairly small chance of rolling one
of yer spells, as well as one that they are allowed to cast, and one that
they need/should be casting... the frequency is just low, the special works.


BTW, why didnt you just use a switch() or nested switches by level if thats
important?  It'd be a lot easier to read :-) 

>         num_used = 8;
>         tmp = number(1, 10);
>  
>         if ((tmp == 4) || (tmp == 5)) {
>         tmp = number(1, num_used);
>  
>         if ((tmp == 1) && (GET_LEVEL(ch) > 13)) {
>          cast_spell(ch, vict, NULL, SPELL_EARTHQUAKE);
>          return TRUE;
>          }
>  
>         if ((tmp == 2) && ((GET_LEVEL(ch) > 8) && IS_EVIL(vict))) {
>          cast_spell(ch, vict, NULL, SPELL_DISPEL_EVIL);
>          return TRUE;
>          }




-Sky



This archive was generated by hypermail 2b30 : 12/07/00 PST