How to add more levels to your server

Read log files for errors! If this fails, come here for help

Moderator: Forum Moderator

Post Reply
whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

How to add more levels to your server

Post by whosyourdaddy » Fri Jan 08, 2010 4:12 pm

well ima help everyone here alot, what im gonna do is have u rename everything so after you make all these changes, if you wanna add more levels you only need to change one thing.

in constants.inl find

Code: Select all

#define MAX_LEVELS
and give it the level you want then

in war3ft.inl find

Code: Select all

			// User is under level 10
			else if ( p_data[id][P_LEVEL] < 10 )
			{
				pos += formatex( szRaceInfo[pos], 255, "%s %L: %d   XP: %d/%d ", szShortRaceName, id, "WORD_LEVEL", p_data[id][P_LEVEL], p_data[id][P_XP], XP_GetByLevel( p_data[id][P_LEVEL]+1) );
				formatex( szXPInfo, 31, "%L: %d   XP: %d/%d", id, "WORD_LEVEL", p_data[id][P_LEVEL], p_data[id][P_XP], XP_GetByLevel( p_data[id][P_LEVEL]+1 ) );
			}
and replace it with

Code: Select all

			// User is under level 10
			else if ( p_data[id][P_LEVEL] < MAX_LEVELS )
			{
				pos += formatex( szRaceInfo[pos], 255, "%s %L: %d   XP: %d/%d ", szShortRaceName, id, "WORD_LEVEL", p_data[id][P_LEVEL], p_data[id][P_XP], XP_GetByLevel( p_data[id][P_LEVEL]+1) );
				formatex( szXPInfo, 31, "%L: %d   XP: %d/%d", id, "WORD_LEVEL", p_data[id][P_LEVEL], p_data[id][P_XP], XP_GetByLevel( p_data[id][P_LEVEL]+1 ) );
			}
then in the same file find

Code: Select all

			// User is under level 10
			else if ( p_data[id][P_LEVEL] < 10 )
			{
				pos += formatex( szRaceInfo[pos], 255, "%s %L: %d^nXP: %d/%d^n", szShortRaceName, id, "WORD_LEVEL", p_data[id][P_LEVEL], p_data[id][P_XP], XP_GetByLevel( p_data[id][P_LEVEL]+1) );
			
			}
and replace it with

Code: Select all

			// User is under level 10
			else if ( p_data[id][P_LEVEL] < MAX_LEVELS )
			{
				pos += formatex( szRaceInfo[pos], 255, "%s %L: %d^nXP: %d/%d^n", szShortRaceName, id, "WORD_LEVEL", p_data[id][P_LEVEL], p_data[id][P_XP], XP_GetByLevel( p_data[id][P_LEVEL]+1) );
			
			}
in the same file find

Code: Select all

	// User is under level 10
	else if ( p_data[iTargetID][P_LEVEL] < 10 )
	{
		iMsgPos += formatex( szMsg, 511, "%s %L: %d   XP: %d/%d", szRaceName, id, "WORD_LEVEL", p_data[iTargetID][P_LEVEL], p_data[iTargetID][P_XP], XP_GetByLevel( p_data[iTargetID][P_LEVEL]+1 ) );
	}
and replace it with

Code: Select all

	// User is under level 10
	else if ( p_data[iTargetID][P_LEVEL] < MAX_LEVELS-1 )
	{
		iMsgPos += formatex( szMsg, 511, "%s %L: %d   XP: %d/%d", szRaceName, id, "WORD_LEVEL", p_data[iTargetID][P_LEVEL], p_data[iTargetID][P_XP], XP_GetByLevel( p_data[iTargetID][P_LEVEL]+1 ) );
	}
in the same file find

Code: Select all

	// Do we need to give this user XP?
	new iStartLevel = get_pcvar_num( CVAR_wc3_start_level );
	if ( p_data[id][P_XP] < XP_GetByLevel( iStartLevel ) && iStartLevel > 0 && iStartLevel <= 10 )
	{
and replace it with

Code: Select all

	// Do we need to give this user XP?
	new iStartLevel = get_pcvar_num( CVAR_wc3_start_level );
	if ( p_data[id][P_XP] < XP_GetByLevel( iStartLevel ) && iStartLevel > 0 && iStartLevel <= MAX_LEVELS )
	{
in the same file find

Code: Select all

	// Store level sprite names
	for ( i = 0; i < 11; i++ )
	{
		formatex( g_szLevelSprites[i], 63, "sprites/warcraft3/level/a_level_%d.spr", i );
	}
and replace it with

Code: Select all

	// Store level sprite names
	for ( i = 0; i < MAX_LEVELS+1; i++ )
	{
		formatex( g_szLevelSprites[i], 63, "sprites/warcraft3/level/a_level_%d.spr", i );
	}
then in xp.inl find

Code: Select all

new Float:iLevelMultiplier = ( fCurrentLevel / 10.0 ) + 1.0;
and replace it with

Code: Select all

new Float:iLevelMultiplier = ( fCurrentLevel / float(MAX_LEVELS) ) + 1.0;
in the same file find

Code: Select all

XP_GetByLevel( iLevel )
{
	if ( iLevel < 0 || iLevel > 10 )
	{
		return 0;
	}
and replace it with

Code: Select all

XP_GetByLevel( iLevel )
{
	if ( iLevel < 0 || iLevel > MAX_LEVELS )
	{
		return 0;
	}
in the same file find

Code: Select all

XP_GivenByLevel( iLevel )
{
	if ( iLevel < 0 || iLevel > 10 )
	{
		return 0;
	}
and replace it with

Code: Select all

XP_GivenByLevel( iLevel )
{
	if ( iLevel < 0 || iLevel > MAX_LEVELS )
	{
		return 0;
	}
in admin.inl find

Code: Select all

		new iLevel = str_to_num( szArg2 );

		if ( iLevel < 0 || iLevel >= 11 )
		{
			ADMIN_Print( id, "%s Error, level must be in between (or equal to) 0 and 17", g_MODclient );

			return PLUGIN_HANDLED;
		}
and replace it with

Code: Select all

		new iLevel = str_to_num( szArg2 );

		if ( iLevel < 0 || iLevel >= MAX_LEVELS+1 )
		{
			ADMIN_Print( id, "%s Error, level must be in between (or equal to) 0 and 17", g_MODclient );

			return PLUGIN_HANDLED;
		}
now thats all the coding from here you will need to make some fake sprite levels and you should be good to go, i have put an attachment that has up to 18 fake sprite hopefully u dont have the show sprite level thing on which is when their levels hover over their heads or something. see attachments for sprites if you have any erorrs pleas post and ill fix them but u shouldnt get any
Attachments
sprites.rar
(6.63 KiB) Downloaded 1712 times
Last edited by whosyourdaddy on Fri Jan 15, 2010 5:43 pm, edited 1 time in total.
Image

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Fri Jan 08, 2010 9:16 pm

also forgot to say that you gotta do this 2

in xp.h find

Code: Select all

// Amount of XP needed to gain a level
new iXPLevelShortTerm[11]				= {0,150,300,600,1000,1500,2100,2800,3400,4500,5500};
new iXPLevelSaved[11]					= {0,100,200,400,800,1600,3200,6400,12800,25600,51200};

// Amount of XP awarded when killing a user of this level
new iXPGivenShortTerm[11]				= {10,15,25,35,40,50,60,70,80,90,95};
new iXPGivenSaved[11]					= {6,8,10,12,14,16,18,20,24,28,32};
and change it to

Code: Select all

// Amount of XP needed to gain a level
new iXPLevelShortTerm[MAX_LEVELS+1]				= {0,150,300,600,1000,1500,2100,2800,3400,4500,5500};
new iXPLevelSaved[MAX_LEVELS+1]					= {0,100,200,400,800,1600,3200,6400,12800,25600,51200};

// Amount of XP awarded when killing a user of this level
new iXPGivenShortTerm[MAX_LEVELS+1]				= {10,15,25,35,40,50,60,70,80,90,95};
new iXPGivenSaved[MAX_LEVELS+1]					= {6,8,10,12,14,16,18,20,24,28,32};
and for this you gotta add what exp you want for each level for example the first set is if your not saving xp and second set is if ur saving xp for example

// Amount of XP needed to gain a level
new iXPLevelShortTerm[MAX_LEVELS+1] = {0,150,300,600,1000,1500,2100,2800,3400,4500,5500}; <<< not saving xp what xp they need for each level
new iXPLevelSaved[MAX_LEVELS+1] = {0,100,200,400,800,1600,3200,6400,12800,25600,51200}; << saving xp what xp they need for each level

// Amount of XP awarded when killing a user of this level
new iXPGivenShortTerm[MAX_LEVELS+1] = {10,15,25,35,40,50,60,70,80,90,95}; << how much xp to give if not saving xp
new iXPGivenSaved[MAX_LEVELS+1] = {6,8,10,12,14,16,18,20,24,28,32}; << how much xp to give if saving xp


now how to read this is

Code: Select all

new iXPLevelSaved[MAX_LEVELS+1]					= {0,100,200,400,800,1600,3200,6400,12800,25600,51200};
for level 0 there xp is 0
for level 1 there xp is 100
for level 2 there xp is 200
for level 3 there xp is 400 etc..

if you add x amount level then after 51200 you will need to add x amount of levels you added for example

Code: Select all

new iXPLevelSaved[MAX_LEVELS+1]					= {0,100,200,400,800,1600,3200,6400,12800,25600,51200,60000,70000,80000};
this is 13 levels and to hit lvl 11 you will need 60000 and to hit lvl 12 you will need 70000 and for 13 you will need 80000
Image

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Sat Jan 09, 2010 5:47 am

to change max skill level with only changing one variable from now on do this

in constants.inl find

Code: Select all

#define MAX_SKILL_LEVEL
and give it the number of how high a skill can go then go to skill_manager.inl and find

Code: Select all

	// Technically we shouldn't have a skill level EVER greater than 3 right?
	if ( iLevel > 3 )
	{
		WC3_Log( false, "Setting skill %d to %d wtf?? (%d)", skill_id, iLevel, iDebugID );

		log_error( AMX_ERR_NATIVE, "Setting skill %d to %d wtf?? (%d)", skill_id, iLevel, iDebugID );

		return;
	}
and change it to

Code: Select all

	// Technically we shouldn't have a skill level EVER greater than 3 right?
	if ( iLevel > MAX_SKILL_LEVEL )
	{
		WC3_Log( false, "Setting skill %d to %d wtf?? (%d)", skill_id, iLevel, iDebugID );

		log_error( AMX_ERR_NATIVE, "Setting skill %d to %d wtf?? (%d)", skill_id, iLevel, iDebugID );

		return;
	}
and then you should be good to go from now on
Image

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Sat Jan 09, 2010 2:15 pm

did u change other codes other than what i posted or did u only change the stuff i told u to change also what do u mean ultimate doesnt work whats ur server ip and is it only the undead ultimate that doesnt work
Image

[Swe]Gizmo
Peon
Posts: 16
Joined: Sun Aug 20, 2006 3:54 pm

Re: How to add more levels to your server

Post by [Swe]Gizmo » Sun Feb 21, 2010 7:02 am

To have 6 levels on each skill you need 19 levels.
6+6+6+1= 19

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Sun Feb 21, 2010 5:48 pm

post ur constants.inl
Image

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Mon Feb 22, 2010 5:19 pm

go to where sprites are saved and copy and paste them to a different location, then take the sprites u just copied and rename them to lvl 11 and lvl 12 to how many levels u have, then paste those new sprites with the other sprites and walla ur done
Image

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Sat May 01, 2010 2:10 pm

did u add a 4th level to ur skills and did u give a value to those 4th skills?

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Wed Jun 16, 2010 3:11 pm

did u change everythign the way it should have been changed?
Image

whosyourdaddy
Spell Breaker
Posts: 398
Joined: Sun Apr 27, 2008 10:11 pm

Re: How to add more levels to your server

Post by whosyourdaddy » Sat Aug 14, 2010 2:18 pm

my suggestion is removing the level sprites, its a useless sprite and it takes up pre-cache space
Image

Post Reply