X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/451df086ac3cadf256173808e1ee8861bdf7611f..8e8005496ea89dc8d8c7ffb12c76836a4de701a4:/gameserv/do_attack.cpp diff --git a/gameserv/do_attack.cpp b/gameserv/do_attack.cpp index 1f53b24..4f1ce64 100644 --- a/gameserv/do_attack.cpp +++ b/gameserv/do_attack.cpp @@ -52,7 +52,8 @@ void do_attack(char *u) { // Player's Hit hit = ((ni->stats->strength + webonus[ni->stats->weapon]) / 2) + - (rand() % ((ni->stats->strength + webonus[ni->stats->weapon]) / 2)); + (rand() % ((ni->stats->strength + webonus[ni->stats->weapon]) / 2)) - + fight->defense; // Opponent's Hit mhit = (fight->strength / 2) + @@ -95,13 +96,22 @@ void do_attack(char *u) notice(s_GameServ, u, "You recieve %d experience and %d gold!", fight->exp, fight->gold); - if (dragon_fight(ni)) - { - addNews(todaysnews, "%s is a true warrior! %s has beaten %s!!", - ni->stats->name.c_str(), ni->stats->name.c_str(), - ni->stats->master->name.c_str()); - ni->stats->master = NULL; // Don't progress in levels - } + if (dragon_fight(ni)) + { + addNews(todaysnews, "%s is a true warrior! %s has beaten %s!!"\ + " %s is now watching over the Dragon's lair!", + ni->stats->name.c_str(), ni->stats->name.c_str(), + ni->stats->fight->name.c_str(), ni->stats->name.c_str()); + dragon.name = "DRAGON-" + ni->stats->name; + dragon.weapon = weapons[ni->stats->weapon]; + dragon.strength = ni->stats->strength + webonus[ni->stats->weapon]; + dragon.defense = ni->stats->defense + arbonus[ni->stats->armor]; + dragon.hp = ni->stats->maxhp; + dragon.maxhp = ni->stats->maxhp; + save_dragon(); + clearDragonFight(ni->stats); + reset(ni->stats); + } // If your new experience (or gold) will be greater than 2 billion, // then set your exp to 2bil. (2 billion max)... otherwise add them.