Long Range Spellcasting

Posted by Manakra on Thu 23 Jun 2005 04:17 AM — 4 posts, 19,005 views.

#0
I would like to include a feature in my mud, Long Ranged Spellcasting. Only IMM's would have this function, and it would work similiar to AT.
something like
Clr (Cast long range) person 'spell' spelltarget

Except, anyone in the room, including the victim, that it casts too, will not be able to see like "Kalise utters the words..." They will just feel the affect.

Anyone know how to do this?
USA #1
A fairly straightforward way of doing this would be talking the cast code, copying it, and removing the parts where it prints (e.g. when it calls the act function.) You'll still have the spell effect messages printed, but not the incantation.

A cleaner way of doing the above would be to take the cast code, bring it to a different function, add another parameter called e.g. 'silent'. If silent is set, do not make calls to act. In the normal cast code, call the function with silent set to false, and in the new cast code, call the function with silent set to true.
USA #2
Might want to add in an ifcheck to make sure the target is a player, otherwise you could end up casting it on mobiles, too. Preventive coding is always nice.
USA #3
Why would we not want to cast on mobiles as well? When selecting a target players should probably be considered first but I see no reason in particular why mobiles should be excluded. Unless, of course, that's part of Manakra's specifications...