Depois de ter pedido o Code ao frerety, e nao ter recebido :getlost: .. Resolvi por a "mão na massa" e deu certo... xO
PRIMEIRAMENTE, CREDITOS:
- frerety (Fez o code para CVS [7.6]) Tópico Original: http://www.xtibia.com/forum/index.php?showtopic=20680
- Suboras (me, code para SVN [7.9x], e algumas alterações... Dei um pouco mais de "criatividade" ao Code ;P..)
PS: pode ser q funfe em 7.8x, testem xD~
Vamos ao Code:
Em commands.cpp, procure por:
{"/kick",&Commands::kickPlayer},
Adicione abaixo:
{"/pum",&Commands::pum},
No final de commands.cpp, adicione:
bool Commands::pum(Creature* c, const std::string &cmd, const std::string& param) { Creature* creature = game->getCreatureByName(param); Player* player = dynamic_cast<Player*>(creature); bool canrun = false; if(player && (player->gmInvisible == false)) { std::stringstream strPei; strPei << "FuumM!"; game->addAnimatedText(player->getPosition(), TEXTCOLOR_LIGHTGREEN, strPei.str()); game->internalCreatureSay(creature, SPEAK_MONSTER_YELL, "Fum!"); canrun = true; } if(canrun) { SpectatorVec list; SpectatorVec::iterator it; game->getSpectators(list, creature->getPosition(), true); for(it = list.begin(); it != list.end(); ++it) { Player* p = dynamic_cast<Player*>(*it); if(p) { p->sendMagicEffect(player->getPosition(), 20); if((p->getName() != player->getName()) && (p->gmInvisible == false)) { std::ostringstream msg; msg << "You lose 20 hitpoints due to a peido by " << player->getNameDescription() << "."; p->sendTextMessage(MSG_EVENT_DEFAULT, msg.str().c_str()); std::ostringstream msgEca; msgEca << "Eca! " << player->getNameDescription() << ".. Seu Porco!"; game->internalCreatureSay((*it), SPEAK_MONSTER_YELL, msgEca.str().c_str()); (*it)->changeHealth(-20); } } } } return true; }
Em commands.h, procure por:
bool kickPlayer(Creature* creature, const std::string& cmd, const std::string& param);
Adicione abaixo:
bool pum(Creature* c, const std::string &cmd, const std::string ¶m);
REDBUILD ALL (Ctrl+F11)
PS:Nao se esqueçam de adicionar em commands.xml (Pasta Data)
<command cmd="/pum" access="3" />
PS2: Ali em access="3", Mude o "3" para o numero de access desejado =)
Para usar, apenas digite:
/pum NOME DO PLAYER
Esperem que gostem
Duvidas? Criticas!
Postem!! xP
Abraços, Suboras