How to add more levels to your server
Posted: 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
and give it the level you want then
in war3ft.inl find
and replace it with
then in the same file find
and replace it with
in the same file find
and replace it with
in the same file find
and replace it with
in the same file find
and replace it with
then in xp.inl find
and replace it with
in the same file find
and replace it with
in the same file find
and replace it with
in admin.inl find
and replace it with
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
in constants.inl find
Code: Select all
#define MAX_LEVELS
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 ) );
}
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 ) );
}
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) );
}
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) );
}
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 ) );
}
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 ) );
}
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 )
{
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 )
{
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 );
}
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 );
}
Code: Select all
new Float:iLevelMultiplier = ( fCurrentLevel / 10.0 ) + 1.0;
Code: Select all
new Float:iLevelMultiplier = ( fCurrentLevel / float(MAX_LEVELS) ) + 1.0;
Code: Select all
XP_GetByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > 10 )
{
return 0;
}
Code: Select all
XP_GetByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > MAX_LEVELS )
{
return 0;
}
Code: Select all
XP_GivenByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > 10 )
{
return 0;
}
Code: Select all
XP_GivenByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > MAX_LEVELS )
{
return 0;
}
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;
}
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;
}