void do_give( CHAR_DATA *ch, char *argument ) { char arg1 [MAX_INPUT_LENGTH]; char arg2 [MAX_INPUT_LENGTH]; char rest[MAX_INPUT_LENGTH];// Marhis char buf[MAX_STRING_LENGTH]; char buf1[MAX_STRING_LENGTH]; //Althea char buf2[MAX_STRING_LENGTH]; CHAR_DATA *victim, *room_ch; OBJ_DATA *obj; int i; // Marhis int number; number = mult_argument(argument,rest);// Marhis strcpy(argument, rest);// Marhis argument = one_argument( argument, arg1 ); sprintf(buf2,"%s",argument); argument = one_argument( argument, arg2 ); if ( arg1[0] == '\0' || arg2[0] == '\0' ) { send_to_char( "{MSintassi: give \n\r", ch ); send_to_char( " give oro \n\r", ch ); send_to_char( " give argento {x\n\r", ch ); return; } //Hazon 7-7-2002 if (( victim = get_char_room( ch, arg2 )) == ch ) { send_to_char( "Vuoi dare a te stesso una cosa che gia' hai? Ottimo passatempo.\n\r", ch ); return; } if ( is_number( arg1 ) ) { /* 'give NNNN coins victim' */ int amount; bool silver; amount = atoi(arg1); if ( amount <= 0 || ( str_cmp( arg2, "monete" ) && str_cmp( arg2, "moneta" ) && str_cmp( arg2, "oro" ) && str_cmp( arg2, "argento")) ) { send_to_char( "Non puoi fare niente del genere.\n\r", ch ); return; } silver = str_cmp(arg2,"oro"); argument = one_argument( argument, arg2 ); if ( arg2[0] == '\0' ) { send_to_char( "{MSintassi: give oro \n\r", ch ); send_to_char( " give argento {x\n\r", ch ); return; } if ( ( victim = get_char_room( ch, arg2 ) ) == NULL ) { send_to_char( "Non c'e' nessuno con quel nome qui.\n\r", ch ); return; } if ( (!silver && ch->gold < amount) || (silver && ch->silver < amount) ) { send_to_char( "Non hai cosi' tanto denaro con te.\n\r", ch ); return; } // Mobius if ( IS_NPC(victim) && IS_SET(victim->act,ACT_IS_CHANGER) && !can_see(victim,ch) ) { act( "$n dice: '{gMi spiace, non vi vedo{x'", victim,NULL,ch,TO_ROOM); return; } if (silver) { ch->silver -= amount; victim->silver += amount; } else { ch->gold -= amount; victim->gold += amount; } sprintf(buf,"$n ti da' %d monete %s.",amount, silver ? "{wd'argento{x" : "{yd'oro{x"); act( buf, ch, NULL, victim, TO_VICT ); act( "$n da' del denaro a $N.", ch, NULL, victim, TO_NOTVICT ); sprintf(buf,"Dai a $N %d monete %s.",amount, silver ? "{wd'argento{x" : "{yd'oro{x"); act( buf, ch, NULL, victim, TO_CHAR ); if (IS_SET(victim->progtypes,MPROG_BRIBE)) (victim->pIndexData->mprogs->bribe_prog) (victim,ch,amount); if (IS_NPC(victim) && IS_SET(victim->act,ACT_IS_CHANGER)) { int change; change = (silver ? 95 * amount / 100 / 100 : 95 * amount); if (!silver && change > victim->silver) victim->silver += change; if (silver && change > victim->gold) victim->gold += change; if (change < 1 && can_see(victim,ch)) { act( "$n dice: '{gMi spiace, non mi avete dato abbastanza denaro da cambiare{x'", victim,NULL,ch,TO_ROOM); //ch->reply = victim; //Althea sprintf(buf,"%d %s %s", amount, silver ? "argento" : "oro",ch->name); do_give(victim,buf); } else if (can_see(victim,ch)) { sprintf(buf,"%d %s %s", change, silver ? "oro" : "argento",ch->name); do_give(victim,buf); if (silver) { sprintf(buf,"%d argento %s", (95 * amount / 100 - change * 100),ch->name); do_give(victim,buf); } act("$n dice: '{gGrazie, tornate presto{x'", victim,NULL,ch,TO_ROOM);//Sarebbe da fare un bel dotell per i colori //ch->reply = victim; //Althea } } return; } if ( ( obj = get_obj_carry( ch, arg1 ) ) == NULL ) { send_to_char( "Non ce l'hai con te.\n\r", ch ); return; } if ( obj->wear_loc != WEAR_NONE ) { send_to_char( "Devi togliertelo di dosso, prima.\n\r", ch ); return; } if ( ( victim = get_char_room( ch, arg2 ) ) == NULL ) { send_to_char( "Non c'e' nessuno con quel nome qui.\n\r", ch ); return; } if ( (IS_NPC(victim) && victim->pIndexData->pShop != NULL ) && !IS_SET(victim->progtypes, MPROG_GIVE) ) { act("$N dice: '{gE' una cosa che puoi vendere, non certo regalare{x'", ch,NULL,victim,TO_ROOM); //ch->reply = victim; //Althea return; } if ( !can_drop_obj( ch, obj ) ) { send_to_char( "Non puoi liberarti di questo oggetto, sembra attaccato alla tua mano.\n\r", ch ); return; } if ( victim->carry_number + get_obj_number( obj ) > can_carry_n( victim ) ) { act( "$N {xnon riesce a prenderlo.", ch, NULL, victim, TO_CHAR ); // Mobius sprintf(buf, "%s {xnon riesce a darti %s{x, liberati le mani.\n\r", NAME(ch), obj->short_descr); send_to_char(buf, victim); return; } if (get_carry_weight(victim) + get_obj_weight(obj) > can_carry_w( victim ) ) { act( "$N {xha gia' troppo peso addosso.", ch, NULL, victim, TO_CHAR ); // Mobius sprintf(buf, "%s {xnon riesce a darti %s{x, pesa troppo.\n\r", NAME(ch), obj->short_descr); send_to_char(buf, victim); return; } if ( !can_see_obj( victim, obj ) ) { act( "$N {xnon riesce a vederlo, come fa a prenderlo?", ch, NULL, victim, TO_CHAR ); return; } if (obj->pIndexData->limit != -1) { if ( ( IS_OBJ_STAT(obj, ITEM_ANTI_EVIL) && IS_EVIL(victim) ) || ( IS_OBJ_STAT(obj, ITEM_ANTI_GOOD) && IS_GOOD(victim) ) || ( IS_OBJ_STAT(obj, ITEM_ANTI_NEUTRAL) && IS_NEUTRAL(victim) ) ) { send_to_char( "Appena lo avvicini alle sue mani senti una strana forza repulsiva... forse e' stato forgiato per persone di indole diversa, e non puoi cederlo altrimenti.", ch ); return; } } /* if (number == 1)// Marhis - modificata da Althea, procedura di prova... sotto c'e' una variante { obj_from_char( obj ); obj_to_char( obj, victim ); act( "$n {xda' $p {xa $N{x.", ch, obj, victim, TO_NOTVICT ); act( "$n {xti da' $p{x.", ch, obj, victim, TO_VICT ); act( "Dai $p {xa $N{x.", ch, obj, victim, TO_CHAR ); if (IS_SET(obj->progtypes,OPROG_GIVE)) (obj->pIndexData->oprogs->give_prog) (obj,ch,victim); if (IS_SET(victim->progtypes,MPROG_GIVE)) (victim->pIndexData->mprogs->give_prog) (victim,ch,obj); } else { if (( obj = get_obj_carry( ch, arg1))!= NULL ) { act( "$n {xda' qualche $p {xa $N{x.", ch, obj, victim, TO_NOTVICT ); act( "$n {xti da' qualche $p{x.", ch, obj, victim, TO_VICT ); act( "Dai qualche $p {xa $N{x.", ch, obj, victim, TO_CHAR ); if (IS_SET(obj->progtypes,OPROG_GIVE)) (obj->pIndexData->oprogs->give_prog) (obj,ch,victim); if (IS_SET(victim->progtypes,MPROG_GIVE)) (victim->pIndexData->mprogs->give_prog) (victim,ch,obj); } for(i=0;ishort_descr); for(i=0;iprogtypes,OPROG_GIVE)) (obj->pIndexData->oprogs->give_prog) (obj,ch,victim); if (IS_SET(victim->progtypes,MPROG_GIVE)) (victim->pIndexData->mprogs->give_prog) (victim,ch,obj); //Natauro - Fine hack per OPROG_GIVE e MPROG_GIVE //MOBIUS - 20151028 - RARITY if (IS_NPC(victim) && IS_SET(victim->act,ACT_IS_CHANGER) &&(obj->item_type == 8)) { int chance; if (obj->rarity == 0){ chance = dice(1,4); if (chance == 1){ act("$n dice: '{gLa solita robaccia...{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 2){ act("$n dice: '{gTutte le volte la stessa storia...{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 3){ act("$n dice: '{gFammi indovinare, l'hai trovato in un baule?{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 4){ act("$n dice: '{gMagari qualcosa si puo' recuperare...{x'", victim,NULL,ch,TO_ROOM); } } else if (obj->rarity == 1){ chance = dice(1,4); if (chance == 1){ act("$n dice: '{gNon male, devo dire. Decisamente non male!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 2){ act("$n dice: '{gSi vede che e' stato fatto da mani esperte.{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 3){ act("$n dice: '{gBeh, decisamente vale piu' di qualcosa!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 4){ act("$n dice: '{gOh, beh. Mi aspettavo di peggio!.{x'", victim,NULL,ch,TO_ROOM); } } else if (obj->rarity == 2){ chance = dice(1,4); if (chance == 1){ act("$n dice: '{gSe volevi stupirmi, questo e' il modo per farlo!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 2){ act("$n dice: '{gUna vera rarita'!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 3){ act("$n dice: '{gPregiato... Davvero interessante.{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 4){ act("$n dice: '{gDiamine, questa roba e' davvero rara!{x'", victim,NULL,ch,TO_ROOM); } } else if (obj->rarity == 3){ chance = dice(1,4); if (chance == 1){ act("$n dice: '{gMa... E' stupendo!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 2){ act("$n dice: '{gNon avevo mai visto niente di simile..!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 3){ act("$n dice: '{gE' un tesoro con la T maiuscola, questo!{x'", victim,NULL,ch,TO_ROOM); } else if (chance == 4){ act("$n dice: '{gPiu' unico che raro, questo e' certo. E se lo dico io..!{x'", victim,NULL,ch,TO_ROOM); } } int valTres; if (obj->cost>=1000){ valTres = (obj->cost)/100; victim->gold += valTres; sprintf(buf,"%d oro %s", valTres,ch->name); do_give(victim, buf); } else { valTres = obj->cost; victim->silver += valTres; sprintf(buf,"%d argento %s", valTres,ch->name); do_give(victim, buf); } } return; }