Рейтинг темы:
  • 0 Голос(ов) - 0 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
event The Fall Harvest
#1
Здравствуйте , скажите есть ли у кого нибудь нормальные скрипты по сборку EMU для этого эвента ? а то я столько уже вожусь и не понимаю в чём дело . Вначале не работали скилы 2003 2004 2005 , тк они были типа NOTDONE потом я решил сделать тыкву суммоном но в итоге она просто появлялась а нектары не давали никакого эффекта. скажите какой способ решения этой проблемы ??

Код:
package events.SquishYourSquash;

import com.l2emu.gameserver.model.L2Object;
import com.l2emu.gameserver.model.L2Skill;
import com.l2emu.gameserver.model.actor.L2Npc;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;
import com.l2emu.gameserver.model.quest.Quest;
import com.l2emu.gameserver.network.serverpackets.NpcSay;
import com.l2emu.gameserver.templates.item.L2Weapon;
import com.l2emu.util.Rnd;

public class SquishYourSquash extends Quest
{
    private static final int[] SKILL_NECTAR = {
                                          2005,2004,2003
              };
    private static final int[] CHRONOWEAPONS = {
            4202, 5133, 5817, 7058, 8350
    };
    private static final int[] SQUASHLIST = {
            12774, 12775, 12776, 12777, 12778, 12779
    };
    private static final int[] CANNOTGROW = {
            13016, 13017
    };
    private static final String[] EAT_TEXT = {
            "More... I need more...", "Yummy, what a great nectar.", "I'm growing...", "Give me more!", "I need moooreee."
    };
    private static final String[] CHRONO_TEXT = {
            "Arghhh... You have chrono weapon.", "My end is coming...", "I feel chrono....", "No.. No.. please don't kill me."
    };
    private static final String[] NOCHRONO_TEXT = {
            "Haha, you can't kill me.", "It's impossible to kill me without chrono weapon.", "I can be defeated only with special chrono weapon!", "Hahaha.... Keep trying..."
    };
    private int _numAtk = 0;
    private int _nectar = 0;

    public SquishYourSquash(int questId, String name, String descr)
    {
        super(questId, name, descr);
        for (int i : SQUASHLIST)
        {
            addSkillSeeId(i);
            addAttackId(i);
            addKillId(i);
            addSpawnId(i);
        }
    }

    @Override
    public String onSpawn(L2Npc npc)
    {
        _numAtk = 0;
        _nectar = 0;
        return super.onSpawn(npc);
    }

    @Override
    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
    {
        _numAtk = 0;
        _nectar = 0;
        return super.onAdvEvent(event, npc, player);
    }

    @Override
    public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
    {
        int npcId = npc.getNpcId();
        if (!contains(targets, npc))
            return super.onSkillSee(npc, caster, skill, targets, isPet);
        if (!contains(SKILL_NECTAR, skill.getId()))
            return super.onSkillSee(npc, caster, skill, targets, isPet);
        if (!contains(CANNOTGROW, npc.getNpcId()))
            return super.onSkillSee(npc, caster, skill, targets, isPet);
        if (_nectar == 0 && _nectar <= 3)
        {
            npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), EAT_TEXT[Rnd.get(EAT_TEXT.length)]));
            _nectar++;
        }
        else if (_nectar == 4)
        {
            if (npcId == 12774)
            {
                addSpawn(12776, npc);
                npc.deleteMe();
                _nectar = 0;
            }
            else if (npcId == 12777)
            {
                addSpawn(12779, npc);
                npc.deleteMe();
                _nectar = 0;
            }
            else
                _nectar++;
        }
        else if (_nectar == 9)
        {
            if (npcId == 12776)
            {
                addSpawn(12775, npc);
                npc.deleteMe();
                _nectar = 0;
            }
            else if (npcId == 12779)
            {
                addSpawn(12778, npc);
                npc.deleteMe();
                _nectar = 0;
            }
            else
                _nectar++;
        }
        else if (_nectar == 19)
        {
            if (npcId == 12775)
            {
                addSpawn(13016, npc);
                npc.deleteMe();
                _nectar = 0;
            }
            else if (npcId == 12778)
            {
                addSpawn(13017, npc);
                npc.deleteMe();
                _nectar = 0;
            }
            else
                _nectar++;
        }
        return super.onSkillSee(npc, caster, skill, targets, isPet);
    }

    @Override
    public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet)
    {
        L2Weapon weapon = attacker.getActiveWeaponItem();
        if (weapon == null)
        {
            npc.setIsInvul(true);
            if (Rnd.get(4) == 1)
                npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), NOCHRONO_TEXT[Rnd.get(NOCHRONO_TEXT.length)]));
        }
        else if (isPet)
        {
            npc.setIsInvul(true);
            if (Rnd.get(4) == 1)
                npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), NOCHRONO_TEXT[Rnd.get(NOCHRONO_TEXT.length)]));
        }
        else
        {
            if (contains(SQUASHLIST, npc.getNpcId()))
            {
                if (contains(CHRONOWEAPONS, weapon.getItemId()))
                {
                    npc.setIsInvul(false);
                    if (_numAtk < 1)
                        npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), CHRONO_TEXT[Rnd.get(CHRONO_TEXT.length)]));
                    _numAtk++;
                }
                else
                {
                    npc.setIsInvul(true);
                    if (Rnd.get(4) == 1)
                        npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), NOCHRONO_TEXT[Rnd.get(NOCHRONO_TEXT.length)]));
                }
            }
            else
                npc.setIsInvul(false);
        }
        return super.onAttack(npc, attacker, damage, isPet);
    }

    @Override
    public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
    {
        npc.broadcastPacket(new NpcSay(npc.getObjectId(), 0, npc.getNpcId(), "Rewards !!"));
        _numAtk = 0;
        _nectar = 0;
        return super.onKill(npc, killer, isPet);
    }

    private static boolean contains(int[] array, int obj)
    {
        for (int i = 0; i < array.length; i++)
        {
            if (array[i] == obj)
                return true;
        }
        return false;
    }

    public static <T> boolean contains(T[] array, T obj)
    {
        for (int i = 0; i < array.length; i++)
        {
            if (array[i] == obj)
                return true;
        }
        return false;
    }

    public static void main(String[] args)
    {
        new SquishYourSquash(-1, "SquishYourSquash", "events");
    }
}

скиллы пока так

Код:
<skill id="2003" levels="1" name="Squash Seed">
       <!-- Summer Squash Event Skill (http://www.lineage2.com/archive/2006/11/fall_harvest.html) -->
       <set name="target" val="TARGET_SELF"/>
       <set name="skillType" val="SUMMON"/>
        <set name="operateType" val="OP_PASSIVE"/>
       <set name="hitTime" val="1500"/>
       <set name="interruptTime" val="1500"/>
       <set name="staticHitTime" val="true"/>
     </skill>
     <skill id="2004" levels="1" name="Large Squash Seed">
       <!-- Summer Squash Event Skill (http://www.lineage2.com/archive/2006/11/fall_harvest.html) -->
       <set name="target" val="TARGET_SELF"/>
       <set name="skillType" val="SUMMON"/>
       <set name="operateType" val="OP_PASSIVE"/>
       <set name="hitTime" val="1500"/>
       <set name="interruptTime" val="1500"/>
       <set name="staticHitTime" val="true"/>
     </skill>
     <skill id="2005" levels="1" name="Nectar">
          <!-- Summer Squash Event Skill (http://www.lineage2.com/archive/2006/11/fall_harvest.html) -->
       <set name="itemConsumeId" val="6391"/>
       <set name="itemConsumeCount" val="1"/>
       <set name="target" val="TARGET_ONE"/>
       <set name="hitTime" val="1000"/>
       <set name="skillType" val="BEAST_FEED"/>
       <set name="operateType" val="OP_ACTIVE"/>
       <set name="castRange" val="40"/>
       <set name="effectRange" val="400"/>
       <cond msgId="109">
         <target npcId="12774 12777"/>
       </cond>
     </skill>
а нельзя ли сделать может на питоне вобще ?
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  Event AprilFools сборка L2J HF5 не работает. Travesil 0 1,211 11-16-2015, 08:17 PM
Последний пост: Travesil
  Event 7 печатей GameAdvisor 2 1,459 07-28-2015, 05:08 PM
Последний пост: GameAdvisor
  Скилы Meteor Shower и Star Fall время каста на ХФ? Munhgauzen 10 2,974 11-08-2013, 07:22 PM
Последний пост: Ashtone Grey
  [Поиск] Nexus Event Engine & Зоны moveton 10 3,786 10-20-2013, 01:19 AM
Последний пост: Visor
  TvT Event low-pts 4 1,948 08-08-2013, 02:13 AM
Последний пост: Zubastic
  Event Moratres 3 1,602 09-09-2012, 10:24 AM
Последний пост: Visor
  [share]Mass PvP event web-one 8 4,545 08-01-2012, 07:29 PM
Последний пост: Zubastic
  Event-ы MaJIou2906 6 2,482 06-18-2011, 04:50 PM
Последний пост: krisadr
  Raid Event vinchelo 11 3,558 05-30-2011, 10:32 PM
Последний пост: vinchelo
  TvT Event на L2JServer 7664 [ADM]Itachi 4 2,620 04-10-2011, 11:19 AM
Последний пост: lopolopp

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


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