|
43 | 43 | #include "raids.h" |
44 | 44 | #include "chat.h" |
45 | 45 | #include "quests.h" |
| 46 | +#include "mounts.h" |
46 | 47 | #ifdef __ENABLE_SERVER_DIAGNOSTIC__ |
47 | 48 | #include "outputmessage.h" |
48 | 49 | #include "connection.h" |
@@ -186,7 +187,11 @@ bool Commands::loadFromXml() |
186 | 187 | else |
187 | 188 | std::cout << "missing acctype tag for " << strCmd << std::endl; |
188 | 189 | } |
| 190 | + #ifdef __ENABLE_SERVER_DIAGNOSTIC__ |
189 | 191 | else |
| 192 | + #else |
| 193 | + else if(strCmd != "/serverdiag") |
| 194 | + #endif |
190 | 195 | std::cout << "Unknown command " << strCmd << std::endl; |
191 | 196 | } |
192 | 197 | else |
@@ -580,11 +585,15 @@ void Commands::reloadInfo(Player* player, const std::string& cmd, const std::str |
580 | 585 | Quests::getInstance()->reload(); |
581 | 586 | player->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "Reloaded quests."); |
582 | 587 | } |
| 588 | + else if(tmpParam == "mount" || tmpParam == "mounts") |
| 589 | + { |
| 590 | + Mounts::getInstance()->reload(); |
| 591 | + player->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "Reloaded mounts."); |
| 592 | + } |
583 | 593 | else |
584 | 594 | player->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "Reload type not found."); |
585 | 595 | } |
586 | 596 |
|
587 | | - |
588 | 597 | void Commands::teleportToTown(Player* player, const std::string& cmd, const std::string& param) |
589 | 598 | { |
590 | 599 | std::string tmp = param; |
@@ -1019,8 +1028,12 @@ void Commands::removeThing(Player* player, const std::string& cmd, const std::st |
1019 | 1028 | void Commands::newType(Player* player, const std::string& cmd, const std::string& param) |
1020 | 1029 | { |
1021 | 1030 | int32_t lookType = atoi(param.c_str()); |
1022 | | - if(lookType >= 0 && lookType != 1 && lookType != 135 && (lookType <= 160 || lookType >= 192) && lookType <= 367) |
1023 | | - g_game.internalCreatureChangeOutfit(player, (const Outfit_t&)lookType); |
| 1031 | + if(lookType >= 0 && lookType != 1 && lookType != 135 && (lookType <= 160 || lookType >= 192) && lookType <= 386) |
| 1032 | + { |
| 1033 | + Outfit_t newOutfit = player->getDefaultOutfit(); |
| 1034 | + newOutfit.lookType = lookType; |
| 1035 | + g_game.internalCreatureChangeOutfit(player, newOutfit); |
| 1036 | + } |
1024 | 1037 | else |
1025 | 1038 | player->sendTextMessage(MSG_STATUS_SMALL, "This looktype does not exist."); |
1026 | 1039 | } |
@@ -1283,10 +1296,10 @@ void Commands::playerKills(Player* player, const std::string& cmd, const std::st |
1283 | 1296 | int32_t fragTime = g_config.getNumber(ConfigManager::FRAG_TIME); |
1284 | 1297 | if(player->redSkullTicks && fragTime > 0) |
1285 | 1298 | { |
1286 | | - int32_t frags = ceil(player->redSkullTicks / (double)fragTime); |
| 1299 | + int32_t frags = (int32_t)ceil(player->redSkullTicks / (double)fragTime); |
1287 | 1300 | int32_t remainingTime = (player->redSkullTicks % fragTime) / 1000; |
1288 | | - int32_t hours = floor(remainingTime / 3600); |
1289 | | - int32_t minutes = floor((remainingTime % 3600) / 60); |
| 1301 | + int32_t hours = (int32_t)floor(remainingTime / 3600); |
| 1302 | + int32_t minutes = (int32_t)floor((remainingTime % 3600) / 60); |
1290 | 1303 |
|
1291 | 1304 | std::stringstream ss; |
1292 | 1305 | ss << "You have " << frags << " unjustified kill" << (frags > 1 ? "s" : "") << ". The amount of unjustified kills will decrease after: " << hours << " hour" << (hours != 1 ? "s" : "") << " and " << minutes << " minute" << (minutes != 1 ? "s" : "") << "."; |
|
0 commit comments