Oggi è 27/04/2024, 22:13



Apri un nuovo argomento Rispondi all’argomento  [ 6 messaggi ] 
Autore Messaggio
 Oggetto del messaggio: salve vorrei tre aiuti da parte vostra conLyonesse mud
MessaggioInviato: 12/08/2015, 0:25  
Iscritto il: 05/11/2010, 23:57
Messaggi: 23
Mud: Vagabondo
Non connesso

salve dal ultima volta che ho scritto qui sono passati 3 anni ora mai ed ora mi ritorno di nuovo qui per mi serve 3 aiuti
vi posto quello che vorrei :


PRIMO AIUTO
======================================

in poche parole vorrei che a seconda della razza che un pg sceglie nasce( la prima volta quando uno si crea il pg) e quando muore il pg che il pg poi risolge in quella determinata locazione


Esempio:(nascita)
Umani= cerchio di pietre umano che si trova a x locazione
Hafling=cerchio di pietre degli hafling che si trova a y locazione
Elfi Neri= cerchio di pietre degli elfi neri che si trova a Z locazione.

con la possibilita che il pg puo scegliere dove risolgere nel cerchio degli elfi o quello degli hafling o quello della sua razza.

SECONDO AIUTO
======================================
che i mob facessero a determinate condizioni e il problema che se un pg uccide un qualsiasi mob il mud crasha dandomi un errore nel file handler.c del codici sorgenti di lyonesse mud nella cartella src

vi posto il pezzo di codice dove mi segnala l errore in seguito ad un uccisione di un mob

/*
* Return real weight of an object, including weight of contents.
*/
int get_real_obj_weight( OBJ_DATA *obj )
{
int weight;

if ( !obj )
return (0);

if ( GET_OBJ_TYPE(obj) == ITEM_MONEY )
weight = MAX(1, (GET_OBJ_VAL(obj, 0) * GET_OBJ_WEIGHT(obj)) / 10);
else
weight = obj->count * GET_OBJ_WEIGHT(obj);

for ( obj = obj->first_content; obj; obj = obj->next_content )
weight += get_real_obj_weight(obj);

return (weight);
}

---------------------------------------------------------------------
il rigo che mi segnala in debug e questo

if ( GET_OBJ_TYPE(obj) == ITEM_MONEY )
weight = MAX(1, (GET_OBJ_VAL(obj, 0) * GET_OBJ_WEIGHT(obj)) / 10);
---------------------------------------------------------------------
la stack di chiamate e questa

> Lyonesse.exe!get_real_obj_weight(obj_data * obj=0xfeeefeee) Riga 2136 + 0x3 byte C

TERZO AIUTO
======================================

mentre l altra cosa dove spero che mi aiuterete ri guarda sui i mob in generale di quello che vorrei far fare ai mob

vi faccio vedere un po lo schema di quello che vorrei (Mob)


1)Il mob risponde alle domande specifiche del pg

Esempio:

Chiedi a una guardia cittadina 'Come ti chiami?'
Una guardia cittadina dice 'Il mio nome è Tanry.'

2)Il mob da e riceve oggetti secondo le cose che il pg deve fare.

Esempio:

La Donna abbronzata dice sorridendo 'Portami una bottiglia di buon vino e sarà tuo.
Dai una bottiglia di vino speziato a una donna abbronzata.
La Donna abbronzata dice sorridendo 'Bene, bene
La Donna abbronzata ti dà un'anfora di terracotta.

3)I mob cattivi attaccano i mob buoni (Ex:animali)

Esempio:

Una volpe rossa attacca un Coniglio
Un orco attacca un elfo

4)I mob aprano solo a determinati tipi di pg

Esempio:

Chiedi a una guardia cittadina 'Mi apri?'
Una guardia cittadina dice 'aprite a (nome pg).'
la guardia cittadina infila la chiave nella serratura ed apre il portone

il pg entra

La guardia cittadina chiude la porta a chiave.

======================================
vi post il file di codice della cartella src dove alcuni mob fanno delle procedure speciali il file in questione e questo.(spec_procs.c)

/**************************************************************************
* # # # ## # # ### ## ## ### http://www.lyonesse.it *
* # # # # # ## # # # # # *
* # # # # # ## ## # # ## ## ## # # ## *
* # # # # # ## # # # # # # # # # # # *
* ### # ## # # ### ## ## ### # # #### ## Ver. 1.0 *
* *
* -Based on CircleMud & Smaug- Copyright (c) 2001-2002 by Mithrandir *
* *
* ********************************************************************** */
/* ************************************************************************
* File: spec_procs.c Part of CircleMUD *
* Usage: implementation of special procedures for mobiles/objects/rooms *
* *
* All rights reserved. See license.doc for complete information. *
* *
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
************************************************************************ */

#include "conf.h"
#include "sysdep.h"

#include "structs.h"
#include "utils.h"
#include "comm.h"
#include "interpreter.h"
#include "handler.h"
#include "db.h"
#include "spells.h"
#include "constants.h"

typedef SPECIAL(*proctype);

/* external vars */
extern struct room_data *world;
extern struct char_data *character_list;
extern struct descriptor_data *descriptor_list;
extern struct index_data *mob_index;
extern struct index_data *obj_index;
extern struct time_info_data time_info;
//extern struct command_info cmd_info[];
//extern struct str_app_type str_app[];
//extern struct dex_app_type dex_app[];
extern const char *mail_type[];

extern TIME_INFO_DATA time_info;
extern SPELL_INFO_DATA spell_info[];
extern int guild_info[][3];
extern int spell_sort_info[MAX_SKILLS + 1];
extern int prac_params[4][NUM_CLASSES];
extern struct time_info_data time_info;

/* extern functions */

ACMD(do_give);
ACMD(do_drop);
ACMD(do_gen_door);
ACMD(do_say);
ACMD(do_action);
ACMD(do_hit);
ACMD(do_look);
//ACMD(do_kill);
//ACMD(holler);
//ACMD(do_get);
ACMD(do_follow);
extern int limite_follower(struct char_data *ch);

struct social_type {
char *cmd;
int next_line;
};
const char *how_good(int percent);
int AddNewSpell(CHAR_DATA *ch, int spellnum);
void add_follower(CHAR_DATA *ch, CHAR_DATA *leader);
void CharLoseAllItems(CHAR_DATA *ch);

/* external specials */
SPECIAL(shop_keeper); // shop.c
SPECIAL(postmaster); // mail.c
SPECIAL(gen_board); // boards.c

/* local functions */
SPECIAL(guild);
SPECIAL(Maestro_delle_Abilita);

SPECIAL(La_Donna_abbronzata_Lilyia)
{
//ACMD(do_hit);
ACMD(do_flee);
ACMD(do_say);
if (cmd)
return 0;
switch (number(0, 20)) {
case 0:
act("&b&3Chiedi a $n '&7Anfora.&3?'&b&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&3Una donna abbronzata sorride allegramente.", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3esclama '&b&7Allora ti serve una delle mie anfore&3!'&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3sorride allegramente.&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7Bene, bene.'&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice '&b&7'Ma non posso dartela per nulla...'&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&3$n riflette pensosamente.'&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7Portami una bottiglia di buon vino e sarà tuo.'&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7Vai adesso, e mi raccomando una buona bottiglia.'&3&7", FALSE, ch, 0, 0,TO_ROOM);
return(1);
case 1:
act("&b&7Dai una bottiglia di vino speziato a una donna abbronzata.&b&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7Bene, bene.&3'&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&3$n incrocia le braccia.&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3sorride allegramente.&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7è proprio il mio preferito.&3'&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n beve un sorso di vino da una bottiglia di vino speziato.&3'&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7Ecco quello che ti avevo promesso.&3'&b&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&3$n ti dà un'anfora di terracotta.&3&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&7$n &b&3dice sorridendo '&b&7A presto e fate attenzione.&3'&b&7", FALSE, ch, 0, 0,TO_ROOM);
act("&b&3$n saluta tutti con la mano.&3&7", FALSE, ch, 0, 0,TO_ROOM);
do_flee(ch, 0, 0, 0);
//do_follow(ch, 0, 0, 0);
return(1);
default: return(FALSE);
break;
}
return(0);
}

/* ********************************************************************
* Special procedures for objects *
******************************************************************** */


SPECIAL(bank)
{
int amount;

if (CMD_IS("bilancio"))
{
if (GET_BANK_GOLD(ch) > 0)
sprintf(buf, "&b&7Un impiegato della banca &b&3ti dice '&b&7Hai un credito di %d monete.&b&3'&b&7\r\n",
GET_BANK_GOLD(ch));
else
sprintf(buf, "&b&7Un impiegato della banca &b&3ti dice '&b&7Non hai alcun conto in questa banca.&b&3'&b&7\r\n");
send_to_char(buf, ch);
return (1);
}
else if (CMD_IS("deposita"))
{
if ((amount = atoi(argument)) <= 0)
{
send_to_char("Quanto vuoi depositare?\r\n", ch);
return (1);
}
if (get_gold(ch) < amount)
{
send_to_char("&b&7Un impiegato della banca &b&3ti esclama '&b&7Ma non possiedi questa somma!&b&3'&b&7\r\n", ch);
return (1);
}
sub_gold(ch, amount);
GET_BANK_GOLD(ch) += amount;
sprintf(buf, "Depositi la somma di %d monete.\r\n", amount);
send_to_char(buf, ch);
act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM);
return (1);
}
else if (CMD_IS("preleva"))
{
if ((amount = atoi(argument)) <= 0)
{
send_to_char("&b&7Un impiegato della banca &b&3ti dice '&b&7Scusa ma non ho capito quanto vuoi prelevare.&b&3'&b&7\r\n", ch);
return (1);
}
if (GET_BANK_GOLD(ch) < amount)
{
send_to_char("&b&7Un impiegato della banca &b&3ti esclama '&b&7Non hai questa somma in deposito!&b&3'&b&7\r\n", ch);
return (1);
}
add_gold(ch, amount);
GET_BANK_GOLD(ch) -= amount;
sprintf(buf, "&b&7Un impiegato della banca &b&3ti dice '&b&7Eccoti il denaro.&b&3'&b&7\r\nRitiri la somma di %d monete.\r\n", amount);
send_to_char(buf, ch);
act("$n makes a bank transaction.", TRUE, ch, 0, FALSE, TO_ROOM);
return (1);
}
else
return (0);
}

SPECIAL(id_a_tron)
{
OBJ_DATA *obj;
int i, found;

if (!CMD_IS("analyze"))
return (0);

skip_spaces(&argument);

if (!*argument)
{
send_to_char("Analyze what?\r\n", ch);
return (1);
}

if (!(obj = get_obj_in_list_vis_rev(ch, argument, NULL, ch->last_carrying)))
{
sprintf(buf, "You don't seem to have any %ss.\r\n", argument);
send_to_char(buf, ch);
return (1);
}

send_to_char("&b&2The machine chitters to itself for a minute, then whirs into life.&0\r\n", ch);
if ( !OBJ_FLAGGED(obj, ITEM_DONATED) )
{
send_to_char("&b&6This is not a donated item!!\r\n&0", ch);
return (1);
}
send_to_char("&b&6Your divination is complete...\r\n&0", ch);

sprintf(buf, "&b&4Oggetto:&0 &b&7%s&0\r\n", obj->short_description);
sprintf(buf, "%s&b&4Tipo Oggetto:&0 &b&7", buf);
sprinttype(GET_OBJ_TYPE(obj), item_types, buf2);
strcat(buf, buf2);
strcat(buf, "&0 &b&4Effects:&0 &b&7");
send_to_char(buf, ch);

// send_to_char("Item is: ", ch);
sprintbit(GET_OBJ_EXTRA(obj), extra_bits, buf);
strcat(buf, "&0\r\n");
send_to_char(buf, ch);

send_to_char("&b&4Restrictions:&0 &b&7", ch);
sprintbit(GET_OBJ_ANTI(obj), anti_bits, buf1);
strcat(buf1,"&0\r\n");
send_to_char(buf1,ch);

sprintf(buf, "&b&4Equipable Locazione(s):&0 &b&7");
sprintbit(GET_OBJ_WEAR(obj), wear_bits, buf2);
strcat(buf, buf2);
strcat(buf, "&0\r\n");
send_to_char(buf, ch);

sprintf(buf, "&b&4Peso: &0&b&7%d&0&b&4, Valutato: &0&b&7%d&b&4, Rent: &0&b&7%d&b&4, Livello Minimo: &0&b&7%d&0\r\n",
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj));
send_to_char(buf, ch);

if (GET_OBJ_PERM(obj))
{
char baf1[256];

*baf1 = '\0';

send_to_char("&b&4affects:&0 &b&7", ch);
if (GET_OBJ_PERM(obj))
sprintbit(GET_OBJ_PERM(obj), affected_bits, baf1);
sprintf(buf, "%s&0\r\n", baf1);
send_to_char(buf, ch);
}

switch (GET_OBJ_TYPE(obj))
{
case ITEM_SCROLL:
case ITEM_POTION:
sprintf(buf, "&b&4Livello &0&b&7%d&0&b&4 spells di&0&b&7", GET_OBJ_VAL(obj, 0));
if (GET_OBJ_VAL(obj, 1) >= 1)
sprintf(buf + strlen(buf), " %s", skill_name(GET_OBJ_VAL(obj, 1)));
if (GET_OBJ_VAL(obj, 2) >= 1)
sprintf(buf + strlen(buf), " &0&b&4/&0&b&7 %s", skill_name(GET_OBJ_VAL(obj, 2)));
if (GET_OBJ_VAL(obj, 3) >= 1)
sprintf(buf + strlen(buf), " &0&b&4/&0&b&7 %s", skill_name(GET_OBJ_VAL(obj, 3)));
strcat(buf, "&0\r\n");
send_to_char(buf, ch);
break;

case ITEM_WAND:
case ITEM_STAFF:
sprintf(buf, "&b&4Level &0&b&7%d&0&b&4 spell of&0&b&7 ", GET_OBJ_VAL(obj, 0));

sprintf(buf + strlen(buf), " %s&0&b&4. ", skill_name(GET_OBJ_VAL(obj, 3)));
sprintf(buf + strlen(buf), "Holds &0&b&7%d&0&b&4 charge%s and has &0&b&7%d&0&b&4 charge%s left.&0\r\n",
GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 1) == 1 ? "" : "s",
GET_OBJ_VAL(obj, 2), GET_OBJ_VAL(obj, 2) == 1 ? "" : "s");
send_to_char(buf, ch);
break;

case ITEM_WEAPON:
sprintf(buf, "&b&4Danni Dice of &0&b&7%d&0&b&4d&0&b&7%d&0&b&4",
GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 2));
sprintf(buf + strlen(buf), " per un danno medio pro-round di &0&b&7%.1f&0\r\n",
(((GET_OBJ_VAL(obj, 2) + 1) / 2.0) * GET_OBJ_VAL(obj, 1)));
send_to_char(buf, ch);
break;

case ITEM_ARMOR:
sprintf(buf, "&b&4AC-apply di &0&b&7%d&0\r\n", GET_OBJ_VAL(obj, 0));
send_to_char(buf, ch);
break;
}

found = FALSE;
for (i = 0; i < MAX_OBJ_AFF; i++)
{
if ((obj->affected[i].location != APPLY_NONE) &&
(obj->affected[i].modifier != 0))
{
if (!found)
{
send_to_char("&b&4Effetti:&0\r\n", ch);
found = TRUE;
}
sprinttype(obj->affected[i].location, apply_types, buf2);
sprintf(buf, " &b&7%+d&0&b&4 a&0&b&7 %s&0\r\n", obj->affected[i].modifier, buf2);
send_to_char(buf, ch);
}
}
return (1);
}


/* ********************************************************************
* Special procedures for mounts and vehicles *
******************************************************************** */
void dismount_char(CHAR_DATA *ch);
void rent_mount(CHAR_DATA *ch, CHAR_DATA *mount);
void unrent_from_stable(CHAR_DATA *ch, STABLE_RENT *strent);
void perform_tell(CHAR_DATA *ch, CHAR_DATA *vict, char *arg);

VEHICLE_DATA *init_vehicle( VEHICLE_INDEX *vType );
bool empty_vehicle(VEHICLE_DATA *vehicle, bool bQuick);
void rent_vehicle(CHAR_DATA *ch, VEHICLE_DATA *vehicle);
void extract_vehicle(VEHICLE_DATA *vehicle, int mode);

extern STABLE_RENT *first_stable_rent;
extern STABLE_RENT *last_stable_rent;

extern VEHICLE_INDEX *vehicle_types[MAX_VEH_TYPE];

NAME_NUMBER sell_mounts_list[] =
{
{"cavallo", 30},
{"\n", -1}
};

SPECIAL(stables)
{
CHAR_DATA *stman = (CHAR_DATA *) me;
char sbuf[MAX_STRING_LENGTH];
char arg1[MAX_INPUT_LENGTH];

argument = one_argument(argument, arg1);

if (CMD_IS("help") || (CMD_IS("list") && !*arg1))
{
strcpy(sbuf,
"Here you can rent your mount or vehicle for 10 gold coins.\r\n"
"To rent write 'rent <mount>' or 'rent <vehicle>'\r\n"
"To have a list write 'withdraw' without any argument.\r\n"
"To withdraw write 'withdraw <mount>' or 'withdraw <vehicle>'"
);
perform_tell(stman, ch, sbuf);
strcpy(sbuf,
"Of course, here you can buy a fast mount or a strong vehicle.\r\n"
"write 'list mounts' or 'list vehicles' for a list of availabilities\r\n"
"write 'buy mount <name>' or 'buy vehicle <name>' to buy what you want."
);
perform_tell(stman, ch, sbuf);
return (1);
}

if ( CMD_IS("list") )
{
if (is_abbrev(arg1, "mounts"))
{
int num;

strcpy(sbuf, "I have the following mounts for sale:");
for (num = 0; *sell_mounts_list[num].name != '\n'; num++)
sprintf(sbuf+strlen(sbuf), "\r\n %s %s",
AN(sell_mounts_list[num].name), sell_mounts_list[num].name);
}
else if (is_abbrev(arg1, "vehicles"))
{
int num;

strcpy(sbuf, "I have the following vehicles for sale:");
for (num = 0; num < MAX_VEH_TYPE; num++)
{
if (!vehicle_types[num])
continue;
sprintf(sbuf+strlen(sbuf), "\r\n &b&7%10s&0 %s",
vehicle_types[num]->name,
vehicle_types[num]->short_description);
}
}
else
strcpy(sbuf, " Un garzone di stalla &b&3ti chiede '&7Chi vuoi affidarmi? Non stai conducendo alcun animale!&b&3'.&7");
perform_tell(stman, ch, sbuf);
return (1);
}

if ( CMD_IS("rent") )
{
if ( !*arg1 )
{
perform_tell(stman, ch, "Rent what?");
return (1);
}

if ( get_gold(ch) < 10 )
{
perform_tell(stman, ch, "il costo e 10 monete d'oro, that you don't have.");
return (1);
}

sub_gold(ch, 10);

// wanna rent a mount?
if ( RIDING(ch) && isname(arg1, GET_PC_NAME(RIDING(ch))) )
{
CHAR_DATA *mount = RIDING(ch);

if ( !AFF_FLAGGED(mount, AFF_TAMED) )
{
perform_tell(stman, ch, "You can rent only tamed mounts.");
return (1);
}

dismount_char(ch);
rent_mount(ch, mount);

perform_tell(stman, ch, "Okay.");
act("You pay 10 gold coins and the stableman carry away $N.", FALSE, ch, NULL, mount, TO_CHAR);
act("The stableman carry away $n's $N.", FALSE, ch, NULL, mount, TO_ROOM);

extract_char_final(mount);
}
// wanna rent a vehicle?
else if ( WAGONER(ch) && isname(arg1, WAGONER(ch)->name) )
{
VEHICLE_DATA *vehicle = WAGONER(ch);

stop_be_wagoner(ch);

/* here we check only for wagoner and ppl inside */
if ( !empty_vehicle(vehicle, TRUE) )
{
send_to_char("You can rent only emptied vehicles.\r\n", ch);
return (1);
}

rent_vehicle(ch, vehicle);

act("You pay 10 gold coins and the stableman carry away $v.", FALSE, ch, NULL, vehicle, TO_CHAR);
act("The stableman carry away $n's $V.", FALSE, ch, NULL, vehicle, TO_ROOM);

extract_vehicle(vehicle, 1);
}
else
{
sprintf(sbuf, "What's exactely this '%s' that you want to rent?", arg1);
perform_tell(stman, ch, sbuf);
}

return (1);
}

if ( CMD_IS("withdraw") )
{
STABLE_RENT *strent;

if ( !first_stable_rent )
{
perform_tell(stman, ch, "You cannot withdraw your belongings at the moment.");
return (1);
}

if ( !*arg1 )
{
int r_num = 0;

strcpy(sbuf, "Here, you have rented the followings:\r\n");
for ( strent = last_stable_rent; strent; strent = strent->prev )
{
// skip other stables..
if ( strent->stable_vnum != ch->in_room->number )
continue;

if ( strent->id_player == GET_IDNUM(ch) )
sprintf(sbuf + strlen(sbuf), "[%d] %s (%s)\r\n",
++r_num, strent->typedescr, st_rent_descr[strent->type]);
}

if ( !r_num )
strcat(sbuf, "Nothing.");
perform_tell(stman, ch, sbuf);
}
else
{
int fnum;
char *vname = str_dup(arg1);

if ( !( fnum = get_number(&vname) ) )
return (1);

for ( strent = first_stable_rent; strent; strent = strent->next )
{
// skip other stables..
if ( strent->stable_vnum != ch->in_room->number )
continue;

if ( strent->id_player == GET_IDNUM(ch) )
{
if ( !str_cmp(vname, strent->typedescr) )
if ( --fnum == 0 )
break;
}
}

if ( !strent )
{
sprintf(sbuf, "Here you don't have %s %s. Try another stable.", AN(vname), vname);
perform_tell(stman, ch, sbuf);
return (1);
}

unrent_from_stable(ch, strent);
}
return (1);
}

if (CMD_IS("buy"))
{
char arg2[MAX_INPUT_LENGTH];
int num, price;

argument = one_argument(argument, arg2);

if (!*arg2)
{
strcpy(sbuf, "What do you want to buy?");
perform_tell(stman, ch, sbuf);
return (1);
}

if (is_abbrev(arg1, "mount"))
{
CHAR_DATA *mount;
int vnum = 0;

for (num = 0; *sell_mounts_list[num].name != '\n'; num++)
{
if (is_abbrev(arg2, sell_mounts_list[num].name))
{
vnum = sell_mounts_list[num].number;
break;
}
}

if (!vnum)
{
strcpy(sbuf, "I have the following mounts for sale:");
for (num = 0; *sell_mounts_list[num].name != '\n'; num++)
sprintf(sbuf+strlen(sbuf), "\r\n %s", sell_mounts_list[num].name);
perform_tell(stman, ch, sbuf);
return (1);
}

if (!(mount = read_mobile(vnum, VIRTUAL)))
{
strcpy(sbuf, "Right now you can't have it.");
perform_tell(stman, ch, sbuf);
return (1);
}

// il prezzo dei cavalli e' : mob->esperienza * 3
price = GET_EXP(mount) * 3;

if ( get_gold(ch) < price )
{
sprintf(sbuf, "Il costo %d monete doro, that you don't have.", price);
perform_tell(stman, ch, sbuf);
return (1);
}

sub_gold(ch, price);

mount->mob_specials.owner_id = GET_IDNUM(ch);
char_to_room(mount, ch->in_room);

sprintf(sbuf, "You pay %d gold coins and $N gives you %s.",
price, mount->player.short_descr);
act(sbuf, FALSE, ch, NULL, stman, TO_CHAR);

sprintf(sbuf, "$n pays %d gold coins and $N gives $m %s.",
price, mount->player.short_descr);
act(sbuf, FALSE, ch, NULL, stman, TO_ROOM);
}
else if (is_abbrev(arg1, "vehicle"))
{
VEHICLE_DATA *pVeh;

for (num = 0; num < MAX_VEH_TYPE; num++)
{
if (!vehicle_types[num])
continue;

if (is_abbrev(arg2, vehicle_types[num]->name))
break;
}

if (num >= MAX_VEH_TYPE)
{
strcpy(sbuf, "I have the following vehicles for sale:");
for (num = 0; num < MAX_VEH_TYPE; num++)
{
if (!vehicle_types[num])
continue;
sprintf(sbuf+strlen(sbuf), "\r\n &b&7%10s&0 %s",
vehicle_types[num]->name,
vehicle_types[num]->short_description);
}
perform_tell(stman, ch, sbuf);
return (1);
}

// il prezzo dei veicoli e' : veicolo->capacita * 25
price = vehicle_types[num]->value.capacity * 25;

if ( get_gold(ch) < price )
{
sprintf(sbuf, "It cost %d gold coins, that you don't have.", price);
perform_tell(stman, ch, sbuf);
return (1);
}

sub_gold(ch, price);

pVeh = init_vehicle(vehicle_types[num]);
pVeh->owner_id = GET_IDNUM(ch);

vehicle_to_room(pVeh, ch->in_room);

sprintf(sbuf, "You pay %d gold coins and $N gives you %s.", price, pVeh->short_description);
act(sbuf, FALSE, ch, NULL, stman, TO_CHAR);
sprintf(sbuf, "$n pays %d gold coins and $N gives $m %s.", price, pVeh->short_description);
act(sbuf, FALSE, ch, NULL, stman, TO_ROOM);
}
else
perform_tell(stman, ch, "I don't understand.");

return (1);
}

return (0);
}
======================================


Top
 Profilo  
 
 Oggetto del messaggio: Re: salve vorrei tre aiuti da parte vostra conLyonesse mud
MessaggioInviato: 18/01/2016, 16:58  
Avatar utente

Iscritto il: 13/01/2010, 12:02
Messaggi: 31
Località: Roma
Mud: Dei delle Ere
Non connesso

Scusate se rispondo ad un quesito posto mesi fa, ma magari il programmatore in questione non ha ancora trovato risposte, quindi tanto vale provarci ;)

Premetto che lo specifico codice di Lyonesse non lo conosco, quindi baserò la mia risposta su delle considerazioni generali.

1)
Questa sembra una impostazione da mettere nel file delle razze. Sicuramente da qualche parte avrai un file che definisce le varie razze rollabili. Aggiungi un parametro che puoi chiamare ad esempio "DefaultSpawnPoint" (punto di rinascita di default), e gestiscine la corretta lettura all'avvio del mud (ci sarà qualcosa chiamato fread_races() o qualcosa di simile).
Se vuoi che il pg possa scegliere un punto di resurrezione differente da quello determinato dalla sua razza, a quel punto ti basterà salvare sul file del pg un ulteriore parametro che puoi chiamare "ActualSpawnPoint" (punto di rinascita attuale), e gestiscine la corretta lettura e salvataggio.
Quando il pg morirà non dovrai fare altro che vedere se la variabile definita dal parametro "ActualSpawnPoint" è valorizzata e usarla, altrimenti vedere il contenuto della variabile definita dal parametro DefaultSpawnPoint della razza del personaggio, e farlo rinascere li.

2)
Purtroppo la segnalazione non è sufficiente. Che tipo di errore ti da? Senza sapere null'altro che non quello che hai scritto è difficile capire perchè vada in errore. Ti consiglio di vedere il contenuto delle variabili e entrare nelle funzioni che quella riga richiama per vedere che non ci siano cose strane.

3)
Lyonesse ha una gestione di programmi sui mob che non siano spec_prog? Parlo di mud_prog.
Le risposte alle domande: "chi sei", "aprimi", ecc.. le ho sempre gestite tramite mud_prog senza problemi, direttamente sui file di area.
Per quanto riguarda il comportamento generico di mob "cattivi" che combattono con mob "buoni" io lo gestirei tramite dei flag e un controllo sull'allineamento.
Nella violence_update() (o ciò che c'è di simile nel Lyonesse) se un mob con il flag "massacra chi non ti sta simpatico" sta vicino ad un mob con allineamento differente, inizi il combattimento.

_________________
Advanced Dei delle Ere - coder


Top
 Profilo  
 
 Oggetto del messaggio: Re: salve vorrei tre aiuti da parte vostra conLyonesse mud
MessaggioInviato: 22/01/2016, 19:40  
Iscritto il: 05/11/2010, 23:57
Messaggi: 23
Mud: Vagabondo
Non connesso

[size=85]Scusate se rispondo ad un quesito posto mesi fa, ma magari il programmatore in questione non ha ancora trovato risposte, quindi tanto vale provarci ;)

Premetto che lo specifico codice di Lyonesse non lo conosco, quindi baserò la mia risposta su delle considerazioni generali.
(Ciao xantos hai fatto bennissimo a rispondere almeno dopo tanto tempo qualcuno posta qualche risposta qui sembra tutto morto qui:(....)

il vari file codice sorgente di lyonesse mud e un po differenze dai file di codice sorgente del smaug anche perche lyonesse mud come anche dalila mud e un derivato del circle mud che e strutturato in maniera un po diversa dal codice sorgente eseguibile smaug

lyonesse e strutturato in questo modo
ce la cartella Lyonesse con dentro i vari file quali
___________________
|Cartella bin |
|Cartella doc |
|Cartella lib |
|Cartella log |
|Cartella src |
|File autorun |
|File LANCIA |
|File Lyonesse.dsp |
|File Lyonesse.dsw |
|File Lyonesse.leggimi|
|File Lyonesse.opt |
|File Lyonesse |
__________________|
e nella cartella src ci stanno tutti i vari file codici sorgenti di Lyonesse Mud
quali questi file qui di seguito

act.comm.c
act.informative.c
act.item.c
act.movement.c
act.offensive.c
act.other.c
act.social.c
act.wizard.c
alias.c
ban.c
boards.c
boards.h
buildings.c
clan.c
clan.h
class.c
comm.c
comm.h
conf.h
config.c
constants.c
constants.h
db.c
db.h
economy.c
events.c
fight.c
goods.c
graph.c
handler.c
handler.h
house.c
house.h
interpreter.c
interpreter.h
limits.c
magic.c
magic2.c
mail.c
mail.h
mobact.c
modify.c
objects.c
objrandom.c
objrandom.h
obj_trap.c
Parser.c
queue.c
random.c
room_trigger.c
save.c
screen.h
shop.c
shop.h
spec_assign.c
spec_procs.c
spells.c
spells.h
spell_parser.c
stables.c
structs.h
sysdep.h
telnet.h
utils.c
utils.h
vehicles.c
weather.c
wild.info.c
wild.life.c
wild.map.c
wild.ships.c
wilderness.c

da questo link si puo scaricare il codice sorgente eseguibile di lyonesse mud
http://www.mudbytes.net/files/view/809/

riguardante il primo aiuto cioe questo PRIMO AIUTO
======================================
in poche parole vorrei che a seconda della razza che un pg sceglie nasce( la prima volta quando uno si crea il pg) e quando muore il pg che il pg poi risolge in quella determinata locazione
Esempio:(nascita)
Umani= cerchio di pietre umano che si trova a x locazione
Hafling=cerchio di pietre degli hafling che si trova a y locazione
Elfi Neri= cerchio di pietre degli elfi neri che si trova a Z locazione.
con la possibilita che il pg puo scegliere dove risolgere nel cerchio degli elfi o quello degli hafling o quello della sua razza.
======================================
Non ce un file razze ci sta il file class dove ci sono anche le razze.

/**************************************************************************
* # # # ## # # ### ## ## ### http://www.lyonesse.it *
* # # # # # ## # # # # # *
* # # # # # ## ## # # ## ## ## # # ## *
* # # # # # ## # # # # # # # # # # # *
* ### # ## # # ### ## ## ### # # #### ## Ver. 1.0 *
* *
* -Based on CircleMud & Smaug- Copyright (c) 2001-2002 by Mithrandir *
* *
* ********************************************************************** */
/* ************************************************************************
* File: class.c Part of CircleMUD *
* Usage: Source file for class-specific code *
* *
* All rights reserved. See license.doc for complete information. *
* *
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
************************************************************************ */

/*
* This file attempts to concentrate most of the code which must be changed
* in order for new classes to be added. If you're adding a new class,
* you should go through this entire file from beginning to end and add
* the appropriate new special cases for your new class.
*/

#include "conf.h"
#include "sysdep.h"

#include "structs.h"
#include "db.h"
#include "utils.h"
#include "comm.h"
#include "spells.h"
#include "interpreter.h"
#include "constants.h"

extern int siteok_everyone;

OBJ_DATA *obj_to_char(OBJ_DATA *object, CHAR_DATA *ch);
void create_new_spellbook(CHAR_DATA *ch, int type);

/* local functions */
void snoop_check(CHAR_DATA *ch);
int parse_class(char arg);
long find_class_bitvector(char arg);
byte saving_throws(int class_num, int type, int level);
int thaco(int class_num, int level);
void roll_real_abils(CHAR_DATA *ch);
void do_start(CHAR_DATA *ch);
int backstab_mult(int level);
int invalid_class(CHAR_DATA *ch, OBJ_DATA *obj);
const char *title_male(int chclass, int level);
const char *title_female(int chclass, int level);

/* Names first */
const char *class_abbrevs[] =
{
"Mu",
"Cl",
"Th",
"Wa",// guerriero
"So",
"\n"
};

const char *race_abbrevs[] =
{
"&b&1Umano Eliantiriano&0",
"&1Umano Emeriani&0",
"&b&2Elfo di Alwenion&0",
//"&2Elfo di Sinor&0",
"&b&3Elfo Ambrato&0",
//"&3Elfo Selvaggio",
"&b&4Elfo Nero&0", // QUSST'VIIRYN Ousst'viiryn
"&4Nano&0",
//"&b&5Mezzuomo&0",
//"&5Mezzelfo&0",
"&b&6Halfling&0",
"&6Orco&0",
"&b&7Goblin&0",
"\n"
};

const char *pc_class_types[] =
{
"&b&1 Mago&0",
"&b&2 Chierico&0",
"&b&3 Bandito&0",
"&b&4 Guerriero&0",
"&b&5 Stregone&0",
"\n"
};

const char *pc_race_types[] =
{
"&b&1Umano Eliantiriano&0",
"&1Umano Emeriani&0",
"&b&2Elfo di Alwenion&0",
//"&2Elfo di Sinor&0",
"&b&3Elfo Ambrato&0",
//"&3Elfo Selvaggio",
"&b&4Elfo Nero&0", // QUSST'VIIRYN Ousst'viiryn
"&4Nano&0",
//"&b&5Mezzuomo&0",
//"&5Mezzelfo&0",
"&b&6Halfling&0",
"&6Orco&0",
"&b&7Goblin&0",
"\n"
};
const char *pc_hometown[] = {
"Deira",
"Cimmura",
"Lamorka",
"Chyrellos",
"\n"
};
/* The menu for choosing a class in interpreter.c: */
const char *class_menu =
"\r\n"
"&b&4-================&b&1}&3****&b&1(&b&3 O&7 S C E L T A C U L T U R A &b&3 O&b&1)&3****&b&1{&b&4================-&0\r\n"
"\r\n"
"Devi ora scegliere la cultura del tuo personaggio. Puoi trovare la &0\r\n"
"documentazione relativa alle culture nella pagina dell'ambientazione:&0\r\n"
"\r\n"
" http://thegate.landmar.it/bg/ \r\n"
"\r\n"
"&4Culture disponibili per la tua razza/etnia!&7\r\n"
"\r\n"
"Seleziona la classe:&0\r\n"
"&b&1 [M]ago&0\r\n"
"&b&2 [C]hierico&0\r\n"
"&b&3 [B]andito&0\r\n"
"&b&4 [G]uerriero&0\r\n"
"&b&5 [S]tregone&0\r\n"
"\r\n"
"&1La cultura attualmente scelta viene indicata con il simbolo &b&3^&7.\r\n";
const char *race_menu =
"\r\n"
"&b&4-================&b&1}&3****&b&1(&b&3 O&7 S C E L T A R A Z Z A &b&3 O&b&1)&3****&b&1{&b&4================-&0\r\n"
"\r\n"
"Devi ora scegliere la razza del tuo personaggio. Puoi trovare la &0\r\n"
"documentazione relativa alle razze nella pagina dell'ambientazione:&0\r\n"
"\r\n"
" http://LyonesseMud.it/bg/ \r\n"
"\r\n"
"&4Razze disponibili!&7\r\n"
"\r\n"
"Seleziona la razza:&0\r\n"
"&7 1 &b&1) Umano Eliantiriano&0\r\n"
"&7 2 &b&1) Umano Emeriano&0\r\n"
"&7 3 &b&1) Elfo di Alwenion&0\r\n"
"&7 4 &b&1) Elfo Ambrato&0\r\n"
"&7 5 &b&1) Elfo Nero&0\r\n" // QUSST'VIIRYN Ousst'viiryn
"&7 6 &b&1) Nano&0\r\n"
"&7 7 &b&1) Halfling&0\r\n"
"&7 8 &b&1) Orco&0&0\r\n"
"&7 9 &b&1) Goblin&0\r\n"
"\r\n"
"&1La razza attualmente scelta viene indicata con il simbolo &b&3^&7.\r\n";
const char *hometown_menu =
"\r\n"
"Ora puoi scegliere la tua citta' natale. Pensaci bene perche'\r\n"
"ogni Regno ha leggi e usanze diverse che guideranno il tuo\r\n"
"destino finche' non sarai forte abbastanza.\r\n"
"\r\n"
"[D]eira ----\r\n" // Esempio Prima Citta'
" Capitale del Regno \r\n"
"[C]immura - Capitale del giovane regno \r\n" // Esempio Seconda Citta'
" l'anima indipendente e libertaria.\r\n"
"[L]amorka - Capitale del fiorente regno di Sendaria\r\n" // Esempio Terza Citta'
" sul mare a sud ed est.\r\n"
"Ch[y]rellos La citta' santa della Daresia\r\n" // Esempio Quarta Citta'
" Cattedrale e centro di riferimento per i quattro ordini\r\n"
"Che citta scegli?\r\n";
/*
* The code to interpret a class letter -- used in interpreter.c when a
* new character is selecting a class and by 'set class' in act.wizard.c.
*/
int parse_class(char arg)
{
arg = LOWER(arg);

switch (arg)
{
case 'm': return CLASS_MAGIC_USER;
case 'c': return CLASS_CLERIC;
case 'b': return CLASS_THIEF;
case 'g': return CLASS_WARRIOR;
case 's': return CLASS_SORCERER;
default: return CLASS_UNDEFINED;
}
}


int parse_race(char arg)
{
switch (arg)
{
case '1': return RACE_UMANO_ELIANTIRIANO;
case '2': return RACE_UMANO_EMERIANO;
case '3': return RACE_ELFO_DI_ALWENION;
case '4': return RACE_ELFO_DI_AMBRATO;
case '5': return RACE_ELFO_NERO; // QUSST'VIIRYN Ousst'viiryn
case '6': return RACE_NANO;
case '7': return RACE_HALFLING;
case '8': return RACE_ORCO;
case '9': return RACE_GOBLIN;
default : return RACE_UNDEFINED;
}
}
int parse_hometown(char arg)
{
arg = LOWER(arg);

switch (arg) {
case 'd':
return 0;
break;
case 'j': // JIROCH - Non e' valida alla nascita !!!!
return 1;
break;
case 'c':
return 2;
break;
case 'y':
return 3;
break;
case 'l':
return 4;
break;
default:
return 0;
break;
}
}
/*pezzo di codice aggiunto[NON COMBATIBILE:-( ] da un altro mud basato sullo stesso codice sorgente lyonesse mud(circle mud)
int parse_hometown(char arg)
{
switch (arg)
{
case 'd': return HOMETOWN_DEIRA;
case 'j': return HOMETOWN_CIMMURA;
case 'c': return HOMETOWN_LAMORKA;
case 'y': return HOMETOWN_CHYRELLOS;
}
}*/
/*
* bitvectors (i.e., powers of two) for each class, mainly for use in
* do_who and do_users. Add new classes at the end so that all classes
* use sequential powers of two (1 << 0, 1 << 1, 1 << 2, 1 << 3, 1 << 4,
* 1 << 5, etc.
*/
long find_class_bitvector(char arg)
{
arg = LOWER(arg);

switch (arg)
{
case 'm': return (1 << CLASS_MAGIC_USER);
case 'c': return (1 << CLASS_CLERIC);
case 'b': return (1 << CLASS_THIEF);
case 'g': return (1 << CLASS_WARRIOR);
case 's': return (1 << CLASS_SORCERER);
default: return 0;
}
}


long find_race_bitvector(char arg)
{
switch (arg)
{
case '1': return (1 << RACE_UMANO_ELIANTIRIANO);
case '2': return (1 << RACE_UMANO_EMERIANO);
case '3': return (1 << RACE_ELFO_DI_ALWENION);
case '4': return (1 << RACE_ELFO_DI_AMBRATO);
case '5': return (1 << RACE_ELFO_NERO); // QUSST'VIIRYN Ousst'viiryn
case '6': return (1 << RACE_NANO);
case '7': return (1 << RACE_HALFLING);
case '8': return (1 << RACE_ORCO);
case '9': return (1 << RACE_GOBLIN);
default : return (0);
}
}
/*pezzo di codice aggiunto[NON COMBATIBILE:-( ] da un altro mud basato sullo stesso codice sorgente lyonesse mud(circle mud)
long find_hometown_bitvector(char arg)
{
switch (arg)
{
case 'd': return (1 << HOMETOWN_DEIRA);
case 'j': return (1 << HOMETOWN_CIMMURA);
case 'c': return (1 << HOMETOWN_LAMORKA);
case 'y': return (1 << HOMETOWN_CHYRELLOS);
default : return (0);
}
}*/
/*
* These are definitions which control the guildmasters for each class.
*
* The first field (top line) controls the highest percentage skill level
* a character of the class is allowed to attain in any skill. (After
* this level, attempts to practice will say "You are already learned in
* this area."
*
* The second line controls the maximum percent gain in learnedness a
* character is allowed per practice -- in other words, if the random
* die throw comes out higher than this number, the gain will only be
* this number instead.
*
* The third line controls the minimu percent gain in learnedness a
* character is allowed per practice -- in other words, if the random
* die throw comes out below this number, the gain will be set up to
* this number.
*
* The fourth line simply sets whether the character knows 'spells'
* or 'skills'. This does not affect anything except the message given
* to the character when trying to practice (i.e. "You know of the
* following spells" vs. "You know of the following skills"
*/

#define SPELL 0
#define SKILL 1

/* #define LEARNED_LEVEL 0 % known which is considered "learned" */
/* #define MAX_PER_PRAC 1 max percent gain in skill per practice */
/* #define MIN_PER_PRAC 2 min percent gain in skill per practice */
/* #define PRAC_TYPE 3 should it say 'spell' or 'skill'? */

int prac_params[4][NUM_CLASSES] =
{
/* MAG CLE THE WAR, SOR */
{ 95, 95, 85, 80, 95 }, /* learned level */
{ 100, 100, 12, 12, 100 }, /* max per practice */
{ 25, 25, 0, 0, 25 }, /* min per practice */
{ SPELL, SPELL, SKILL, SKILL, SPELL } /* prac name */
};


/*
* ...And the appropriate rooms for each guildmaster/guildguard; controls
* which types of people the various guildguards let through. i.e., the
* first line shows that from room 3017, only MAGIC_USERS are allowed
* to go south.
*
* Don't forget to visit spec_assign.c if you create any new mobiles that
* should be a guild master or guard so they can act appropriately. If you
* "recycle" the existing mobs that are used in other guilds for your new
* guild, then you don't have to change that file, only here.
*/
int guild_info[][3] =
{
/* Midgaard */
{CLASS_MAGIC_USER, 3017, SCMD_SUD},
{CLASS_SORCERER, 3017, SCMD_SUD},
{CLASS_CLERIC, 3004, SCMD_NORD},
{CLASS_THIEF, 3027, SCMD_EST},
{CLASS_WARRIOR, 3021, SCMD_EST},

/* Brass Dragon */
{-999 /* all */ , 5065, SCMD_OVEST},

/* this must go last -- add new guards above! */
{-1, -1, -1}
};


/* Order of saving throws: PARA, ROD, PETRI, BREATH, SPELL */
/* This matrix determines the base saving throw for each */
/* class (i.e. the saving throw needed at level 1). */
int saving_throw_base[NUM_CLASSES][5] =
{
{ 70, 55, 65, 75, 60 }, /* MU */
{ 60, 70, 65, 80, 75 }, /* CL */
{ 65, 70, 60, 80, 75 }, /* TH */
{ 70, 80, 75, 85, 85 }, /* WA */
{ 70, 55, 65, 75, 60 } /* SO */
};

/* This is the rate at which saving throws improve, *10 */
/* So, if a saving throw improves at a rate of 1.4 per */
/* level, it is entered into this matrix as -14. */
int saving_throw_improve[NUM_CLASSES][5] =
{
{ -14, -16, -17, -17, -17 }, /* MU */
{ -16, -15, -15, -15, -15 }, /* CL */
{ -10, -20, -10, -10, -20 }, /* TH */
{ -21, -21, -21, -25, -21 }, /* WA */
{ -14, -16, -17, -17, -17 } /* SO */
};

/*
* Saving throws for:
* MCTW
* PARA, ROD, PETRI, BREATH, SPELL
* Levels 0-40
*
* Do not forget to change extern declaration in magic.c if you add to this.
*/

byte saving_throws(int class_num, int type, int level)
{
float mod;

mod = (saving_throw_improve[class_num][type] / 10.0) * (level - 1);

return (saving_throw_base[class_num][type] + mod);
}

/* THAC0 for classes and levels. (To Hit Armor Class 0) */
int thaco(int class_num, int level)
{
int t = 100; /* Default THAC0 */

if (level > 0)
{
switch (class_num)
{
case CLASS_MAGIC_USER: t = 20 - ((level - 1) / 3); break;
case CLASS_CLERIC: t = 20 - (((level - 1) / 3) * 2); break;
case CLASS_THIEF: t = 20 - ((level - 1) / 2); break;
case CLASS_WARRIOR: t = 20 - (level - 1); break;
case CLASS_SORCERER: t = 20 - ((level - 1) / 3); break;
default:
log("SYSERR: Unknown class in thac0 chart."); break;
}
}

if (t < 1) /* Nobody can have a THAC0 better than 1! */
t = 1;

return (t);
}


/*
* Roll the 6 stats for a character... each stat is made of the sum of
* the best 3 out of 4 rolls of a 6-sided die. Each class then decides
* which priority will be given for the best to worst stats.
*/
void roll_real_abils(CHAR_DATA *ch)
{
int i, j, k, temp;
ubyte table[6];
ubyte rolls[4];

for (i = 0; i < 6; i++)
table[i] = 0;

for (i = 0; i < 6; i++)
{
for (j = 0; j < 4; j++)
rolls[j] = number(1, 6);

temp = rolls[0] + rolls[1] + rolls[2] + rolls[3] -
MIN(rolls[0], MIN(rolls[1], MIN(rolls[2], rolls[3])));

for (k = 0; k < 6; k++)
if (table[k] < temp)
{
temp ^= table[k];
table[k] ^= temp;
temp ^= table[k];
}
}

switch (GET_CLASS(ch))
{
case CLASS_MAGIC_USER:
ch->real_abils.intel = table[0];
ch->real_abils.wis = table[1];
ch->real_abils.dex = table[2];
ch->real_abils.str = table[3];
ch->real_abils.con = table[4];
ch->real_abils.cha = table[5];
break;
case CLASS_CLERIC:
ch->real_abils.wis = table[0];
ch->real_abils.intel = table[1];
ch->real_abils.str = table[2];
ch->real_abils.dex = table[3];
ch->real_abils.con = table[4];
ch->real_abils.cha = table[5];
break;
case CLASS_THIEF:
ch->real_abils.dex = table[0];
ch->real_abils.str = table[1];
ch->real_abils.con = table[2];
ch->real_abils.intel = table[3];
ch->real_abils.wis = table[4];
ch->real_abils.cha = table[5];
break;
case CLASS_WARRIOR:
ch->real_abils.str = table[0];
ch->real_abils.dex = table[1];
ch->real_abils.con = table[2];
ch->real_abils.wis = table[3];
ch->real_abils.intel = table[4];
ch->real_abils.cha = table[5];
break;
case CLASS_SORCERER:
ch->real_abils.intel = table[0];
ch->real_abils.dex = table[1];
ch->real_abils.str = table[2];
ch->real_abils.wis = table[3];
ch->real_abils.con = table[4];
ch->real_abils.cha = table[5];
}

switch (GET_RACE(ch))
{
case RACE_UMANO_ELIANTIRIANO:
break;
case RACE_UMANO_EMERIANO:
break;
case RACE_ELFO_DI_ALWENION:
ch->real_abils.dex += 1;
ch->real_abils.con -= 1;
break;
case RACE_ELFO_DI_AMBRATO:
ch->real_abils.dex += 1;
ch->real_abils.con -= 1;
break;
case RACE_ELFO_NERO:
ch->real_abils.dex += 1;
ch->real_abils.con -= 1;
break;
case RACE_NANO:
ch->real_abils.con += 2;
ch->real_abils.intel -= 1;
ch->real_abils.cha -= 1;
break;
case RACE_HALFLING:
ch->real_abils.con += 2;
ch->real_abils.intel -= 1;
ch->real_abils.cha -= 1;
case RACE_ORCO:
break;
case RACE_GOBLIN:
break;
}

ch->aff_abils = ch->real_abils;
}


/* Some initializations for characters, including initial skills */
void do_start(CHAR_DATA *ch)
{
OBJ_DATA *obj;
int i;
obj_vnum give_obj[] = {2542, 2544, 3010, 3022, 3030, 3042, 3071, 3076, 3081, 4328, 3104, 3221, 4002, 5423, 5441, -1};
//obj_vnum give_obj[] = {3015, 3015, -1};
/*
Oggetti di partenza alla creazione del personaggio base

N vnum oggetto N Peso in Libbre

1 3015 un pezzo di carne 1 1--- Libbre
2 3015 un pezzo di carne 2 1--- Libbre
* ---- ------------------------------------ -- 2-/-- Libbre Totali

Oggetti di partenza alla creazione del personaggio completo
( tutti gli oggetti nel inventario)e non nell'equip.

N Vnum Oggetto N Peso in Libbre

1 2542 Un paio di grandi stivali 1 1???
2 2544 Uno Zaino di Cuoio 2 2--- Libbre
3 3010 Un pezzo di pane 3 1???
4 3022 Una spada lunga 4 5--- Libbre
5 3030 Una torcia 5 1--- Libbre
6 3042 Uno scudo di legno 6 5--- Libbre
7 3071 Un paio di guanti di cuoio 7 1--- Libbre
8 3076 Un elmetto di cuoio 8 3--- Libbre
9 3081 Un paio di pantaloni di cotone 9 1--- Libbre
10 3104 Una borraccia acqua 10 9--- Libbre
11 3221 Una razione di frutta essiccata 11 1--- Libbre
12 4002 Una some di 500 monete 12 2???
13 4328 Un paio di bracciali di cuoio 13 4--- Libbre
14 5423 Una Giacca di pelle 14 1???
15 5441 Un filoncino di pane 15 1--- Libbre
* ---- ------------------------------ -- 34/38 Libbre Totali
esempio di un pg appena creato in mud con 36% 40 libbre.
*/

GET_LEVEL(ch) = 1;
GET_TOT_LEVEL(ch) = 1;
GET_EXP(ch) = 1;

set_title(ch, NULL);

switch (GET_CLASS(ch))
{
case CLASS_MAGIC_USER:
SET_SKILL(ch, SKILL_AGGUATO, 20);
SET_SKILL(ch, SKILL_SNEAK, 5);
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
SET_SKILL(ch, SKILL_CALCIARE, 5);
SET_SKILL(ch, SKILL_CAVALCARE, 60);
SET_SKILL(ch, SKILL_TRACK, 20);
SET_SKILL(ch, SKILL_SCASSINARE, 10);
SET_SKILL(ch, SKILL_HIDE, 20);
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
SET_SKILL(ch, SKILL_TAME, 50);
//SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
//SET_SKILL(ch, SKILL_DAGGERS, 15);
//SET_SKILL(ch, SKILL_BLUDGEONS, 15);
SET_SKILL(ch, SKILL_STUDY, 15);
SET_SKILL(ch, SKILL_READ_MAGIC, 10);
break;

case CLASS_CLERIC:

SET_SKILL(ch, SKILL_AGGUATO, 20);
SET_SKILL(ch, SKILL_SNEAK, 5);
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
SET_SKILL(ch, SKILL_CALCIARE, 5);
SET_SKILL(ch, SKILL_CAVALCARE, 60);
SET_SKILL(ch, SKILL_TRACK, 20);
SET_SKILL(ch, SKILL_SCASSINARE, 10);
SET_SKILL(ch, SKILL_HIDE, 20);
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
SET_SKILL(ch, SKILL_TAME, 50);
//SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
//SET_SKILL(ch, SKILL_DAGGERS, 15);
//SET_SKILL(ch, SKILL_BLUDGEONS, 15);
SET_SKILL(ch, SKILL_STUDY, 10);
SET_SKILL(ch, SKILL_READ_MAGIC, 10);
break;

case CLASS_WARRIOR:
SET_SKILL(ch, SKILL_AGGUATO, 20);
SET_SKILL(ch, SKILL_SNEAK, 5);
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
SET_SKILL(ch, SKILL_CALCIARE, 5);
SET_SKILL(ch, SKILL_CAVALCARE, 60);
SET_SKILL(ch, SKILL_TRACK, 20);
SET_SKILL(ch, SKILL_SCASSINARE, 10);
SET_SKILL(ch, SKILL_HIDE, 20);
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
SET_SKILL(ch, SKILL_TAME, 50);
//SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
//SET_SKILL(ch, SKILL_DAGGERS, 15);
//SET_SKILL(ch, SKILL_BLUDGEONS, 15);
SET_SKILL(ch, SKILL_STUDY, 10);
SET_SKILL(ch, SKILL_NAVIGATION, 15);
break;

case CLASS_THIEF:
SET_SKILL(ch, SKILL_AGGUATO, 20);
SET_SKILL(ch, SKILL_SNEAK, 5);
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
SET_SKILL(ch, SKILL_CALCIARE, 5);
SET_SKILL(ch, SKILL_CAVALCARE, 60);
SET_SKILL(ch, SKILL_TRACK, 20);
SET_SKILL(ch, SKILL_SCASSINARE, 10);
SET_SKILL(ch, SKILL_HIDE, 20);
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
SET_SKILL(ch, SKILL_TAME, 50);
//SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
//SET_SKILL(ch, SKILL_DAGGERS, 15);
//SET_SKILL(ch, SKILL_BLUDGEONS, 15);
SET_SKILL(ch, SKILL_STUDY, 10);
break;

case CLASS_SORCERER:
SET_SKILL(ch, SKILL_AGGUATO, 20);
SET_SKILL(ch, SKILL_SNEAK, 5);
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
SET_SKILL(ch, SKILL_CALCIARE, 5);
SET_SKILL(ch, SKILL_CAVALCARE, 60);
SET_SKILL(ch, SKILL_TRACK, 20);
SET_SKILL(ch, SKILL_SCASSINARE, 10);
SET_SKILL(ch, SKILL_HIDE, 20);
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
SET_SKILL(ch, SKILL_TAME, 50);
//SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
//SET_SKILL(ch, SKILL_DAGGERS, 15);
//SET_SKILL(ch, SKILL_BLUDGEONS, 15);
SET_SKILL(ch, SKILL_STUDY, 10);
SET_SKILL(ch, SKILL_READ_MAGIC, 15);
create_new_spellbook(ch, BOOK_TRAVELLING);
break;
}

advance_level(ch);
sprintf(buf, "%s avanzi di livello %d", GET_NAME(ch), GET_LEVEL(ch));
mudlog(buf, BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);

GET_HIT(ch) = GET_MAX_HIT(ch);
GET_MANA(ch) = GET_MAX_MANA(ch);
GET_MOVE(ch) = GET_MAX_MOVE(ch);

//pezzo di codice preso dal file sorgente( che se si vuole modificare il tempo alla fame e alla sete bisogna andare nei seguenti file act.wizard.c, limits.c, act.informative.c, act.item.c, db.c.

//fame = 300 Minuti '5 Ore' ( Mud )
//sete = 180 Minuti '3 Ore' ( Mud )

GET_COND(ch, THIRST) = 96;
GET_COND(ch, FULL) = 96;
GET_COND(ch, DRUNK) = 0;

SET_BIT(PRF_FLAGS(ch), PRF_AUTOEXIT);
// SET_BIT(PRF_FLAGS(ch), PRF_AUTODIR);
SET_BIT(PRF_FLAGS(ch), PRF_DISPHP);
SET_BIT(PRF_FLAGS(ch), PRF_DISPMANA);
SET_BIT(PRF_FLAGS(ch), PRF_DISPMOVE);
SET_BIT(PRF_FLAGS(ch), PRF_COLOR_1);
SET_BIT(PRF_FLAGS(ch), PRF_COLOR_2);

ch->player.time.played = 0;
ch->player.time.logon = time(0);

if (siteok_everyone)
SET_BIT(PLR_FLAGS(ch), PLR_SITEOK);

SET_BIT(PRF_FLAGS(ch), PRF_COLOR_1);
SET_BIT(PRF_FLAGS(ch), PRF_COLOR_2);

/* give them something to start with */
for (i = 0; give_obj[i] != -1; i++)
{
obj = read_object(give_obj[i], VIRTUAL);
obj_to_char(obj, ch);
}
}



/*
* This function controls the change to maxmove, maxmana, and maxhp for
* each class every time they gain a level.
*/
void advance_level(CHAR_DATA *ch)
{
int add_hp, add_mana = 0, add_move = 0, i;

add_hp = con_app[GET_CON(ch)].hitp;

switch (GET_CLASS(ch))
{
case CLASS_MAGIC_USER:
add_hp += number(6, 16); // add_hp += number(3, 8);
add_mana = number(GET_LEVEL(ch), 1.5 * GET_LEVEL(ch)); //
add_mana = MIN(add_mana, 10); //
add_move = number(0, 6); // add_move = number(0, 3);
GET_PRACTICES(ch) += 4;
break;

case CLASS_CLERIC:
add_hp += number(10, 20); // add_hp += number(5, 10);
add_mana = number(GET_LEVEL(ch), 1.5 * GET_LEVEL(ch)); //
add_mana = MIN(add_mana, 10); //
add_move = number(4, 10); // add_move = number(2, 5);
GET_PRACTICES(ch) += 4;
break;

case CLASS_THIEF:
add_hp += number(14, 26); // add_hp += number(7, 13);
add_mana = 0; //
add_move = number(6, 12); // add_move = number(3, 6);
GET_PRACTICES(ch) += 4;
break;

case CLASS_WARRIOR:
add_hp += number(20, 30); // add_hp += number(10, 15);
add_mana = 0; //
add_move = number(6, 10); // add_move = number(3, 5);
GET_PRACTICES(ch) += 4;
break;

case CLASS_SORCERER:
add_hp += number(8, 18); // add_hp += number(4, 9);
add_mana = 0; //
add_move = number(2, 8); // add_move = number(1, 4);
GET_PRACTICES(ch) += 4;
break;
}

GET_MAX_HIT(ch) += MAX(1, add_hp);
GET_MAX_MOVE(ch) += MAX(1, add_move);
GET_MAX_MANA(ch) += add_mana;

if (IS_MAGIC_USER(ch) || IS_CLERIC(ch) || IS_SORCERER(ch))
GET_PRACTICES(ch) += MAX(2, wis_app[GET_WIS(ch)].bonus);
else
GET_PRACTICES(ch) += MIN(2, MAX(1, wis_app[GET_WIS(ch)].bonus));

if (GET_LEVEL(ch) >= LVL_IMMORT)
{
for (i = 0; i < 3; i++)
GET_COND(ch, i) = (char) -1;
SET_BIT(PRF_FLAGS(ch), PRF_HOLYLIGHT);
}

snoop_check(ch);
save_char(ch, NULL);
}


/*
* This simply calculates the backstab multiplier based on a character's
* level. This used to be an array, but was changed to be a function so
* that it would be easier to add more levels to your MUD. This doesn't
* really create a big performance hit because it's not used very often.
*/
int backstab_mult(int level)
{
if (level <= 0) return (1); /* livello 0 */
else if (level <= 7) return (2); /* livello 1 - 7 */
else if (level <= 13) return (3); /* livello 8 - 13 */
else if (level <= 20) return (4); /* livello 14 - 20 */
else if (level <= 28) return (5); /* livello 21 - 28 */
else if (level < LVL_IMMORT) return (6); /* tutti i rimandenti livelli mortali */
else return (20); /* immortali */
}


/*
* invalid_class is used by handler.c to determine if a piece of equipment is
* usable by a particular class, based on the ITEM_ANTI_{class} bitvectors.
*/
int invalid_class(CHAR_DATA *ch, OBJ_DATA *obj)
{
if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_MAGIC_USER) && IS_MAGIC_USER(ch))
return (TRUE);

if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_CLERIC) && IS_CLERIC(ch))
return (TRUE);

if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_THIEF) && IS_THIEF(ch))
return (TRUE);

//if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_WARRIOR) && IS_WARRIOR(ch))
// return (TRUE);

if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_SORCERER) && IS_SORCERER(ch))
return (TRUE);

return (FALSE);
}


int invalid_race(CHAR_DATA *ch, OBJ_DATA *obj)
{
//if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_UMANO) && IS_UMANO(ch))
//return (TRUE);

//if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_ELFO) && IS_ELFO(ch))
//return (TRUE);

//if (IS_SET(GET_OBJ_ANTI(obj), ITEM_ANTI_NANO) && IS_NANO(ch))
//return (TRUE);

return (FALSE);
}

/*
* SPELLS AND SKILLS. This area defines which spells are assigned to
* which classes, and the minimum level the character must be to use
* the spell or skill.
*/
void init_spell_levels(void)
{
/* MAGHI */

spell_level(SKILL_AGGUATO, CLASS_MAGIC_USER, 1);
spell_level(SKILL_SNEAK, CLASS_MAGIC_USER, 1);
spell_level(SKILL_SBILANCIARE, CLASS_MAGIC_USER, 1);
spell_level(SKILL_CALCIARE, CLASS_MAGIC_USER, 1);
spell_level(SKILL_CAVALCARE, CLASS_MAGIC_USER, 1);
spell_level(SKILL_TRACK, CLASS_MAGIC_USER, 1);
spell_level(SKILL_SCASSINARE, CLASS_MAGIC_USER, 1);
spell_level(SKILL_HIDE, CLASS_MAGIC_USER, 1);
spell_level(SKILL_BORSEGGIARE, CLASS_MAGIC_USER, 1);
//spell_level(SPELL_CHARM, CLASS_MAGIC_USER, 1);
spell_level(SKILL_TAME, CLASS_MAGIC_USER, 1);
spell_level(SPELL_SENSE_LIFE, CLASS_MAGIC_USER, 1);
spell_level(SKILL_WEAPON_SWORDS, CLASS_MAGIC_USER, 1); // Spade
spell_level(SKILL_WEAPON_DAGGERS, CLASS_MAGIC_USER, 1); // Pugnali
spell_level(SKILL_WEAPON_BLUDGEONS, CLASS_MAGIC_USER, 1); // mazze
//spell_level(STUDY, CLASS_MAGIC_USER, 1);
spell_level(SPELL_MAGIC_MISSILE, CLASS_MAGIC_USER, 1);
spell_level(SPELL_SHIELD, CLASS_MAGIC_USER, 1);
spell_level(SPELL_DETECT_INVIS, CLASS_MAGIC_USER, 2);
spell_level(SPELL_DETECT_MAGIC, CLASS_MAGIC_USER, 2);
spell_level(SPELL_CHILL_TOUCH, CLASS_MAGIC_USER, 3);
spell_level(SPELL_INFRAVISION, CLASS_MAGIC_USER, 3);
spell_level(SPELL_INVISIBLE, CLASS_MAGIC_USER, 4);
spell_level(SPELL_ARMOR, CLASS_MAGIC_USER, 4);
spell_level(SPELL_BURNING_HANDS, CLASS_MAGIC_USER, 5);
spell_level(SPELL_LOCATE_OBJECT, CLASS_MAGIC_USER, 6);
spell_level(SPELL_STRENGTH, CLASS_MAGIC_USER, 6);
spell_level(SPELL_SHOCKING_GRASP, CLASS_MAGIC_USER, 7);
spell_level(SPELL_SLEEP, CLASS_MAGIC_USER, 8);
spell_level(SPELL_LIGHTNING_BOLT, CLASS_MAGIC_USER, 9);
spell_level(SPELL_BLINDNESS, CLASS_MAGIC_USER, 9);
spell_level(SPELL_DETECT_POISON, CLASS_MAGIC_USER, 10);
spell_level(SPELL_COLOR_SPRAY, CLASS_MAGIC_USER, 11);
spell_level(SPELL_ACID_ARROW, CLASS_MAGIC_USER, 12);
spell_level(SPELL_ENERGY_DRAIN, CLASS_MAGIC_USER, 13);
spell_level(SPELL_CURSE, CLASS_MAGIC_USER, 14);
spell_level(SPELL_POISON, CLASS_MAGIC_USER, 14);
spell_level(SPELL_FIREBALL, CLASS_MAGIC_USER, 15);
spell_level(SPELL_FLASH, CLASS_MAGIC_USER, 18);
spell_level(SPELL_PARALYSIS, CLASS_MAGIC_USER, 20);
spell_level(SPELL_CLONE, CLASS_MAGIC_USER, 22);
spell_level(SPELL_STONE_SKIN, CLASS_MAGIC_USER, 25);
spell_level(SPELL_SHOCKWAVE, CLASS_MAGIC_USER, 27);
spell_level(SPELL_INCENDIARY_CLOUD, CLASS_MAGIC_USER, 30);

/* CHIERICO */

spell_level(SKILL_AGGUATO, CLASS_CLERIC, 1);
spell_level(SKILL_SNEAK, CLASS_CLERIC, 1);
spell_level(SKILL_SBILANCIARE, CLASS_CLERIC, 1);
spell_level(SKILL_CALCIARE, CLASS_CLERIC, 1);
spell_level(SKILL_CAVALCARE, CLASS_CLERIC, 1);
spell_level(SKILL_TRACK, CLASS_CLERIC, 1);
spell_level(SKILL_SCASSINARE, CLASS_CLERIC, 1);
spell_level(SKILL_HIDE, CLASS_CLERIC, 1);
spell_level(SKILL_BORSEGGIARE, CLASS_CLERIC, 1);
//spell_level(SPELL_CHARM, CLASS_CLERIC, 1);
spell_level(SKILL_TAME, CLASS_CLERIC, 1);
spell_level(SPELL_SENSE_LIFE, CLASS_CLERIC, 1);
spell_level(SKILL_WEAPON_SWORDS, CLASS_CLERIC, 1); // Spade
spell_level(SKILL_WEAPON_DAGGERS, CLASS_CLERIC, 1); // Pugnali
spell_level(SKILL_WEAPON_BLUDGEONS, CLASS_CLERIC, 1); // mazze
//spell_level(STUDY, CLASS_CLERIC, 1);
spell_level(SPELL_CURE_LIGHT, CLASS_CLERIC, 1);
spell_level(SPELL_ARMOR, CLASS_CLERIC, 1);
spell_level(SPELL_CREATE_FOOD, CLASS_CLERIC, 2);
spell_level(SPELL_CREATE_WATER, CLASS_CLERIC, 2);
spell_level(SPELL_DETECT_POISON, CLASS_CLERIC, 3);
spell_level(SPELL_DETECT_ALIGN, CLASS_CLERIC, 4);
spell_level(SPELL_CURE_BLIND, CLASS_CLERIC, 4);
spell_level(SPELL_BLESS, CLASS_CLERIC, 5);
spell_level(SPELL_DETECT_INVIS, CLASS_CLERIC, 6);
spell_level(SPELL_BLINDNESS, CLASS_CLERIC, 6);
spell_level(SPELL_INFRAVISION, CLASS_CLERIC, 7);
spell_level(SPELL_PROT_FROM_EVIL, CLASS_CLERIC, 8);
spell_level(SPELL_POISON, CLASS_CLERIC, 8);
spell_level(SPELL_GROUP_ARMOR, CLASS_CLERIC, 9);
spell_level(SPELL_CURE_CRITIC, CLASS_CLERIC, 9);
spell_level(SPELL_SUMMON, CLASS_CLERIC, 10);
spell_level(SPELL_REMOVE_POISON, CLASS_CLERIC, 10);
spell_level(SPELL_REGENERATION, CLASS_CLERIC, 10);
spell_level(SPELL_WORD_OF_RECALL, CLASS_CLERIC, 12);
spell_level(SPELL_EARTHQUAKE, CLASS_CLERIC, 12);
spell_level(SPELL_FLASH, CLASS_CLERIC, 13);
spell_level(SPELL_DISPEL_EVIL, CLASS_CLERIC, 14);
spell_level(SPELL_DISPEL_GOOD, CLASS_CLERIC, 14);
spell_level(SPELL_SANCTUARY, CLASS_CLERIC, 15);
spell_level(SPELL_CALL_LIGHTNING, CLASS_CLERIC, 15);
spell_level(SPELL_HEAL, CLASS_CLERIC, 16);
spell_level(SPELL_CONTROL_WEATHER, CLASS_CLERIC, 17);
spell_level(SPELL_HARM, CLASS_CLERIC, 19);
spell_level(SPELL_GROUP_HEAL, CLASS_CLERIC, 22);
spell_level(SPELL_REMOVE_CURSE, CLASS_CLERIC, 26);

/* BANDITO */
spell_level(SKILL_AGGUATO, CLASS_THIEF, 1);
spell_level(SKILL_SNEAK, CLASS_THIEF, 1);
spell_level(SKILL_SBILANCIARE, CLASS_THIEF, 1);
spell_level(SKILL_CALCIARE, CLASS_THIEF, 1);
spell_level(SKILL_CAVALCARE, CLASS_THIEF, 1);
spell_level(SKILL_TRACK, CLASS_THIEF, 1);
spell_level(SKILL_SCASSINARE, CLASS_THIEF, 1);
spell_level(SKILL_HIDE, CLASS_THIEF, 1);
spell_level(SKILL_BORSEGGIARE, CLASS_THIEF, 1);
//spell_level(SPELL_CHARM, CLASS_THIEF, 1);
spell_level(SKILL_TAME, CLASS_THIEF, 1);
spell_level(SPELL_SENSE_LIFE, CLASS_THIEF, 1);
spell_level(SKILL_WEAPON_SWORDS, CLASS_THIEF, 1); // Spade
spell_level(SKILL_WEAPON_DAGGERS, CLASS_THIEF, 1); // Pugnali
spell_level(SKILL_WEAPON_BLUDGEONS, CLASS_THIEF, 1); // mazze
//spell_level(STUDY, CLASS_THIEF, 1);
spell_level(SKILL_DISARM_TRAPS, CLASS_THIEF, 9);

/* GUERRIERO */

spell_level(SKILL_AGGUATO, CLASS_WARRIOR, 1);
spell_level(SKILL_SNEAK, CLASS_WARRIOR, 1);
spell_level(SKILL_SBILANCIARE, CLASS_WARRIOR, 1);
spell_level(SKILL_CALCIARE, CLASS_WARRIOR, 1);
spell_level(SKILL_CAVALCARE, CLASS_WARRIOR, 1);
spell_level(SKILL_TRACK, CLASS_WARRIOR, 1);
spell_level(SKILL_SCASSINARE, CLASS_WARRIOR, 1);
spell_level(SKILL_HIDE, CLASS_WARRIOR, 1);
spell_level(SKILL_BORSEGGIARE, CLASS_WARRIOR, 1);
spell_level(SKILL_RESCUE, CLASS_WARRIOR, 1);
spell_level(SKILL_TAME, CLASS_WARRIOR, 1);
spell_level(SPELL_SENSE_LIFE, CLASS_WARRIOR, 1);
//spell_level(STUDY, CLASS_WARRIOR, 1);
//spell_level(SPELL_CHARM, CLASS_WARRIOR, 1);
//spell_level(SKILL_NAVIGATION, CLASS_WARRIOR, PROF_LVL_START);
spell_level(SKILL_WEAPON_BOW, CLASS_WARRIOR, PROF_LVL_START);
spell_level(SKILL_WEAPON_SLING, CLASS_WARRIOR, PROF_LVL_START);
spell_level(SKILL_WEAPON_CROSSBOW, CLASS_WARRIOR, PROF_LVL_START);
spell_level(SKILL_WEAPON_SWORDS, CLASS_WARRIOR, 1); // Spade
spell_level(SKILL_WEAPON_DAGGERS, CLASS_WARRIOR, 1); // Pugnali
spell_level(SKILL_WEAPON_WHIPS, CLASS_WARRIOR, PROF_LVL_START);
spell_level(SKILL_WEAPON_TALONOUS_ARMS, CLASS_WARRIOR, PROF_LVL_START);
spell_level(SKILL_WEAPON_BLUDGEONS, CLASS_WARRIOR, 1); // mazze
spell_level(SKILL_WEAPON_EXOTICS, CLASS_WARRIOR, PROF_LVL_START);

/* STREGONE */

spell_level(SKILL_AGGUATO, CLASS_SORCERER, 1);
spell_level(SKILL_SNEAK, CLASS_SORCERER, 1);
spell_level(SKILL_SBILANCIARE, CLASS_SORCERER, 1);
spell_level(SKILL_CALCIARE, CLASS_SORCERER, 1);
spell_level(SKILL_CAVALCARE, CLASS_SORCERER, 1);
spell_level(SKILL_TRACK, CLASS_SORCERER, 1);
spell_level(SKILL_SCASSINARE, CLASS_SORCERER, 1);
spell_level(SKILL_HIDE, CLASS_SORCERER, 1);
spell_level(SKILL_BORSEGGIARE, CLASS_SORCERER, 1);
spell_level(SPELL_CHARM, CLASS_SORCERER, 1);
spell_level(SKILL_TAME, CLASS_SORCERER, 1);
spell_level(SPELL_SENSE_LIFE, CLASS_SORCERER, 1);
//spell_level(STUDY, CLASS_SORCERER, 1);
spell_level(SKILL_WEAPON_SWORDS, CLASS_SORCERER, 1); // Spade
spell_level(SKILL_WEAPON_DAGGERS, CLASS_SORCERER, 1); // Pugnali
spell_level(SKILL_WEAPON_BLUDGEONS, CLASS_SORCERER, 1); // mazze
spell_level(SPELL_MAGIC_MISSILE, CLASS_SORCERER, 1);
spell_level(SPELL_DETECT_INVIS, CLASS_SORCERER, 2);
spell_level(SPELL_DETECT_MAGIC, CLASS_SORCERER, 2);
spell_level(SPELL_CHILL_TOUCH, CLASS_SORCERER, 3);
spell_level(SPELL_INFRAVISION, CLASS_SORCERER, 3);
spell_level(SPELL_INVISIBLE, CLASS_SORCERER, 4);
spell_level(SPELL_ARMOR, CLASS_SORCERER, 4);
spell_level(SPELL_BURNING_HANDS, CLASS_SORCERER, 5);
spell_level(SPELL_LOCATE_OBJECT, CLASS_SORCERER, 6);
spell_level(SPELL_STRENGTH, CLASS_SORCERER, 6);
spell_level(SPELL_SHOCKING_GRASP, CLASS_SORCERER, 7);
spell_level(SPELL_SLEEP, CLASS_SORCERER, 8);
spell_level(SPELL_LIGHTNING_BOLT, CLASS_SORCERER, 9);
spell_level(SPELL_DETECT_POISON, CLASS_SORCERER, 10);
spell_level(SPELL_COLOR_SPRAY, CLASS_SORCERER, 11);
spell_level(SPELL_CURSE, CLASS_SORCERER, 14);
spell_level(SPELL_POISON, CLASS_SORCERER, 14);
spell_level(SPELL_FIREBALL, CLASS_SORCERER, 15);
spell_level(SPELL_BLINDNESS, CLASS_SORCERER, 16);
spell_level(SPELL_PARALYSIS, CLASS_SORCERER, 18);
spell_level(SPELL_ENCHANT_WEAPON, CLASS_SORCERER, 20);
spell_level(SKILL_ENCHANT_ITEMS, CLASS_SORCERER, 22);
spell_level(SPELL_FIRESHIELD, CLASS_SORCERER, 25);
spell_level(SPELL_SHOCKWAVE, CLASS_SORCERER, 27);
}


/*
* This is the exp given to implementors -- it must always be greater
* than the exp required for immortality, plus at least 20,000 or so.
*/
#define EXP_MAX 10000000

/*
* I titoli di default di personaggi maschili.
*/
const char *title_male(int chclass, int level)
{
if (level <= 0 || level > LVL_IMPL)
return ("L'Uomo");
if (level == LVL_IMPL)
return ("L'Implementor");

switch (chclass)
{
case CLASS_MAGIC_USER:
if (level < 10) return ("L'Appredista di magia ");
else if (level < 20) return ("Il Mago");
else if (level < 30) return ("l'Arcimago");
else return ("L'Immortale Arcimago ");
break;

case CLASS_CLERIC:
if (level < 10) return ("Il Druido");
else if (level < 20) return ("Il Prete");
else if (level < 30) return ("Il Vescovo");
else return ("L'Immortale Chierico");
break;

case CLASS_THIEF:
if (level < 10) return ("Il Ladro");
else if (level < 20) return ("Il furfante");
else if (level < 30) return ("Il bandito");
else return ("LImmortale Bandito");
break;

case CLASS_WARRIOR:
if (level < 10) return ("il combattente");
else if (level < 20) return ("il guerriero");
else if (level < 30) return ("il maestro guerriero");
else return ("l'Immortal maestro guerriero");
break;

case CLASS_SORCERER:
if (level < 10) return ("the Spell Student");
else if (level < 20) return ("the Magician");
else if (level < 30) return ("Il Stregone");
else return ("L'Immortale Stregone");
break;
}

/* Default title for classes which do not have titles defined */
return ("the Classless");
}


/*
* Default titles of female characters.
*/
const char *title_female(int chclass, int level)
{
if (level <= 0 || level > LVL_IMPL)
return ("La Donna");
if (level == LVL_IMPL)
return ("the Implementress");

switch (chclass)
{
case CLASS_MAGIC_USER:
if (level < 10) return ("the Apprentice of Magic"); // "the Apprentice of Magic"
else if (level < 20) return ("the Witch"); // "the Witch"
else if (level < 30) return ("the Archwitch"); // "the Archwitch"
else return ("the Immortal Archwitch"); // "the Immortal Archwitch"
break;

case CLASS_CLERIC:
if (level < 10) return ("the Acolyte"); // "the Acolyte"
else if (level < 20) return ("the Priestess"); // "the Priestess"
else if (level < 30) return ("the Bishop"); // "the Bishop"
else return ("the Immortal Priestess"); // "the Immortal Priestess"
break;

case CLASS_THIEF:
if (level < 10) return ("the Cut-Purse"); // "the Cut-Purse"
else if (level < 20) return ("the Rogue"); // "the Rogue"
else if (level < 30) return ("the Thief"); // "the Thief"
else return ("the Immortal Thief"); // "the Immortal Thief"
break;

case CLASS_WARRIOR:
if (level < 10) return ("the Fighter"); // "the Fighter"
else if (level < 20) return ("the Warrior"); // "the Warrior"
else if (level < 30) return ("the Swordmistress"); // "the Swordmistress"
else return ("the Immortal Swordmistress"); // "the Immortal Swordmistress"
break;

case CLASS_SORCERER:
if (level < 10) return ("the Spell Student"); // "the Spell Student"
else if (level < 20) return ("the Magician"); // "the Magician"
else if (level < 30) return ("the Sorceress"); // "the Sorceress"
else return ("the Immortal Sorceress"); // "the Immortal Sorceress"
break;
}

/* Default title for classes which do not have titles defined */
return "the Classless";
}

/* ********************************************************************* */
/* Remort Code */
/* ********************************************************************* */

/* Multi message - modify this message to set multi message */
char *multi_message =
"You have multied, and must begin anew. However, you will retain knowledge\r\n"
"of your previous skills and spells, you just will not be able to use them\r\n"
"until you reach the appropriate level.\r\n";

int can_multi(CHAR_DATA *ch, int newclass)
{
/* Is wanted class same as current class? */
if (newclass == GET_CLASS(ch))
{
sprintf(buf, "Ma tu sei un %s!!!\r\n", pc_class_types[(int)GET_CLASS(ch)]);
send_to_char(buf, ch);
return (FALSE);
}

/* Has char already completed this class? */
if (MULTICLASSED(ch, (1 << newclass)))
{
send_to_char("You can not repeat a class already completed.\r\n", ch);
return (FALSE);
}

if (GET_LEVEL(ch) < MULTI_LEVEL)
{
sprintf(buf, "You are only level %d, you must be at least level %d before you can multi.\r\n",
GET_LEVEL(ch), MULTI_LEVEL);
send_to_char(buf, ch);
return (FALSE);
}

/* Is the char in the appropriate room? */
if (MULTI_ROOM != NOWHERE)
{
ROOM_DATA *pRoom;

if ((pRoom = get_room(MULTI_ROOM)) && ch->in_room != pRoom)
{
send_to_char("You are not in the correct room to multi!\r\n", ch);
return (FALSE);
}
}

return (TRUE);
}

ACMD(do_remort)
{
int newclass;

one_argument(argument, arg);

if (!*arg)
{
send_to_char(
"&b&4-================&b&1}&3****&b&1(&b&3 O&7 S C E L T A C U L T U R A &b&3 O&b&1)&3****&b&1{&b&4================-&0\r\n"
"Usare: multi <nome classe>\r\n"
"I nomi classi validi sono:\r\n"
"&b&1[M]ago\r\n"
"&b&1[C]hierico\r\n"
"&b&1[B]andito\r\n"
"&b&1[G]uerriero\r\n"
"&b&1[S]tregone\r\n", ch);
return;
}

if ((newclass = parse_class(arg[0])) < 0)
{
send_to_char("Improper class name, please try again.\r\n", ch);
return;
}

if (!can_multi(ch, newclass))
return;

SET_BIT(MULTICLASS(ch), (1 << GET_CLASS(ch)));
GET_TOT_LEVEL(ch) += 1;
GET_LEVEL(ch) = 1;
GET_CLASS(ch) = newclass;
GET_EXP(ch) = 1;

GET_MAX_HIT(ch) = 10;
GET_MAX_MANA(ch) = 100;
GET_MAX_MOVE(ch) = 100;

set_title(ch, NULL);

switch (GET_CLASS(ch))
{
case CLASS_MAGIC_USER:
if (!GET_SKILL(ch, SKILL_AGGUATO))
SET_SKILL(ch, SKILL_AGGUATO, 20);
if (!GET_SKILL(ch, SKILL_SNEAK))
SET_SKILL(ch, SKILL_SNEAK, 5);
if (!GET_SKILL(ch, SKILL_SBILANCIARE))
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
if (!GET_SKILL(ch, SKILL_CALCIARE))
SET_SKILL(ch, SKILL_CALCIARE, 5);
if (!GET_SKILL(ch, SKILL_CAVALCARE))
SET_SKILL(ch, SKILL_CAVALCARE, 60);
if (!GET_SKILL(ch, SKILL_TRACK))
SET_SKILL(ch, SKILL_TRACK, 20);
if (!GET_SKILL(ch, SKILL_SCASSINARE))
SET_SKILL(ch, SKILL_SCASSINARE, 10);
if (!GET_SKILL(ch, SKILL_HIDE))
SET_SKILL(ch, SKILL_HIDE, 20);
if (!GET_SKILL(ch, SKILL_BORSEGGIARE))
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
//if (!GET_SKILL(ch, SKILL_CHARM))
// SET_SKILL(ch, SKILL_CHARM, 5);
if (!GET_SKILL(ch, SKILL_TAME))
SET_SKILL(ch, SKILL_TAME, 50);
//if (!GET_SKILL(ch, SKILL_SENSE_LIFE))
// SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_SWORDS))
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
if (!GET_SKILL(ch, SKILL_WEAPON_DAGGERS))
SET_SKILL(ch, SKILL_WEAPON_DAGGERS, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_BLUDGEONS))
SET_SKILL(ch, SKILL_WEAPON_BLUDGEONS, 15);
if (!GET_SKILL(ch, SKILL_STUDY))
SET_SKILL(ch, SKILL_STUDY, 15);
if (!GET_SKILL(ch, SKILL_READ_MAGIC))
SET_SKILL(ch, SKILL_READ_MAGIC, 10);
break;

case CLASS_CLERIC:
if (!GET_SKILL(ch, SKILL_AGGUATO))
SET_SKILL(ch, SKILL_AGGUATO, 20);
if (!GET_SKILL(ch, SKILL_SNEAK))
SET_SKILL(ch, SKILL_SNEAK, 5);
if (!GET_SKILL(ch, SKILL_SBILANCIARE))
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
if (!GET_SKILL(ch, SKILL_CALCIARE))
SET_SKILL(ch, SKILL_CALCIARE, 5);
if (!GET_SKILL(ch, SKILL_CAVALCARE))
SET_SKILL(ch, SKILL_CAVALCARE, 60);
if (!GET_SKILL(ch, SKILL_TRACK))
SET_SKILL(ch, SKILL_TRACK, 20);
if (!GET_SKILL(ch, SKILL_SCASSINARE))
SET_SKILL(ch, SKILL_SCASSINARE, 10);
if (!GET_SKILL(ch, SKILL_HIDE))
SET_SKILL(ch, SKILL_HIDE, 20);
if (!GET_SKILL(ch, SKILL_BORSEGGIARE))
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
//if (!GET_SKILL(ch, SKILL_CHARM))
// SET_SKILL(ch, SKILL_CHARM, 5);
if (!GET_SKILL(ch, SKILL_TAME))
SET_SKILL(ch, SKILL_TAME, 50);
//if (!GET_SKILL(ch, SKILL_SENSE_LIFE))
// SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_SWORDS))
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
if (!GET_SKILL(ch, SKILL_WEAPON_DAGGERS))
SET_SKILL(ch, SKILL_WEAPON_DAGGERS, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_BLUDGEONS))
SET_SKILL(ch, SKILL_WEAPON_BLUDGEONS, 15);
if (!GET_SKILL(ch, SKILL_STUDY))
SET_SKILL(ch, SKILL_STUDY, 10);
if (!GET_SKILL(ch, SKILL_READ_MAGIC))
SET_SKILL(ch, SKILL_READ_MAGIC, 10);
break;

case CLASS_WARRIOR:
if (!GET_SKILL(ch, SKILL_AGGUATO))
SET_SKILL(ch, SKILL_AGGUATO, 20);
if (!GET_SKILL(ch, SKILL_SNEAK))
SET_SKILL(ch, SKILL_SNEAK, 5);
if (!GET_SKILL(ch, SKILL_SBILANCIARE))
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
if (!GET_SKILL(ch, SKILL_CALCIARE))
SET_SKILL(ch, SKILL_CALCIARE, 5);
if (!GET_SKILL(ch, SKILL_CAVALCARE))
SET_SKILL(ch, SKILL_CAVALCARE, 60);
if (!GET_SKILL(ch, SKILL_TRACK))
SET_SKILL(ch, SKILL_TRACK, 20);
if (!GET_SKILL(ch, SKILL_SCASSINARE))
SET_SKILL(ch, SKILL_SCASSINARE, 10);
if (!GET_SKILL(ch, SKILL_HIDE))
SET_SKILL(ch, SKILL_HIDE, 20);
if (!GET_SKILL(ch, SKILL_BORSEGGIARE))
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
//if (!GET_SKILL(ch, SKILL_CHARM))
// SET_SKILL(ch, SKILL_CHARM, 5);
if (!GET_SKILL(ch, SKILL_TAME))
SET_SKILL(ch, SKILL_TAME, 50);
//if (!GET_SKILL(ch, SKILL_SENSE_LIFE))
// SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_SWORDS))
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
if (!GET_SKILL(ch, SKILL_WEAPON_DAGGERS))
SET_SKILL(ch, SKILL_WEAPON_DAGGERS, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_BLUDGEONS))
SET_SKILL(ch, SKILL_WEAPON_BLUDGEONS, 15);
if (!GET_SKILL(ch, SKILL_STUDY))
SET_SKILL(ch, SKILL_STUDY, 10);
if (!GET_SKILL(ch, SKILL_NAVIGATION))
SET_SKILL(ch, SKILL_NAVIGATION, 5);
break;

case CLASS_THIEF:
if (!GET_SKILL(ch, SKILL_AGGUATO))
SET_SKILL(ch, SKILL_AGGUATO, 20);
if (!GET_SKILL(ch, SKILL_SNEAK))
SET_SKILL(ch, SKILL_SNEAK, 5);
if (!GET_SKILL(ch, SKILL_SBILANCIARE))
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
if (!GET_SKILL(ch, SKILL_CALCIARE))
SET_SKILL(ch, SKILL_CALCIARE, 5);
if (!GET_SKILL(ch, SKILL_CAVALCARE))
SET_SKILL(ch, SKILL_CAVALCARE, 60);
if (!GET_SKILL(ch, SKILL_TRACK))
SET_SKILL(ch, SKILL_TRACK, 20);
if (!GET_SKILL(ch, SKILL_SCASSINARE))
SET_SKILL(ch, SKILL_SCASSINARE, 10);
if (!GET_SKILL(ch, SKILL_HIDE))
SET_SKILL(ch, SKILL_HIDE, 20);
if (!GET_SKILL(ch, SKILL_BORSEGGIARE))
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
//if (!GET_SKILL(ch, SKILL_CHARM))
// SET_SKILL(ch, SKILL_CHARM, 5);
if (!GET_SKILL(ch, SKILL_TAME))
SET_SKILL(ch, SKILL_TAME, 50);
//if (!GET_SKILL(ch, SKILL_SENSE_LIFE))
// SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_SWORDS))
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
if (!GET_SKILL(ch, SKILL_WEAPON_DAGGERS))
SET_SKILL(ch, SKILL_WEAPON_DAGGERS, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_BLUDGEONS))
SET_SKILL(ch, SKILL_WEAPON_BLUDGEONS, 15);
if (!GET_SKILL(ch, SKILL_STUDY))
SET_SKILL(ch, SKILL_STUDY, 10);
break;

case CLASS_SORCERER:
if (!GET_SKILL(ch, SKILL_AGGUATO))
SET_SKILL(ch, SKILL_AGGUATO, 20);
if (!GET_SKILL(ch, SKILL_SNEAK))
SET_SKILL(ch, SKILL_SNEAK, 5);
if (!GET_SKILL(ch, SKILL_SBILANCIARE))
SET_SKILL(ch, SKILL_SBILANCIARE, 5);
if (!GET_SKILL(ch, SKILL_CALCIARE))
SET_SKILL(ch, SKILL_CALCIARE, 5);
if (!GET_SKILL(ch, SKILL_CAVALCARE))
SET_SKILL(ch, SKILL_CAVALCARE, 60);
if (!GET_SKILL(ch, SKILL_TRACK))
SET_SKILL(ch, SKILL_TRACK, 20);
if (!GET_SKILL(ch, SKILL_SCASSINARE))
SET_SKILL(ch, SKILL_SCASSINARE, 10);
if (!GET_SKILL(ch, SKILL_HIDE))
SET_SKILL(ch, SKILL_HIDE, 20);
if (!GET_SKILL(ch, SKILL_BORSEGGIARE))
SET_SKILL(ch, SKILL_BORSEGGIARE, 15);
//if (!GET_SKILL(ch, SKILL_CHARM))
// SET_SKILL(ch, SKILL_CHARM, 5);
if (!GET_SKILL(ch, SKILL_TAME))
SET_SKILL(ch, SKILL_TAME, 50);
//if (!GET_SKILL(ch, SKILL_SENSE_LIFE))
// SET_SKILL(ch, SKILL_SENSE_LIFE, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_SWORDS))
SET_SKILL(ch, SKILL_WEAPON_SWORDS, 40);
if (!GET_SKILL(ch, SKILL_WEAPON_DAGGERS))
SET_SKILL(ch, SKILL_WEAPON_DAGGERS, 15);
if (!GET_SKILL(ch, SKILL_WEAPON_BLUDGEONS))
SET_SKILL(ch, SKILL_WEAPON_BLUDGEONS, 15);
if (!GET_SKILL(ch, SKILL_STUDY))
SET_SKILL(ch, SKILL_STUDY, 10);
if (!GET_SKILL(ch, SKILL_READ_MAGIC))
SET_SKILL(ch, SKILL_READ_MAGIC, 15);
create_new_spellbook(ch, BOOK_TRAVELLING);
break;
}

advance_level(ch);
sprintf(buf, "%s remorted a livello %d", GET_NAME(ch), GET_LEVEL(ch));
mudlog(buf, BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE);
send_to_char(multi_message, ch);
}

/*
* this is just a rough layout of the exp needed for a ch
* to level. recommend you change the modifier, and also
* the 4000 to something that suits you better.
*/

/* Nic Suzor's Exp Formula */
int exp_to_level(int level)
{
int modifier;

if (level == 1)
return (0);
else if (level < 6) modifier = 1;
else if (level < 9) modifier = 2;
else if (level < 11) modifier = 5;
else if (level < 13) modifier = 6;
else if (level < 15) modifier = 7;
else modifier = 8;

return (MIN(20, level - 1) * modifier * 340);/* 3400 */
}

int tot_exp_to_level(int level)
{
int exp, lvl;

for (exp = 0, lvl = 1; lvl <= level; lvl++)
exp += exp_to_level(lvl);

return (exp);
}
===============================================================

il msg lo devo dividere in due risposte perche e molto lungo:p


Top
 Profilo  
 
 Oggetto del messaggio: Re: salve vorrei tre aiuti da parte vostra conLyonesse mud
MessaggioInviato: 22/01/2016, 19:40  
Iscritto il: 05/11/2010, 23:57
Messaggi: 23
Mud: Vagabondo
Non connesso

seconda risposta del lungo msg

nel file config ci sta la funzione dove puoi scegliere 1 locazione dove il pg nasce

/**************************************************************************
* # # # ## # # ### ## ## ### http://www.lyonesse.it *
* # # # # # ## # # # # # *
* # # # # # ## ## # # ## ## ## # # ## *
* # # # # # ## # # # # # # # # # # # *
* ### # ## # # ### ## ## ### # # #### ## Ver. 1.0 *
* *
* -Based on CircleMud & Smaug- Copyright (c) 2001-2002 by Mithrandir *
* *
* ********************************************************************** */
/* ************************************************************************
* File: config.c Part of CircleMUD *
* Usage: Configuration of various aspects of CircleMUD operation *
* *
* All rights reserved. See license.doc for complete information. *
* *
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University *
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. *
************************************************************************ */

#define __CONFIG_C__

#include "conf.h"
#include "sysdep.h"

#include "structs.h"
#include "interpreter.h" /* alias_data definition for structs.h */

#define TRUE 1
#define YES 1
#define FALSE 0
#define NO 0

/*
* Below are several constants which you can change to alter certain aspects
* of the way CircleMUD acts. Since this is a .c file, all you have to do
* to change one of the constants (assuming you keep your object files around)
* is change the constant in this file and type 'make'. Make will recompile
* this file and relink; you don't have to wait for the whole thing to
* recompile as you do if you change a header file.
*
* I realize that it would be slightly more efficient to have lots of
* #defines strewn about, so that, for example, the autowiz code isn't
* compiled at all if you don't want to use autowiz. However, the actual
* code for the various options is quite small, as is the computational time
* in checking the option you've selected at run-time, so I've decided the
* convenience of having all your options in this one file outweighs the
* efficency of doing it the other way.
*
*/

/****************************************************************************/
/****************************************************************************/


/* GAME PLAY OPTIONS */

/*
* pk_allowed sets the tone of the entire game. If pk_allowed is set to
* NO, then players will not be allowed to kill, summon, charm, or sleep
* other players, as well as a variety of other "asshole player" protections.
* However, if you decide you want to have an all-out knock-down drag-out
* PK Mud, just set pk_allowed to YES - and anything goes.
*/
int pk_allowed = YES;

/* is playerthieving allowed? */
int pt_allowed = NO;

/* minimum level a player must be to shout/holler/gossip/auction */
int level_can_shout = 1;

/* number of movement points it costs to holler */
int holler_move_cost = 5;

/* i mob deridono i player che uccidono */
//int brag_on = NO;

/* how many people can get into a tunnel? The default is two, but there
* is also an alternate message in the case of one person being allowed.
*/
int tunnel_size = 2;

/* exp change limits */
int max_exp_gain = 100000; /* max gainable per kill */
int max_exp_loss = 100000; /* max losable per death */

/* number of tics (usually 75 seconds) before PC/NPC corpses decompose */
int max_npc_corpse_time = 5;
int max_pc_corpse_time = 10;

/* How many ticks before a player is sent to the void or idle-rented. */
int idle_void = 8;
int idle_rent_time = 48;

/* This level and up is immune to idling, LVL_IMPL+1 will disable it. */
int idle_max_level = LVL_GOD;

/* should items in death traps automatically be junked? */
int dts_are_dumps = YES;

/*
* Whether you want items that immortals load to appear on the ground or not.
* It is most likely best to set this to 'YES' so that something else doesn't
* grab the item before the immortal does, but that also means people will be
* able to carry around things like boards. That's not necessarily a bad
* thing, but this will be left at a default of 'NO' for historic reasons.
*/
int load_into_inventory = YES;

/* "okay" etc. */
const char *OK = "Okay.\r\n";
const char *NOPERSON = "Non vedi nessuno con quel nome qui.\r\n";
const char *NOEFFECT = "Nothing seems to happen.\r\n";

/*
* You can define or not define TRACK_THOUGH_DOORS, depending on whether
* or not you want track to find paths which lead through closed or
* hidden doors. A setting of 'NO' means to not go through the doors
* while 'YES' will pass through doors to find the target.
*/
int track_through_doors = YES;

/****************************************************************************/
/****************************************************************************/


/* RENT/CRASHSAVE OPTIONS */

/*
* Should the MUD allow you to 'rent' for free? (i.e. if you just quit,
* your objects are saved at no cost, as in Merc-type MUDs.)
*/
int free_rent = YES;

/* maximum number of items players are allowed to rent */
int max_obj_save = 50;

/* receptionist's surcharge on top of item costs */
int min_rent_cost = 100;

/*
* Should the game automatically save people? (i.e., save player data
* every 4 kills (on average), and Crash-save as defined below. This
* option has an added meaning past bpl13. If auto_save is YES, then
* the 'save' command will be disabled to prevent item duplication via
* game crashes.
*/
int auto_save = YES;

/*
* if auto_save (above) is yes, how often (in minutes) should the MUD
* Crash-save people's objects? Also, this number indicates how often
* the MUD will Crash-save players' houses.
*/
int autosave_time = 5;

/* Lifetime of crashfiles and forced-rent (idlesave) files in days */
//int crash_file_timeout = 10;

/* Lifetime of normal rent files in days */
//int rent_file_timeout = 30;


/****************************************************************************/
/****************************************************************************/


/* ROOM NUMBERS */

/* virtual number of room that mortals should enter at */

/*pezzo di codice aggiunto[NON COMBATIBILE:-( ] da un altro mud basato sullo stesso codice sorgente lyonesse mud(circle mud)
#define NUM_STARTROOMS 6
#define NUM_STARTZONES NUM_STARTROOMS
/* virtual number of room that mortals should enter at */
const room_vnum mortal_start_room[NUM_STARTROOMS +1] = {
20200, /* Newbie loadroom element */
0, /* Deira */
5401, /* Jiroch */
2444951, /* Cimmura */
21208, /* Cyrellos */
6601, /* Lamorka */
50044 /* Alorn */
//};*/


/* virtual number of room that immorts should enter at by default */
room_vnum immort_start_room = 1204;/* 1204 */

/* virtual number of room that frozen players should enter at */
room_vnum frozen_start_room = 1202;

/*pezzo di codice aggiunto[NON COMBATIBILE:-( ] da un altro mud basato sullo stesso codice sorgente lyonesse mud(circle mud)
virtual number of room that mortals should enter at */
room_vnum mortal_start_room = 20200;
room_vnum mortal_start_room_1 = 20100;(NON FUNZIONANTE)
*/const int mortal_start_zone[NUM_STARTZONES+1]=
{
20200, /* Newbie loadroom element */
//0, /* Deira */
//5401, /* Jiroch */
//2444951, /* Cimmura */
//21208, /* Cyrellos */
//6601, /* Lamorka */
//50044 /* Alorn */
//};
/*
* virtual numbers of donation rooms. note: you must change code in
* do_drop of act.item.c if you change the number of non-NOWHERE
* donation rooms.
*/
room_vnum donation_room_1 = 3063;
room_vnum donation_room_2 = NOWHERE; /* unused - room for expansion */
room_vnum donation_room_3 = NOWHERE; /* unused - room for expansion */


/****************************************************************************/
/****************************************************************************/


/* GAME OPERATION OPTIONS */

/*
* This is the default port on which the game should run if no port is
* given on the command-line. NOTE WELL: If you're using the
* 'autorun' script, the port number there will override this setting.
* Change the PORT= line in autorun instead of (or in addition to)
* changing this.
*/
ush_int DFLT_PORT = 4000;

/*
* IP address to which the MUD should bind. This is only useful if
* you're running Circle on a host that host more than one IP interface,
* and you only want to bind to *one* of them instead of all of them.
* Setting this to NULL (the default) causes Circle to bind to all
* interfaces on the host. Otherwise, specify a numeric IP address in
* dotted quad format, and Circle will only bind to that IP address. (Of
* course, that IP address must be one of your host's interfaces, or it
* won't work.)
*/
const char *DFLT_IP = NULL; /* bind to all interfaces */
/* const char *DFLT_IP = "192.168.1.1"; -- bind only to one interface */

/* default directory to use as data directory */
const char *DFLT_DIR = "lib";

/*
* What file to log messages to (ex: "log/syslog"). Setting this to NULL
* means you want to log to stderr, which was the default in earlier
* versions of Circle. If you specify a file, you don't get messages to
* the screen. (Hint: Try 'tail -f' if you have a UNIX machine.)
*/
//const char *LOGNAME = NULL;
const char *LOGNAME = "log/syslog"; /* -- useful for Windows users */

/* maximum number of players allowed before game starts to turn people away */
int max_playing = 300;

/* maximum size of bug, typo and idea files in bytes (to prevent bombing) */
int max_filesize = 50000;

/* maximum number of password attempts before disconnection */
int max_bad_pws = 3;

/*
* Rationale for enabling this, as explained by naved@bird.taponline.com.
*
* Usually, when you select ban a site, it is because one or two people are
* causing troubles while there are still many people from that site who you
* want to still log on. Right now if I want to add a new select ban, I need
* to first add the ban, then SITEOK all the players from that site except for
* the one or two who I don't want logging on. Wouldn't it be more convenient
* to just have to remove the SITEOK flags from those people I want to ban
* rather than what is currently done?
*/
int siteok_everyone = TRUE;

/*
* Some nameservers are very slow and cause the game to lag terribly every
* time someone logs in. The lag is caused by the gethostbyaddr() function
* which is responsible for resolving numeric IP addresses to alphabetic names.
* Sometimes, nameservers can be so slow that the incredible lag caused by
* gethostbyaddr() isn't worth the luxury of having names instead of numbers
* for players' sitenames.
*
* If your nameserver is fast, set the variable below to NO. If your
* nameserver is slow, of it you would simply prefer to have numbers
* instead of names for some other reason, set the variable to YES.
*
* You can experiment with the setting of nameserver_is_slow on-line using
* the SLOWNS command from within the MUD.
*/

int nameserver_is_slow = YES;


const char *MENU =
//"&b&3Qual e' il tuo nome('&b&7?&b&3' per aiuto)?&b&0\r\n"

"\r\n&b&1Benvenuto in Lyonesse!&b&0\r\n"
"0) &b&2Esci da Lyonesse.&b&0\r\n"
"1) &b&3Entra in gioco.&b&0\r\n"
"2) &b&4Entra description.&b&0\r\n"
"3) &b&5Read the background storia.&b&0\r\n"
"4) &b&6Cambia password.&b&0\r\n"
"5) &b&7Cancella questo personaggio.&b&0\r\n"
"\r\n"
"&b&8Fai la tua scelta: Digita un numero e poi Premi Invio&b&0";

const char *GREETINGS =

//"&b&6!!MUSIC(evfalls.mid L=1 C=1) \r\n\r\n\r\n"
" &4... .. .. ..... ... ... ...... ... ... ......\r\n"
" ::: :: :: ::::::::: ::::: ::: :::::: ::: ::: ::::::\r\n"
" +:: +: :+ :+: :+: +:: :: ::+ +:: :: :: +::\r\n"
" +:+ +:+: +:+ +:+ +:+ +: :+: +:+ :+ :+ +:+\r\n"
" ++: ++ :++ ++: ++: :+ +:+ ++:++ :+ :+ ++:++\r\n"
" ++# #+ +++ +++ ++# ++ +++ ++#++ +: +: ++#++\r\n"
" +#+ ++ #++ ++# +#+ +# +#+ +#+ +# +# +#+\r\n"
" #+# +# ##+ +## #+# +##+# #+# #+ #+ #+#\r\n"
" ##+### #+ ##+#+#+## ##+ +### +####+ +#+ +#+ +####+\r\n"
" ###### ## ##### ### ### ###### ### ### ######\r\n"
"\r\n"
" Benvenuto in un mondo di avventure senza fine\r\n"
"\r\n"
"--- TU PUOI RIMUOVERE ANYTHING ABOVE QUESTA LINEA, CREDITI BELOW _MUST_ BE LEFT IN PLACE ---\r\n"
"\r\n"
" Basato su LyonesseMUD 1.0,\r\n"
" Creato da Fabrizio Baldi\r\n"
"\r\n"
" Un derivato del CircleMUD 3.0, Creato da Jeremy Elson\r\n"
"\r\n"
" SMAUG 1.4 scritto da Thoric (Derek Snider) con Altrag, Blodkai, Haus, Narn,\r\n"
" Scryn, Swordbearer, Tricops, Gorog, Rennard, Grishnakh, Fireblade e Nivek.\r\n"
"\r\n"
" Originale MERC 2.1 codice da Hatchet, Furey, e Kahn.\r\n"
"\r\n"
" Un derivato del DikuMUD (GAMMA 0.0),\r\n"
" da Hans Staerfeldt, Katja Nyboe, Tom Madsen, Michael Seifert, Sebastian Hammer\r\n"
"&4-==========&b&3}****(O Home Page: http://lyonessemud.it O)****{==========-\r\n"
"&3Qual e' il tuo nome('?' per aiuto)?";

const char *WELC_MESSG =
"\r\n"
"&b&4-================&b&1}&3****&b&1(&b&3 O&7 N O V I T A'&b&3 O&b&1)&3****&b&1{&b&4================-&0\r\n"
"&b&9Nuovo sito online!\r\n"
"www.lyonessemud.it\r\n"
"\r\n"
"&b&3Benvenuto. possa tu trovare gloria e fortuna nella terre di Ikary.&b&0"
"\r\n";

const char *START_MESSG =
"&1Benvenuto. Questo e il tuo nuovo CircleMUD character! Tu puoi guadagnare soldi,\r\n"
"accumulare esperienza, trovare armi, ecqupaggiamento, e molto altro -- ancora\r\n"
"ed incontrare persone da tutto il mondo!&0\r\n";



/* AUTOWIZ OPTIONS */

/*
* Should the game automatically create a new wizlist/immlist every time
* someone immorts, or is promoted to a higher (or lower) god level?
* NOTE: this only works under UNIX systems.
*/
int use_autowiz = NO;

/* If yes, what is the lowest level which should be on the wizlist? (All
immort levels below the level you specify will go on the immlist instead.) */
int min_wizlist_lev = LVL_GOD;
/****************************************************************************/

===============================================================

io ho inserito nel file structs ho inserito questo pezzo di codice

/* HOMETOWN */
#define CITTA_UNDEFINED -1
#define CITTA_DEIRA 0
#define CITTA_CIMMURA 1
#define CITTA_LAMORKA 2
#define CITTA_CHYRELLOS 3

senza risultato positivo :-( quindi non so come fare sul primo punto.
sul secondo aiuto

SECONDO AIUTO
======================================
che i mob facessero a determinate condizioni e il problema che se un pg uccide un qualsiasi mob il mud crasha dandomi un errore nel file handler.c del codici sorgenti di lyonesse mud nella cartella src

vi posto il pezzo di codice dove mi segnala l'errore in seguito ad un uccisione di un mob

/*
* Return real weight of an object, including weight of contents.
*/
int get_real_obj_weight( OBJ_DATA *obj )
{
int weight;

if ( !obj )
return (0);

if ( GET_OBJ_TYPE(obj) == ITEM_MONEY )
weight = MAX(1, (GET_OBJ_VAL(obj, 0) * GET_OBJ_WEIGHT(obj)) / 10);
else
weight = obj->count * GET_OBJ_WEIGHT(obj);

for ( obj = obj->first_content; obj; obj = obj->next_content )
weight += get_real_obj_weight(obj);

return (weight);
}

---------------------------------------------------------------------
il rigo che mi segnala in debug e questo

if ( GET_OBJ_TYPE(obj) == ITEM_MONEY )
weight = MAX(1, (GET_OBJ_VAL(obj, 0) * GET_OBJ_WEIGHT(obj)) / 10);
---------------------------------------------------------------------
la stack di chiamate e questa

> Lyonesse.exe!get_real_obj_weight(obj_data * obj=0xfeeefeee) Riga 2136 + 0x3 byte C


non so bene se ti riferisci a questo pezzo di codice qui, ma io lo posto lo stesso

/*
* If possible group obj2 into obj1 -Thoric
* This code, along with clone_object, obj->count, and special support
* for it implemented throughout handler.c and save.c should show improved
* performance on MUDs with players that hoard tons of potions and scrolls
* as this will allow them to be grouped together both in memory, and in
* the player files.
*/
OBJ_DATA *group_object( OBJ_DATA *obj1, OBJ_DATA *obj2 )
{
if (!obj1 || !obj2)
return (NULL);

if (obj1 == obj2)
return (obj1);

/* no corpse grouping */
if (IS_CORPSE(obj1) || IS_CORPSE(obj2))
return (obj2);

/* no grouping for item with specials */
if (obj1->special || obj2->special)
return (obj2);

/* money items group differently.. */
if (GET_OBJ_TYPE(obj1) == GET_OBJ_TYPE(obj2) && GET_OBJ_TYPE(obj1) == ITEM_MONEY)
{
GET_OBJ_VAL(obj1, 0) += GET_OBJ_VAL(obj2, 0);

if (obj1->item_number != NOTHING)
/* to be decremented in extract_obj */
obj_index[obj1->item_number].number += obj2->count;

update_money(obj1);
extract_obj(obj2);
return (obj1);
}

if ( QUICKMATCH(obj1->name, obj2->name)
&& QUICKMATCH(obj1->short_description, obj2->short_description)
&& QUICKMATCH(obj1->description, obj2->description)
&& GET_OBJ_TYPE(obj1) == GET_OBJ_TYPE(obj2)
&& GET_OBJ_EXTRA(obj1) == GET_OBJ_EXTRA(obj2)
&& GET_OBJ_ANTI(obj1) == GET_OBJ_ANTI(obj2)
&& GET_OBJ_WEAR(obj1) == GET_OBJ_WEAR(obj2)
&& GET_OBJ_WEIGHT(obj1) == GET_OBJ_WEIGHT(obj2)
&& GET_OBJ_COST(obj1) == GET_OBJ_COST(obj2)
&& GET_OBJ_LEVEL(obj1) == GET_OBJ_LEVEL(obj2)
&& GET_OBJ_TIMER(obj1) == GET_OBJ_TIMER(obj2)
&& GET_OBJ_COND(obj1) == GET_OBJ_COND(obj2)
&& GET_OBJ_MAXCOND(obj1) == GET_OBJ_MAXCOND(obj2)
&& GET_OBJ_VAL(obj1, 0) == GET_OBJ_VAL(obj2, 0)
&& GET_OBJ_VAL(obj1, 1) == GET_OBJ_VAL(obj2, 1)
&& GET_OBJ_VAL(obj1, 2) == GET_OBJ_VAL(obj2, 2)
&& GET_OBJ_VAL(obj1, 3) == GET_OBJ_VAL(obj2, 3)
&& GET_OBJ_QUALITY(obj1) == GET_OBJ_QUALITY(obj2)
&& !obj1->ex_description && !obj2->ex_description
&& !obj1->first_content && !obj2->first_content
&& obj1->count + obj2->count > 0 ) /* prevent count overflow */
{
obj1->count += obj2->count;

if ( obj1->item_number != NOTHING )
/* to be decremented in extract_obj */
obj_index[obj1->item_number].number += obj2->count;

// you never know..
if ( GET_OBJ_TYPE(obj1) == ITEM_MONEY )
update_money(obj1);

extract_obj( obj2 );
return (obj1);
}

return (obj2);
}

/*
* Split off a grouped object -Thoric
* decreased obj's count to num, and creates a new object containing the rest
*/
void split_obj( OBJ_DATA *obj, int num )
{
int count = obj->count;
OBJ_DATA *rest;

if ( count <= num || num == 0 )
return;

rest = clone_object(obj);

if ( obj->item_number != NOTHING )
--obj_index[obj->item_number].number;

rest->count = obj->count - num;
obj->count = num;

if ( GET_OBJ_TYPE(obj) == ITEM_MONEY )
{
update_money(obj);
update_money(rest);
}

if ( obj->carried_by )
{
LINK(rest, obj->carried_by->first_carrying, obj->carried_by->last_carrying,
next_content, prev_content);

rest->carried_by = obj->carried_by;
rest->in_room = NULL;
rest->in_obj = NULL;
}
else if ( obj->in_room )
{
LINK(rest, obj->in_room->first_content, obj->in_room->last_content,
next_content, prev_content);

rest->carried_by = NULL;
rest->in_room = obj->in_room;
rest->in_obj = NULL;
}
else if ( obj->in_obj )
{
LINK(rest, obj->in_obj->first_content, obj->in_obj->last_content,
next_content, prev_content);

rest->in_obj = obj->in_obj;
rest->in_room = NULL;
rest->carried_by = NULL;
}
}

void separate_obj( OBJ_DATA *obj )
{
split_obj( obj, 1 );
}

/*
* Return real weight of an object, including weight of contents.
*/
int get_real_obj_weight( OBJ_DATA *obj )
{
int weight;

if ( !obj )
return (0);

// if (GET_OBJ_TYPE(GET_EQ(obj, WEAR_LIGHT)) == ITEM_MONEY)

if ( GET_OBJ_TYPE(obj) == ITEM_MONEY )
weight = MAX(1, (GET_OBJ_VAL(obj, 0) * GET_OBJ_WEIGHT(obj)) / 10);
else
weight = obj->count * GET_OBJ_WEIGHT(obj);

for ( obj = obj->first_content; obj; obj = obj->next_content )
weight += get_real_obj_weight(obj);

return (weight);
}

===============================================================
posto un altro ezzo di codice che sta nel file fight che potrebbe interessare

void make_corpse(CHAR_DATA *ch)
{
OBJ_DATA *corpse, *o;
char bufcor[MAX_STRING_LENGTH];
int i;

corpse = create_obj();

corpse->item_number = NOTHING;
corpse->in_room = NULL;

sprintf( bufcor, "corpo %s &1{&7m&1}", IS_NPC(ch) ? GET_PC_NAME(ch) : unknown_name(ch) );
corpse->name = str_dup(bufcor);

sprintf(buf2, "Il corpo di %s giace qui. &1{&7m&1}", unknown_name(ch));
corpse->description = str_dup(buf2);

sprintf(buf2, "Il corpo di %s &1{&7m&1}", unknown_name(ch));
//sprintf(buf2, "&1[&7O&1] &2Il corpo di %s &1{&7m&1}", unknown_name(ch));
corpse->short_description = str_dup(buf2);

GET_OBJ_TYPE(corpse) = ITEM_CONTAINER;
GET_OBJ_WEAR(corpse) = ITEM_WEAR_TAKE;
GET_OBJ_EXTRA(corpse) = ITEM_NODONATE;
GET_OBJ_VAL(corpse, 0) = 0; /* You can't store stuff in a corpse */
GET_OBJ_VAL(corpse, 3) = 1; /* corpse identifier */
GET_OBJ_WEIGHT(corpse) = GET_WEIGHT(ch) + IS_CARRYING_W(ch);
GET_OBJ_RENT(corpse) = 100000;

if (IS_NPC(ch))
{
GET_OBJ_TIMER(corpse) = max_npc_corpse_time;
GET_OBJ_VAL(corpse, 1) = 0;
}
else
{
GET_OBJ_TIMER(corpse) = max_pc_corpse_time;
GET_OBJ_VAL(corpse, 1) = GET_IDNUM(ch);
}

/* transfer character's inventory to the corpse */
corpse->first_content = ch->first_carrying;
corpse->last_content = ch->last_carrying;

for (o = corpse->first_content; o; o = o->next_content)
o->in_obj = corpse;
object_list_new_owner(corpse, NULL);

/* transfer character's equipment to the corpse */
for (i = 0; i < NUM_WEARS; i++)
{
if (GET_EQ(ch, i))
obj_to_obj(unequip_char(ch, i), corpse);
}

/* make gold coins from gold value (Mob only) */
if (IS_NPC(ch) && GET_GOLD(ch) > 0)
create_amount(GET_GOLD(ch), NULL, NULL, corpse, NULL, FALSE);

ch->first_carrying = NULL;
ch->last_carrying = NULL;

IS_CARRYING_N(ch) = 0;
IS_CARRYING_W(ch) = 0;

obj_to_room(corpse, ch->in_room);
}


/* When ch kills victim */
void change_alignment(CHAR_DATA *ch, CHAR_DATA *victim)
{
/*
* new alignment change algorithm: if you kill a monster with alignment A,
* you move 1/16th of the way to having alignment -A. Simple and fast.
*/
GET_ALIGNMENT(ch) += (-GET_ALIGNMENT(victim) - GET_ALIGNMENT(ch)) / 16;
}



void death_cry(CHAR_DATA *ch)
{
EXIT_DATA *pexit;

act("&5Il sangue ti si gela nelle vene quando senti le ultime grida agonizzanti di&7 $n's .", FALSE, ch, 0, 0, TO_ROOM);

for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
{
if ( valid_exit( pexit ) )
send_to_room("&5Il sangue ti si gela nelle vene quando senti le ultime grida agonizzanti di qualcuno&7.\r\n",
pexit->to_room);
}
}


void raw_kill(CHAR_DATA *ch)
{
if (FIGHTING(ch))
stop_fighting(ch);

while (ch->affected)
affect_remove(ch, ch->affected);

death_cry(ch);

if (IS_NPC(ch))
{
make_corpse(ch);
extract_char(ch);
}
else
{
char_to_ghost(ch);
send_to_char("Ti senti di essere trascinato in una luce brillante...\r\n", ch);
/* char_from_room(ch);
char_to_room(ch, get_room(20200));*/
GET_HIT(ch) = GET_MAX_HIT(ch);
GET_MANA(ch) = GET_MAX_MANA(ch);
GET_MOVE(ch) = GET_MAX_MOVE(ch);
/*GET_COND(ch, THIRST) = GET_MAX_COND(ch, THIRST);*/


update_pos(ch);
look_at_room(ch, 0);
SET_BIT(PLR_FLAGS(ch), PLR_GHOST);
SET_BIT(PRF_FLAGS(ch), PRF_NOHASSLE);
SET_BIT(PRF_FLAGS(ch), PRF_HOLYLIGHT);
//GET_RESUSCITA(ch)=0;//
}
}

in piu posto un oggetto di tipo moneta
===============================================================

#3114
monete 37 gold~
&1[&7O&1] &2Una piccola pila di 37 monete gold.&7~
&1[&7O&1] &2Una piccola pila di monete gold lies qui. &7{&2p&7}~
~
20 0 a 0 0
37 0 0 0
0 0 0 0 100 100

questo e per quando riguarda il punto due il punto tre
===============================================================

mentre l altra cosa dove spero che mi aiuterete ri guarda sui i mob in generale di quello che vorrei far fare ai mob

vi faccio vedere un po lo schema di quello che vorrei (Mob)


1)Il mob risponde alle domande specifiche del pg

Esempio:

Chiedi a una guardia cittadina 'Come ti chiami?'
Una guardia cittadina dice 'Il mio nome è Tanry.'

2)Il mob da e riceve oggetti secondo le cose che il pg deve fare.

Esempio:

La Donna abbronzata dice sorridendo 'Portami una bottiglia di buon vino e sarà tuo.
Dai una bottiglia di vino speziato a una donna abbronzata.
La Donna abbronzata dice sorridendo 'Bene, bene
La Donna abbronzata ti dà un'anfora di terracotta.

3)I mob cattivi attaccano i mob buoni (Ex:animali)

Esempio:

Una volpe rossa attacca un Coniglio
Un orco attacca un elfo

4)I mob aprano solo a determinati tipi di pg

Esempio:

Chiedi a una guardia cittadina 'Mi apri?'
Una guardia cittadina dice 'aprite a (nome pg).'
la guardia cittadina infila la chiave nella serratura ed apre il portone

il pg entra

La guardia cittadina chiude la porta a chiave.

===============================================================
avrei trovato su intenet dei pezzi di codice da inserire nel file del codice sorgente
mobact nella funziona del aggressive mob

e il pezzo di codice inserito e questo
//if (!CAN_SEE(ch, vict) || (!IS_NPC(vict) && PRF_FLAGGED(vict, PRF_NOHASSLE)))
//if (vict == ch)

e devo dire che ha funzionato tutto a 50% perche i mob buoni attaccano quelli cattivi e i mob cattivi attaccano quelli buon grazie a questa fuzione e grazie allinemaento dei due mob e al flags quali questi di seguito

#define MOB_AGGRESSIVE (1 << 5) /* f Mob auto-attacks everybody nearby*/
#define MOB_AGGR_EVIL (1 << 8) /* i Auto-attack any evil PC's */
#define MOB_AGGR_GOOD (1 << 9) /* j Auto-attack any good PC's */
#define MOB_AGGR_NEUTRAL (1 << 10) /* k Auto-attack any neutral PC's */
(non ci sta la flag [MOB_AGGR_RACE (1<< ??) ]/* devo andare in cerca su intenet se ce qualche funzione che integra anche questa altra flag*/

e devo dire che i mob forti uccidevano i mob deboli ed ho aggiunto anche una nuova flag che e quello dello stato pietoso che mob stordisce senza uccidere il mob vittima
pero a volte funziona e a volte no fatto sta che avendo il problema che qualnque uccisone mi crasha il server mud segnalando quel errore del reale peso degli oggetti monete????? ho dovuto disabilitare la funzione dei mob che attaccano altri mob rimandendo soltando la flag del pietoso.

qui di seguito posto il pezzo di codice che rigurda la funzione dei mob aggressivi.

/* Mob Memory */
if (MOB_FLAGGED(ch, MOB_MEMORY) && MEMORY(ch))
{
found = FALSE;
for (vict = ch->in_room->people; vict && !found; vict = vict->next_in_room)
{
if (IS_NPC(vict) || !CAN_SEE(ch, vict) || PRF_FLAGGED(vict, PRF_NOHASSLE))
continue;

for (names = MEMORY(ch); names && !found; names = names->next)
{
if (names->id != GET_IDNUM(vict))
continue;

/* Can a master successfully control the charmed monster? */
if (aggressive_mob_on_a_leash(ch, ch->master, vict))
continue;

found = TRUE;
act("&b&7$n'&b&3dice '&b&7Hey! Tu sei la persona che mi ha attaccato pagherai per i tuoi crimini!!!&b&3'&7.", FALSE, ch, 0, 0, TO_ROOM);
hit(ch, vict, TYPE_UNDEFINED);
}
}
}

/*
* Charmed Mob Rebellion
*
* In order to rebel, there need to be more charmed monsters
* than the person can feasibly control at a time. Then the
* mobiles have a chance based on the charisma of their leader.
*
* 1-4 = 0, 5-7 = 1, 8-10 = 2, 11-13 = 3, 14-16 = 4, 17-19 = 5, etc.
*/
if (AFF_FLAGGED(ch, AFF_CHARM) && ch->master && num_followers_charmed(ch->master) > (GET_CHA(ch->master) - 2) / 3)
{
if (!aggressive_mob_on_a_leash(ch, ch->master, ch->master))
{
if (CAN_SEE(ch, ch->master) && !PRF_FLAGGED(ch->master, PRF_NOHASSLE))
hit(ch, ch->master, TYPE_UNDEFINED);
stop_follower(ch);
}
}

/* Helper Mobs */
if (MOB_FLAGGED(ch, MOB_HELPER) && !AFF_FLAGGED(ch, AFF_BLIND | AFF_CHARM))
{
found = FALSE;
for (vict = ch->in_room->people; vict && !found; vict = vict->next_in_room)
{
if (ch == vict || !IS_NPC(vict) || !FIGHTING(vict))
continue;
if (IS_NPC(FIGHTING(vict)) || ch == FIGHTING(vict))
continue;

act("$n jumps to the aid of $N!", FALSE, ch, 0, vict, TO_ROOM);
hit(ch, FIGHTING(vict), TYPE_UNDEFINED);
found = TRUE;
}
}

/* Hunting Mobs */
if (AFF_FLAGGED(ch, AFF_HUNTING) && HUNTING(ch) && !FIGHTING(ch))
{
if (hunt_victim(ch))
continue;
}

/* Mob Movimento */
if (!MOB_FLAGGED(ch, MOB_SENTINEL) && !MOB_FLAGGED(ch, MOB_ENCOUNTER) && GET_POS(ch) == POS_STANDING)
{
int door, max_doors;


if (IN_WILD(ch))
{
door = number(0, 30);
max_doors = NUM_OF_DIRS;
}
else
{
door = number(0, 18);
max_doors = NUM_OF_EX_DIRS;
}

if (door < max_doors)
{
EXIT_DATA *pexit = get_exit(ch->in_room, door);
if (pexit && pexit->to_room && !ROOM_FLAGGED(pexit->to_room, ROOM_NOMOB | ROOM_DEATH))
{
if (!MOB_FLAGGED(ch, MOB_STAY_ZONE) ||
(pexit->to_room->zone == ch->in_room->zone))
{
perform_move(ch, door, 1);
}
}
}
}

/* Add new mobile actions here */
}
}

===============================================================

e posto anche l altro pezzo di codice aggiunto riguardande la flag dei pietoso nel file del codice sorgente(fight.c)

/* control the fights going on. Called every 2 seconds from comm.c. */
void perform_violence(void)
{
CHAR_DATA *ch;
OBJ_DATA *wielded;
sh_int num_of_attacks = 1, loop_attacks;

for (ch = combat_list; ch; ch = next_combat_list)
{
next_combat_list = ch->next_fighting;

if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room || !valid_target(ch, FIGHTING(ch)))
{
stop_fighting(ch);
continue;
}

if (IS_NPC(ch))
{
if (GET_MOB_WAIT(ch) > 0)
{
GET_MOB_WAIT(ch) -= PULSE_VIOLENCE;
continue;
}
GET_MOB_WAIT(ch) = 0;
if (GET_POS(ch) < POS_FIGHTING)
{
GET_POS(ch) = POS_FIGHTING;
act("$n scrambles to $s feet!", TRUE, ch, 0, 0, TO_ROOM);
}
if ((GET_POS (FIGHTING(ch)) == POS_STUNNED) &&
(MOB_FLAGGED(ch, MOB_MERCY)))
stop_fighting(ch);
}

io ho preso questi pezzi di codice da questo sito per i cirle mud.
// http://www.circlemud.org/pub/CircleMUD/ ... rciful.txt */

===============================================================
in conclusione lyonesse mud non ha dei mud_prog o dei mob_prog hao ce solo spec_program, act.mob quindi in sintesi vorrei avre delle risposte soluzioni a questi tre punticini il 50% li ho risolti ma solo a meta:( che dire spero che si hanno soluzioni a questi 3 punti che dire attendo vostre risposte buon pomeriggio;)


Top
 Profilo  
 
 Oggetto del messaggio: Re: salve vorrei tre aiuti da parte vostra conLyonesse mud
MessaggioInviato: 24/01/2016, 3:27  
Avatar utente

Iscritto il: 13/01/2010, 12:02
Messaggi: 31
Località: Roma
Mud: Dei delle Ere
Non connesso

Mi dispiace, da quel che vedo e leggo la struttura del lyonesse è troppo difforme da quella dello smaug per cui io possa essere di valido aiuto senza scaricarmi e studiare il lyonesse o il circle... :(

_________________
Advanced Dei delle Ere - coder


Top
 Profilo  
 
 Oggetto del messaggio: Re: salve vorrei tre aiuti da parte vostra conLyonesse mud
MessaggioInviato: 26/01/2016, 23:43  
Iscritto il: 05/11/2010, 23:57
Messaggi: 23
Mud: Vagabondo
Non connesso

http://www.circlemud.org/pub/CircleMUD/ ... metown.txt

From: "Daniel W. Burke" <dwb@ix.netcom.com>
Subject: Hometown - could easily be used for classes

For simplicity, I found it easier to make another header file to
handle the define for num_startrooms. structs.h was a bad place since
it's only needed in a few files, and to change it would mean basically
recopiling the mud, so this include in the below listed files would be
most logical.

#include "loadrooms.h"

loadrooms.h -- You will need to add this file and make sure that all
the dependancies are correct. It only needs to contain one line:

#define NUM_STARTROOMS 4

act.wizard.c -- I Added set hometown to do_set, with it sending a list
of hometowns, and their numbers no matter what you set it for.

case 55:
RANGE(0, NUM_STARTROOMS);
GET_HOME(vict) = value;
send_to_char("NUM ROOM ZONE\r\n", ch);
send_to_char(" 1) 4298 Adrilankha\r\n", ch);
send_to_char(" 2) 3001 Midgaard\r\n", ch);
send_to_char(" 3) 5400 New Thalos\r\n", ch);
send_to_char(" 4) 7500 Guarlan\r\n", ch);
break;

config.c

/* virtual number of room that mortals should enter at */
const sh_int mortal_start_room[NUM_STARTROOMS +1] = {
0, /* Newbie loadroom element */
4298, /* Adrilankha */
3001, /* Midgaard */
5400, /* New Thalos */
7500 /* Guarlan */
};

db.c -- if you are going to put a menu to choose a hometown when the
character is created don't forget to comment out the line in
init_char that sets hometown to 1. This is defined near the top of
the file.

sh_int r_mortal_start_room[NUM_STARTROOMS +1];

This is a total replacement for the stock procedure... it assumes that
under any circumstances, that mortal_start_room[1] always exists, and
if any others are missing, sets it equal to mortal_start_room[1]

/* make sure the start rooms exist & resolve their vnums to rnums */
void check_start_rooms(void)
{
int count;
extern sh_int mortal_start_room[NUM_STARTROOMS +1];
extern sh_int immort_start_room;
extern sh_int frozen_start_room;

for (count = 1; count <= (NUM_STARTROOMS + 1); count++)
if ((r_mortal_start_room[count] = real_room(mortal_start_room[count])) < 0)
{
if (count > 1)
r_mortal_start_room[count] = real_room(mortal_start_room[1]);
else {
log("SYSERR: Mortal start room does not exist. Change in config.c.")
;
exit(1);
}
}

if ((r_immort_start_room = real_room(immort_start_room)) < 0) {
if (!mini_mud)
log("SYSERR: Warning: Immort start room does not exist. Change in confi
g.c.");
r_immort_start_room = r_mortal_start_room[1];
}
if ((r_frozen_start_room = real_room(frozen_start_room)) < 0) {
if (!mini_mud)
log("SYSERR: Warning: Frozen start room does not exist. Change in confi
g.c.");
r_frozen_start_room = r_mortal_start_room[1];
}
}

spells.c -- in spell_recall, change 2 lines to equal these:

extern sh_int r_mortal_start_room[NUM_STARTROOMS +1];

char_to_room(victim, r_mortal_start_room[GET_HOME(ch)]);

interpreter.c -- in nanny()

extern sh_int r_mortal_start_room[NUM_STARTROOMS +1];

load_room = r_mortal_start_room[GET_HOME(d->character)];
^^^^^^^^^^^^^^^^^^^^^^^^--add :)

---------------------------------------------------------------------------------

questo pezzo di codice se funziona su lyonesse era meglio ma penso che sideve fare qualche modifica..... ma non so come qualche aiuto?:P nelf ra tempo buona serata.


Top
 Profilo  
 
Visualizza ultimi messaggi:  Ordina per  
Apri un nuovo argomento Rispondi all’argomento  [ 6 messaggi ] 

Tutti gli orari sono UTC + 1 ora [ ora legale ]


Chi c’è in linea

Visitano il forum: Nessuno e 0 ospiti


Non puoi aprire nuovi argomenti
Non puoi rispondere negli argomenti
Non puoi modificare i tuoi messaggi
Non puoi cancellare i tuoi messaggi

Cerca per:
Vai a:  
cron

World of Warcraft phpBB template "WoWMoonclaw" created by MAËVAH (ex-MOONCLAW) (v3.0.4) - wowcr.net : World of Warcraft styles & videos
© World of Warcraft and Blizzard Entertainment are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. wowcr.net is in no way associated with Blizzard Entertainment.