Jump to content
Sign in to follow this  
xurumelous

GM Look

Recommended Posts

xurumelous    0
xurumelous

Olá!!

 

Fiz meu primeiro code de OTServ!!!! (felicidade =P)

Testado no Evolutions 0.6.3!

 

Quando você der look em alguém com access 3 ou maior, sairá a frase: "You see a Gamemaster."

Funfo 100% aqui!!

 

Sei que é simples, mas pow, meu primeiro code né rsrsrs

 

Vamos lá:

Em game.cpp

Procure por:

ss << "You see " << thing->getDescription(lookDistance);    if(player->access >= g_config.getNumber(ConfigManager::ACCESS_LOOK)){  if(Creature* lookCreature = thing->getCreature()){      ss << " (Hp: " << lookCreature->health << "/" << lookCreature->healthmax << ")";      if(Player* lookPlayer = lookCreature->getPlayer()){    ss << " (Mp: " << lookPlayer->mana << "/" << lookPlayer->manamax << ")";      }  }  else if(Item* item = thing->getItem()){      ss << " ID: " << item->getID() << ".";   if(item->getActionId())    ss << " ActionID: " << item->getActionId() << ".";      if(item->getUniqueId())    ss << " UniqueID: " << item->getUniqueId() << ".";  }  ss << " Position(X: " << thing->getPosition().x << " Y: " << thing->getPosition().y << " Z: " << thing->getPosition().z << ")";    }

Substitua por:

bool xuru = false;    if(Creature* lookCreature = thing->getCreature()){  if(Player* lookPlayer = lookCreature->getPlayer()){      if(lookPlayer->access >= 3) {               ss << "You See a Gamemaster.";               xuru = true;            } else {               ss << "You see " << thing->getDescription(lookDistance);             }                                                  }    } else {      ss << "You see " << thing->getDescription(lookDistance);     }              if(xuru == false) {   if(player->access >= g_config.getNumber(ConfigManager::ACCESS_LOOK)){    if(Creature* lookCreature = thing->getCreature()){     ss << " (Hp: " << lookCreature->health << "/" << lookCreature->healthmax << ")";     if(Player* lookPlayer = lookCreature->getPlayer()){      ss << " (Mp: " << lookPlayer->mana << "/" << lookPlayer->manamax << ")";     }    }    else if(Item* item = thing->getItem()){     ss << " ID: " << item->getID() << ".";             if(item->getActionId())      ss << " ActionID: " << item->getActionId() << ".";    if(item->getUniqueId())      ss << " UniqueID: " << item->getUniqueId() << ".";    }      ss << " Position(X: " << thing->getPosition().x << " Y: " << thing->getPosition().y << " Z: " << thing->getPosition().z << ")";   }    }

Só isso! facinho facinho =P

 

Bye~

Share this post


Link to post
Ablankzin    0
Ablankzin

Está bem legal...tem um aqui no forum que é bem parecido com este...mas para primeiro code está bem legal =)

Share this post


Link to post
Guest GabrieL Portnoy   
Guest GabrieL Portnoy

Vo testar aki...Vlw!

Share this post


Link to post
Jordan    0
Jordan

Parabéns xurumelous.aqui funfo certin ^^

Share this post


Link to post
Faelzinhow    0
Faelzinhow

Se for seu, está de parabens!agora gogo aulas de c++, e fazer um Code fu***** mesmo :]

Share this post


Link to post
xurumelous    0
xurumelous

@Rappa Carnaúba Isso foi uma acusação?@allThx =]

Share this post


Link to post
Guest Staype   
Guest Staype

Pow, ta rox! : Dtestado e aprovado xP

Share this post


Link to post
Oxy Nitrous    0
Oxy Nitrous

Pedro B.? nem eh do otfans...foi postado ali ewmbaixo n sei por kem tbm soh q o code eh de GOd

Share this post


Link to post
Guest Rappa Carnaúba   
Guest Rappa Carnaúba

@Xurumelous....não né http://forum.otserv.com.br/style_emoticons/<#EMO_DIR#>/tongue.gif mais você ta usando o codigo do pedro b que se encontrava no evolutions e vc fez uma pequena modificacão

 

 

http://otfans.net/showthread.php?t=42973&h...highlight=pedro

 

@Oxy nitrous

Quem é você pra dizer que o pedro b não é da OTFans? ele é um oficial developer da CVS uma coisa que você nunca sera não é? Olhe no link ai seu nub XD

Share this post


Link to post
xurumelous    0
xurumelous

@Rappa CarnaúbaBom, até quando fiz ele era 100% meu =SNão copiei de nenhum lugar...Estou aprendendo C++ mas não me baseei em outro ;]

Share this post


Link to post
Pedro Vincenzo    0
Pedro Vincenzo

Cara, nada haver com o code do Pedro. B, porra Rapha, se nem olha o código pra dizer de quem ele é. Porisso que o Honux te pwna todo dia.. p***a.. k me*** heim.Parabéns Xurmelous, continue assim;// Pedro Vincenzo

Share this post


Link to post
rivcdrigo    0
rivcdrigo

mt bom msm!

agr us gm podem botar moral

xD

hail all!

Share this post


Link to post
rivcdrigo    0
rivcdrigo

mt bom msm!

agr us gm podem botar moral

xD

hail all!

Share this post


Link to post
Guest Victor Hugo   
Guest Victor Hugo

Ow cara no meu game.cpp nao tem

 

ss << "You see " << thing->getDescription(lookDistance);



   if(player->access >= g_config.getNumber(ConfigManager::ACCESS_LOOK)){

      if(Creature* lookCreature = thing->getCreature()){

         ss << " (Hp: " << lookCreature->health << "/" << lookCreature->healthmax << ")";

         if(Player* lookPlayer = lookCreature->getPlayer()){

            ss << " (Mp: " << lookPlayer->mana << "/" << lookPlayer->manamax << ")";

         }

      }

      else if(Item* item = thing->getItem()){

         ss << " ID: " << item->getID() << ".";

   if(item->getActionId())

            ss << " ActionID: " << item->getActionId() << ".";

         if(item->getUniqueId())

            ss << " UniqueID: " << item->getUniqueId() << ".";

      }

      ss << " Position(X: " << thing->getPosition().x << " Y: " << thing->getPosition().y << " Z: " << thing->getPosition().z << ")";

   }

se eu procurar por : ss << "You see " << thing->getDescription(lookDistance);

 

eu vo axar isso:

 

ss << "You see " << thing->getDescription(lookDistance);

	player->sendTextMessage(MSG_INFO_DESCR, ss.str());



	return true;

}



bool Game::playerSetAttackedCreature(Player* player, unsigned long creatureId)

{

	OTSYS_THREAD_LOCK_CLASS lockClass(gameLock, "Game::playerSetAttackedCreature()");

	if(player->isRemoved())

  return false;

etc... nao axei o que vc tava pedindo =(

Share this post


Link to post
CapitaoX    0
CapitaoX

Boa cara

 

 

Continua assim

Share this post


Link to post
Guest HoKaGeSs   
Guest HoKaGeSs

Comigo aconteceu quase a msma coisa q o Victor...

tpw, soh q n existe nem uma parte parecida... y.y...

flws

Share this post


Link to post
Jackson Zani    1
Jackson Zani

boa

:)

deu certinho

Share this post


Link to post
Jackson Zani    1
Jackson Zani

boa

:)

deu certinho

Share this post


Link to post
xXSinistrOXx    0
xXSinistrOXx

bem loko continue assim, postando mais C++ pra nois :]

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×