Bom, no site do Tibia brasileiro, está disponível uma calculadora, para vocês poderem calcular suas skills, exp, velocidade..
Então, olhando o código fonte ( em html é óbvio ), resolvi passar para o c++..
OBS : não passei 100% do código
cClass.h
cIncludes.h
cInfo.h
cPrincipal.cpp
Está ai, dá pra vocês darem uma estudada hard
Agradeço a equipe do TibiaBR por disponibilizarem as fórmulas
Então, olhando o código fonte ( em html é óbvio ), resolvi passar para o c++..
OBS : não passei 100% do código
cClass.h
- Código:
// Made by Coder.Fail
class cTibia
{
public :
int CalcLevel(int Vocation, int Level);
int CalcHp(int Vocation, int Level);
int CalcMana(int Vocation, int Level);
int CalcCap(int Vocation, int Level);
float CalcExpParty(float RightLevel);
int CalcVel(int Level, int Boh, int TimeRings, int Utanihur, int UtaniGranHur);
int CalcExptoLevel(int Exp, int Level);
int CalcMelee(int Vocation, int melee1, int melee2);
int CalcShield(int Vocation, int shield1, int shield2);
int CalcDist(int Vocation, int dist1, int dist2);
int ConverttoMinutes(int time);
private :
int varHpPts, varManaPts, varCapPts, melee, timemelee, time2melee, timeshield, time2shield, shield, dist, varExpRes, varExp, varVelocidadeHaste, varVelocidadeStrongHaste;
int timedist, time2dist;
};
class cShow
{
public :
void ShowExpParty();
void ShowPlayerInfo();
void ShowVel();
void ShowExp();
void ShowSkills();
};
cIncludes.h
- Código:
// Made by Coder.Fail
#include <windows.h>
#include <iostream>
#include <fstream>
#include <math.h>
#define _CRT_SECURE_NO_WARNINGS
#pragma warning( disable: 4172 )
#pragma warning( disable: 4700 )
#pragma warning( disable: 4244 )
#pragma warning( disable: 4715 )
#pragma warning( disable: 4800 )
#pragma warning( disable: 4101 )
#pragma warning( disable: 4804 )
#pragma warning( disable: 4430 )
#include "cInfo.h"
cInfo.h
- Código:
#include "cClass.h"
using namespace std;
cTibia Tibia;
cShow Show;
int cTibia::ConverttoMinutes(int time)
{
float time2 = time / 60;
return time2;
}
float cTibia::CalcExpParty(float HighLevel)
{
float Final = floor((HighLevel * 67) / 100);
return Final;
}
int cTibia::CalcHp(int Vocation, int Level)
{
switch(Vocation) {
case 1:
varHpPts = 15;
break;
case 2:
varHpPts = 10;
break;
case 3:
varHpPts = 5;
break;
case 4:
varHpPts = 5;
break;
}
int varHp = (Level - 7) * varHpPts + 185 - varHpPts;
return varHp;
}
int cTibia::CalcMana(int Vocation, int Level)
{
switch(Vocation) {
case 1:
varManaPts = 5;
break;
case 2:
varManaPts = 15;
break;
case 3:
varManaPts = 30;
break;
case 4:
varManaPts = 30;
break;
}
int varMana = (Level - 7) * varManaPts + 40 - varManaPts;
return varMana;
}
int cTibia::CalcCap(int Vocation, int Level)
{
switch(Vocation) {
case 1:
varCapPts = 25;
break;
case 2:
varCapPts = 20;
break;
case 3:
varCapPts = 10;
break;
case 4:
varCapPts = 10;
break;
}
int varCap = (Level - 7) * varCapPts + 470 - varCapPts;
return varCap;
}
int cTibia::CalcLevel(int Vocation, int Level)
{
int varExp = (((50 * Level) * (Level) * (Level) - 150 * (Level) * (Level) + 400 * (Level)) / 3);
return varExp;
}
int cTibia::CalcVel(int Level, int Boh, int TimeRings, int Utanihur, int UtaniGranHur)
{
int varVelocidade = (220 + (2 * (Level-1)));
if ( Utanihur == 1 )
{
varVelocidadeHaste = ((varVelocidade * 0.3) - 25);
varVelocidade += varVelocidadeHaste;
}
if ( UtaniGranHur == 1 )
{
varVelocidadeStrongHaste = ((varVelocidade * 0.7) - 56);
varVelocidade += varVelocidadeStrongHaste;
}
if ( Boh == 1 )
{
varVelocidade += 40;
}
if ( TimeRings == 1 )
{
varVelocidade += 60;
}
return varVelocidade;
}
int cTibia::CalcExptoLevel(int Exp, int Level)
{
varExp = (((50 * Level) * (Level) * (Level) - 150 * (Level) * (Level) + 400 * (Level)) / 3);
if (Exp > varExp) cout << "Seu level atual e maior do que o level desejado";
return varExp - Exp;
}
int cTibia::CalcMelee(int Vocation, int melee1, int melee2)
{
if (Vocation == 1)
{
if (melee1 > 15) {
timemelee = 0;
for (melee = melee1; melee < melee2; melee++) {
timemelee += (120 * (pow(1.1,(melee - 9))));
}
time2melee = Tibia.ConverttoMinutes(timemelee);
} else if (melee1 < 15) cout << "\nDigite valores maiores do que 15 ! \n\n";
}
return time2melee;
}
int cTibia::CalcShield(int Vocation, int shield1, int shield2)
{
if (Vocation)
{
if (shield1 > 15) {
for (shield = shield1; shield < shield2; shield++) {
timeshield += (120 * (pow(1.1,(shield - 9))));
}
time2shield = Tibia.ConverttoMinutes(timeshield);
} else if (shield < 15) cout << "\nDigite valores maiores do que 15 ! \n\n";
}
return time2shield;
}
int cTibia::CalcDist(int Vocation, int dist1, int dist2)
{
if (Vocation == 2)
{
if (dist1 > 15) {
for (dist = dist1; dist < dist2; dist++) {
timedist += (60 * (pow(1.1,(dist - 9))));
}
time2dist = Tibia.ConverttoMinutes(timedist);
} else if (shield < 15) cout << "\nDigite valores maiores do que 15 ! \n\n";
}
return time2dist;
}
void cShow::ShowExpParty()
{
float Final, highlevel;
cout << "\n\nDigite o mair lvl da party : \n";
cin >> highlevel;
Final = Tibia.CalcExpParty(highlevel);
cout << " \n\nO level minimo e de : " << Final << "\n\n";
}
void cShow::ShowPlayerInfo()
{
int Vocation, Level, exp, hp, mana, cap;
cout << "\nDigite sua vocaçao :\n\n"
<< "1 : Knight\n2 : Paladin\n3 : Sorcerer\n4 : Druid\n\n";
cin >> Vocation;
cout << "\nDigite o lvl que voce deseja ver : \n\n";
cin >> Level;
exp = Tibia.CalcLevel(Vocation, Level);
hp = Tibia.CalcHp(Vocation, Level);
mana = Tibia.CalcMana(Vocation, Level);
cap = Tibia.CalcCap(Vocation, Level);
cout << "\n\nO level : " << Level << " possui : \n\n"
<< "Exp : " << exp << "\n\n"
<< "Hp : " << hp << "\n\n"
<< "Mana : " << mana << "\n\n"
<< "Capacity : " << cap << "\n\n";
}
void cShow::ShowVel()
{
int Level, Boh, TimeRings, Utanihur, UtaniGranHur, velo;
cout << "\nDigite o level do player :\n\n";
cin >> Level;
cout << "\n\nDeseja usar Boots of Haste ?\n\n1 : Sim\n2 : Nao\n\n";
cin >> Boh;
cout << "\n\nDeseja usar Time Rings ?\n\n1 : Sim\n2 : Nao\n\n";
cin >> TimeRings;
cout << "\n\nDeseja usar Utanihur ?\n\n1 : Sim\n2 : Nao\n\n";
cin >> Utanihur;
cout << "\n\nDeseja usar UtaniGranHur ?\n\n1 : Sim\n2 : Nao\n\n";
cin >> UtaniGranHur;
velo = Tibia.CalcVel(Level, Boh, TimeRings, Utanihur, UtaniGranHur);
cout << "\n\nNo level " << Level << " a sua velocidade e de : " << velo;
if ( Boh == 1 )
Level += 20;
if ( TimeRings == 1 )
Level += 30;
if ( Utanihur == 1 )
Level += 56;
if ( UtaniGranHur == 1 )
Level += 132;
cout << ", o que e equivalente a velocidade de um level : " << Level << "\n\n";
}
void cShow::ShowExp()
{
int exp, Level, expres;
cout << "\nDigite a sua experiencia atual : \n\n";
cin >> exp;
cout << "\n\nDigite o nivel desejado :\n\n";
cin >> Level;
expres = Tibia.CalcExptoLevel(exp, Level);
cout << "\n\nVoce necessita de : " << expres << " para chegar ao level " << Level << " \n\n";
}
void cShow::ShowSkills()
{
int Vocation, melee1, melee2, shield1, shield2, time, time2, time3, time4, dist1, dist2;
cout << "\nDigite sua vocaçao :\n\n"
<< "1 : Knight\n2 : Paladin\n3 : Sorcerer\n4 : Druid\n\n";
cin >> Vocation;
if (Vocation == 1)
{
cout << "\n\nDigite o seu Sword/Axe/Melee/Mace atual : \n\n";
cin >> melee1;
cout << "\n\nDigite o skill desejado :\n\n";
cin >> melee2;
cout << "\n\nDigite o seu shield atual : \n\n";
cin >> shield1;
cout << "\n\nDigite o skill desejado :\n\n";
cin >> shield2;
time = Tibia.CalcMelee(Vocation, melee1, melee2);
time2 = Tibia.CalcShield(Vocation, shield1, shield2);
cout << "\n\nPara avançar o skill " << melee1
<< " para o " << melee2
<< " demorara : " << time << " minutos"
<< "\n\nE para avancar do shield "
<< shield1 << " para o "
<< shield2 << " , demorara "
<< time2
<< " minutos\n\n";
} else if (Vocation == 2)
{
cout << "\n\nDigite seu distance atual : \n\n";
cin >> dist1;
cout << "\n\nDigite o distance desejado :\n\n";
cin >> dist2;
cout << "\n\nDigite o seu shield atual : \n\n";
cin >> shield1;
cout << "\n\nDigite o skill desejado :\n\n";
cin >> shield2;
time3 = Tibia.CalcDist(Vocation, dist1, dist2);
time4 = Tibia.CalcShield(Vocation, shield1, shield2);
cout << "\n\nPara avançar o skill "
<< dist1
<< " para o "
<< dist2
<< " demorara : "
<< time3
<< " minutos"
<< "\n\nE para avancar do shield "
<< shield1
<< " para o "
<< shield2
<< " , demorara "
<< time4
<< " minutos\n\n";
} else if(Vocation == 3 || Vocation == 4) cout << "\n\nApenas calculamos skills de knight e paladin !\n\n";
}
cPrincipal.cpp
- Código:
// Made by Coder.Fail
#include "cIncludes.h"
int main()
{
cTibia Tibia;
cShow Show;
int c, c2;
while(true)
{
cout << "Voce deseja ver o level de party, as informaçoes de determinado level, a velocidade em determinado level, a experiencia ou o skill ? \n\n"
<< "1 : Party\n2 : Info Level\n3 : Velocidade\n4 : Experiencia\n5 : Skill\n\n";
cin >> c;
if ( c == 1 )
Show.ShowExpParty();
else if ( c == 2 )
Show.ShowPlayerInfo();
else if ( c == 3 )
Show.ShowVel();
else if ( c == 4 )
Show.ShowExp();
else if ( c == 5 )
Show.ShowSkills();
else
cout << "Digite um numero valido !\n\n";
cout << "Voce deseja continuar usando o programa ? \n\n"
<< "1 : Sim\n2 : Nao\n\n";
cin >> c2;
c2 == 1 ? cout << "\n\n" : exit(0);
}
system("pause");
return 0;
}
Está ai, dá pra vocês darem uma estudada hard
Agradeço a equipe do TibiaBR por disponibilizarem as fórmulas