/* The life insurance snippet coded by Shinji for Rom24 code base, located on Destinymud leguin.openprojects.net port 7000 it has been modied on Destiny a bit, but you can pretty much do anything you want to it :), just a little credit or an email if you use it please (tim_hoye@hotmail.com) Thank you, all the files are in here to edit, clean compile, and go with it :)*/ /* act_wiz.c */ void do_life_insurance(CHAR_DATA *ch, char *argument) { CHAR_DATA *victim; char buf[MAX_STRING_LENGTH]; char arg1[MAX_STRING_LENGTH]; char arg2[MAX_STRING_LENGTH]; argument = one_argument(argument, arg1); argument = one_argument(argument, arg2); if (IS_NPC(ch)) return; if ((arg1[0] =='\0') || (arg2[0]=='\0')) { send_to_char("Syntax : Life (char) (policy)\nPolicies are Equipment, Exp\n\r", ch); return; } victim = get_char_world(ch, arg1); if (victim == NULL) { send_to_char("That person is not currently logged on.\n\r", ch); return; } if (IS_NPC(victim)) { send_to_char("Not on NPC's\n\r", ch); return; } if (is_name(arg2, "equipment")) { if (victim->gold >= 300000) { victim->gold -= 300000; send_to_char("You are now unable to lose equipment in death.\n\r",victim); sprintf(buf, "You grant %s the life policy not to lose equipment in death.\n\r", victim->name); send_to_char(buf, ch); REMOVE_BIT(victim->pcdata->policy, LIFE_EXP); REMOVE_BIT(victim->pcdata->policy, LIFE_SPELLS); SET_BIT(victim->pcdata->policy, LIFE_EQUIPMENT); } else { sprintf(buf, "%s doesn't have enough gold for that policy.",victim->name); send_to_char(buf, ch); return; } } else if (is_name(arg2, "exp")) { if (victim->gold >= 200000) { victim->gold -= 200000; send_to_char("You are now unable to lose exp in death.\n\r",victim); sprintf(buf, "You grant %s the life policy to not lost exp in death.\n\r",victim->name); send_to_char(buf, ch); REMOVE_BIT(victim->pcdata->policy, LIFE_EQUIPMENT); SET_BIT(victim->pcdata->policy, LIFE_EXP); REMOVE_BIT(victim->pcdata->policy, LIFE_SPELLS); } else { sprintf(buf, "%s doesn't have enough gold for that policy.",victim->name); send_to_char(buf, ch); return; } } else if (is_name(arg2,"spells")) { if (victim->gold >= 300000) { victim->gold -= 300000; send_to_char("You now do not lose your spells in death.\n\r",victim); sprintf(buf, "You grant %s the life policy to not lose spells in death.\n\r",victim->name); send_to_char(buf, ch); REMOVE_BIT(victim->pcdata->policy, LIFE_EQUIPMENT); REMOVE_BIT(victim->pcdata->policy, LIFE_EXP); SET_BIT(victim->pcdata->policy, LIFE_SPELLS); } else { sprintf(buf, "%s doesn't have enough gold for that policy.",victim->name); send_to_char(buf, ch); return; } } } /* merch.h */ /* Life Insurance Policyes, Coded by Shinji */ #define LIFE_EQUIPMENT (A) #define LIFE_EXP (B) #define LIFE_SPELLS (C) extern const struct insurance_type insurance_table []; struct insurance_type { char * name; long flag; int level; }; /* const.c */ /* Stuff needed for the life insurance */ const struct insurance_type insurance_table [] = { { "equipment", LIFE_EQUIPMENT, 1 }, { "exp", LIFE_EXP, 1 }, { NULL, 0, 0 } }; /* fight.c */ /* after you die */ if (!IS_SET(victim->pcdata->policy,LIFE_EXP)) gain_exp( victim, (2 * (exp_per_level(victim,victim->pcdata->points) * victim->level - victim->exp)/3) + 50 ); /* make corpse function */ if (! IS_NPC(victim) &&! IS_SET(victim->pcdata->policy,LIFE_SPELLS) ) while ( victim->affected ) affect_remove( victim, victim->affected ); if (! IS_NPC(victim) && IS_SET(victim->pcdata->policy,LIFE_EQUIPMENT) ) spell_corpse_summon(skill_lookup("corpse summon"),victim->level, victim,(void *)victim,TARGET_CHAR); /* Compile and go */