L2JMobius

npc buffer

Ezio · 4 · 231

Offline Ezio

  • Heir
  • **
    • Posts: 28
I created this xml and placed it in the status-npc - custom folder.
<?xml version="1.0" encoding="UTF-8"?>
<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/npcs.xsd">
   <npc id="60001" displayId="31221" type="Folk" name="Gemini Buffer" title="Custom Buffer">
      <collision>
         <radius normal="8.0" />
         <height normal="23.5" />
      </collision>
   </npc>
</list>


I created this html and placed it in the html-default folder.
<html>
<body>
<center>
<font color="LEVEL">Gemini Buffer</font><br>
<img src="L2UI.SquareWhite" width="300" height="1"><br>
<font color="FF9900">Basic Buffs</font><br>
<a action="bypass -h Quest 9999 Skill 1204 2">Wind Walk</a><br>
<a action="bypass -h Quest 9999 Skill 1040 3">Shield</a><br>
<a action="bypass -h Quest 9999 Skill 1068 3">Might</a><br>
<a action="bypass -h Quest 9999 Skill 1036 2">Magic Barrier</a><br>
<a action="bypass -h Quest 9999 Skill 1035 4">Mental Shield</a><br>
<a action="bypass -h Quest 9999 Skill 1045 6">Bless the Body</a><br>
<a action="bypass -h Quest 9999 Skill 1048 6">Bless the Soul</a><br>
<a action="bypass -h Quest 9999 Skill 1062 2">Berserker Spirit</a><br>
<a action="bypass -h Quest 9999 Skill 1086 2">Haste</a><br>
<a action="bypass -h Quest 9999 Skill 1240 3">Guidance</a><br>
<a action="bypass -h Quest 9999 Skill 1242 3">Death Whisper</a><br>
<a action="bypass -h Quest 9999 Skill 1077 3">Focus</a><br>
<a action="bypass -h Quest 9999 Skill 1268 4">Vampiric Rage</a><br>
<a action="bypass -h Quest 9999 Skill 1087 3">Agility</a><br>
<a action="bypass -h Quest 9999 Skill 1085 3">Acumen</a><br>
<a action="bypass -h Quest 9999 Skill 1059 3">Empower</a><br>
<a action="bypass -h Quest 9999 Skill 1303 2">Wild Magic</a><br>
<a action="bypass -h Quest 9999 Skill 1078 6">Concentration</a><br>
<a action="bypass -h Quest 9999 Skill 1243 6">Bless Shield</a><br>
<a action="bypass -h Quest 9999 Skill 1259 4">Resist Shock</a><br>
<img src="L2UI.SquareWhite" width="300" height="1"><br>
<font color="FF9900">Dances & Songs</font><br>
<a action="bypass -h Quest 9999 Skill 271 1">Dance Warrior</a> - <a action="bypass -h Quest 9999 Skill 264 1">Song Earth</a><br>
<a action="bypass -h Quest 9999 Skill 274 1">Dance Fire</a> - <a action="bypass -h Quest 9999 Skill 268 1">Song Wind</a><br>
<img src="L2UI.SquareWhite" width="300" height="1"><br>
<a action="bypass -h Quest 9999 Heal"><font color="00FF00">Heal (HP/MP/CP)</font></a><br>
<a action="bypass -h npc_%objectId%_cancel">Cancel Buffs</a><br>
</center>
</body>
</html>

Despite this, as soon as I enter the game, the npc buffer doesn't give buffs. Can someone help me fix it?


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19654

Offline Ezio

  • Heir
  • **
    • Posts: 28
package custom.GeminiBuffer;

import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.skill.Skill;

public class GeminiBuffer extends Quest
{
    public GeminiBuffer()
    {
        super(-1, "GeminiBuffer");
        addStartNpc(60001);
        addTalkId(60001);
        addFirstTalkId(60001);
    }
   
    @Override
    public String onFirstTalk(Npc npc, Player player)
    {
        return "60001.htm";
    }

    @Override
    public String onEvent(String event, Npc npc, Player player)
    {
        if (player == null)
        {
            return null;
        }

        if (event.startsWith("Skill"))
        {
            try
            {
                String[] parts = event.split(" ");
                int id = Integer.parseInt(parts[1]);
                int lvl = Integer.parseInt(parts[2]);
                Skill skill = SkillData.getInstance().getSkill(id, lvl);
               
                if (skill != null)
                {
                    skill.getEffects(npc, player);
                }
            }
            catch (Exception e)
            {
                e.printStackTrace();
            }
        }
        else if (event.equalsIgnoreCase("Heal"))
        {
            player.setCurrentHp(player.getMaxHp());
            player.setCurrentMp(player.getMaxMp());
            player.setCurrentCp(player.getMaxCp());
        }
        else if (event.equalsIgnoreCase("Cancel"))
        {
            player.getEffectList().stopAllEffects();
        }

        return "60001.htm";
    }
}

Sorry, I didn't notice, I tried, I had made this script but it didn't work.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19654
extends Quest
->
extends Script

bypass -h Quest
->
bypass -h Script