Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Titanms PROPER ability to multi level

Newbie Spellweaver
Joined
Apr 7, 2008
Messages
72
Reaction score
0
ok i didnt make this script, except the script didnt stop you from leveling when you got to lvl 200, and ti still gave u exp which caused like neg exp problems and stuff so i just added a few simple lines, none the less i didnt make this script just edited it.

replace ur levels.cpp with this

#include "Levels.h"
#include "Player.h"
#include "Maps.h"
#include "LevelsPacket.h"
#include "SkillsPacket.h"
#include "Skills.h"

int Levels::exps[200] = {15, 34, 57, 92, 135, 372, 560, 840, 1242, 1716, 2360, 3216, 4200,
5460, 7050, 8840, 11040, 13716, 16680, 20216, 24402, 28980, 34320, 40512, 47216, 54900,
63666, 73080, 83720, 95700, 108480, 122760, 138666, 155540, 174216, 194832, 216600, 240500,
266682, 294216, 324240, 356916, 391160, 428280, 468450, 510420, 555680, 604416, 655200,
709716, 748608, 789631, 832902, 878545, 926689, 977471, 1031036, 1087536, 1147032, 1209994,
1276301, 1346242, 1420016, 1497832, 1579913, 1666492, 1757815, 1854143, 1955750, 2062925,
2175973, 2295216, 2420993, 2553663, 2693603, 2841212, 2996910, 3161140, 3334370, 3517093,
3709829, 3913127, 4127566, 4353756, 4592341, 4844001, 5109452, 5389449, 5684790, 5996316,
6324914, 6671519, 7037118, 7422752, 7829518, 8258575, 8711144, 9188514, 9692044, 10223168,
10783397, 11374327, 11997640, 12655110, 13348610, 14080113, 14851703, 15665576, 16524049,
17429566, 18384706, 19392187, 20454878, 21575805, 22758159, 24005306, 25320796, 26708375,
28171993, 29715818, 31344244, 33061908, 34873700, 36784778, 8800583, 40926854, 43169645,
45535341, 48030677, 50662758, 53439077, 56367538, 59456479, 62714694, 66151459, 69776558,
73600313, 77633610, 81887931, 86375389, 91108760, 96101520, 101367883, 106992842, 112782213,
118962678, 125481832, 132358236, 139611467, 147262175, 155332142, 163844343, 172823012,
182293713, 192283408, 202820538, 213935103, 225658746, 238024845, 251068606, 264827165,
279339639, 294647508, 310794191, 327825712, 345790561, 364739883, 384727628, 405810702,
428049128, 451506220, 476248760, 502347192, 529875818, 558913012, 589541445, 621848316,
655925603, 691870326, 729784819, 769777027, 811960808, 856456260, 903390063, 952895838,
1005114529, 1060194805, 1118293480, 1244216724, 1312399800, 1384319309, 1460180007,
1540197871, 1624600714, 1179575962, 1713628833, 1807535693, 1906558648, 2011069705, 2121276324};

//A very simple fix to stop it from spamming EXP you gained for those with little experience
bool stoprepeat=FALSE;


//Multi-level by Reiyhn
void Levels::giveEXP(Player* player, int exp, char type){
if(player->getLevel() >= 200) return;

if(stoprepeat!=TRUE) {
stoprepeat = TRUE;
LevelsPacket::showEXP(player, exp, type);
}

//If your experience and the experience added doesn't level you
if(player->getExp() + exp <= exps[player->getLevel()-1]) {


stoprepeat=FALSE;
int cexp = player->getExp() + exp;
player->setExp(cexp, 1);
if(cexp >= exps[player->getLevel()-1]){
if(player->getLevel()>=200){
player->setExp(0, 0);
}
cexp -= exps[player->getLevel()-1];
if(cexp >= exps[player->getLevel()])
cexp = exps[player->getLevel()] - 1;
stoprepeat=FALSE;
player->setExp(cexp, 0);
player->setLevel(player->getLevel()+1);
player->setAp(player->getAp()+5);
int job=player->getJob()/100;
if(job ==0){
player->setMHP(player->getMHP()+15);
player->setMMP(player->getMMP()+10);
}
else if(job==1){
player->setMHP(player->getMHP()+25);
player->setMMP(player->getMMP()+15);
if(player->skills->getSkillLevel(1000001)>0){
player->setMHP(player->getMHP()+Skills::skills[1000001][player->skills->getSkillLevel(1000001)].x);
}
}
else if(job== 2){
player->setMHP(player->getMHP()+15);
player->setMMP(player->getMMP()+35);
}
else{
player->setMHP(player->getMHP()+25);
player->setMMP(player->getMMP()+15);
}
LevelsPacket::levelUP(player, Maps::info[player->getMap()].Players);
player->setHP(player->getMHP());
player->setMP(player->getMMP());
if(player->getJob() > 0){
player->setSp(player->getSp()+3);
}
}
}

//If you overlevel
else if(player->getExp() + exp > exps[player->getLevel()-1]) {

int neededEXP = exps[player->getLevel()-1] - player->getExp();
exp -= neededEXP;
int cexp = player->getExp() + neededEXP;


player->setExp(cexp, 1);
if(cexp >= exps[player->getLevel()-1]){
cexp -= exps[player->getLevel()-1];
if(cexp >= exps[player->getLevel()])
cexp = exps[player->getLevel()] - 1;
player->setExp(cexp, 0);
player->setLevel(player->getLevel()+1);
player->setAp(player->getAp()+5);
int job=player->getJob()/100;
if(job == 0){
player->setMHP(player->getMHP()+15);
player->setMMP(player->getMMP()+10);
}
else if(job == 1){
player->setMHP(player->getMHP()+25);
player->setMMP(player->getMMP()+15);
if(player->skills->getSkillLevel(1000001)>0){
player->setMHP(player->getMHP()+Skills::skills[1000001][player->skills->getSkillLevel(1000001)].x);
}
}
else if(job == 2){
player->setMHP(player->getMHP()+15);
player->setMMP(player->getMMP()+35);
}
else{
player->setMHP(player->getMHP()+25);
player->setMMP(player->getMMP()+15);
}
LevelsPacket::levelUP(player, Maps::info[player->getMap()].Players);
player->setHP(player->getMHP());
player->setMP(player->getMMP());
if(player->getJob() > 0){
player->setSp(player->getSp()+3);
}
}
Levels::giveEXP(player, exp, 1);
}

}

void Levels::addStat(Player* player, unsigned char* packet){
int type = getInt(packet+4);
LevelsPacket::statOK(player);
if(type == 0x40){
player->setStr(player->getStr()+1);
player->setAp(player->getAp()-1);
LevelsPacket::changeStat(player, type + 0x4000, player->getStr());
}
else if(type == 0x80){
player->setDex(player->getDex()+1);
player->setAp(player->getAp()-1);
LevelsPacket::changeStat(player, type + 0x4000, player->getDex());
}
else if(type == 0x100){
player->setInt(player->getInt()+1);
player->setAp(player->getAp()-1);
LevelsPacket::changeStat(player, type + 0x4000, player->getInt());
}
else if(type == 0x200){
player->setLuk(player->getLuk()+1);
player->setAp(player->getAp()-1);
LevelsPacket::changeStat(player, type + 0x4000, player->getLuk());
}
}

void Levels::setLevel(Player* player, int level){
player->setLevel(level);
LevelsPacket::levelUP(player, Maps::info[player->getMap()].Players);

}

void Levels::setJob(Player* player, int job){
player->setJob(job);
LevelsPacket::jobChange(player, Maps::info[player->getMap()].Players);
}



ENJOY
 
Initiate Mage
Joined
Jun 5, 2008
Messages
4
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

Nice release!
FIRST!
But I hope this is useful to many
 
Newbie Spellweaver
Joined
Jul 15, 2008
Messages
16
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

So this is for the Vana not the New TitanMS 2.0.0 right? Because 2.0.0 doesn't have a Levels.cpp

VANA Release....
 
Newbie Spellweaver
Joined
Apr 2, 2008
Messages
38
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

if im not mistakin this is the old one for the old TitanMS. its not angelscript so im not sure if it would work.
 
Newbie Spellweaver
Joined
Jun 7, 2008
Messages
14
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

I prefer no newb trys this with the new titan because it will mess it up and you wont be able to go back.
 
Newbie Spellweaver
Joined
Apr 7, 2008
Messages
72
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

lol if you needa go back click ctrl + z very simple ;P
 
for(alive>0){makeMoney()}
Loyal Member
Joined
Aug 1, 2006
Messages
357
Reaction score
68
Re: [release]Titanms PROPER ability to multi level

Use
Code:
 or [php] next time.
 
Master Summoner
Loyal Member
Joined
Apr 27, 2008
Messages
596
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

Sigh, back to Titan we go.
 
Newbie Spellweaver
Joined
Apr 7, 2008
Messages
72
Reaction score
0
Re: [release]Titanms PROPER ability to multi level

titan IS better than odin. Im sorry but once titan pulls up its boots and gets off their lazy butt, gets together and actually codes party, buddy system and chat it will be way better then odin. its 100x easier to use, its simple and MUCH more stable. Im currently looking for a team to code party but its hard to find ppl with such knowledge, its only a matter of time...
 
Back
Top