Recently created this spell:
code:
#include <lib.h>
#include <magic.h>
#include <damage_types.h>
#include <magic_protection.h>
inherit LIB_SPELL;
static void create()
{
spell::create();
SetSpell("pblast");
SetRules("","LIV");
SetSpellType(SPELL_COMBAT);
SetRequiredMagic(10);
SetSkills(([ "conjuring" : 8, "magic attack" : 10 ]));
SetMagicCost(30, 0);
SetStaminaCost(20, 16);
SetDifficulty(0);
SetHelp("Syntax: <cast pblast>\n\n"
" ");
}
int eventCast(object who, int level, mixed limbs, object array targets)
{
object target;
target = targets[0];
send_messages("", "%^BOLD%^WHITE%^A ray of white light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,MAGIC,(10 *5),0);
send_messages("", "%^BOLD%^GREEN%^A ray of green light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,ACID,(10 *5),0);
send_messages("", "%^BOLD%^BLUE%^A ray of blue light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,GAS,(10 *5),0);
send_messages("", "%^BOLD%^MAGENTA%^A ray of purple light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,DISEASE,(10 *5),0);
send_messages("", "%^ORANGE%^A ray of orange light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,PSIONIC,(10 *5),0);
send_messages("", "%^BOLD%^YELLOW%^A ray of yellow light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,ANOXIA,(10 *5),0);
send_messages("", "%^BOLD%^RED%^A ray of red light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,SONIC,(10 *5),0);
send_messages("", "%^BOLD%^BLACK%^A ray of DEATH leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",
get_livings(environment(this_player())), target);
target->eventReceiveDamage(target,DEATHRAY,(10 *5),0);
return 1;
}
And it produces:
A ray of white light leaps from your hands and strikes Mage!You lash out at Mage's body, but miss it completely.
HP { 791/800 } SP { 402/550} EP { 373/550 }
When I change the code to :
code:
#include <lib.h>
#include <magic.h>
#include <damage_types.h>
#include <magic_protection.h>
inherit LIB_SPELL;
static void create()
{
spell::create();
SetSpell("pblast");
SetRules("","LIV");
SetSpellType(SPELL_COMBAT);
SetRequiredMagic(10);
SetSkills(([ "conjuring" : 8, "magic attack" : 10 ]));
SetMagicCost(30, 0);
SetStaminaCost(20, 16);
SetDifficulty(0);
SetHelp("Syntax: <cast pblast>\n\n"
" ");
}
int eventCast(object who, int level, mixed limbs, object array targets)
{
object target;
target = targets[0];
send_messages("", "%^BOLD%^WHITE%^A ray of white light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^",who, target);
target->eventReceiveDamage(target,MAGIC,(10 *5),0);
send_messages("", "%^BOLD%^GREEN%^A ray of green light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,ACID,(10 *5),0);
send_messages("", "%^BOLD%^BLUE%^A ray of blue light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,GAS,(10 *5),0);
send_messages("", "%^BOLD%^MAGENTA%^A ray of purple light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,DISEASE,(10 *5),0);
send_messages("", "%^ORANGE%^A ray of orange light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,PSIONIC,(10 *5),0);
send_messages("", "%^BOLD%^YELLOW%^A ray of yellow light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,ANOXIA,(10 *5),0);
send_messages("", "%^BOLD%^RED%^A ray of red light leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,SONIC,(10 *5),0);
send_messages("", "%^BOLD%^BLACK%^A ray of DEATH leaps from $agent_possessive_noun hands and strikes $target_name!%^RESET%^", who, target);
target->eventReceiveDamage(target,DEATHRAY,(10 *5),0);
return 1;
}
It produces this:
A ray of white light leaps from your hands and strikes Mage!
A ray of green light leaps from your hands and strikes Mage!
A ray of blue light leaps from your hands and strikes Mage!
A ray of purple light leaps from your hands and strikes Mage!
A ray of orange light leaps from your hands and strikes Mage!
A ray of yellow light leaps from your hands and strikes Mage!
A ray of red light leaps from your hands and strikes Mage!
A ray of DEATH leaps from your hands and strikes Mage!
BUT no one else in the room can see the spell hitting the target. Could someone point me to the right syntax, or maybe a better way of doing this?