Oi gente... Essa é a versão 2.0 do comando /randomoutfit... Nessa nova versão, você pode usar 5 tipos de RandomOutfit... Esses tipos são:
monsters: outfits de monstros
colors: mudar a cor do seu outfit
items: mudar seu outfit pra items (não sao todos os items mas são muitos ;D)
addons: mudar somente os addons
addons_colors: mudar os addons e a cor do outfit também
- Aí você usa o comando assim:
/randomoutfit tipo
Por exemplo:
/randomoutfit monsters
Lá vai o code:
---------------------------------------------
Commands.cpp
Depois de:
{"/town",&Commands::teleportToTown},
Adicione:
{"/randomoutfit",&Commands::randomOutfit},
---
No final do Commands.cpp adicione:
bool Commands::randomOutfit(Creature* creature, const std::string& cmd, const std::string& param){ //code by Zorzin versão 2.0 Player* player = creature->getPlayer(); if(!player) return false; if(player->changeOutfitRandom == 0 && (param != "monsters" && param != "colors" && param != "items" && param != "addons" && param != "addons_colors")) { player->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "The options are: monsters, colors, items, addons, addons_colors."); return false; } if(player->changeOutfitRandom == 0){ if(param == "monsters") player->changeOutfitRandom = 1; else if(param == "colors") player->changeOutfitRandom = 2; else if(param == "items") player->changeOutfitRandom = 3; else if(param == "addons") player->changeOutfitRandom = 4; else if(param == "addons_colors") player->changeOutfitRandom = 5; // player->sendTextMessage(MSG_INFO_DESCR, "Random Outfit Change: enabled."); return true;}else{ player->changeOutfitRandom = 0; player->currentOutfit.lookType = player->defaultOutfit.lookType; player->currentOutfit.lookHead = player->defaultOutfit.lookHead; player->currentOutfit.lookBody = player->defaultOutfit.lookBody; player->currentOutfit.lookLegs = player->defaultOutfit.lookLegs; player->currentOutfit.lookFeet = player->defaultOutfit.lookFeet; player->currentOutfit.lookAddons = player->defaultOutfit.lookAddons; g_game.internalCreatureChangeOutfit(player, player->getCurrentOutfit()); //o char vai voltar pro outfit inicial;) player->sendTextMessage(MSG_INFO_DESCR, "Random Outfit Change: disabled."); return true;} return false;}
---------------------------------------------
Commands.h
Depois de:
bool teleportToTown(Creature* creature, const std::string& cmd, const std::string& param);
Adicione:
bool randomOutfit(Creature* creature, const std::string& cmd, const std::string& param);
---------------------------------------------
Player.cpp
Depois de:
magLevel = 20;
Adicione:
changeOutfitRandom = 0;
---
Depois de:
#ifdef __SKULLSYSTEM__ checkRedSkullTicks(interval);#endif
Adicione:
changeRandomOtf();
---
No final do Player.cpp adicione:
void Player::changeRandomOtf(){ if(changeOutfitRandom == 0) return; if(changeOutfitRandom == 1) { short x = random_range(1, 2); if(x == 1) currentOutfit.lookType = random_range(2, 127); else currentOutfit.lookType = random_range(192, 247); g_game.internalCreatureChangeOutfit(this, getCurrentOutfit()); } else if(changeOutfitRandom == 2) { currentOutfit.lookHead = random_range(0, 132); currentOutfit.lookBody = random_range(0, 132); currentOutfit.lookLegs = random_range(0, 132); currentOutfit.lookFeet = random_range(0, 132); g_game.internalCreatureChangeOutfit(this, getCurrentOutfit()); } else if(changeOutfitRandom == 3) { Outfit_t outfit; short z = random_range(1, 7); if(z == 1) outfit.lookTypeEx = random_range(2376, 2456); else if(z == 2) outfit.lookTypeEx = random_range(2509, 2542); else if(z == 3) outfit.lookTypeEx = random_range(2457, 2500); else if(z == 4) outfit.lookTypeEx = random_range(2640, 2665); else if(z == 5) outfit.lookTypeEx = random_range(2261, 2316); else if(z == 6) outfit.lookTypeEx = random_range(1487, 1508); else if(z == 7) outfit.lookTypeEx = random_range(2086, 2092); g_game.internalCreatureChangeOutfit(this, outfit); } else if(changeOutfitRandom == 4) { currentOutfit.lookAddons = random_range(0, 3); g_game.internalCreatureChangeOutfit(this, getCurrentOutfit()); } else if(changeOutfitRandom == 5) { currentOutfit.lookHead = random_range(0, 132); currentOutfit.lookBody = random_range(0, 132); currentOutfit.lookLegs = random_range(0, 132); currentOutfit.lookFeet = random_range(0, 132); currentOutfit.lookAddons = random_range(0, 3); g_game.internalCreatureChangeOutfit(this, getCurrentOutfit()); }}
---------------------------------------------
Player.h
Depois de:
virtual Player* getPlayer() {return this;};
Adicione:
short changeOutfitRandom;void changeRandomOtf();
---------------------------------------------
Pronto... agora dê REBUILD ALL e divirta-se :icon1:
Não se esqueça de adicionar no data/commands.xml:
<command cmd="/randomoutfit" access="3" />
Credits: Zorzin
Obrigado,
Zorzin