ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/living.C
(Generate patch)

Comparing deliantra/server/common/living.C (file contents):
Revision 1.53 by root, Sat May 12 19:07:21 2007 UTC vs.
Revision 1.54 by root, Sat May 12 19:30:18 2007 UTC

1011 1011
1012 if (weapon_speed < 0) 1012 if (weapon_speed < 0)
1013 weapon_speed = 0; 1013 weapon_speed = 0;
1014 1014
1015 weapon_weight = tmp->weight; 1015 weapon_weight = tmp->weight;
1016 stats.dam += tmp->stats.dam * (1 + (chosen_skill->level / 9)); 1016 stats.dam += 1 + (chosen_skill->level * tmp->stats.dam / 9);
1017 1017
1018 if (tmp->magic) 1018 if (tmp->magic)
1019 stats.dam += tmp->magic; 1019 stats.dam += tmp->magic;
1020 } 1020 }
1021 1021
1225 stats.maxsp = (sint16)sp_tmp; 1225 stats.maxsp = (sint16)sp_tmp;
1226 1226
1227 for (i = 11; i <= mana_obj->level; i++) 1227 for (i = 11; i <= mana_obj->level; i++)
1228 stats.maxsp += 2; 1228 stats.maxsp += 2;
1229 } 1229 }
1230
1230 /* Characters can get their sp supercharged via rune of transferrance */ 1231 /* Characters can get their sp supercharged via rune of transferrance */
1231 if (stats.sp > stats.maxsp * 2) 1232 if (stats.sp > stats.maxsp * 2)
1232 stats.sp = stats.maxsp * 2; 1233 stats.sp = stats.maxsp * 2;
1233 1234
1234 /* set maxgrace, notice 3-4 lines below it depends on both Wis and Pow */ 1235 /* set maxgrace, notice 3-4 lines below it depends on both Wis and Pow */
1265 1266
1266 /* two grace points per level after 11 */ 1267 /* two grace points per level after 11 */
1267 for (i = 11; i <= grace_obj->level; i++) 1268 for (i = 11; i <= grace_obj->level; i++)
1268 stats.maxgrace += 2; 1269 stats.maxgrace += 2;
1269 } 1270 }
1271
1270 /* No limit on grace vs maxgrace */ 1272 /* No limit on grace vs maxgrace */
1271 1273
1272 if (contr->braced) 1274 if (contr->braced)
1273 { 1275 {
1274 ac += 2; 1276 ac += 2;
1287 * we give the player a bonus here in wc and dam 1289 * we give the player a bonus here in wc and dam
1288 * to make up for the change. Note that I left the 1290 * to make up for the change. Note that I left the
1289 * monster bonus the same as before. -b.t. 1291 * monster bonus the same as before. -b.t.
1290 */ 1292 */
1291 1293
1292 if (type == PLAYER && wc_obj && wc_obj->level > 1) 1294 if (contr && wc_obj && wc_obj->level > 1)
1293 { 1295 {
1294 wc -= wc_obj->level + thaco_bonus[stats.Str]; 1296 wc -= wc_obj->level + thaco_bonus[stats.Str];
1295 1297
1296 for (i = 1; i < wc_obj->level; i++) 1298 for (i = 1; i < wc_obj->level; i++)
1297 { 1299 {
1298 /* addtional wc every 6 levels */ 1300 /* additional wc every 6 levels */
1299 if (!(i % 6)) 1301 if (!(i % 6))
1300 wc--; 1302 wc--;
1301 1303
1302 /* addtional dam every 4 levels. */ 1304 /* additional dam every 4 levels. */
1303 if (!(i % 4) && dam_bonus[stats.Str] >= 0) 1305 if (!(i % 4) && dam_bonus[stats.Str] >= 0)
1304 stats.dam += 1 + dam_bonus[stats.Str] / 5; 1306 stats.dam += 1 + dam_bonus[stats.Str] / 5;
1305 } 1307 }
1306 } 1308 }
1307 else 1309 else
1603 } 1605 }
1604 1606
1605 return skill_obj; 1607 return skill_obj;
1606} 1608}
1607 1609
1608
1609/* player_lvl_adj() - for the new exp system. we are concerned with 1610/* player_lvl_adj() - for the new exp system. we are concerned with
1610 * whether the player gets more hp, sp and new levels. 1611 * whether the player gets more hp, sp and new levels.
1611 * Note this this function should only be called for players. Monstes 1612 * Note this this function should only be called for players. Monstes
1612 * don't really gain levels 1613 * don't really gain levels
1613 * who is the player, op is what we are checking to gain the level 1614 * who is the player, op is what we are checking to gain the level
1623 1624
1624 if (op->level < settings.max_level && op->stats.exp >= level_exp (op->level + 1, who->expmul)) 1625 if (op->level < settings.max_level && op->stats.exp >= level_exp (op->level + 1, who->expmul))
1625 { 1626 {
1626 op->level++; 1627 op->level++;
1627 1628
1628 if (op != NULL && op == who && op->stats.exp > 1 && is_dragon_pl (who)) 1629 if (op && op == who && op->stats.exp > 1 && is_dragon_pl (who))
1629 dragon_level_gain (who); 1630 dragon_level_gain (who);
1630 1631
1631 /* Only roll these if it is the player (who) that gained the level */ 1632 /* Only roll these if it is the player (who) that gained the level */
1632 if (op == who && (who->level < 11) && who->type == PLAYER) 1633 if (op == who && (who->level < 11) && who->type == PLAYER)
1633 { 1634 {
1641 { 1642 {
1642 if (op->type != PLAYER) 1643 if (op->type != PLAYER)
1643 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name); 1644 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name);
1644 else 1645 else
1645 sprintf (buf, "You are now level %d.", op->level); 1646 sprintf (buf, "You are now level %d.", op->level);
1647
1646 if (who) 1648 if (who)
1647 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf); 1649 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf);
1648 } 1650 }
1651
1649 player_lvl_adj (who, op); /* To increase more levels */ 1652 player_lvl_adj (who, op); /* To increase more levels */
1650 } 1653 }
1651 else if (op->level > 1 && op->stats.exp < level_exp (op->level, who->expmul)) 1654 else if (op->level > 1 && op->stats.exp < level_exp (op->level, who->expmul))
1652 { 1655 {
1653 op->level--; 1656 op->level--;
1654 who->update_stats (); 1657 who->update_stats ();
1658
1655 if (op->type != PLAYER) 1659 if (op->type != PLAYER)
1656 { 1660 {
1657 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name); 1661 sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name);
1658 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf); 1662 new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf);
1659 } 1663 }
1664
1660 player_lvl_adj (who, op); /* To decrease more levels */ 1665 player_lvl_adj (who, op); /* To decrease more levels */
1661 } 1666 }
1662 1667
1663 /* check if the spell data has changed */ 1668 /* check if the spell data has changed */
1664 esrv_update_stats (who->contr); 1669 esrv_update_stats (who->contr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines