|
Дата: Понедельник, 04.02.2013, 23:11 | Сообщение # ( 1)
|
Пользователи
I love LINK-CSS.PP.UA
|
Заходим в cssbWar3ftMod.sma и добавляем новый код:
Код #include "war3ft/race_undead.inl" // Undead Scourge - 1 #include "war3ft/race_human.inl" // Human Alliance - 2 #include "war3ft/race_orc.inl" // Orcish Horde - 3 #include "war3ft/race_elf.inl" // Night Elf - 4 #include "war3ft/race_blood.inl" // Blood Mage - 5 #include "war3ft/race_shadow.inl" // Shadow Hunter - 6 #include "war3ft/race_warden.inl" // Warden - 7 #include "war3ft/race_crypt.inl" // Crypt Lord - 8 #include "war3ft/race_chameleon.inl" // Chameleon - 9 #include "war3ft/race_название_вашей_расы.inl" // race_название_вашей_расы - 10 2) Далее идем в constants.inl и находим: Код // Race numbers #define RACE_NONE 0 #define RACE_UNDEAD 1 #define RACE_HUMAN 2 #define RACE_ORC 3 #define RACE_ELF 4 #define RACE_BLOOD 5 #define RACE_SHADOW 6 #define RACE_WARDEN 7 #define RACE_CRYPT 8 #define RACE_ВАША_РАСА 9 #define RACE_CHAMELEON 10 3) Там же находим: Код #define MAX_RACES 9
Заменяем 9 на 10. 4) Создаем файл в папке war3ft под названием race_ваша_раса.inl где будут хранится скиллы и ультимэйт.
5) Заходим в constants.inl и регестрируем ваши скиллы: Код #define SKILL_ВАШ_СКИЛЛ_1 36 #define SKILL_ВАШ_СКИЛЛ_2 37 #define SKILL_ВАШ_СКИЛЛ_3 38 #define ULTIMATE_ВАШ_СУПЕР_НАВЫК 39 #define PASS_ВАША_ПАССИВКА 40 P.S пассивный навык не обязательно создавать, на ваше усмотрение.
6) Заходим в skill_manager.inl и заменяем там: Код SM_Init() { // Set up the Skill Owners g_SkillOwner[SKILL_VAMPIRICAURA ] = RACE_UNDEAD; g_SkillOwner[SKILL_UNHOLYAURA ] = RACE_UNDEAD; g_SkillOwner[SKILL_LEVITATION ] = RACE_UNDEAD; g_SkillOwner[ULTIMATE_SUICIDE ] = RACE_UNDEAD;
g_SkillOwner[SKILL_INVISIBILITY ] = RACE_HUMAN; g_SkillOwner[SKILL_DEVOTION ] = RACE_HUMAN; g_SkillOwner[SKILL_BASH ] = RACE_HUMAN; g_SkillOwner[ULTIMATE_BLINK ] = RACE_HUMAN;
g_SkillOwner[SKILL_CRITICALSTRIKE ] = RACE_ORC; g_SkillOwner[SKILL_CRITICALGRENADE ] = RACE_ORC; g_SkillOwner[SKILL_REINCARNATION ] = RACE_ORC; g_SkillOwner[ULTIMATE_CHAINLIGHTNING ] = RACE_ORC;
g_SkillOwner[SKILL_EVASION ] = RACE_ELF; g_SkillOwner[SKILL_THORNS ] = RACE_ELF; g_SkillOwner[SKILL_TRUESHOT ] = RACE_ELF; g_SkillOwner[ULTIMATE_ENTANGLE ] = RACE_ELF;
g_SkillOwner[SKILL_PHOENIX ] = RACE_BLOOD; g_SkillOwner[SKILL_BANISH ] = RACE_BLOOD; g_SkillOwner[SKILL_SIPHONMANA ] = RACE_BLOOD; g_SkillOwner[ULTIMATE_IMMOLATE ] = RACE_BLOOD; g_SkillOwner[PASS_RESISTANTSKIN ] = RACE_BLOOD;
g_SkillOwner[SKILL_HEALINGWAVE ] = RACE_SHADOW; g_SkillOwner[SKILL_HEX ] = RACE_SHADOW; g_SkillOwner[SKILL_SERPENTWARD ] = RACE_SHADOW; g_SkillOwner[ULTIMATE_BIGBADVOODOO ] = RACE_SHADOW; g_SkillOwner[PASS_UNSTABLECONCOCTION ] = RACE_SHADOW;
g_SkillOwner[SKILL_FANOFKNIVES ] = RACE_WARDEN; g_SkillOwner[SKILL_BLINK ] = RACE_WARDEN; g_SkillOwner[SKILL_SHADOWSTRIKE ] = RACE_WARDEN; g_SkillOwner[ULTIMATE_VENGEANCE ] = RACE_WARDEN; g_SkillOwner[PASS_HARDENEDSKIN ] = RACE_WARDEN;
g_SkillOwner[SKILL_IMPALE ] = RACE_CRYPT; g_SkillOwner[SKILL_SPIKEDCARAPACE ] = RACE_CRYPT; g_SkillOwner[SKILL_CARRIONBEETLES ] = RACE_CRYPT; g_SkillOwner[ULTIMATE_LOCUSTSWARM ] = RACE_CRYPT; g_SkillOwner[PASS_ORB ] = RACE_CRYPT;
g_SkillOwner[SKILL_ВАШ_СКИЛЛ_1 ] = RACE_ВАША_РАСА; g_SkillOwner[SKILL_ВАШ_СКИЛЛ_2 ] = RACE_ВАША_РАСА; g_SkillOwner[SKILL_ВАШ_СКИЛЛ_3 ] = RACE_ВАША_РАСА; g_SkillOwner[ULTIMATE_ВАШ_СУПЕР_НАВЫК ] = RACE_ВАШИ_РАСА;
// Set up the skill types g_SkillType[SKILL_VAMPIRICAURA ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_UNHOLYAURA ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_LEVITATION ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_SUICIDE ] = SKILL_TYPE_ULTIMATE;
g_SkillType[SKILL_INVISIBILITY ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_DEVOTION ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_BASH ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_BLINK ] = SKILL_TYPE_ULTIMATE;
g_SkillType[SKILL_CRITICALSTRIKE ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_CRITICALGRENADE ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_REINCARNATION ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_CHAINLIGHTNING ] = SKILL_TYPE_ULTIMATE;
g_SkillType[SKILL_EVASION ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_THORNS ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_TRUESHOT ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_ENTANGLE ] = SKILL_TYPE_ULTIMATE;
g_SkillType[SKILL_PHOENIX ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_BANISH ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_SIPHONMANA ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_IMMOLATE ] = SKILL_TYPE_ULTIMATE; g_SkillType[PASS_RESISTANTSKIN ] = SKILL_TYPE_PASSIVE;
g_SkillType[SKILL_HEALINGWAVE ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_HEX ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_SERPENTWARD ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_BIGBADVOODOO ] = SKILL_TYPE_ULTIMATE; g_SkillType[PASS_UNSTABLECONCOCTION ] = SKILL_TYPE_PASSIVE;
g_SkillType[SKILL_FANOFKNIVES ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_BLINK ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_SHADOWSTRIKE ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_VENGEANCE ] = SKILL_TYPE_ULTIMATE; g_SkillType[PASS_HARDENEDSKIN ] = SKILL_TYPE_PASSIVE;
g_SkillType[SKILL_IMPALE ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_SPIKEDCARAPACE ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_CARRIONBEETLES ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_LOCUSTSWARM ] = SKILL_TYPE_ULTIMATE; g_SkillType[PASS_ORB ] = SKILL_TYPE_PASSIVE;
g_SkillType[SKILL_ВАШ_СКИЛЛ_1 ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_ВАШ_СКИЛЛ_2 ] = SKILL_TYPE_TRAINABLE; g_SkillType[SKILL_ВАШ_СКИЛЛ_3 ] = SKILL_TYPE_TRAINABLE; g_SkillType[ULTIMATE_ВАШ_СУПЕР_НАВЫК ] = SKILL_TYPE_ULTIMATE;
// Set up the skill order g_SkillOrder[SKILL_VAMPIRICAURA ] = SKILL_POS_1; g_SkillOrder[SKILL_UNHOLYAURA ] = SKILL_POS_2; g_SkillOrder[SKILL_LEVITATION ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_SUICIDE ] = SKILL_POS_4;
g_SkillOrder[SKILL_INVISIBILITY ] = SKILL_POS_1; g_SkillOrder[SKILL_DEVOTION ] = SKILL_POS_2; g_SkillOrder[SKILL_BASH ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_BLINK ] = SKILL_POS_4;
g_SkillOrder[SKILL_CRITICALSTRIKE ] = SKILL_POS_1; g_SkillOrder[SKILL_CRITICALGRENADE ] = SKILL_POS_2; g_SkillOrder[SKILL_REINCARNATION ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_CHAINLIGHTNING ] = SKILL_POS_4;
g_SkillOrder[SKILL_EVASION ] = SKILL_POS_1; g_SkillOrder[SKILL_THORNS ] = SKILL_POS_2; g_SkillOrder[SKILL_TRUESHOT ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_ENTANGLE ] = SKILL_POS_4;
g_SkillOrder[SKILL_PHOENIX ] = SKILL_POS_1; g_SkillOrder[SKILL_BANISH ] = SKILL_POS_2; g_SkillOrder[SKILL_SIPHONMANA ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_IMMOLATE ] = SKILL_POS_4; g_SkillOrder[PASS_RESISTANTSKIN ] = SKILL_POS_NONE;
g_SkillOrder[SKILL_HEALINGWAVE ] = SKILL_POS_1; g_SkillOrder[SKILL_HEX ] = SKILL_POS_2; g_SkillOrder[SKILL_SERPENTWARD ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_BIGBADVOODOO ] = SKILL_POS_4; g_SkillOrder[PASS_UNSTABLECONCOCTION ] = SKILL_POS_NONE;
g_SkillOrder[SKILL_FANOFKNIVES ] = SKILL_POS_1; g_SkillOrder[SKILL_BLINK ] = SKILL_POS_2; g_SkillOrder[SKILL_SHADOWSTRIKE ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_VENGEANCE ] = SKILL_POS_4; g_SkillOrder[PASS_HARDENEDSKIN ] = SKILL_POS_NONE;
g_SkillOrder[SKILL_IMPALE ] = SKILL_POS_1; g_SkillOrder[SKILL_SPIKEDCARAPACE ] = SKILL_POS_2; g_SkillOrder[SKILL_CARRIONBEETLES ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_LOCUSTSWARM ] = SKILL_POS_4; g_SkillOrder[PASS_ORB ] = SKILL_POS_NONE;
g_SkillOrder[SKILL_ВАШ_СКИЛЛ_1 ] = SKILL_POS_1; g_SkillOrder[SKILL_ВАШ_СКИЛЛ_2 ] = SKILL_POS_2; g_SkillOrder[SKILL_ВАШ_СКИЛЛ_3 ] = SKILL_POS_3; g_SkillOrder[ULTIMATE_ВАШ_СУПЕР_НАВЫК ] = SKILL_POS_4; } 7) Регестрируем наши скиллы в langugage.inl. Находим функцию LANG_GetSkillInfo( skill_id, idUser, skill_description[], len ) {
И добавляем в конец: Код // Название вашей рассы case SKILL_ВАШ_СКИЛЛ_1: formatex ( skill_description, len, "%L", id, "SKILL_I_36" ); case SKILL_ВАШ_СКИЛЛ_2: formatex ( skill_description, len, "%L", id, "SKILL_I_37" ); case SKILL_ВАШ_СКИЛЛ_3: formatex ( skill_description, len, "%L", id, "SKILL_I_38" ); case ULTIMATE_ВАШ_СУПЕР_НАВЫК: formatex ( skill_description, len, "%L", id, "SKILL_I_39" ); 8) Далее нам нужно создать скиллы и ультимэйт ( создаете сами ) Только скажу одно, что скиллы должны быть аттакующие и защищающие и их нужно регестрировать в файле events.inl
9) Создаем ультимэйт: он подразделяется на 2 типа: 1) который ищит жертву ( слышно по звуку пикания ) 2) который работает без поиска жертвы ( пример ультимэйт вардена. Далее нам нужно регестрировать ультимэйты в файле ClientCommands.inl и Events.inl ( нужно регестрировать только при 1 типе ультимэйта )
10) Заходим в ultimates.h и видим Код new g_UltimateIcons[10][32] = { "dmg_rad", // Undead "item_longjump", // Human Alliance "dmg_shock", // Orcish Horde "item_healthkit", // Night Elf "dmg_heat", // Blood Mage "suit_full", // Shadow Hunter "cross", // Warden "dmg_gas", // Crypt Lord "", // Хамелеон если 9 рассой стоит хамелеон то ковычки должны быть пустые! "dmg_cold" // Ваша расса, dmg_cold - значок снежинки }; 11) Заходим в ultimates.inl и ищем Код // Each race has its on color for its icon... switch ( iRaceID ) { case 1: r=255, g=0, b=0; // Undead case 2: r=0, g=120, b=120; // Human case 3: r=255, g=255, b=255; // Orc case 4: r=0, g=0, b=255; // Night Elf case 5: r=255, g=0, b=0; // Blood Mage case 6: r=0, g=200, b=200; // Shadow Hunter case 7: r=255, g=0, b=0; // Warden case 8: r=0, g=255, b=0; // Crypt Lord case 9: r=0, g=0, b=0; // Хамелеон case 10: r=0, g=255, b=255; // Цвет значка вашей рассы } 12) Идем в skills.inl и изменяем значение MAX_SKILLS. Оно меняется по записи ваших скиллов в constants.inl, если последняя запись была Код #define PASS_ВАША_ПАССИВКА 40 то MAX_SKILLS будет равняться 41 ( т.е механизм такой constants.inl + 1) 13) Заходим в menus.inl и ищем функцию Код public MENU_ChangeRace( idUser, iRaceXP[MAX_RACES] ) и public _MENU_ChangeRace( idUser, key ) и заменяем ее под 10 расс: Код // Function will display the changerace menu public MENU_ChangeRace( idUser, iRaceXP[MAX_RACES] ) {
new szRaceName[MAX_RACES+1][64], i, pos, iKeys = 0, szMenu[512], szXP[16];
// Get our race names for ( i = 0; i < 10; i++ ) { lang_GetRaceName( i + 1, idUser, szRaceName[i], 63 ); }
pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "MENU_SELECT_RACE" );
// Then add the experience column if ( get_pcvar_num( CVAR_wc3_save_xp ) ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\R%L^n^n", LANG_PLAYER, "MENU_WORD_EXPERIENCE" ); } else { //pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n^n" ); pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "^n" ); }
// Build the changerace menu (for every race) for ( i = 0; i < 10; i++ ) { num_to_str( iRaceXP[i], szXP, 15 );
// Add the "Select a Hero" message if necessary if ( i == 4 ) { pos += format( szMenu[pos], charsmax(szMenu)-pos, "%L", LANG_PLAYER, "SELECT_HERO" ); }
// User's current race if ( i == p_data[idUser][P_RACE] - 1 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s\d\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
iKeys |= (1<<i); }
// Race the user wants to change to else if ( i == p_data[idUser][P_CHANGERACE] - 1 ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\r%d. %s\r\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
iKeys |= (1<<i); }
// All other cases else {
new bool:bAllowRace = true;
// Check to see if the user can choose this race (are there too many of this race?) if ( bAllowRace ) { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\w%d. %s\y\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
iKeys |= (1<<i); }
// If not, display the race, but don't give them a key to press else { pos += formatex( szMenu[pos], charsmax(szMenu)-pos, "\d%d. %s\y\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) ); } }
}
iKeys |= (1<<i);
// Show the menu to the user! show_menu( idUser, iKeys, szMenu, -1 );
return; }
public _MENU_ChangeRace( idUser, key ) {
if ( !WC3_Check() ) { return PLUGIN_HANDLED; }
// Save the current race data before we change DB_SaveXP( idUser, false );
new iRace;
iRace = key + 1;
// User currently has a race if ( p_data[idUser][P_RACE] != 0 ) {
// Change the user's race at the start of next round if ( iRace != p_data[idUser][P_RACE] ) {
// Special message for csdm if ( CVAR_csdm_active > 0 && get_pcvar_num( CVAR_csdm_active ) == 1 ) { client_print( idUser, print_center, "%L",LANG_PLAYER,"CLIENT_PRINT_MENU_CHANGE_RACE");
} else { client_print( idUser, print_center, "%L",LANG_PLAYER,"CENTER_CHANGED_NEXT"); }
p_data[idUser][P_CHANGERACE] = iRace; }
// Do nothing else { p_data[idUser][P_CHANGERACE] = 0; } }
// User doesn't have a race so give it to him!!! else { WC3_SetRace( idUser, iRace ); }
return PLUGIN_HANDLED; }
<br>http://servera-cs.net/userbar/userbar.png?serv=91.211.117.52:27029</br>
| |
| |