Skip to content

Any movement when castiing buff

Featured Replies

Hello, everyone. How can I make my custom npc buff express some movement when casting a buff as if I cast a self buff?

By sending the appropriate packet to the client, in your case:

/* 0x48 */ MagicSkillUse,

 

Exemple with scheme posted for aCis..

 

java/net/sf/l2j/gameserver/model/actor/instance/SchemeBuffer

 

For all buffs animation:

  1.  public void onBypassFeedback(Player player, String command)
  2.  {
  3.  StringTokenizer st = new StringTokenizer(command, " ");
  4.  String currentCommand = st.nextToken();
  5. +
  6.  if (currentCommand.startsWith("menu"))
  7.  {
  8.  NpcHtmlMessage html = new NpcHtmlMessage(1);
  9.  html.setFile(getHtmlPath(getNpcId(), 0));
  10.  html.replace("%objectId%", getObjectId());
  11.  player.sendPacket(html);
  12.  }
  13.  else if (currentCommand.equalsIgnoreCase("getbuff"))
  14.  {
  15.  int buffid = 0;
  16.  int bufflevel = 1;
  17.  String nextWindow = null;
  18.  
  19.  if (st.countTokens() == 3)
  20.  {
  21.  buffid = Integer.valueOf(st.nextToken());
  22.  bufflevel = Integer.valueOf(st.nextToken());
  23.  nextWindow = st.nextToken();
  24.  }
  25.  else if (st.countTokens() == 1)
  26.  buffid = Integer.valueOf(st.nextToken());
  27.  
  28.  if (buffid != 0)
  29.  {
  30. + player.broadcastPacket(new MagicSkillUse(this, player, buffid, bufflevel, 200, 0));
  31.  
  32.  player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT).addSkillName(buffid, bufflevel));
  33.  SkillTable.getInstance().getInfo(buffid, bufflevel).getEffects(this, player);
  34.  showSubBufferWindow(player);
  35.  showChatWindow(player, nextWindow);
  36.  }
  37.  }
 
  1. For Cancel Animation:
 
  1.  else if (currentCommand.startsWith("cleanup"))
  2.  {
  3.  +player.broadcastPacket(new MagicSkillUse(this, player, 1056, 12, 200, 0));
  4.  player.stopAllEffectsExceptThoseThatLastThroughDeath();
  5.  
  6.  final Summon summon = player.getSummon();
  7.  if (summon != null)
  8.  summon.stopAllEffectsExceptThoseThatLastThroughDeath();
  9.  
  10.  NpcHtmlMessage html = new NpcHtmlMessage(1);
  11.  html.setFile(getHtmlPath(getNpcId(), 0));
  12.  html.replace("%objectId%", getObjectId());
  13.  player.sendPacket(html);
  14.  }
 
Player use animation of buff on get buffs
player.sendPacket(new MagicSkillUse(player, player, buffid, bufflevel, 1000, 0));
 
NPC use SocialAction
player.sendPacket(new SocialAction(this.getObjectId(), 1));

Edited by Orochy

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.