Добро пожаловать на форум, Гость, это ваша панель
  • Страница 1 из 1
  • 1
Fatal strike (спецально для Uwc)
KinD
Дата: Среда, 07.03.2012, 10:54 | Сообщение # 1
офлайн

  • Сообщения: 1148
  • Награды: 22
  • Замечания:
 
Нашел исходники одного скила.Данный скил даст 2% нанести смертельный урон
Может кому интресно и кто нить захочет добавить на свой вар
Поехали..
Нужно переименовать шаблон New skills или просто существующее умение
Все написано для UWC
Skills.inl
[/code]skill_minlev[SKILLIDX_NEWSKILL14] = 51;
Code
skill_minlev[SKILLIDX_FATAL]    = 26;


Устанавливаем макс уровень умения
Code
skill_limits[SKILLIDX_FATAL]    = MAX_SKILL_LEVEL1;


Линия с шансом умения
Code
p_fatal[i]                    = ( 0.02 *  i );


Как должно быть(не разобрался с переводом честно

Code
//Critical strike or fatal strike
        if ((skill_idx == SKILLIDX_CRITSTRIKE) && (p_skills[id][SKILLIDX_FATAL]))
          {
              if( Util_Should_Msg_Client(id) )
              {
                  client_print(id, print_chat, "%L", id, "CRIT_NO_FATAL", MOD);
                  client_print(id, print_center, "%L", id, "CRIT_NO_FATAL", MOD);
              }
              return PLUGIN_HANDLED;
          }
          else if ((skill_idx == SKILLIDX_FATAL) && (p_skills[id][SKILLIDX_CRITSTRIKE]))
          {
              if( Util_Should_Msg_Client(id) )
              {
                  client_print(id, print_chat, "%L", id, "FATAL_NO_CRIT", MOD);
                  client_print(id, print_center, "%L", id, "FATAL_NO_CRIT", MOD);
              }
              return PLUGIN_HANDLED;
          }


Defines.inl Заходим и заменяем
Code
#define SKILLIDX_NEWSKILL14 61

На
Code
#define SKILLIDX_FATAL 61


Events_damage.inl

Code
// Fatal Strike
      // [24-09-09] - New critical strike based skill by Deimos
      if ( p_skills[enemy][SKILLIDX_FATAL])
      {
          new Float:randomnumber = random_float( 0.0, 1.0 );
          new SkillLevel = ( p_skills[enemy][SKILLIDX_FATAL]);

          if( SkillLevel > 0 )
          {

              if ( randomnumber <= p_fatal[ SkillLevel ] )
              {
                  damage = read_data( 2 );
                  // Changed to do triple damage
                  damage = floatround( float( damage ) * 3 )

                  new idname[32], ename[32];
                  get_user_name( id, idname, 31 );
                  get_user_name( enemy, ename, 31 );

                  do_damage( id, enemy, damage, 6, 1, weapon, bodypart, 0 );

                      if( Util_Should_Msg_Client(id) )
                      {
                          client_print( id, print_center, "%L", id, "FATAL_STRIKE1", MOD, ename );
                          client_print( id, print_chat, "%L", id, "FATAL_STRIKE1", MOD, ename );
                          if ( file_exists( "sound/warcraft3/critical_hit_02.wav" ) == 1 )
                     emit_sound( id, CHAN_STATIC, "warcraft3/critical_hit_02.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
                      }

                      if( Util_Should_Msg_Client(enemy) )
                      {
                          client_print( enemy, print_center, "%L", enemy, "FATAL_STRIKE2", MOD, idname );
                          client_print( enemy, print_chat, "%L", enemy, "FATAL_STRIKE2", MOD, idname );
                          if ( file_exists( "sound/warcraft3/critical_hit_02.wav" ) == 1 )
                    emit_sound( enemy, CHAN_STATIC, "warcraft3/critical_hit_02.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
                      }

                    
                  if ( iglow[id][0] < 1 )
                  {
                      new parm[2];
                      parm[0] = id;
                      set_task( 0.01, "ChangeGlow", 12, parm, 2 );
                  }

                  iglow[id][0] += damage;
                  iglow[id][1] = 0;
                  iglow[id][2] = 0;
                  iglow[id][3] = 0;

                  if ( iglow[id][0] > MAXGLOW )
                      iglow[id][0] = MAXGLOW;

                  if( Util_Should_Msg_Client( id ) )
                  {
                      message_begin( MSG_ONE, gmsgFade, { 0, 0, 0 }, id );
                      write_short( 1<<10 ); // fade lasts this long duration
                      write_short( 1<<10 ); // fade lasts this long hold time
                      write_short( 1<<12 ); // fade type ( in / out )
                      write_byte( 255 ); // fade red
                      write_byte( 0 ); // fade green
                      write_byte( 0 ); // fade blue
                      write_byte( iglow[id][0] ); // fade alpha
                      message_end( );
                  }
              }
          }
      }
      // Fatal Strike


Vars.inl Заходим
Code
// Fatal Strike
     new Float:p_fatal[MAX_SKILL_LEVEL10];


Help.inl Заходим
Code
case SKILLIDX_FATAL:
                 pos+= format( temp[pos], 4096-pos, "<li>%L<p>", id, "FATAL_DESC" );

Заметка: Line 144

uwc3.txt заходим и добавляем
Code
FATAL_NO_CRIT = [%s] You have to give up your Critical Strike skill to train Fatal Strike
CRIT_NO_FATAL = [%s] You have to give up your Fatal Strike skill to train Critical Strike


Code
FATAL_STRIKE1 = [%s] You strike a merciless fatal blow to %s
FATAL_STRIKE2 = [%s] You just got hit by a fatal strike from %s


Code
FATAL_DESC = Fatal Strike: Gives you really small chance (2%%) of doing triple damage to enemy


Спасибо за внимание

Добавлено (07.03.2012, 10:54)
---------------------------------------------
Надеюсь кому нибудь понадобиться :)


Skype:daywerok

Сообщение отредактировал KinD - Среда, 07.03.2012, 10:44
 
  • Страница 1 из 1
  • 1
Поиск: