LF(StealCode)-v2.1 by Kracus I wanted to code a steal that would fit for the mud I code, so I decided to just put this steal code as a download for anyone who wanted to use it. You will need to change the checks for classes bonuses, as well as the level checks for eq levels and playerstealplayer levels, since LF is a 250 level mud. I also left open room for npcpc mobs aka mobs that save and levelup, in case they need to steal as my code allows. I seperated the checks for pc and npc because mobprogs can use this steal code if you wanted them to steal, while limiting them in ways that you did not limit pc-stealing. Anyhow, it is a nice code to modify or get ideas from, even though I did not use case switches or even call different functions from steal like ie. mobsteal(ch, victim); or maybe doing something like a steal_playerlist and stealmoblist with DATA STEAL so it would remember who you stole from and then you have less of a chance to try to steal if you failed the first time on that specified mob. :) Thanks to the people below for the making muds possible! :) Based on ROM Version 2.4 beta (c)1993-96 Russ Taylor Based on Merc 2.1 code by Hatchet, Furey, and Kahn Original DikiMud by: Hans Staerfeldt, Katja Nyboe, Tom Madsen, Micheal Seifert, Sebastian Hammer // LF(StealCode)-v.2.1 for LF by Kracus 2002 // If you want steal based on ITEM_TYPES you need to recode // the order of the else statements and make sure you do not // ... // 8 percent bonus stealing keys // if (obj->item_type == ITEM_KEY) // stealbonus += 8; // ... // before the checks to determine if worn or inven EQ is NULL // This Version 2.1 of steal allows the Stealer to use the syntax // ... // Syntax: steal <"coin" "coins" "eqname"> // ... // This Code auto determines the gold and silver on a victim, // taking into account the gold to silver ratio. After determining // which of the currencies(gold/silver) is greater it then // tries to steal that currency...(code for currency same for NPCsteal) // ... // With EQ it allows a PC to steal INV and WORN eq from an NPCvictim // With EQ it allows a PC to steal INV eq from a PCvictim // With EQ it allows a NPC using mobprogs with command steal // ..to steal INV eq from a PCvictim // With EQ it allows a NPC using mobprogs with command steal // ..to steal INV and WORN eq from a NPCvictim // Code left open for additional code for SAVEDMOBS that level void do_steal( CHAR_DATA *ch, char *argument ) { char buf [MAX_STRING_LENGTH]; char arg1 [MAX_INPUT_LENGTH]; char arg2 [MAX_INPUT_LENGTH]; CHAR_DATA *victim; OBJ_DATA *obj; int percent, stealbonus, skill; argument = one_argument(argument, arg1); argument = one_argument(argument, arg2); if(!IS_NPC(ch)) { if((skill = get_skill(ch,gsn_steal)) < 1) { send_to_char("You do not have the skill to steal items.\n\r",ch); return; } if(arg1[0] == '\0' || arg2[0] == '\0') { send_to_char("Steal what from whom?\n\r", ch); return; } if((victim = get_char_room( ch, arg2)) == NULL) { send_to_char("They aren't here.\n\r", ch); return; } if (victim->fighting != NULL) return; // Kracus- no stealing in battle if(IS_SET(ch->act, PLR_BATTLE)) { send_to_char("You cannot steal while in a battle.\n\r", ch); return; } // Kracus- no stealing from Admin if(IS_IMMORTAL(victim)) { send_to_char("Your pathetic attempt to steal fails miserably.\n\r", ch); return; } if(IS_NPC(victim) && victim->pIndexData->pShop != NULL) { send_to_char("You should not attempt to steal from shopkeepers.\n\r", ch); return; } if(IS_SET(victim->act, ACT_IS_HEALER)) { send_to_char("You should not attempt to steal from a healer.\n\r", ch); return; } if(IS_SET(victim->act, ACT_BANKER)) { send_to_char("You should not attempt to steal from a banker.\n\r", ch); return; } if(victim == ch) { send_to_char("You can't steal from yourself...\n\r", ch); return; } if(is_safe(ch,victim)) { send_to_char("Your attempt to steal fails miserably.\n\r", ch); return; } if(IS_NPC(victim) && victim->position == POS_FIGHTING) { send_to_char("Kill stealing is not permitted.\n\r",ch); return; } if(!IS_NPC(victim) && (!IS_NPC(ch) && !is_clan(ch))) { send_to_char("You can only steal from another person if you are clanned...\n\r", ch); return; } if(!IS_NPC(victim) && !is_clan(victim)) { send_to_char("You cannot steal from an unclanned person...\n\r", ch); return; } WAIT_STATE(ch, skill_table[gsn_steal].beats); percent = number_percent(); } else { if((skill = get_skill(ch,gsn_steal)) < 1) { send_to_char("You do not have the skill to steal items.\n\r",ch); return; } if(arg1[0] == '\0' || arg2[0] == '\0') { send_to_char("Steal what from whom?\n\r", ch); return; } if((victim = get_char_room( ch, arg2)) == NULL) { send_to_char("They aren't here.\n\r", ch); return; } if (victim->fighting != NULL) return; if(IS_IMMORTAL(victim) || IS_SET(victim->act, ACT_IS_HEALER) || IS_SET(victim->act, ACT_BANKER) || (IS_NPC(victim) && victim->pIndexData->pShop != NULL)) { send_to_char("Your attempt to steal fails.\n\r", ch); return; } if(victim == ch) { send_to_char("You can't steal from yourself...\n\r", ch); return; } if(is_safe(ch,victim)) { send_to_char("Your attempt to steal fails miserably.\n\r", ch); return; } // if(IS_NPC(victim) && victim->position == POS_FIGHTING) { // return; // } percent = number_percent(); } // PC stealing from Mob if(!IS_NPC(ch) && IS_NPC(victim)) { if(!str_cmp(arg1, "coin") || !str_cmp(arg1, "coins")) { if(victim->gold <= 0 && victim->silver <= 0) { send_to_char( "Your victim does not have that item...\n\r", ch); return; } } else { if((obj = get_obj_carry(victim, arg1, ch)) == NULL) if((obj = get_obj_wear(victim, arg1)) == NULL) { send_to_char( "Your victim does not have that item...\n\r", ch); return; } } } else // PC stealing from PC or Mob stealing from PC { if(!str_cmp(arg1, "coin") || !str_cmp(arg1, "coins")) { if(victim->gold <= 0 && victim->silver <= 0) { send_to_char( "Your victim does not have that item...\n\r", ch); return; } } else { if((obj = get_obj_carry(victim, arg1, ch)) == NULL) { send_to_char("Your victim is not carrying that item...\n\r", ch); return; } } } // 5 percent bonus full stats + automatic 5%bonus stealbonus = ((get_curr_modstat(ch,STAT_LUC) + get_curr_modstat(ch,STAT_DEX))/10) + 5; // 2 percent bonus victim sleeping if (!IS_AWAKE(victim)) stealbonus += 2; // 2 percent bonus victim cannot see shd if (!can_see(victim,ch)) stealbonus += 2; // PC Class bonuses and penalties if(!IS_NPC(ch) && !IS_NPC(victim)) { if(victim->class == 0) // Illum stealbonus += 5; else if(victim->class == 1) // Cleric stealbonus += 10; else if(victim->class == 2) // Shd stealbonus -= 10; else if(victim->class == 4) // Aes stealbonus += 5; else stealbonus += 0; // Default Class bonus if wanted } // Kracus- PC stealing from PC LEVEL STEAL FAIL CHECKS // Steal level ranges failure messages // NO stealing from players less the LEVEL 21 // 12 LEVEL Range for stealing if ch/victim are not both 100level+ // 50 LEVEL Range for stealing if ch/victim 100level+ // Also stealing strips the gsn_sneak // If is victim is awake fill the buf with message and do_yell // If is victim is sleeping wake victim and no buf message if((!IS_NPC(victim) && !IS_NPC(ch)) && ((ch->level < 21) || (victim->level < 21) || (((ch->level >= 100) && (victim->level >= 100)) && ((ch->level > victim->level + 50) || (ch->level < victim->level - 50))) || (((ch->level >= 100) && (victim->level < 100)) && ((ch->level > victim->level + 12) || (ch->level < victim->level - 12))) || (((ch->level < 100) && (victim->level >= 100)) && ((ch->level > victim->level + 12) || (ch->level < victim->level - 12))) || (((ch->level < 100) && (victim->level < 100)) && ((ch->level > victim->level + 12) || (ch->level < victim->level - 12))))) { send_to_char( "You are experience is not suitable to steal from that victim.\n\r", ch ); affect_strip(ch,gsn_sneak); REMOVE_BIT(ch->affected_by,AFF_SNEAK); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); switch(number_range(0,3)) { case 0 : sprintf( buf, "%s is a flaming thief!", ch->name ); break; case 1 : sprintf( buf, "%s couldn't steal %s own flaming eq!", ch->name,(ch->sex == 2) ? "her" : "his"); break; case 2 : sprintf( buf,"%s tried to steal from me!",ch->name ); break; case 3 : sprintf(buf,"Don't even try to steal from me, %s!",ch->name); break; } if (!IS_AWAKE(victim)) do_function(victim, &do_wake, ""); if (IS_AWAKE(victim)) do_function( victim, &do_yell, buf ); return; } // Kracus- PC Stealer // If FAILURE...stealing strips the gsn_sneak // If is victim is awake fill the buf with message and do_yell // If is victim is sleeping wake victim and no buf message // FAILURE PUTS the PC Stealer into a fight with victim multi_hit // ...and if victim is a PC the PC Stealer has chance of being // ...flagged a THIEF and then put into a fight via multi_hit if(!IS_NPC(ch)) { if(!str_cmp( arg1, "coin") || !str_cmp( arg1, "coins")) // Steal coins now { if(percent < ((get_skill(ch,gsn_steal) / 2) + stealbonus)) { // Success for stealing COINS int gold_conversion; int silver_compare; int base_silver; int gold; int silver; base_silver = victim->silver; gold_conversion = victim->gold; silver_compare = base_silver/100; if(IS_NPC(victim)) { gold = (victim->gold * 50)/100; // NPC 50% silver = (victim->silver *50)/100; // NPC 50% } else { gold = (victim->gold * 10)/100; // PC 10% silver = (victim->silver * 10)/100; // PC 10% } if(victim->gold > 0 && victim->silver > 0) { if(gold_conversion >= silver_compare) { ch->gold += gold; victim->gold -= gold; sprintf(buf,"\n\rYou successfully steal {Y%d gold{x coins.\n\r", gold); send_to_char(buf, ch); check_improve(ch,gsn_steal,TRUE,2); return; } else { ch->silver += silver; victim->silver -= silver; sprintf(buf,"\n\rYou successfully steal {W%d silver{x coins.\n\r", silver); send_to_char(buf, ch); check_improve(ch,gsn_steal,TRUE,2); return; } } else if(victim->gold > 0 && victim->silver <= 0) { ch->gold += gold; victim->gold -= gold; sprintf(buf,"\n\rYou successfully steal {Y%d gold{x coins.\n\r", gold); send_to_char(buf, ch); check_improve(ch,gsn_steal,TRUE,2); return; } else if(victim->silver > 0 && victim->gold <= 0) { ch->silver += silver; victim->silver -= silver; sprintf(buf,"\n\rYou successfully steal {W%d silver{x coins.\n\r", silver); send_to_char(buf, ch); check_improve(ch,gsn_steal,TRUE,2); return; } else { send_to_char("Your victim has no coins to steal!\n\r", ch); return; } } else // Failure to steal COINS { send_to_char( "Your attempt to steal was unsuccessful.\n\r", ch ); affect_strip(ch,gsn_sneak); REMOVE_BIT(ch->affected_by,AFF_SNEAK); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); switch(number_range(0,3)) { case 0 : sprintf( buf, "%s is a flaming thief!", ch->name ); break; case 1 : sprintf( buf, "%s couldn't steal %s own flaming eq!", ch->name,(ch->sex == 2) ? "her" : "his"); break; case 2 : sprintf( buf,"%s tried to steal from me!",ch->name ); break; case 3 : sprintf(buf,"Don't even try to steal from me, %s!",ch->name); break; } if(!IS_AWAKE(victim)) do_function(victim, &do_wake, ""); if(IS_AWAKE(victim)) do_function( victim, &do_yell, buf); // NPC victim if(IS_NPC(victim)) { check_improve(ch,gsn_steal,FALSE,2); multi_hit( victim, ch, TYPE_UNDEFINED ); } else // PC victim { sprintf(buf,"$N tried to steal from %s.",victim->name); wiznet(buf,ch,NULL,WIZ_FLAGS,0,0); if(!IS_SET(ch->act, PLR_THIEF)) { if(number_percent() > 75) { SET_BIT(ch->act, PLR_THIEF); send_to_char("{rYou are now known as a THIEF!{x\n\r", ch); save_char_obj(ch); } } check_improve(ch,gsn_steal,FALSE,2); multi_hit( victim, ch, TYPE_UNDEFINED ); } return; } } else // NOW DEAL with Stealing EQ and not coins { if(!IS_NPC(victim)) // PC stealing from PC { if(percent < ((get_skill(ch,gsn_steal) / 10) + (stealbonus/2))) { // Kracus- PC steal from PC eq levels // Checks for ITEM flags/types if(IS_SET(obj->extra_flags, ITEM_NODROP) // || (IS_SET(obj->extra_flags, ITEM_INVENTORY) || IS_SET(obj->extra_flags, ITEM_NOREMOVE) || IS_SET(obj->extra_flags, ITEM_ROT_DEATH) || IS_SET(obj->extra_flags, ITEM_NOSTEAL) || IS_SET(obj->extra_flags, ITEM_ARTIFACT) || (obj->item_type == ITEM_CORPSE_NPC) || (obj->item_type == ITEM_CORPSE_PC) || (obj->item_type == ITEM_CONTAINER) || (ch->level <= 5 && ch->level < obj->level) || (ch->level < 50 && obj->level >= 50) || (ch->level < 100 && obj->level >= 100) || (ch->level < 150 && obj->level >= 150) || (ch->level < 200 && obj->level >= 200) || (ch->level < 251 && obj->level >= 251) || (!can_drop_obj(ch, obj))) { send_to_char( "You don't seem able to steal that item.\n\r", ch ); return; } if ( ch->carry_number + get_obj_number( obj ) > can_carry_n( ch ) ) { send_to_char( "You are already carrying too many items.\n\r", ch ); return; } if ( ch->carry_weight + get_obj_weight( obj ) > can_carry_w( ch ) ) { send_to_char( "You can't carry that much weight.\n\r", ch ); return; } if((obj = get_obj_carry(victim, arg1, ch)) != NULL) { obj_from_char( obj ); obj_to_char( obj, ch ); act("\n\r{rYou successfully steal $p unnoticed.{x",ch,obj,NULL,TO_CHAR); check_improve(ch,gsn_steal,TRUE,2); return; } else if((obj = get_obj_wear(victim, arg1)) != NULL) { if(obj->wear_loc != WEAR_NONE && obj->wear_loc != SHEATH_PRIMARY && obj->wear_loc != SHEATH_SECONDARY) { // Kracus- uncomment for PC stealing WORN EQ // and add in an act message and check_improve // remember to keep the return; at the end // remove_obj(ch,obj->wear_loc, TRUE); // obj_from_char( obj ); // obj_to_char( obj, ch ); // act("\n\r{rYou successfully steal $p unnoticed.{x",ch,obj,NULL,TO_CHAR); // check_improve(ch,gsn_steal,TRUE,2); send_to_char( "You don't seem able to steal that item.\n\r", ch ); return; } else { send_to_char( "You don't seem able to steal that item.\n\r", ch ); return; } } } else // FAILURE to steal PC to PC EQ { send_to_char( "Your attempt to steal was unsuccessful.\n\r", ch ); affect_strip(ch,gsn_sneak); REMOVE_BIT(ch->affected_by,AFF_SNEAK); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); switch(number_range(0,3)) { case 0 : sprintf( buf, "%s is a flaming thief!", ch->name ); break; case 1 : sprintf( buf, "%s couldn't steal %s own flaming eq!", ch->name,(ch->sex == 2) ? "her" : "his"); break; case 2 : sprintf( buf,"%s tried to steal from me!",ch->name ); break; case 3 : sprintf(buf,"Don't even try to steal from me, %s!",ch->name); break; } if(!IS_AWAKE(victim)) do_function(victim, &do_wake, ""); if(IS_AWAKE(victim)) do_function( victim, &do_yell, buf); sprintf(buf,"$N tried to steal from %s.",victim->name); wiznet(buf,ch,NULL,WIZ_FLAGS,0,0); if(!IS_SET(ch->act, PLR_THIEF)) { if(number_percent() > 75) { SET_BIT(ch->act, PLR_THIEF); send_to_char("{rYou are now known as a THIEF!{x\n\r", ch); save_char_obj(ch); } } check_improve(ch,gsn_steal,FALSE,2); multi_hit( victim, ch, TYPE_UNDEFINED ); return; } } else if(IS_NPC(victim)) // PC stealing from NPC { if(percent < ((get_skill(ch,gsn_steal) / 5) + stealbonus)) { // Kracus- PC steal from NPC levels // No Weapons since they are needed for Mob skills // Checks for ITEM flags/types if(IS_SET(obj->extra_flags, ITEM_NODROP) || IS_SET(obj->extra_flags, ITEM_NOREMOVE) || IS_SET(obj->extra_flags, ITEM_ROT_DEATH) || IS_SET(obj->extra_flags, ITEM_NOSTEAL) || IS_SET(obj->extra_flags, ITEM_ARTIFACT) || (obj->item_type == ITEM_WEAPON) || (obj->item_type == ITEM_CORPSE_NPC) || (obj->item_type == ITEM_CORPSE_PC) || (obj->item_type == ITEM_CONTAINER) || (ch->level <= 5 && ch->level < obj->level) || (ch->level < 50 && obj->level >= 50) || (ch->level < 100 && obj->level >= 100) || (ch->level < 150 && obj->level >= 150) || (ch->level < 200 && obj->level >= 200) || (ch->level < 251 && obj->level >= 251) || (!can_drop_obj(ch, obj))) { send_to_char( "You don't seem able to steal that item.\n\r", ch ); return; } if ( ch->carry_number + get_obj_number( obj ) > can_carry_n( ch ) ) { send_to_char( "You are already carrying too many items.\n\r", ch ); return; } if ( ch->carry_weight + get_obj_weight( obj ) > can_carry_w( ch ) ) { send_to_char( "You can't carry that much weight.\n\r", ch ); return; } if((obj = get_obj_carry(victim, arg1, ch)) != NULL) { obj_from_char( obj ); obj_to_char( obj, ch ); act("\n\r{rYou successfully steal $p unnoticed.{x",ch,obj,NULL,TO_CHAR); check_improve(ch,gsn_steal,TRUE,2); return; } else if((obj = get_obj_wear(victim, arg1)) != NULL) { if(obj->wear_loc != WEAR_NONE && obj->wear_loc != SHEATH_PRIMARY && obj->wear_loc != SHEATH_SECONDARY) { remove_obj(victim,obj->wear_loc, TRUE); obj_from_char( obj ); obj_to_char( obj, ch ); act("\n\r{rYou successfully steal $p unnoticed.{x",ch,obj,NULL,TO_CHAR); check_improve(ch,gsn_steal,TRUE,2); return; } else { send_to_char( "You don't seem able to steal that item.\n\r", ch ); return; } } } else // Failure to steal EQ { send_to_char( "Your attempt to steal was unsuccessful.\n\r", ch ); affect_strip(ch,gsn_sneak); REMOVE_BIT(ch->affected_by,AFF_SNEAK); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); switch(number_range(0,3)) { case 0 : sprintf( buf, "%s is a flaming thief!", ch->name ); break; case 1 : sprintf( buf, "%s couldn't steal %s own flaming eq!", ch->name,(ch->sex == 2) ? "her" : "his"); break; case 2 : sprintf( buf,"%s tried to steal from me!",ch->name ); break; case 3 : sprintf(buf,"Don't even try to steal from me, %s!",ch->name); break; } if(!IS_AWAKE(victim)) do_function(victim, &do_wake, ""); if(IS_AWAKE(victim)) do_function( victim, &do_yell, buf); check_improve(ch,gsn_steal,FALSE,2); multi_hit( victim, ch, TYPE_UNDEFINED ); return; } } } } else if(IS_NPC(ch)) // NPC stealing { if(!str_cmp( arg1, "coin") || !str_cmp( arg1, "coins")) // Steal coins now { if(percent < ((get_skill(ch,gsn_steal) / 4) + stealbonus)) { // Success for stealing COINS int gold_conversion; int silver_compare; int base_silver; int gold; int silver; base_silver = victim->silver; gold_conversion = victim->gold; silver_compare = base_silver/100; if(IS_NPC(victim)) { gold = (victim->gold * 50)/100; // NPC 50% silver = (victim->silver *50)/100; // NPC 50% } else { gold = (victim->gold * 10)/100; // PC 10% silver = (victim->silver * 10)/100; // PC 10% } if(victim->gold > 0 && victim->silver > 0) { if(gold_conversion >= silver_compare) { ch->gold += gold; victim->gold -= gold; return; } else { ch->silver += silver; victim->silver -= silver; return; } } else if(victim->gold > 0 && victim->silver <= 0) { ch->gold += gold; victim->gold -= gold; return; } else if(victim->silver > 0 && victim->gold <= 0) { ch->silver += silver; victim->silver -= silver; return; } else { return; // NO COINS } } else // Failure to steal COINS { affect_strip(ch,gsn_sneak); REMOVE_BIT(ch->affected_by,AFF_SNEAK); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); switch(number_range(0,3)) { case 0 : sprintf( buf, "%s is a flaming thief!", ch->name ); break; case 1 : sprintf( buf, "%s couldn't steal %s own flaming eq!", ch->name,(ch->sex == 2) ? "her" : "his"); break; case 2 : sprintf( buf,"%s tried to steal from me!",ch->name ); break; case 3 : sprintf(buf,"Don't even try to steal from me, %s!",ch->name); break; } if(!IS_AWAKE(victim)) do_function(victim, &do_wake, ""); if(IS_AWAKE(victim)) do_function( victim, &do_yell, buf); // NPC victim if(IS_NPC(victim)) { multi_hit( victim, ch, TYPE_UNDEFINED ); } else // PC victim { // Kracus- uncomment if your mobs can have // THIEF FLAGS when they fail in stealing // if(!IS_SET(ch->act, PLR_THIEF)) // { // if(number_percent() > 75) // { // SET_BIT(ch->act, PLR_THIEF); // send_to_char("{rYou are now known as a THIEF!{x\n\r", ch); // save_char_obj(ch); // } // } multi_hit( victim, ch, TYPE_UNDEFINED ); } return; } } else { if(!IS_NPC(victim)) { // This Part of the CODE deal with NPC having skills // LF has NPC's with skills so if your mud has no // NPC skills then you need to comment this section out. if(percent < ((get_skill(ch,gsn_steal) / 10) + stealbonus)) { // Kracus- NPC steal from PC levels // No Weapons in case you call steal while fighting // Checks for ITEM flags/types // Level Checks since you dont want a high level // NPC with the steal skill failing and killing // a much lower level PC....very bad hehehe // Also no calls to check_improve LF mobs // improve skills in a different way... if(IS_SET(obj->extra_flags, ITEM_NODROP) || IS_SET(obj->extra_flags, ITEM_NOREMOVE) || IS_SET(obj->extra_flags, ITEM_ROT_DEATH) || IS_SET(obj->extra_flags, ITEM_NOSTEAL) || IS_SET(obj->extra_flags, ITEM_ARTIFACT) || (obj->item_type == ITEM_WEAPON) || (obj->item_type == ITEM_CORPSE_NPC) || (obj->item_type == ITEM_CORPSE_PC) || (obj->item_type == ITEM_CONTAINER) || (ch->level <= 5 && ch->level < obj->level) || (ch->level < 50 && obj->level >= 50) || (ch->level < 100 && obj->level >= 100) || (ch->level < 150 && obj->level >= 150) || (ch->level < 200 && obj->level >= 200) || (ch->level < 251 && obj->level >= 251) || (!can_drop_obj(ch, obj))) return; if ( ch->carry_number + get_obj_number( obj ) > can_carry_n( ch ) ) return; if ( ch->carry_weight + get_obj_weight( obj ) > can_carry_w( ch ) ) return; if((obj = get_obj_carry(victim, arg1, ch)) != NULL) { obj_from_char( obj ); obj_to_char( obj, ch ); return; } else if((obj = get_obj_wear(victim, arg1)) != NULL) { if(obj->wear_loc != WEAR_NONE && obj->wear_loc != SHEATH_PRIMARY && obj->wear_loc != SHEATH_SECONDARY) { remove_obj(victim,obj->wear_loc, TRUE); obj_from_char( obj ); obj_to_char( obj, ch ); return; } else { return; } } } else // Failure to steal EQ { affect_strip(ch,gsn_sneak); REMOVE_BIT(ch->affected_by,AFF_SNEAK); act( "$n tried to steal from you.\n\r", ch, NULL, victim, TO_VICT ); act( "$n tried to steal from $N.\n\r", ch, NULL, victim, TO_NOTVICT ); switch(number_range(0,3)) { case 0 : sprintf( buf, "%s is a flaming thief!", ch->name ); break; case 1 : sprintf( buf, "%s couldn't steal %s own flaming eq!", ch->name,(ch->sex == 2) ? "her" : "his"); break; case 2 : sprintf( buf,"%s tried to steal from me!",ch->name ); break; case 3 : sprintf(buf,"Don't even try to steal from me, %s!",ch->name); break; } if(!IS_AWAKE(victim)) do_function(victim, &do_wake, ""); if(IS_AWAKE(victim)) do_function( victim, &do_yell, buf); multi_hit( victim, ch, TYPE_UNDEFINED ); return; } } else // if(IS_NPC(victim)) { // ADD in code for NPC stealing from NPC if you want below return; } } } else // Already checked for PC stealers, NPC stealers, left open... { // if you have special mobs like NPClevelingMOBS that save... return; } }