/* this has both code for normal donate and clan donate * i may just combine then so that if you are in a clan * and donate and the clan has a donation pit, you donate * to your clan. otherwise its put the donation pit. */ /* do the nessecary changes to interp.c and interp.h, * add this function to wherever and compile. */ /* additional changes are. change your clan table to include * the room where the donation pit is in the clan hall, if there * isnt one just put a 0 where the vnum for the room would go. * if you need a better explantion, email me and ill be glad * to explain. chancedj@peaknet.net */ void do_donate( CHAR_DATA *ch, char *argument) { OBJ_DATA *pit; OBJ_DATA *obj; ROOM_INDEX_DATA *original, *pitroom; char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; int amount; argument = one_argument(argument, arg); if (arg[0] == '\0' ) { send_to_char("Donate what?\n\r",ch); return; } if (ch->position == POS_FIGHTING) { send_to_char(" You're {Yfighting!{x\n\r",ch); return; } /* gotta be in your inventory */ if ( (obj = get_obj_carry (ch, arg, ch)) == NULL) { send_to_char("You do not have that!\n\r",ch); return; } if (!can_drop_obj(ch, obj) && ch->level < LEVEL_IMMORTAL) { send_to_char("Its stuck to you.\n\r",ch); return; } /* no donating corpses */ if ((obj->item_type == ITEM_CORPSE_NPC) || (obj->item_type == ITEM_CORPSE_PC)) { send_to_char("You cannot donate that!\n\r",ch); return; } /* anything with ROT_DEATH is not worth the effort */ if (obj->timer > 0) { send_to_char("You cannot donate that.\n\r",ch); return; } /* make sure the room is there */ if ((pitroom = get_room_index(ROOM_VNUM_ALTAR)) == NULL) { send_to_char("No Pit Room, report to immortal.\n\r", ch ); return; } /* kinda dumb to donte in to your pit WHEN your in the same room! */ if (ch->in_room == pitroom) { send_to_char("Just put it in there!\n\r", ch ); return; } original = ch->in_room; char_from_room(ch); char_to_room(ch,pitroom); if ((pit = get_obj_list(ch, "pit", ch->in_room->contents)) == NULL) { send_to_char("Sorry, the pit isnt available, inform an imm immediately.\n\r", ch ); char_from_room(ch); char_to_room(ch,original); return; } obj_from_char(obj); obj_to_obj(obj, pit); char_from_room(ch); char_to_room(ch,original); act("$n donates {Y$p{x.",ch,obj,NULL,TO_ROOM); act("You donate {Y$p{x.",ch,obj,NULL,TO_CHAR); if ((!IS_OBJ_STAT(obj ,ITEM_ANTI_EVIL) && IS_EVIL(ch)) || (!IS_OBJ_STAT(obj ,ITEM_ANTI_GOOD) && IS_GOOD(ch)) || IS_NEUTRAL(ch)) if (obj->cost > 0 && obj->level > 0) { amount = UMAX(1, obj->cost/2); sprintf( buf, "You receive {M%d silver{x for your donation.\n\r",amount); send_to_char(buf,ch); ch->silver += amount; } save_char_obj(ch); return; } void do_cdonate( CHAR_DATA *ch, char *argument) { OBJ_DATA *pit; OBJ_DATA *obj; ROOM_INDEX_DATA *original, *pitroom; char arg[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; int amount, clanroom; argument = one_argument(argument, arg); if (arg[0] == '\0' ) { send_to_char("Donate what?\n\r",ch); return; } if (ch->position == POS_FIGHTING) { send_to_char(" You're {Yfighting!{x\n\r",ch); return; } /* gotta be in your inventory */ if ( (obj = get_obj_carry (ch, arg, ch)) == NULL) { send_to_char("You do not have that!\n\r",ch); return; } if (!can_drop_obj(ch, obj) && ch->level < LEVEL_IMMORTAL) { send_to_char("Its stuck to you.\n\r",ch); return; } /* no donating corpses */ if ((obj->item_type == ITEM_CORPSE_NPC) || (obj->item_type == ITEM_CORPSE_PC)) { send_to_char("You cannot donate that!\n\r",ch); return; } /* anything with ROT_DEATH is not worth the effort */ if (obj->timer > 0) { send_to_char("You cannot donate that.\n\r",ch); return; } /* check the clan stuff */ if (!(clanroom = clan_table[ch->clan].donation || !is_clan(ch)) { send_to_char("Nope, can't do it.\n\r", ch ); return; } /* make sure the room is there */ if ((pitroom = get_room_index(ROOM_VNUM_ALTAR)) == NULL) { send_to_char("No Pit Room, report to immortal.\n\r", ch ); return; } /* kinda dumb to donte in to your pit WHEN your in the same room! */ if (ch->in_room == pitroom) { send_to_char("Just put it in there!\n\r", ch ); return; } original = ch->in_room; char_from_room(ch); char_to_room(ch,pitroom); /* make sure the pit is there, just incase */ if ((pit = get_obj_list(ch, "pit", ch->in_room->contents)) == NULL) { send_to_char("Sorry, the pit isnt available, inform an imm immediately.\n\r", ch ); char_from_room(ch); char_to_room(ch,original); return; } /* DONATE! */ obj_from_char(obj); obj_to_obj(obj, pit); char_from_room(ch); char_to_room(ch,original); act("$n donates {Y$p{x.",ch,obj,NULL,TO_ROOM); act("You donate {Y$p{x.",ch,obj,NULL,TO_CHAR); if ((!IS_OBJ_STAT(obj ,ITEM_ANTI_EVIL) && IS_EVIL(ch)) || (!IS_OBJ_STAT(obj ,ITEM_ANTI_GOOD) && IS_GOOD(ch)) || IS_NEUTRAL(ch)) if (obj->cost > 0 && obj->level > 0) { amount = UMAX(1, obj->cost/2); sprintf( buf, "You receive {M%d silver{x for your donation.\n\r",amount); send_to_char(buf,ch); ch->silver += amount; } save_char_obj(ch); return; }