Reborn System
Reborn System
1. Autor: Xelix
2. Opis:
3. Klient: 7.60
4. Przedstawienie kodu:
Commands.cpp
Pod:
Pod:
Pod:
Nad:
Pod:
Pod:
Na samym końcu dodaj:
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:
- Kod:
//table of commands
s_defcommands Commands::defined_commands[] = {
- Kod:
#ifdef _XELIX_REBORN_
{"!reborn",&Commands::reborn},
#endif //_XELIX_REBORN_
- Kod:
#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:
- Kod:
protected:
bool loaded;
Game *game;
std::string datadir;
//commands
- Kod:
#ifdef _XELIX_REBORN_
bool reborn(Creature* c, const std::string &cmd, const std::string ¶m);
#endif //_XELIX_REBORN_
Pod:
- Kod:
if (damage != 0)
{
- Kod:
#ifdef _XELIX_REBORN_
if(attackPlayer && attackPlayer->reborn > 0){
damage += (int)(damage*(0.01*(attackPlayer->reborn*(g_config.getGlobalNumber("addRebornDMG", 2)))));
}
#endif //_XELIX_REBORN_
Nad:
- Kod:
nodeValue = (char*)xmlGetProp(root, (const xmlChar *) "cap");
if(nodeValue) {
player->capacity = atoi(nodeValue);
xmlFreeOTSERV(nodeValue);
}
else
isLoaded = false;
- Kod:
#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_
- Kod:
sb << player->maglevel; xmlSetProp(root, (const xmlChar*) "maglevel", (const xmlChar*)sb.str().c_str()); sb.str("");
- Kod:
#ifdef _XELIX_REBORN_
sb << player->reborn; xmlSetProp(root, (const xmlChar*) "reborn", (const xmlChar*)sb.str().c_str()); sb.str("");
#endif //_XELIX_REBORN_
Pod:
- Kod:
maglevel = 20;
- Kod:
#ifdef _XELIX_REBORN_
reborn = 0;
#endif //XELIX_REBORN_
- Kod:
#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] << ".";
}
- Kod:
#ifdef _XELIX_REBORN_
if(reborn > 0){
s << "Posiada " << reborn << ".";
}else{
s << "Nie posiada rebornu.";
}
#endif //_XELIX_REBORN_
Pod:
- Kod:
class Player : public Creature
{
public:
- Kod:
#ifdef _XELIX_REBORN_
int reborn;
#endif //_XELIX_REBORN_
Na samym końcu dodaj:
- Kod:
----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
darkes- Uploader
- Liczba postów : 27
Join date : 13/11/2012
Similar topics
» Dragon Ball Reborn
» [NPC]Egg System
» [8.54] System 2 broni
» [8.54] Absorb System
» Saga System [CreatureEvents&Npc]
» [NPC]Egg System
» [8.54] System 2 broni
» [8.54] Absorb System
» Saga System [CreatureEvents&Npc]
Permissions in this forum:
Nie możesz odpowiadać w tematach
|
|