1. Autor: Xelix
2. Opis:
3. Klient: 7.60
4. Przedstawienie kodu:
Commands.cpp
Pod:
Dodaj:
Na sam koniec dodaj:
Commands.h
Pod:
Dodaj:
Game.cpp
Pod:
Dodaj:
Ioplayerxml.cpp
Nad:
Dodaj:
Pod:
Dodaj:
Player.cpp
Pod:
Dodaj:
Pod:
Dodaj:
Player.h
Pod:
Dodaj:
Config.lua
Na samym ko?cu dodaj:
ALT+P >> Parametry >> Kompilator C++ >> -D_XELIX_REBORN_
2. Opis:
- Po wbiciu odpowiedniego poziomu pojawia si? napis o informacji potrzeby rebornu.
- Po wpisaniu !reborn automatycznie nas wylogowuje z postaci.
- Po zalogowaniu na posta? mamy zresetowany lvl,exp oraz pojawiamy si? w pozycji podanej w config.lua
- Zwi?ksza procent zadawanych obra?e? po rebornie (config).
- Po klikni?ciu "Look" na gracza wy?wietlana jest ilo?? wykonanych reborn?w.
3. Klient: 7.60
4. Przedstawienie kodu:
Commands.cpp
Pod:
PHP:
//table of commands
s_defcommands Commands::defined_commands[] = {
PHP:
#ifdef _XELIX_REBORN_
{"!reborn",&Commands::reborn},
#endif //_XELIX_REBORN_
PHP:
#ifdef _XELIX_REBORN_
bool Commands::reborn(Creature* c, const std::string &cmd, const std::string ¶m)
{
int reborn_level = (g_config.getGlobalNumber("reborn_level", 2));
Player* player = dynamic_cast<Player*>(c);
Position pos;
if(!player)
return false;
if(player->level >= reborn_level){
pos.x = (g_config.getGlobalNumber("pos_x", 123));
pos.y = (g_config.getGlobalNumber("pos_y", 123));
pos.z = (g_config.getGlobalNumber("pos_z", 7));
game->teleport(player, pos);
player->experience = 0;
player->level = 1;
player->reborn++;
player->kickPlayer(); //Wyrzuca postac
}else{
std::stringstream text;
text << "Musisz miec " << reborn_level << " poziom.";
player->sendTextMessage(MSG_BLUE_TEXT, text.str().c_str());
}
return true;
}
#endif //_XELIX_REBORN_
Pod:
PHP:
protected:
bool loaded;
Game *game;
std::string datadir;
//commands
PHP:
#ifdef _XELIX_REBORN_
bool reborn(Creature* c, const std::string &cmd, const std::string ¶m);
#endif //_XELIX_REBORN_
Pod:
PHP:
if (damage != 0)
{
PHP:
#ifdef _XELIX_REBORN_
if(attackPlayer && attackPlayer->reborn > 0){
damage += (int)(damage*(0.01*(attackPlayer->reborn*(g_config.getGlobalNumber("addRebornDMG", 2)))));
}
#endif //_XELIX_REBORN_
Nad:
PHP:
nodeValue = (char*)xmlGetProp(root, (const xmlChar *) "cap");
if(nodeValue) {
player->capacity = atoi(nodeValue);
xmlFreeOTSERV(nodeValue);
}
else
isLoaded = false;
PHP:
#ifdef _XELIX_REBORN_
nodeValue = (char*)xmlGetProp(root, (const xmlChar *) "reborn");
if(nodeValue) {
player->reborn = (atoi(nodeValue) != 0);
xmlFreeOTSERV(nodeValue);
}
else
isLoaded = false;
#endif //_XELIX_REBORN_
PHP:
sb << player->maglevel; xmlSetProp(root, (const xmlChar*) "maglevel", (const xmlChar*)sb.str().c_str()); sb.str("");
PHP:
#ifdef _XELIX_REBORN_
sb << player->reborn; xmlSetProp(root, (const xmlChar*) "reborn", (const xmlChar*)sb.str().c_str()); sb.str("");
#endif //_XELIX_REBORN_
Pod:
PHP:
maglevel = 20;
PHP:
#ifdef _XELIX_REBORN_
reborn = 0;
#endif //XELIX_REBORN_
PHP:
#ifdef YUR_PREMIUM_PROMOTION
if (isPromoted() && access == 0 && vocation == 0)
s << " is "<< g_config.PROMOTED_VOCATIONS[(int)vocation] << ".";
else
#endif //YUR_PREMIUM_PROMOTION
s << " is "<< g_config.VOCATIONS[(int)vocation] << ".";
}
PHP:
#ifdef _XELIX_REBORN_
if(reborn > 0){
s << "Posiada " << reborn << ".";
}else{
s << "Nie posiada rebornu.";
}
#endif //_XELIX_REBORN_
Pod:
PHP:
class Player : public Creature
{
public:
PHP:
#ifdef _XELIX_REBORN_
int reborn;
#endif //_XELIX_REBORN_
Na samym ko?cu dodaj:
PHP:
----XELIX REBORN SYSTEM----
-- Ile % dmg ma dodawac reborn
addRebornDMG = 2
-- Od ktorego poziomu mozna robic reborn
reborn_level = 400000
-- Pozycje do spawnu po rebornie
pos_x = 123
pos_y = 123
pos_z = 7