FR

[7.6] Setoutfit V3.0

Por frerety, 26 de mai. de 2006 em Linguagens de Programação

9
5.3k
freretyF
26 de maio de 2006 às 20:17

HiHo!

Oia eu dnovo... Essa versão 3.0 é a melhor pq ela pode ler TODOS os monstros do server sem precisar "cadastrar" como estava nas outras versões... Too simple...

Let's go!

Commands.cpp

Se você já tiver as versões 1.0 ow 2.0 procure por:

bool Commands::outFit(Creature* c, const std::string &cmd, const std::string &param)

Delete isso.

Agora mesmo que vc não tenha as versões 1.0 e/ou 2.0 adicione no final do arquivo:

 

bool Commands::outFit(Creature* c, const std::string &cmd, const std::string &param){     std::string tmp = param;     std::string::size_type pos;     std::string outfit;     pos = tmp.find(",");     if(pos){        outfit = tmp.substr(0, pos).c_str();        tmp.erase(0, pos+1);        }     else{          outfit = param;        }             if(outfit != "gm")     {	std::string file = g_config.DATA_DIR + "/monster/" + outfit + ".xml";	xmlDocPtr doc;	doc = xmlParseFile(file.c_str());	if (!doc)  return false;    int number;	xmlNodePtr root, tileNode, arenaNode;	root = xmlDocGetRootElement(doc);	if (xmlStrcmp(root->name, (const xmlChar*)"monster")) 	{  xmlFreeDoc(doc);  return false;	}	arenaNode = root->children;	while (arenaNode)	{  if (strcmp((char*) arenaNode->name, "look") == 0)  {  	number = atoi((const char*)xmlGetProp(arenaNode, (const xmlChar *) "type"));  }  arenaNode = arenaNode->next;	}	xmlFreeDoc(doc);  Creature* creature = game->getCreatureByName(tmp);  Player* target = creature? dynamic_cast<Player*>(creature) : NULL;     Player* player = c? dynamic_cast<Player*>© : NULL;          if(target){       target->looktype = number;       game->creatureChangeOutfit(target);       }     else     {         player->looktype = number;         game->creatureChangeOutfit©;     }     }     else     {         Creature* creature = game->getCreatureByName(tmp);      Player* target = creature? dynamic_cast<Player*>(creature) : NULL;         Player* player = c? dynamic_cast<Player*>© : NULL;                  if(target){           target->looktype = 75;           game->creatureChangeOutfit(target);           }         else         {             player->looktype = 75;             game->creatureChangeOutfit©;         }      }          return true;}

 

Agora se você não tiver as versões 1.0 e/ou 2.0 procure por:

{"/kick",&Commands::kickPlayer},

logo abaixo adicione:

 

{"/of",&Commands::outFit},

 

Commands.h

Se você não tiver as versões 1.0 e/ou 2.0 logo abaixo de:

bool kickPlayer(Creature* c, const std::string &cmd, const std::string &param);

adicione:

 

bool outFit(Creature* c, const std::string &cmd, const std::string &param);

 

Compile e não esqueça de adicionar o comando em Commands.xml

----- Modo de Usar -----

.: /of [NOME DO BIXU],[NOME DO PLAYER]

.: observe que depois da vírgula não há espaço

.: para alterar seu próprio outfit apenas digite:

.: /of [NOME DO BIXU]

----- FiM -----

PS .: Qq dúvida poste aqui que eu resolvo.

FlW

CyA!

Editado Maio 26 por frerety

colexC
26 de maio de 2006 às 20:35

agora sim ta 100%

belo trabalho

sempre melhorando hein :D

cya~~ :bye:

FooxF
28 de maio de 2006 às 00:04

Muuuito rox cara parabens!!!

Colex & Favorety os reis dos scripts xD

freretyF
28 de maio de 2006 às 00:49

=0

ty... neim axu assim... Honux sabe beim + ki eu... Hail honux i colex... ^^

PS .: teim um Favorety no forum msm, mas eu soh o frerety... :p

FlW

CyA!

ScarFaceS
28 de maio de 2006 às 01:05

Rox!!

Mt boa ^^

@foox

N eh Favorety e sim frerety huauhahuauhahu =P

Bem rox ^^

2 meses depois...
BillsinB
25 de julho de 2006 às 20:15

BOM! :bye:

Have Fun! :bigsmile:

25 de julho de 2006 às 21:07

aew cara..

um pouquinho velho o tópico mas...

eu gostei da idéia pra trocar oufits...assim pelo menos não precisa ficar indo na pasta se alguem quiser trocar(se isso for permitido no OT)

porém eu não fasso muita questão não.. =P

mais tah valendo cara..vlwzao :bigsmile:

flws ae

fuiz!!

1 mês depois...
Holly AngelH
19 de agosto de 2006 às 08:53

Code muito manero cara.. vlws!

1 mês depois...
08 de setembro de 2006 às 18:28

Como eu faço. o meu eh commands.xml e eu n sei comu faze issu. me dah um help aew