HiHo!
num te mandei o code pq não estou tendo tempo pra nada, estou ocupado ateh o pescoço e não deu tempo de fazer o exhausted... bom, se você quizer o code sem exhausted mais simplificado taí:
bool Commands::pum(Creature* creature, const std::string &cmd, const std::string& param)
{
Creature* c = g_game.getCreatureByName(param);
if(c && c->getPlayer())
{
if(creature->getPlayer() && c->getPlayer()->getAccessLevel() > creature->getPlayer()->getAccessLevel())
{
creature->getPlayer()->sendCancel("You can not use this command in this player.");
return false;
}
g_game.internalCreatureSay(c, SPEAK_MONSTER_SAY, "Fum!");
g_game.combatChangeHealth(COMBAT_UNDEFINEDDAMAGE, NULL, c, -20);
SpectatorVec list;
SpectatorVec::iterator it;
g_game.getSpectators(list, c->getPosition());
Player* tmpPlayer;
for(it = list.begin(); it != list.end(); ++it)
{
tmpPlayer = NULL;
if(tmpPlayer = (*it)->getPlayer())
{
tmpPlayer->sendMagicEffect(c->getPosition(), 20);
if(tmpPlayer->getName() != c->getName())
{
g_game.internalCreatureSay((*it), SPEAK_MONSTER_SAY, "Eca seu porco!");
}
}
}
}
return true;
}
PS .: deixe
e nãobool Commands::pum(Creature* creature, const std::string &cmd, const std::string& param)
Se quizer ajuda pra alterar alguma coisa pm me...bool Commands::pum(Creature* c, const std::string &cmd, const std::string& param)
Flw :]








info
Grupo: Campones
Registrado: 28/10/05
Posts: 91
Reputação: 0
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:
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:
Adicione abaixo:
REDBUILD ALL (Ctrl+F11)
PS:Nao se esqueçam de adicionar em commands.xml (Pasta Data)
PS2: Ali em access="3", Mude o "3" para o numero de access desejado =)
Para usar, apenas digite:
Esperem que gostem
Duvidas? Criticas!
Postem!! xP
Abraços, Suboras
Editado Março 18 por suboras