Главная » Статьи » Скриптинг/ Статьи/ Мануалы

Делаем больше уровней для War3FT
Quote
Ничего сложного в этом туторе нет, делаем по статье и наслаждаемся игрой!


Code
Взято с:http://www.amxserv.net
Автор:Magnum


Приветствую всех кто читает эту тему!Уже давно ходит вопрос как сделать более 10 уровней в моде WAR3FT,сегодня я расскажу вам об этом.
Всё действия будут происходить в папке:addons\amxmodx\scripting\war3ft.Все файлы будут открывать любым текстовым редактором(я юзаю блокнот ).MAX_LEVELS нужно будет заменять на своё число!!!
В constants.inl находим:

Code
#define MAX_LEVELS 10


и заменяем 10 на нужное нам кол-во уровней.
Quote
В дальнейшем заменяем MAX_SKILL_LEVEL на наше количество уровней.


В war3ft.inl находим:
Code
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// 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
// Store level sprite names
for ( i = 0; i < 11; i++ )
{
formatex( g_szLevelSprites, 63, "sprites/warcraft3/level/a_level_%d.spr", i );
}


Заменяем на:

Code
// 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 );
}


В файле xp.inl находим:
Code
new Float:iLevelMultiplier = ( fCurrentLevel / 10.0 ) + 1.0;


И заменяем на:
Code
new Float:iLevelMultiplier = ( fCurrentLevel / float(MAX_LEVELS) ) + 1.0;


Находим:

Quote
XP_GetByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > 10 )
{
return 0;
}


Заменяем на:

Code
XP_GetByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > MAX_LEVELS )
{
return 0;
}


Находим:

Code
XP_GivenByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > 10 )
{
return 0;
}


Заменяем на:

Code
XP_GivenByLevel( iLevel )
{
if ( iLevel < 0 || iLevel > MAX_LEVELS )
{
return 0;
}


В файле admin.inl находим:

Code
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
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;
}


В файле xp.h находим:

Code
// 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};


И заменяем на:

Code
// 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};


Quote
// 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}; << сколько даётся опыта за килл при сохранении хп
В фигурные скобки вы должны добавить числа,чтобы их было столько,сколько у вас уровней включая нулевой.
Вот так будет выглядеть для 13 уровней:


new iXPLevelSaved[14] = {0,100,200,400,800,1600,3200,6400,12800,25600,51200,60000,70000,80000};

Так теперь будем делать новые скиллы )
В файле constants.inl находим:

Code
#define MAX_SKILLS 36
#define MAX_RACE_SKILLS 3
#define MAX_SKILL_LEVEL 3


Заменяем:

Code
#define MAX_SKILLS 36 - если у вас 13 уровней,то на 48.Если 16,на 60...


Quote
#define MAX_RACE_SKILLS 3
#define MAX_SKILL_LEVEL 3
Каждые +3 левла добавляется +1 к этим двум параметрам


Находим:
Code
// Constants for Abilities
new const Float:p_vampiric[3] = {0.10,0.20,0.30} // Vampiric Aura (skill 1)
new Float:p_unholy[3] = {265.0,285.0,300.0} // Unholy Aura (skill 2)
new Float:p_unholy_dod[3] = {33.3,66.6,100.0} // Unholy Aura (skill 2)
new const Float:p_levitation[3] = {0.8,0.6,0.4} // Levitation (skill 3)

new const p_invisibility[3] = {200,175,135} // Invisibility (skill 1)
new const p_devotion = 15 // Devotion Aura (skill 2)
new const Float:p_bash[3] = {0.10,0.20,0.30} // Bash (skill 3)

new const Float:p_critical[3] = {0.25,0.50,0.75} // Critical Strike (skill 1)
new const Float:p_grenade[3] = {2.0,3.0,4.0} // Critical Grenade (skill 2)
new const Float:p_ankh[3] = {0.333,0.666,1.0} // Equipment reincarnation (skill 3)

new const Float:p_evasion[3] = {0.1,0.175,0.25} // Evasion (skill 1)
new const Float:p_thorns[3] = {0.05,0.1,0.15} // Thorns Aura (skill 2)
new const Float:p_trueshot[3] = {0.1,0.2,0.35} // Trueshot Aura (skill 3)

new const Float:p_phoenix[3] = {0.333,0.666,1.0} // Phoenix (skill 1)
new const p_phoenix_dod[3] = {300,600,900} // Phoenix - DOD (skill 1)
new const Float:p_banish[3] = {0.05,0.10,0.15} // Banish (skill 2)
new const Float:p_mana[3] = {0.02,0.04,0.08} // Siphon Mana (skill 3)
new const Float:p_resistant[11] = {0.02, 0.04, 0.08, 0.12, 0.16, 0.20, 0.24, 0.28, 0.32, 0.36, 0.40} // Resistant Skin (Skill 4)

new const Float:p_heal[3] = {6.0,4.0,2.0} // Healing Wave (skill 1)
new const Float:p_hex[3] = {0.05,0.10,0.15} // Hex (skill 2)
new const p_serpent[3] = {1,2,3} // Serpent Ward (skill 3)
new const Float:p_concoction[11] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.15} // Unstable Concoction (Skill 4)

new const Float:p_fan[3] = {0.05,0.10,0.15} // Fan of Knives (skill 1)
new const Float:p_blink[3] = {0.333,0.666,1.0} // Blink (skill 2)
new const Float:p_shadow[3] = {0.05,0.10,0.15} // Shadow Strike (skill 3)
new const Float:p_harden[11] = {0.03, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50} // Hardened Skin (Skill 4)

new const Float:p_impale[3] = {0.05,0.1,0.15} // Impale (skill 1)
new const Float:p_spiked[3] = {0.05,0.1,0.15} // Spiked Carapace (skill 2)
new const Float:p_carrion[3] = {0.05,0.10,0.15} // Carrion Beetle (skill 3)
new const Float:p_orb[11] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.15} // Orb of Annihilation (Skill 4)


Заменяем на(я тут сделал для 13 левлов):
Code
// Constants for Abilities
new const Float:p_vampiric[4] = {0.10,0.20,0.30,0.40} // Vampiric Aura (skill 1)
new Float:p_unholy[4] = {265.0,285.0,300.0,320.0} // Unholy Aura (skill 2)
new Float:p_unholy_dod[4] = {33.3,66.6,100.0,133.3} // Unholy Aura (skill 2)
new const Float:p_levitation[4] = {0.8,0.6,0.4,0.3} // Levitation (skill 3)

new const p_invisibility[4] = {200,175,135,120} // Invisibility (skill 1)
new const p_devotion = 15 // Devotion Aura (skill 2)
new const Float:p_bash[4] = {0.10,0.20,0.30,0.40} // Bash (skill 3)

new const Float:p_critical[4] = {0.25,0.50,0.75,0.85} // Critical Strike (skill 1)
new const Float:p_grenade[4] = {2.0,3.0,4.0,5.0} // Critical Grenade (skill 2)
new const Float:p_ankh[4] = {0.333,0.666,0.788,1.0} // Equipment reincarnation (skill 3)

new const Float:p_evasion[4] = {0.1,0.175,0.25,0.275} // Evasion (skill 1)
new const Float:p_thorns[4] = {0.05,0.1,0.15,0.2} // Thorns Aura (skill 2)
new const Float:p_trueshot[4] = {0.1,0.2,0.35,0.45} // Trueshot Aura (skill 3)

new const Float:p_phoenix[4] = {0.333,0.666,0.788,1.0} // Phoenix (skill 1)
new const p_phoenix_dod[4] = {300,600,900,1200} // Phoenix - DOD (skill 1)
new const Float:p_banish[4] = {0.05,0.10,0.15,0.20} // Banish (skill 2)
new const Float:p_mana[4] = {0.02,0.04,0.08,0.12} // Siphon Mana (skill 3)
new const Float:p_resistant[14] = {0.02, 0.04, 0.08, 0.12, 0.16, 0.20, 0.24, 0.28, 0.32, 0.34, 0.36,0.38,0.40,0.42} // Resistant Skin  
new const Float:p_heal[4] = {6.0,4.0,2.0,1.5} // Healing Wave (skill 1)
new const Float:p_hex[4] = {0.05,0.10,0.15,0.20} // Hex (skill 2)
new const p_serpent[4] = {1,2,3,4} // Serpent Ward (skill 3)
new const Float:p_concoction[14] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11,0.12,0.13,0.14} // Unstable Concoction (Skill 4)

new const Float:p_fan[4] = {0.05,0.10,0.15,0.20} // Fan of Knives (skill 1)
new const Float:p_blink[4] = {0.333,0.666,0.8,1.0} // Blink (skill 2)
new const Float:p_shadow[4] = {0.05,0.10,0.15,0.20} // Shadow Strike (skill 3)
new const Float:p_harden[14] = {0.03, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.37, 0.40, 0.43,0.46,0.50,0.55} // Hardened Skin (Skill 4)

new const Float:p_impale[4] = {0.05,0.1,0.15,0.2} // Impale (skill 1)
new const Float:p_spiked[4] = {0.05,0.1,0.15,0.2} // Spiked Carapace (skill 2)
new const Float:p_carrion[4] = {0.05,0.10,0.15,0.2} // Carrion Beetle (skill 3)
new const Float:p_orb[14] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11,0.12,0.13,0.15} // Orb of Annihilation (Skill 4)


Или на это(16 левлов):
Code
// Constants for Abilities
new const Float:p_vampiric[5] = {0.10,0.20,0.30,0.40,0.50} // Vampiric Aura (skill 1)
new Float:p_unholy[5] = {265.0,285.0,300.0,320.0,340.0} // Unholy Aura (skill 2)
new Float:p_unholy_dod[5] = {33.3,66.6,100.0,133.3,166.6} // Unholy Aura (skill 2)
new const Float:p_levitation[5] = {0.8,0.6,0.4,0.3,0.2} // Levitation (skill 3)

new const p_invisibility[5] = {200,175,135,120,105} // Invisibility (skill 1)
new const p_devotion = 15 // Devotion Aura (skill 2)
new const Float:p_bash[5] = {0.10,0.20,0.30,0.40,0.50} // Bash (skill 3)

new const Float:p_critical[5] = {0.25,0.50,0.75,0.85,1.00} // Critical Strike (skill 1)
new const Float:p_grenade[5] = {2.0,3.0,4.0,5.0,6.0} // Critical Grenade (skill 2)
new const Float:p_ankh[5] = {0.333,0.666,0.788,1.0,1.333} // Equipment reincarnation (skill 3)

new const Float:p_evasion[5] = {0.1,0.175,0.25,0.275,0.5} // Evasion (skill 1)
new const Float:p_thorns[5] = {0.05,0.1,0.15,0.2,0.3} // Thorns Aura (skill 2)
new const Float:p_trueshot[5] = {0.1,0.2,0.35,0.45,0.55} // Trueshot Aura (skill 3)

new const Float:p_phoenix[5] = {0.333,0.666,0.788,1.0,1.333} // Phoenix (skill 1)
new const p_phoenix_dod[5] = {300,600,900,1200,1500} // Phoenix - DOD (skill 1)
new const Float:p_banish[5] = {0.05,0.10,0.15,0.20,0.30} // Banish (skill 2)
new const Float:p_mana[5] = {0.02,0.04,0.08,0.12,0.16} // Siphon Mana (skill 3)
new const Float:p_resistant[17] = {0.02, 0.04, 0.08, 0.12, 0.16, 0.20, 0.24, 0.28, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42, 0.44, 0.46, 0.48} // Resistant Skin  
new const Float:p_heal[5] = {6.0,4.0,2.0,1.5,1.0} // Healing Wave (skill 1)
new const Float:p_hex[5] = {0.05,0.10,0.15,0.20,0.30} // Hex (skill 2)
new const p_serpent[5] = {1,2,3,4,5} // Serpent Ward (skill 3)
new const Float:p_concoction[17] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17} // Unstable Concoction (Skill 4)

new const Float:p_fan[5] = {0.05,0.10,0.15,0.20,0.30} // Fan of Knives (skill 1)
new const Float:p_blink[5] = {0.333,0.666,0.8,1.0,1.333} // Blink (skill 2)
new const Float:p_shadow[5] = {0.05,0.10,0.15,0.20,0.30} // Shadow Strike (skill 3)
new const Float:p_harden[17] = {0.03, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.37, 0.40, 0.43,0.46,0.50,0.55,0.60,0.65,0.70} // Hardened Skin (Skill 4)

new const Float:p_impale[5] = {0.05,0.1,0.15,0.2,0.30} // Impale (skill 1)
new const Float:p_spiked[5] = {0.05,0.1,0.15,0.2,0.30} // Spiked Carapace (skill 2)
new const Float:p_carrion[5] = {0.05,0.10,0.15,0.2,0.30} // Carrion Beetle (skill 3)
new const Float:p_orb[17] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17} // Orb of Annihilation (Skill 4)


В файле skill_manager.inl находим:

Code
// 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;
}


Заменяем на:

Code
// 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;
}
Категория: Скриптинг/ Статьи/ Мануалы | Добавил: Lacosta (16.02.2012)
Просмотров: 616 | Рейтинг: 0.0/0
Всего комментариев: 0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]
Вверх