Dziś przedstawiam Reborn System praktycznie taki sam jak na MazurskimOTS.
1. Opis:
Po wbiciu danego poziomu (Do ustawienia w config.lua):
- postać automatycznie otrzymuje reborn.
- postać automatycznie dostaje 10 poziom.
- postać dostaje "ileś %" dmg (Do ustawienia w config.lua).
- postać otrzymuje połowę hp,mp z poprzedniego rebornu (Co to znaczy? Jeżeli postać na poziomie np. 700,000 ma 2,000,000 HP to po rebornie będzie posiadać 1,000,000).
- postać dostaje wiadomość o tym że wbiła reborn.
2. Autorzy: Rolus
Autorem jestem Ja: Rolus jednak przy dzieleniu hp,mp na pół i zwiększaniu dmg pomógł mi Wizard.
3. Przedstawienie kodu:
W ioplayerxml.cpp pod:
nodeValue = (char*)xmlGetProp(root, (const xmlChar *) "cap"); if(nodeValue) { player->capacity = atoi(nodeValue); xmlFreeOTSERV(nodeValue); } else isLoaded = false;
dodajemy:
#ifdef AUTO_REB nodeValue = (char*)xmlGetProp(root, (const xmlChar *) "reborn"); if(nodeValue) { player->reborn = (atoi(nodeValue) != 0); xmlFreeOTSERV(nodeValue); } else isLoaded = false; #endif //AUTO_REB
dalej pod:
sb << player->getCapacity(); xmlSetProp(root, (const xmlChar*) "cap", (const xmlChar*)sb.str().c_str()); sb.str("");
dodajemy:
#ifdef AUTO_REB sb << player->reborn; xmlSetProp(root, (const xmlChar*) "reborn", (const xmlChar*)sb.str().c_str()); sb.str(""); #endif //AUTO_REB
Teraz w player.cpp pod:
guildId = 0;
dodajemy:
#ifdef AUTO_REB reborn = 0; #endif //AUTO_REB
dalej pod:
if(guildNick.length()) s << " (" << guildNick << ")"; s << "."; }
dodajemy:
#ifdef AUTO_REB if(reborn > 0){ s << "Reborn: " << reborn << "."; } #endif //AUTO_REB
dalej w tym samym pliku zamieniamy całą funkcje:
void Player::addExp(exp_t exp)
na moją:
#ifdef AUTO_REB void Player::addExp(exp_t exp) { this->experience += exp; int lastLv = this->level; while (this->experience >= this->getExpForLv(this->level+1)) { this->level++; this->healthmax += g_config.HP_GAIN[(int)vocation]; this->health += g_config.HP_GAIN[(int)vocation]; this->manamax += g_config.MANA_GAIN[(int)vocation]; this->mana += g_config.MANA_GAIN[(int)vocation]; this->capacity += g_config.CAP_GAIN[(int)vocation]; } if(lastLv != this->level) { this->setNormalSpeed(); g_game.changeSpeed(this->getID(), this->getSpeed()); std::stringstream lvMsg,rebMsg; if(this->level > g_config.getGlobalNumber("rebornLvl")) { this->level = 10; this->experience = 9300; this->reborn++; this->healthmax /= 2; this->health /= 2; this->manamax /= 2; this->mana /= 2; lvMsg << "Awansowales z poziomu " << lastLv << " na poziom " << level << "."; rebMsg << "Gratulacje! Osiagnales reborn."; this->sendTextMessage(MSG_INFO,rebMsg.str().c_str()); this->sendTextMessage(MSG_ADVANCE,lvMsg.str().c_str()); }else { lvMsg << "Awansowales z poziomu " << lastLv << " na poziom " << level << "."; this->sendTextMessage(MSG_ADVANCE,lvMsg.str().c_str()); this->sendStats(); } } } #endif //AUTO_REB
Na koniec w player.h pod:
class Player : public Creature { public:
dodajemy:
#ifdef AUTO_REB short reborn; #endif //AUTO_REB
Jeszcze w game.cpp pod:
if (damage != 0) {
dodaj:
#ifdef AUTO_REB if(attackPlayer && attackPlayer->reborn > 0){ damage += (int)(damage*(0.01*(attackPlayer->reborn*(g_config.getGlobalNumber("rebornDmg", 2))))); } #endif//AUTO_REB
No i jeszcze dodamy do Parametrów (ALT + P):
:-DAUTO_REB
i do config.lua na samym końcu pliku:
----- Reborn System © by Rolus, Wizard ---- rebornDmg = 140 -- Ile % DMG postac ma dostawac za kazdy reborn. rebornLvl = 700 -- Od jakiego poziomu ma byc reborn. ----- Reborn System © by Rolus, Wizard ----
Przebuduj i gotowe
Offline