Furniture, Fountains etc.,

Posted by Nystix on Tue 22 Oct 2002 09:51 PM — 4 posts, 19,392 views.

#0
How might I go about either adding something which prevents players from getting items? Also, how can I add affects to fountains. (Ex: A Marble fountain contains the level 10 spell 'heal') One last thing, on weapons - besides editing the hard code is there any way to make a weapon randomly cast a spell during battle? Thanks for any help.
USA #1
if you dont want a mortal picking up an item make sure there is no take flag in the wear location.. if there is a take there anyone can pick uit up if not only an imm can

im not to sure about adding affects to fountains.. you'd probly have to code another item type and in the do_drink function add it in there..

as for weapons casting spells.. thats built into the mud already. every time you weapon hits it casts a spell.. to add a spell to a weapon you have to slookup the spell so you know the spell number then oset weapon affect weaponspell <sn>

enojy
-typ
#2
Thanks for your help... I should have checked it as a non-immortal. I was aware of weaponspell, but I was wondering if there was a way to cause it to not cast each time it hits?
USA #3
typhons got most covered but u can add the affects to fountains with a use prog, since drinking from fountain is using it ;)
i.e.
use_prog 100
c heal $n
although im not sure if the objects level carries over for spells, probly not. Also you could make things little more complicated with things like after drinking it drops item(or mob) in a dummy room, and only able to get the spell if the object is in that current room and add a rand prog to occasionally purge the object.. you can manipulate progs a lot, but for random castings from weapon i would assume that would require minimum coding, here snippet i wrote just now for it

--in fight.c
--after
void show_condition args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );
--add
void randweap args( ( CHAR_DATA *ch, CHAR_DATA *victim ) );

void randweap( CHAR_DATA *ch, CHAR_DATA *victim )
{
ch_ret retcode;
SKILLTYPE *skill;
OBJ_DATA *obj;
int sn;

obj = get_eq_char( ch, WEAR_WIELD );
if ( obj != NULL )
{
if ( obj->value[4] != 0 )
{
sn = obj->value[5];
if ( number_range( 1, obj->value[4] ) == 1 )
{
retcode = spell_smaug( sn, ch->level, ch, victim );
if ( retcode != rNONE || char_died(ch) || char_died(victim) )
return retcode;
}
}
}

}
--after
trip(ch, victim);
--add
randweap (ch,victim);

sets so that of a weapon has a value for v4 it will have a 1 through v4 chance of casting spell with sn of v5 on target.. probly wont work, not tested or anything but it may give a idea on how to do it.
or somewhere in fight.c you can add the oprog_fight_trigger( obj ); to use the objects fight prog.. not sure if they are used anywhere else tho.. probly would be easier but im masocistic and stupid