Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Помогите с бафером!
#1
Здравствуйте форумчане
Тут такая ситуация.
Скачал бафера ринча
http://l2edit.ru/news/2010-10-07-2090
Все вроде получилось

Но!
Мне надо прописать в скрипте
custom/555_NPCBUFFER/__init__.py
Чтоб он работал

Но в папки Server\game\data

Файла scripts.cfg просто напросто нету,пробывал поиском пользоваться не нашел.

Вот и прошу помочь,где все скрипты могут прописыватся,теже самые евенты которые у меня есть стандартные.

И как быть?с бафером

Прощу пожалуйста помочь!
Сборка L2NOVA Premium
Они работали на исходниках феникса

Добавлено через 1 час 29 минут
И че не кто не знает???
Ответ
#2
Данная сборка не работает с .py, только с .java
Ответ
#3
kasik Написал:Данная сборка не работает с .py, только с .java

а по проще ?
объяснить можете?


p/s или я так понел с java скриптами только работает?

Добавлено через 25 минут
Все я понел о чем вы говорили


А я могу через программку,открыть этот файл и прописать в чем что либо?
Ответ
#4
Dzhakonda Написал:А я могу через программку,открыть этот файл и прописать в чем что либо?

Это как? Вообще там есть родной бафер (Ивентовый Кот), берите его как пример и переделывайте.
Ответ
#5
kasik Написал:Это как? Вообще там есть родной бафер (Ивентовый Кот), берите его как пример и переделывайте.

я конечно извиняюсь)

Где вы его нашли,можно по подробнее)Smile
Ответ
#6
Код:
package services.NPCBuffer;

import l2r.gameserver.Config;
import l2r.gameserver.network.serverpackets.components.CustomMessage;
import l2r.gameserver.scripts.Functions;
import l2r.gameserver.scripts.ScriptFile;
import l2r.gameserver.ThreadPoolManager;
import l2r.gameserver.cache.Msg;
import l2r.gameserver.data.htm.HtmCache;
import l2r.gameserver.model.Creature;
import l2r.gameserver.model.Player;
import l2r.gameserver.model.Skill;
import l2r.gameserver.model.Summon;
import l2r.gameserver.model.entity.residence.Residence;
import l2r.gameserver.model.instances.NpcInstance;
import l2r.gameserver.network.serverpackets.MagicSkillLaunched;
import l2r.gameserver.network.serverpackets.MagicSkillUse;
import l2r.gameserver.tables.SkillTable;
import l2r.gameserver.utils.Files;
import l2r.gameserver.utils.Util;

public class Buffer extends Functions implements ScriptFile
{

private static int grpCount1, grpCount2, grpCount3, grpCount4, grpCount5;

    private boolean BUFFER_ON = true;
    private boolean BUFFER_PET_ENABLED = true;
    
    private int BUFFER_PRICE = 50;
    private int BUFFER_MIN_LVL = 1;
    private int BUFFER_MAX_LVL = 99;


    private static int buffs[][] = { // id, lvl, group
        { 1251, 2, 5 }, // Chant of Fury
        { 1252, 3, 5 }, // Chant of Evasion
        { 1253, 3, 5 }, // Chant of Rage
        { 1284, 3, 5 }, // Chant of Revenge
        { 1308, 3, 5 }, // Chant of Predator
        { 1309, 3, 5 }, // Chant of Eagle
        { 1310, 4, 5 }, // Chant of Vampire
        { 1362, 1, 5 }, // Chant of Spirit
        { 1363, 1, 5 }, // Chant of Victory
        { 1390, 3, 5 }, // War Chant
        { 1391, 3, 5 }, // Earth Chant
        { 1500, 1, 4 }, // Improved magic
        { 1503, 1, 4 }, // Improved shield defense
        { 1303, 2, 4 }, // Wild Magic
        { 1353, 1, 4 }, // Divine Protection
        { 4350, 4, 4 }, // Resist shok
        { 1504, 1, 4 }, // Improved movement
        { 1397, 3, 4 }, // Clarity
        { 4352, 2, 4 }, // Berserker spirit
        { 4346, 4, 4 }, // Mental shield
        { 4355, 3, 4 }, // Acumen
        { 1501, 1, 4 }, // Improved condition
        { 1352, 1, 4 }, // Elemental Protection
        { 4351, 6, 4 }, // Concentration
        { 1362, 1, 4 }, // Chant of spirit
        { 1461, 1, 4 }, // Chant of protection
        { 1284, 3, 4 }, // Chant of revenge
        { 1413, 1, 4 }, // Magnus chant
        { 264, 1, 4 }, // Song of earth
        { 267, 1, 4 }, // Song of Warding
        { 268, 1, 4 }, // Song of wind
        { 304, 1, 4 }, // Song of vitality
        { 363, 1, 4 }, // Song of meditation
        { 764, 1, 4 }, // Song of wind storm
        { 349, 1, 4 }, // Song of renewal
        { 305, 1, 4 }, // Song of vengeance
        { 273, 1, 4 }, // Dance of mystic
        { 276, 1, 4 }, // Dance of Concentration
        { 365, 1, 4 }, // Dance of siren
        { 915, 1, 4 }, // dance of Berserker
        { 1397, 3, 3 }, // Clarity
        { 4350, 4, 3 }, // Resist shok
        { 1500, 1, 3 }, // Improved magic
        { 1503, 1, 3 }, // Improved shield defense
        { 4346, 4, 3 }, // Mental shield
        { 4352, 2, 3 }, // Berserker spirit
        { 1352, 1, 3 }, // Elemental Protection
        { 764, 1, 3 }, // Song of wind storm
        { 349, 1, 3 }, // Song of renewal
        { 268, 1, 3 }, // Song of wind
        { 304, 1, 3 }, // Song of vitality
        { 269, 1, 3 }, // Song of hunter
        { 267, 1, 3 }, // Song of Warding
        { 264, 1, 3 }, // Song of Earth
        { 310, 1, 3 }, // Dance of the vampire
        { 271, 1, 3 }, // Dance of the warrior
        { 274, 1, 3 }, // Dance of the fire
        { 275, 1, 3 }, // Dance of the fury
        { 1461, 1, 3 }, // Chant of protection
        { 1519, 1, 3 }, // Chant of blood awakening
        { 1363, 1, 3 }, // Chant of victory
        { 1518, 1, 3 }, // Chant of critical attack
        { 1284, 3, 3 }, // Chant of revenge
        { 1517, 1, 3 }, // Chant of combat
        { 1535, 1, 3 }, // Chatn of movement
        { 1390, 3, 3 }, // War chant
        { 1310, 3, 3 }, // Chant of vampire
        { 306, 1, 2 },
        { 308, 1, 2 },
        { 272, 1, 2 },
        { 307, 1, 2 },
        { 309, 1, 2 },
        { 311, 1, 2 },
        { 764, 1, 2 },
        { 266, 1, 2 },
        { 529, 1, 2 },
        { 530, 1, 2 },
        { 305, 1, 2 },
        { 1303, 2, 2 },
        { 1087, 3, 2 },
        { 1045, 3, 2 },
        { 1048, 3, 2 },
        { 1085, 3, 2 },
        { 1059, 3, 2 },
        { 1040, 3, 2 },
        { 1036, 2, 2 },
        { 1204, 2, 2 },
        { 1062, 2, 2 },
        { 4703, 3, 2 },
        { 1389, 3, 2 },
        { 1461, 1, 2 },
        { 1413, 1, 2 },
        { 1284, 3, 2 },
        { 1191, 3, 2 },
        { 1182, 3, 2 },
        { 1189, 3, 2 },
        { 1392, 3, 2 },
        { 1035, 4, 2 },
        { 1259, 4, 2 },
        { 1460, 1, 2 },
        { 1044, 3, 2 },
        { 1078, 6, 2 },
        { 264, 1, 2 },
        { 265, 1, 2 },
        { 267, 1, 2 },
        { 268, 1, 2 },
        { 269, 1, 2 },
        { 304, 1, 2 },
        { 349, 1, 2 },
        { 363, 1, 2 },
        { 364, 1, 2 },
        { 273, 1, 2 },
        { 276, 1, 2 },
        { 365, 1, 2 },
        { 270, 1, 2 },
        { 830, 1, 2 },
        { 1500, 1, 2 },
        { 1503, 1, 2 },
        { 915, 1, 2 },
        { 1504, 1, 2 },
        { 1077, 3, 1 },
        { 1242, 3, 1 },
        { 1086, 2, 1 },
        { 1240, 3, 1 },
        { 1087, 3, 1 },
        { 1045, 3, 1 },
        { 1048, 3, 1 },
        { 1068, 3, 1 },
        { 1040, 3, 1 },
        { 1036, 2, 1 },
        { 1268, 3, 1 },
        { 1204, 2, 1 },
        { 1062, 2, 1 },
        { 4699, 3, 1 },
        { 1388, 3, 1 },
        { 1389, 3, 1 },
        { 1461, 1, 1 },
        { 1363, 1, 1 },
        { 1284, 3, 1 },
        { 1191, 3, 1 },
        { 1182, 3, 1 },
        { 1189, 3, 1 },
        { 1392, 3, 1 },
        { 1352, 1, 1 },
        { 1035, 4, 1 },
        { 264, 1, 1 },
        { 265, 1, 1 },
        { 267, 1, 1 },
        { 268, 1, 1 },
        { 269, 1, 1 },
        { 304, 1, 1 },
        { 349, 1, 1 },
        { 363, 1, 1 },
        { 364, 1, 1 },
        { 365, 1, 1 },
        { 271, 1, 1 },
        { 274, 1, 1 },
        { 275, 1, 1 },
        { 270, 1, 1 },
        { 305, 1, 1 },
        { 306, 1, 1 },
        { 308, 1, 1 },
        { 272, 1, 1 },
        { 307, 1, 1 },
        { 309, 1, 1 },
        { 310, 1, 1 },
        { 311, 1, 1 },
        { 764, 1, 1 },
        { 266, 1, 1 },
        { 529, 1, 1 },
        { 530, 1, 1 },
        { 825, 1, 1 },
        { 826, 1, 1 },
        { 827, 1, 1 },
        { 828, 1, 1 },
        { 829, 1, 1 },
        { 1502, 1, 1 },
        { 1503, 1, 1 },
        { 915, 1, 1 },
        { 1517, 1, 1 },
        { 1519, 1, 1 },
        { 1504, 1, 1 }
        };

    public void onLoad()
    {
        if(BUFFER_ON)
            System.out.println("Loaded Service: NPCBuffer [state: activated]");
        else
            System.out.println("Loaded Service: NPCBuffer [state: deactivated]");

        for(int buff[] : buffs)
            switch(buff[2])
            {
                case 1:
                    grpCount1++;
                break;
                case 2:
                    grpCount2++;
                break;
                case 3:
                    grpCount3++;
                break;
                case 4:
                    grpCount4++;
                break;
                case 5:
                    grpCount5++;
                break;
            }
    }

    public void onReload()
    {}

    public void onShutdown()
    {}


    public void doBuffGroup(String[] args)
    {
        Player player = (Player) getSelf();
        Summon pet = player.getPet();

        if(!checkCondition(player))
            return;
        
        if(player.isCursedWeaponEquipped() || player.isDead() || player.isAlikeDead() || player.isCastingNow() || player.isInCombat() || player.isAttackingNow() || player.isInOlympiadMode() || player.isFlying() || player.isTerritoryFlagEquipped())
            return;

        if(player.getAdena() < BUFFER_PRICE * (Integer.valueOf(args[1]) + 2))
        {
            player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA );
            return;
        }
        player.reduceAdena(BUFFER_PRICE * (Integer.valueOf(args[1]) + 2));

        int time = 0;
        int id_groups = Integer.valueOf(args[0]);
        int select_id = Integer.valueOf(args[1]);
        Skill skill;
        for(int buff[] : buffs)
            if(buff[2] == id_groups)
            {
                if(select_id == 0)
                {
                    skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                    time += skill.getHitTime();
                    ThreadPoolManager.getInstance().schedule(new BeginBuff(player, skill, player), time);
                    time += 200;
                }
                if(select_id == 1)
                {
                    if(pet == null)
                        return;

                    skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                    time += skill.getHitTime();
                    ThreadPoolManager.getInstance().schedule(new BeginPetBuff(player, skill, pet), time);
                    time += 200;
                }
            }
    }


    public void doBuff(String[] args)
    {
        Player player = (Player) getSelf();
        Summon pet = player.getPet();

        if(!checkCondition(player))
            return;
        
        if(player.isInOlympiadMode())
            return;

        if(player.getAdena() < BUFFER_PRICE)
        {
            player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA );
            return;
        }

        try
        {
            int skill_id = Integer.valueOf(args[0]);
            int skill_lvl = Integer.valueOf(args[1]);
            int select_id = Integer.valueOf(args[2]);
            Skill skill = SkillTable.getInstance().getInfo(skill_id, skill_lvl);
            if(select_id == 0)
                ThreadPoolManager.getInstance().schedule(new BeginBuff(player, skill, player), skill.getHitTime());
            if(select_id == 1)
            {
                if(pet == null)
                    return;

                ThreadPoolManager.getInstance().schedule(new BeginPetBuff(player, skill, pet), skill.getHitTime());
            }
            player.reduceAdena(BUFFER_PRICE);
        }
        catch(Exception e)
        {
            player.sendMessage("Invalid skill!");
        }

        show(HtmCache.getInstance().getNotNull("script/services/NPCBuffer/buffs.htm", player), player);
    }

    public boolean checkCondition(Player player)
    {
        if(!BUFFER_ON || player == null)
            return false;

        String html;

        if(player.getLevel() > BUFFER_MAX_LVL || player.getLevel() < BUFFER_MIN_LVL)
        {
            html = HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/no-lvl.htm", player);
            html = html.replace("%min_lvl%", Integer.toString(BUFFER_MIN_LVL));
            html = html.replace("%max_lvl%", Integer.toString(BUFFER_MAX_LVL));
            show(html, player);
            return false;
        }
        return true;
    }

    public void SelectMenu(String[] args)
    {
        int select_menu = Integer.valueOf(args[0]);
        Player player = (Player) getSelf();

        String html = null;

        if(select_menu == 0)
            html = HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/buffschar.htm", player);

        if(select_menu == 1)
        {
            if(BUFFER_PET_ENABLED != true)
                return;
            if(player.getPet() == null)
                return;
            html = HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/buffspet.htm", player);
        }

        assert html != null;
        html = html.replace("%grp_price1%", Util.formatAdena(BUFFER_PRICE * (grpCount1 + 2)));
        html = html.replace("%grp_price2%", Util.formatAdena(BUFFER_PRICE * (grpCount2 + 2)));
        html = html.replace("%grp_price3%", Util.formatAdena(BUFFER_PRICE * (grpCount3 + 2)));
        html = html.replace("%grp_price4%", Util.formatAdena(BUFFER_PRICE * (grpCount4 + 2)));
        html = html.replace("%grp_price5%", Util.formatAdena(BUFFER_PRICE * (grpCount5 + 2)));
        html = html.replace("%buffs_in_grp1%", Integer.toString(grpCount1));
        html = html.replace("%buffs_in_grp2%", Integer.toString(grpCount2));
        html = html.replace("%buffs_in_grp3%", Integer.toString(grpCount3));
        html = html.replace("%buffs_in_grp4%", Integer.toString(grpCount4));
        html = html.replace("%buffs_in_grp5%", Integer.toString(grpCount5));
        html = html.replace("%price%", Util.formatAdena(BUFFER_PRICE));
        show(html, player);
    }

    public void SelectBuffs()
    {
    Player player = (Player) getSelf();
    
    if(!checkCondition(player))
        return;
        
        if(player.isCursedWeaponEquipped() || player.isDead() || player.isAlikeDead() || player.isCastingNow() || player.isInCombat() || player.isAttackingNow() || player.isInOlympiadMode() || player.isFlying() || player.isTerritoryFlagEquipped())
            return;
    
    show(HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/buffs.htm", player), player);
    }

    public String OutDia()
    {
    if(!BUFFER_ON)
        return "";
    String append = "<br><a action=\"bypass -h scripts_services.NPCBuffer.Buffer:SelectBuffs\">";
    append += new CustomMessage("scripts.services.NPCBuffer.Buffer.s electBuffs", getSelf());
    append += "</a>";
        return append;
    }


    public String DialogAppend_12741(Integer val)
    {
    if(val != 0)
        return "";
    return OutDia();
    }

    public class BeginBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Player _target;

        public BeginBuff(Creature buffer, Skill skill, Player target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            if(_target.isInOlympiadMode())
                return;
            _buffer.broadcastPacket(new MagicSkillUse(_buffer, _target, _skill.getDisplayId(), _skill.getLevel(), _skill.getHitTime(), 0));
            ThreadPoolManager.getInstance().schedule(new EndBuff(_buffer, _skill, _target), _skill.getHitTime());
        }
    }

    public class EndBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Player _target;

        public EndBuff(Creature buffer, Skill skill, Player target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            _skill.getEffects(_buffer, _target, false, false);
            _buffer.broadcastPacket(new MagicSkillLaunched(_buffer.getObjectId(), _skill.getId(), _skill.getLevel(), _target));
        }
    }

    public class BeginPetBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Summon _target;

        public BeginPetBuff(Creature buffer, Skill skill, Summon target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            _buffer.broadcastPacket(new MagicSkillUse(_buffer, _target, _skill.getDisplayId(), _skill.getLevel(), _skill.getHitTime(), 0));
            ThreadPoolManager.getInstance().schedule(new EndPetBuff(_buffer, _skill, _target), _skill.getHitTime());
        }
    }

    public class EndPetBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Summon _target;

        public EndPetBuff(Creature buffer, Skill skill, Summon target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            _skill.getEffects(_buffer, _target, false, false);
            _buffer.broadcastPacket(new MagicSkillLaunched(_buffer.getObjectId(), _skill.getId(), _skill.getLevel(), _target));
        }
    }
}
вызов с html
Код:
<center><button action="bypass -h scripts_services.NPCBuffer.Buffer:SelectMenu 0" value="Баф игрока" width=174 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center>

<center><button action="bypass -h scripts_services.NPCBuffer.Buffer:SelectMenu 1" value="Баф питомца" width=174 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center>
http://rghost.ru/38910881
адаптируйте под сборку сами
Ответ
#7
4ipolino Написал:
Код:
package services.NPCBuffer;

import l2r.gameserver.Config;
import l2r.gameserver.network.serverpackets.components.CustomMessage;
import l2r.gameserver.scripts.Functions;
import l2r.gameserver.scripts.ScriptFile;
import l2r.gameserver.ThreadPoolManager;
import l2r.gameserver.cache.Msg;
import l2r.gameserver.data.htm.HtmCache;
import l2r.gameserver.model.Creature;
import l2r.gameserver.model.Player;
import l2r.gameserver.model.Skill;
import l2r.gameserver.model.Summon;
import l2r.gameserver.model.entity.residence.Residence;
import l2r.gameserver.model.instances.NpcInstance;
import l2r.gameserver.network.serverpackets.MagicSkillLaunched;
import l2r.gameserver.network.serverpackets.MagicSkillUse;
import l2r.gameserver.tables.SkillTable;
import l2r.gameserver.utils.Files;
import l2r.gameserver.utils.Util;

public class Buffer extends Functions implements ScriptFile
{

private static int grpCount1, grpCount2, grpCount3, grpCount4, grpCount5;

    private boolean BUFFER_ON = true;
    private boolean BUFFER_PET_ENABLED = true;
    
    private int BUFFER_PRICE = 50;
    private int BUFFER_MIN_LVL = 1;
    private int BUFFER_MAX_LVL = 99;


    private static int buffs[][] = { // id, lvl, group
        { 1251, 2, 5 }, // Chant of Fury
        { 1252, 3, 5 }, // Chant of Evasion
        { 1253, 3, 5 }, // Chant of Rage
        { 1284, 3, 5 }, // Chant of Revenge
        { 1308, 3, 5 }, // Chant of Predator
        { 1309, 3, 5 }, // Chant of Eagle
        { 1310, 4, 5 }, // Chant of Vampire
        { 1362, 1, 5 }, // Chant of Spirit
        { 1363, 1, 5 }, // Chant of Victory
        { 1390, 3, 5 }, // War Chant
        { 1391, 3, 5 }, // Earth Chant
        { 1500, 1, 4 }, // Improved magic
        { 1503, 1, 4 }, // Improved shield defense
        { 1303, 2, 4 }, // Wild Magic
        { 1353, 1, 4 }, // Divine Protection
        { 4350, 4, 4 }, // Resist shok
        { 1504, 1, 4 }, // Improved movement
        { 1397, 3, 4 }, // Clarity
        { 4352, 2, 4 }, // Berserker spirit
        { 4346, 4, 4 }, // Mental shield
        { 4355, 3, 4 }, // Acumen
        { 1501, 1, 4 }, // Improved condition
        { 1352, 1, 4 }, // Elemental Protection
        { 4351, 6, 4 }, // Concentration
        { 1362, 1, 4 }, // Chant of spirit
        { 1461, 1, 4 }, // Chant of protection
        { 1284, 3, 4 }, // Chant of revenge
        { 1413, 1, 4 }, // Magnus chant
        { 264, 1, 4 }, // Song of earth
        { 267, 1, 4 }, // Song of Warding
        { 268, 1, 4 }, // Song of wind
        { 304, 1, 4 }, // Song of vitality
        { 363, 1, 4 }, // Song of meditation
        { 764, 1, 4 }, // Song of wind storm
        { 349, 1, 4 }, // Song of renewal
        { 305, 1, 4 }, // Song of vengeance
        { 273, 1, 4 }, // Dance of mystic
        { 276, 1, 4 }, // Dance of Concentration
        { 365, 1, 4 }, // Dance of siren
        { 915, 1, 4 }, // dance of Berserker
        { 1397, 3, 3 }, // Clarity
        { 4350, 4, 3 }, // Resist shok
        { 1500, 1, 3 }, // Improved magic
        { 1503, 1, 3 }, // Improved shield defense
        { 4346, 4, 3 }, // Mental shield
        { 4352, 2, 3 }, // Berserker spirit
        { 1352, 1, 3 }, // Elemental Protection
        { 764, 1, 3 }, // Song of wind storm
        { 349, 1, 3 }, // Song of renewal
        { 268, 1, 3 }, // Song of wind
        { 304, 1, 3 }, // Song of vitality
        { 269, 1, 3 }, // Song of hunter
        { 267, 1, 3 }, // Song of Warding
        { 264, 1, 3 }, // Song of Earth
        { 310, 1, 3 }, // Dance of the vampire
        { 271, 1, 3 }, // Dance of the warrior
        { 274, 1, 3 }, // Dance of the fire
        { 275, 1, 3 }, // Dance of the fury
        { 1461, 1, 3 }, // Chant of protection
        { 1519, 1, 3 }, // Chant of blood awakening
        { 1363, 1, 3 }, // Chant of victory
        { 1518, 1, 3 }, // Chant of critical attack
        { 1284, 3, 3 }, // Chant of revenge
        { 1517, 1, 3 }, // Chant of combat
        { 1535, 1, 3 }, // Chatn of movement
        { 1390, 3, 3 }, // War chant
        { 1310, 3, 3 }, // Chant of vampire
        { 306, 1, 2 },
        { 308, 1, 2 },
        { 272, 1, 2 },
        { 307, 1, 2 },
        { 309, 1, 2 },
        { 311, 1, 2 },
        { 764, 1, 2 },
        { 266, 1, 2 },
        { 529, 1, 2 },
        { 530, 1, 2 },
        { 305, 1, 2 },
        { 1303, 2, 2 },
        { 1087, 3, 2 },
        { 1045, 3, 2 },
        { 1048, 3, 2 },
        { 1085, 3, 2 },
        { 1059, 3, 2 },
        { 1040, 3, 2 },
        { 1036, 2, 2 },
        { 1204, 2, 2 },
        { 1062, 2, 2 },
        { 4703, 3, 2 },
        { 1389, 3, 2 },
        { 1461, 1, 2 },
        { 1413, 1, 2 },
        { 1284, 3, 2 },
        { 1191, 3, 2 },
        { 1182, 3, 2 },
        { 1189, 3, 2 },
        { 1392, 3, 2 },
        { 1035, 4, 2 },
        { 1259, 4, 2 },
        { 1460, 1, 2 },
        { 1044, 3, 2 },
        { 1078, 6, 2 },
        { 264, 1, 2 },
        { 265, 1, 2 },
        { 267, 1, 2 },
        { 268, 1, 2 },
        { 269, 1, 2 },
        { 304, 1, 2 },
        { 349, 1, 2 },
        { 363, 1, 2 },
        { 364, 1, 2 },
        { 273, 1, 2 },
        { 276, 1, 2 },
        { 365, 1, 2 },
        { 270, 1, 2 },
        { 830, 1, 2 },
        { 1500, 1, 2 },
        { 1503, 1, 2 },
        { 915, 1, 2 },
        { 1504, 1, 2 },
        { 1077, 3, 1 },
        { 1242, 3, 1 },
        { 1086, 2, 1 },
        { 1240, 3, 1 },
        { 1087, 3, 1 },
        { 1045, 3, 1 },
        { 1048, 3, 1 },
        { 1068, 3, 1 },
        { 1040, 3, 1 },
        { 1036, 2, 1 },
        { 1268, 3, 1 },
        { 1204, 2, 1 },
        { 1062, 2, 1 },
        { 4699, 3, 1 },
        { 1388, 3, 1 },
        { 1389, 3, 1 },
        { 1461, 1, 1 },
        { 1363, 1, 1 },
        { 1284, 3, 1 },
        { 1191, 3, 1 },
        { 1182, 3, 1 },
        { 1189, 3, 1 },
        { 1392, 3, 1 },
        { 1352, 1, 1 },
        { 1035, 4, 1 },
        { 264, 1, 1 },
        { 265, 1, 1 },
        { 267, 1, 1 },
        { 268, 1, 1 },
        { 269, 1, 1 },
        { 304, 1, 1 },
        { 349, 1, 1 },
        { 363, 1, 1 },
        { 364, 1, 1 },
        { 365, 1, 1 },
        { 271, 1, 1 },
        { 274, 1, 1 },
        { 275, 1, 1 },
        { 270, 1, 1 },
        { 305, 1, 1 },
        { 306, 1, 1 },
        { 308, 1, 1 },
        { 272, 1, 1 },
        { 307, 1, 1 },
        { 309, 1, 1 },
        { 310, 1, 1 },
        { 311, 1, 1 },
        { 764, 1, 1 },
        { 266, 1, 1 },
        { 529, 1, 1 },
        { 530, 1, 1 },
        { 825, 1, 1 },
        { 826, 1, 1 },
        { 827, 1, 1 },
        { 828, 1, 1 },
        { 829, 1, 1 },
        { 1502, 1, 1 },
        { 1503, 1, 1 },
        { 915, 1, 1 },
        { 1517, 1, 1 },
        { 1519, 1, 1 },
        { 1504, 1, 1 }
        };

    public void onLoad()
    {
        if(BUFFER_ON)
            System.out.println("Loaded Service: NPCBuffer [state: activated]");
        else
            System.out.println("Loaded Service: NPCBuffer [state: deactivated]");

        for(int buff[] : buffs)
            switch(buff[2])
            {
                case 1:
                    grpCount1++;
                break;
                case 2:
                    grpCount2++;
                break;
                case 3:
                    grpCount3++;
                break;
                case 4:
                    grpCount4++;
                break;
                case 5:
                    grpCount5++;
                break;
            }
    }

    public void onReload()
    {}

    public void onShutdown()
    {}


    public void doBuffGroup(String[] args)
    {
        Player player = (Player) getSelf();
        Summon pet = player.getPet();

        if(!checkCondition(player))
            return;
        
        if(player.isCursedWeaponEquipped() || player.isDead() || player.isAlikeDead() || player.isCastingNow() || player.isInCombat() || player.isAttackingNow() || player.isInOlympiadMode() || player.isFlying() || player.isTerritoryFlagEquipped())
            return;

        if(player.getAdena() < BUFFER_PRICE * (Integer.valueOf(args[1]) + 2))
        {
            player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA );
            return;
        }
        player.reduceAdena(BUFFER_PRICE * (Integer.valueOf(args[1]) + 2));

        int time = 0;
        int id_groups = Integer.valueOf(args[0]);
        int select_id = Integer.valueOf(args[1]);
        Skill skill;
        for(int buff[] : buffs)
            if(buff[2] == id_groups)
            {
                if(select_id == 0)
                {
                    skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                    time += skill.getHitTime();
                    ThreadPoolManager.getInstance().schedule(new BeginBuff(player, skill, player), time);
                    time += 200;
                }
                if(select_id == 1)
                {
                    if(pet == null)
                        return;

                    skill = SkillTable.getInstance().getInfo(buff[0], buff[1]);
                    time += skill.getHitTime();
                    ThreadPoolManager.getInstance().schedule(new BeginPetBuff(player, skill, pet), time);
                    time += 200;
                }
            }
    }


    public void doBuff(String[] args)
    {
        Player player = (Player) getSelf();
        Summon pet = player.getPet();

        if(!checkCondition(player))
            return;
        
        if(player.isInOlympiadMode())
            return;

        if(player.getAdena() < BUFFER_PRICE)
        {
            player.sendPacket(Msg.YOU_DO_NOT_HAVE_ENOUGH_ADENA );
            return;
        }

        try
        {
            int skill_id = Integer.valueOf(args[0]);
            int skill_lvl = Integer.valueOf(args[1]);
            int select_id = Integer.valueOf(args[2]);
            Skill skill = SkillTable.getInstance().getInfo(skill_id, skill_lvl);
            if(select_id == 0)
                ThreadPoolManager.getInstance().schedule(new BeginBuff(player, skill, player), skill.getHitTime());
            if(select_id == 1)
            {
                if(pet == null)
                    return;

                ThreadPoolManager.getInstance().schedule(new BeginPetBuff(player, skill, pet), skill.getHitTime());
            }
            player.reduceAdena(BUFFER_PRICE);
        }
        catch(Exception e)
        {
            player.sendMessage("Invalid skill!");
        }

        show(HtmCache.getInstance().getNotNull("script/services/NPCBuffer/buffs.htm", player), player);
    }

    public boolean checkCondition(Player player)
    {
        if(!BUFFER_ON || player == null)
            return false;

        String html;

        if(player.getLevel() > BUFFER_MAX_LVL || player.getLevel() < BUFFER_MIN_LVL)
        {
            html = HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/no-lvl.htm", player);
            html = html.replace("%min_lvl%", Integer.toString(BUFFER_MIN_LVL));
            html = html.replace("%max_lvl%", Integer.toString(BUFFER_MAX_LVL));
            show(html, player);
            return false;
        }
        return true;
    }

    public void SelectMenu(String[] args)
    {
        int select_menu = Integer.valueOf(args[0]);
        Player player = (Player) getSelf();

        String html = null;

        if(select_menu == 0)
            html = HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/buffschar.htm", player);

        if(select_menu == 1)
        {
            if(BUFFER_PET_ENABLED != true)
                return;
            if(player.getPet() == null)
                return;
            html = HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/buffspet.htm", player);
        }

        assert html != null;
        html = html.replace("%grp_price1%", Util.formatAdena(BUFFER_PRICE * (grpCount1 + 2)));
        html = html.replace("%grp_price2%", Util.formatAdena(BUFFER_PRICE * (grpCount2 + 2)));
        html = html.replace("%grp_price3%", Util.formatAdena(BUFFER_PRICE * (grpCount3 + 2)));
        html = html.replace("%grp_price4%", Util.formatAdena(BUFFER_PRICE * (grpCount4 + 2)));
        html = html.replace("%grp_price5%", Util.formatAdena(BUFFER_PRICE * (grpCount5 + 2)));
        html = html.replace("%buffs_in_grp1%", Integer.toString(grpCount1));
        html = html.replace("%buffs_in_grp2%", Integer.toString(grpCount2));
        html = html.replace("%buffs_in_grp3%", Integer.toString(grpCount3));
        html = html.replace("%buffs_in_grp4%", Integer.toString(grpCount4));
        html = html.replace("%buffs_in_grp5%", Integer.toString(grpCount5));
        html = html.replace("%price%", Util.formatAdena(BUFFER_PRICE));
        show(html, player);
    }

    public void SelectBuffs()
    {
    Player player = (Player) getSelf();
    
    if(!checkCondition(player))
        return;
        
        if(player.isCursedWeaponEquipped() || player.isDead() || player.isAlikeDead() || player.isCastingNow() || player.isInCombat() || player.isAttackingNow() || player.isInOlympiadMode() || player.isFlying() || player.isTerritoryFlagEquipped())
            return;
    
    show(HtmCache.getInstance().getNotNull("scripts/services/NPCBuffer/buffs.htm", player), player);
    }

    public String OutDia()
    {
    if(!BUFFER_ON)
        return "";
    String append = "<br><a action=\"bypass -h scripts_services.NPCBuffer.Buffer:SelectBuffs\">";
    append += new CustomMessage("scripts.services.NPCBuffer.Buffer.s electBuffs", getSelf());
    append += "</a>";
        return append;
    }


    public String DialogAppend_12741(Integer val)
    {
    if(val != 0)
        return "";
    return OutDia();
    }

    public class BeginBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Player _target;

        public BeginBuff(Creature buffer, Skill skill, Player target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            if(_target.isInOlympiadMode())
                return;
            _buffer.broadcastPacket(new MagicSkillUse(_buffer, _target, _skill.getDisplayId(), _skill.getLevel(), _skill.getHitTime(), 0));
            ThreadPoolManager.getInstance().schedule(new EndBuff(_buffer, _skill, _target), _skill.getHitTime());
        }
    }

    public class EndBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Player _target;

        public EndBuff(Creature buffer, Skill skill, Player target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            _skill.getEffects(_buffer, _target, false, false);
            _buffer.broadcastPacket(new MagicSkillLaunched(_buffer.getObjectId(), _skill.getId(), _skill.getLevel(), _target));
        }
    }

    public class BeginPetBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Summon _target;

        public BeginPetBuff(Creature buffer, Skill skill, Summon target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            _buffer.broadcastPacket(new MagicSkillUse(_buffer, _target, _skill.getDisplayId(), _skill.getLevel(), _skill.getHitTime(), 0));
            ThreadPoolManager.getInstance().schedule(new EndPetBuff(_buffer, _skill, _target), _skill.getHitTime());
        }
    }

    public class EndPetBuff implements Runnable
    {
        Creature _buffer;
        Skill _skill;
        Summon _target;

        public EndPetBuff(Creature buffer, Skill skill, Summon target)
        {
            _buffer = buffer;
            _skill = skill;
            _target = target;
        }

        public void run()
        {
            _skill.getEffects(_buffer, _target, false, false);
            _buffer.broadcastPacket(new MagicSkillLaunched(_buffer.getObjectId(), _skill.getId(), _skill.getLevel(), _target));
        }
    }
}
вызов с html
Код:
<center><button action="bypass -h scripts_services.NPCBuffer.Buffer:SelectMenu 0" value="Баф игрока" width=174 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center>

<center><button action="bypass -h scripts_services.NPCBuffer.Buffer:SelectMenu 1" value="Баф питомца" width=174 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></center>
http://rghost.ru/38910881
адаптируйте под сборку сами



Спасибо вам огромное!!

Эм..спросить хотел на будущее.
Вы этот бафер где то скачали,или сами написали?

Добавлено через 11 часов 33 минуты
Импорты переправил пишет эту штуку
17:25:08.139 Script class services.NPCBuffer.Buffer not found
17:27:44.513 Script class services.NPCBuffer.Buffer not found
17:27:46.183 Script class services.NPCBuffer.Buffer not found

Бафера кинул по этому адресу \game\data\scripts\services

Добавлено через 13 часов 21 минуту
Ошибка когда нажимаешь на диалог бафнутся
17:25:08.139 Script class services.NPCBuffer.Buffer not
Бафера вроде правельно кинулу \game\data\scripts\services\NPCBuffer\
HTML запрос
"bypass -h scripts_services.NPCBuffer.Buffer:SelectMenu 0"
Импорты вроде тоже правильно прописал
Цитата:package services.NPCBuffer;
import l2p.gameserver.Config;
import l2p.gameserver.network.serverpackets.components.CustomMessage;
import l2p.gameserver.scripts.Functions;
import l2p.gameserver.scripts.ScriptFile;
import l2p.gameserver.ThreadPoolManager;
import l2p.gameserver.cache.Msg;
import l2p.gameserver.data.htm.HtmCache;
import l2p.gameserver.model.Creature;
import l2p.gameserver.model.Player;
import l2p.gameserver.model.Skill;
import l2p.gameserver.model.Summon;
import l2p.gameserver.model.entity.residence.Residence;
import l2p.gameserver.model.instances.NpcInstance;
import l2p.gameserver.network.serverpackets.MagicSkillLaunched;
import l2p.gameserver.network.serverpackets.MagicSkillUse;
import l2p.gameserver.tables.SkillTable;
import l2p.gameserver.utils.Files;
import l2p.gameserver.utils.Util;
Ответ
#8
на соседнем файле ( любом .java ) посмотри как выглядит импорт и советую использовать или иду или эклипс ...
СЕО Оптимизация сайтов
Ответ
#9
gorodetskiy Написал:на соседнем файле ( любом .java ) посмотри как выглядит импорт и советую использовать или иду или эклипс ...

Вот импорт в евента
Цитата:package events.FiveYearsLineage;

import java.util.ArrayList;
import java.util.HashMap;

import l2p.Config;
import l2p.extensions.scripts.Functions;
import l2p.extensions.scripts.ScriptFile;
import l2p.gameserver.Announcements;
import l2p.gameserver.cache.Msg;
import l2p.gameserver.model.L2Character;
import l2p.gameserver.model.L2Player;
import l2p.gameserver.model.L2Spawn;
import l2p.gameserver.model.instances.L2NpcInstance;
import l2p.gameserver.templates.L2NpcTemplate;
import l2p.util.Files;
import l2p.util.GArray;
import l2p.util.Rnd;
import events.Helper;

@SuppressWarnings("unused")
public class FiveYearsLineage extends Functions implements ScriptFile
{
private static int EVENT_MANAGER_ID = 32103;

// Буквы
Ответ
#10
https://www.google.ru/webhp?hl=ru&tab=ww...80&bih=866

посмотри, много интересного найдёшь
СЕО Оптимизация сайтов
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Помогите с Сервером L2Dream версии 439 для Lineage 2 Gracia Part 2 CAHTEX 4 3,380 10-01-2021, 02:40 PM
Последний пост: tenor
  Помогите выбрать! denisgreen11 3 1,408 09-25-2021, 05:13 PM
Последний пост: zmeylsdn
  Помогите. IIpu3pak 2 1,367 05-10-2021, 12:43 PM
Последний пост: Lord_Gothic
  Помогите voland3 8 5,320 01-30-2021, 10:54 AM
Последний пост: han
  Уважаемые Гуру помогите ! Klvl 46 11,302 06-20-2020, 08:02 PM
Последний пост: Klvl
  Ребята помогите с настройкой сервера la2 Heon 11 2,838 04-15-2020, 10:36 PM
Последний пост: Shady
  Помогите с ошибкой ГС при запуске pustota312 1 1,299 04-15-2020, 11:27 AM
Последний пост: Tiger7th
  помогите понять в чем дело. nexami 1 1,807 11-14-2019, 01:30 AM
Последний пост: nexami
  Помогите с сервером не могу запустить Lalak 4 3,030 10-13-2018, 10:23 PM
Последний пост: Kampina
  Ребята помогите с ошибкой умоляю) Lackyjack 2 1,687 04-19-2018, 12:52 PM
Последний пост: Daan Raven

Перейти к форуму:


Пользователи, просматривающие эту тему: 1 Гость(ей)