… | |
… | |
1514 | if (type == PLAYER) |
1514 | if (type == PLAYER) |
1515 | { |
1515 | { |
1516 | esrv_update_stats (contr); |
1516 | esrv_update_stats (contr); |
1517 | esrv_update_spells (contr); |
1517 | esrv_update_spells (contr); |
1518 | } |
1518 | } |
|
|
1519 | |
|
|
1520 | // update the mapspace, if we are on a map |
|
|
1521 | if (!flag [FLAG_REMOVED] && map) |
|
|
1522 | map->at (x, y).flags_ = 0; |
1519 | } |
1523 | } |
1520 | |
1524 | |
1521 | /* |
1525 | /* |
1522 | * Returns true if the given player is a legal class. |
1526 | * Returns true if the given player is a legal class. |
1523 | * The function to add and remove class-bonuses to the stats doesn't |
1527 | * The function to add and remove class-bonuses to the stats doesn't |
… | |
… | |
1950 | del_exp = check_exp_loss (tmp, (sint64) (tmp->stats.exp * fraction)); |
1954 | del_exp = check_exp_loss (tmp, (sint64) (tmp->stats.exp * fraction)); |
1951 | tmp->stats.exp -= del_exp; |
1955 | tmp->stats.exp -= del_exp; |
1952 | player_lvl_adj (op, tmp); |
1956 | player_lvl_adj (op, tmp); |
1953 | } |
1957 | } |
1954 | } |
1958 | } |
|
|
1959 | |
1955 | if (flag != SK_SUBTRACT_SKILL_EXP) |
1960 | if (flag != SK_SUBTRACT_SKILL_EXP) |
1956 | { |
1961 | { |
1957 | del_exp = check_exp_loss (op, exp); |
1962 | del_exp = check_exp_loss (op, exp); |
1958 | op->stats.exp -= del_exp; |
1963 | op->stats.exp -= del_exp; |
1959 | player_lvl_adj (op, NULL); |
1964 | player_lvl_adj (op, NULL); |
1960 | } |
1965 | } |
1961 | } |
1966 | } |
1962 | |
|
|
1963 | |
|
|
1964 | |
1967 | |
1965 | /* change_exp() - changes experience to a player/monster. This |
1968 | /* change_exp() - changes experience to a player/monster. This |
1966 | * does bounds checking to make sure we don't overflow the max exp. |
1969 | * does bounds checking to make sure we don't overflow the max exp. |
1967 | * |
1970 | * |
1968 | * The exp passed is typically not modified much by this function - |
1971 | * The exp passed is typically not modified much by this function - |
1969 | * it is assumed the caller has modified the exp as needed. |
1972 | * it is assumed the caller has modified the exp as needed. |
1970 | * skill_name is the skill that should get the exp added. |
1973 | * skill_name is the skill that should get the exp added. |
1971 | * flag is what to do if player doesn't have the skill. |
1974 | * flag is what to do if player doesn't have the skill. |
1972 | * these last two values are only used for players. |
1975 | * these last two values are only used for players. |
1973 | */ |
1976 | */ |
1974 | |
|
|
1975 | void |
1977 | void |
1976 | change_exp (object *op, sint64 exp, const char *skill_name, int flag) |
1978 | change_exp (object *op, sint64 exp, const char *skill_name, int flag) |
1977 | { |
1979 | { |
1978 | |
1980 | |
1979 | #ifdef EXP_DEBUG |
1981 | #ifdef EXP_DEBUG |