Jump to content
  • 0

[REQUEST] Java adapt


Question

Posted

adpat for l2jfrozen current 936 pleasee

 

Index: datapack/data/scripts/events/tesouro perdido/TesouroPerdido.java
===================================================================
--- /datapack/data/scripts/events/tesouro perdido/TesouroPerdido.java (revision 1035)
+++ /datapack/data/scripts/events/tesouro perdido/TesouroPerdido.java (revision 2532)
@@ -00,0 +13891,23 @@
/**
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

package events.TesouroPerdido;

import java.util.List;
import java.util.Map;

import javolution.util.FastList;
import javolution.util.FastMap;

import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.util.random.Rnd;

/**
* @author TheOne
* @version Over12 - Configurado , e Fixados erros.
*/

public class TesouroPerdido extends Quest
{
	private static final String qn = "TesouroPerdido";
	private static final int _eventInterval = 4 * 60 * 60 * 1000; // Intervalo do Evento em 4 em 4 horas.
	private static final int _firstStart = 2 * 60 * 1000; //Apos religar o servidor inicia o evento automaticamente 10 minuto.
	private static final int _mobInterval = 1 * 60 * 60 * 1000;//1 Hora ate matar o Mob.
	private static L2NpcInstance RbSpawn = null;
	private static final String[][] Mobs = {
        { "Tesouro Perdido", "20629" }, //Npc para usar

};
    private static final String[][] RbCoords = {  // Valores aleatorios.
        { "Primeval Isle", "10724,-23729,-3650" }, // Coordenadas de onde pode aparecer o mob ou tesouro , pegar Coordenadas no game e adicionar.
        { "Primeval Isle", "10724,-23729,-3650" },
    };
    private static final int MOUNT = 5;
    private static final int[][] REWARD = {//id,amount,chance
    { 5592, Rnd.get(1, MOUNT), 90 },//Greater CP Potion
    { 57, Rnd.get(2000000000, MOUNT), 90 },//2kkk deAdena
    };
    private static Map<Integer, String> Mobs_ = new FastMap<Integer, String>();
    private static List<Integer> MobsId = new FastList<Integer>();
    private static List<String> MobsLocName = new FastList<String>();
    private static List<Integer> MobsX = new FastList<Integer>();
    private static List<Integer> MobsY = new FastList<Integer>();
    private static List<Integer> MobsZ = new FastList<Integer>();
    static
    {
        for (String[] monster : Mobs)
        {
            Mobs_.put(Integer.valueOf(monster[1]), monster[0]);
            MobsId.add(Integer.valueOf(monster[1]));
        }
        
        for (String[] mobCoords : RbCoords)
        {
            String[] coords = mobCoords[1].split(",");
            MobsLocName.add(mobCoords[0]);
            MobsX.add(Integer.valueOf(coords[0]));
            MobsY.add(Integer.valueOf(coords[1]));
            MobsZ.add(Integer.valueOf(coords[2]));
        }
    }
    
    public TesouroPerdido(int questId, String name, String descr)
    {
        super(questId, name, descr);
        for (int mobsid : MobsId)
        {
            addKillId(mobsid);
        }
        
        this.startQuestTimer("raidSpawn", _firstStart, null, null);
    }
    
    @Override
    public String onAdvEvent(String event, L2NpcInstance npc, L2PcInstance player)
    {
        if (event.equalsIgnoreCase("raidSpawn"))
        {
            int rbId = Rnd.get(MobsId.size());//id
            int rbLoc = Rnd.get(RbCoords.length);//loc
            String mob = Mobs_.get(MobsId.get(rbId));
            Announcements.getInstance().announceToAll("Mob Apareceu use o comando /loc para localizar o mob: " + MobsX + " | " + MobsY + " | " + MobsZ + ".");
            System.out.println("# Mob Evento Iniciado (" + mob + ")!");
            RbSpawn = this.addSpawn(MobsId.get(rbId), MobsX.get(rbLoc), MobsY.get(rbLoc), MobsZ.get(rbLoc), 0, false, 0);
            this.startQuestTimer("RbDespawn", _mobInterval, null, null);
        }
        
        if (event.equalsIgnoreCase("RbDespawn"))
        {
            this.startQuestTimer("raidSpawn", _eventInterval, null, null);
            RbSpawn.deleteMe();
            Announcements.getInstance().announceToAll("Ninguem derrotou o Mob.");
            System.out.println("# Evento desapareu.!");
        }
        return null;
    }
    
    @Override
    public String onKill(L2NpcInstance npc, L2PcInstance player, boolean isPet)
    {
        if (npc == RbSpawn)
        {
            if (npc.getObjectId() == RbSpawn.getObjectId())
            {
                for (L2PcInstance p : npc.getKnownList().getKnownPlayersInRadius(300))
                {
                    if (!p.isDead())
                    {
                        p.sendMessage("Recompensa por ter Vencido!");
                        for (int[] item : REWARD)
                        {
                            switch (item[0])
                            {                               
                                default:
                                {
                                    if (Rnd.get(100) <= item[2])
                                        p.addItem(qn, item[0], item[1], player, true);
                                }
                                    break;
                            }
                        }
                    }
                }
            }
        }
        this.startQuestTimer("raidSpawn", _eventInterval, null, null);
        this.cancelQuestTimer("RbDespawn", null, null);
        String name = player.getName();
        Announcements.getInstance().announceToAll("Parabens " + name + " .");
        Announcements.getInstance().announceToAll("Parabens derrotaram o Mob!");
        System.out.println("# Mob Morto !!");
        return null;
    }
    
    public static void main(String[] args)
    {
        new TesouroPerdido(-1, qn, "events");
        System.out.println(qn + " - ON");
    }
}

2 answers to this question

Recommended Posts

  • 0
Posted

No problem boss!

 

Index: datapack/data/scripts/events/tesouro perdido/TesouroPerdido.java
===================================================================
--- /datapack/data/scripts/events/tesouro perdido/TesouroPerdido.java (revision 1035)
+++ /datapack/data/scripts/events/tesouro perdido/TesouroPerdido.java (revision 2532)
@@ -00,0 +13891,23 @@
/**
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

package events.TesouroPerdido;

import java.util.List;
import java.util.Map;

import javolution.util.FastList;
import javolution.util.FastMap;

import com.l2jfrozen.gameserver.model.entity.Announcements;
import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.quest.Quest;
import com.l2jfrozen.util.random.Rnd;

/**
* @author TheOne
* @version Over12 - Configurado , e Fixados erros.
*/

public class WereNotHereToProgramJavaForYou extends Quest
{
public WereNotHereToProgramJavaForYou()
{
	System.out.println("We're not here to do your work for you");
}
}

Guest
This topic is now closed to further replies.


  • Posts

    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • Ave is trustworthy,fast  and reliable.His work is amazing!100% satisfied with his services!
    • SMMTOOL.ORG ТВОЙ ПРЯМОЙ ПОСТАВЩИК TG/YouTube/MAX ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ПОЧЕМУ МЫ? • Свой софт — работаем без посредников и переплат. • Скорость до 50.000.000 в сутки. • Минимальный **** — всего ~5%. ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ Услуги Telegram ПРАЙС-ЛИСТ (ЗА 1000 ЕД.) ПОДПИСЧИКИ (LIFETIME) ➥ 1.2$ — RU База ➥ 1.2$ — Китай База ➥ 1$ — Ultra Fast Группа (~80₽) ➥ 1$ — Ultra Fast (~80₽) ➥ 0.99$ — Super Fast (~80₽) ➥ 0.8$ — Fast (~64₽) ➥ 0.55$ — Normal (~40₽) ➥ 0.44$ — 100K+ Only (~35₽) ПОДПИСЧИКИ (Дневные) ➥ 0.7$ — 60 дней РУ (~55₽) ➥ 0.5$ — 30 Дней РУ (~40₽) ➥ 0.7$ — 60 Дней Китай (~55₽) ➥ 0.5$ — 60 Дней Китай (~40₽) ОПТИМИЗАЦИЯ КАНАЛОВ И БОТОВ ➥ 1.5$ — Подписчики из Поиска Китай (~120₽) ➥ 1.5$ — Подписчики из Поиска РУ База (~120₽) ➥ 1$ — Подписчики из Поиска МИКС (~₽80) ➥ 0.8$ — Бот Старты из Поиска (~64₽) АКТИВНОСТЬ И БОТЫ ➥ 0.7$ — Реакции на Комменты (Позитивные) + Подписчики (Бонус) ➥ 0.7$ — Реакции на Комменты (Негативные) + Подписчики (Бонус) ➥ 0.08$ — Просмотры постов ➥ 0.08$ — Реакции (Любые) ➥ 0.18$ — Запуски ботов МИКС ➥ 0.4$ — Запуски ботов РУ ➥ 0.4$ — Запуски ботов Китай ➥ 0.18$ — Запуски ботов + сообщение (/settings) ➥ 0.5$ — Рефералы в боты ➥ 0.3$ — Репост Истории + просмотр ➥ 0.3$ — Лайк Истории + просмотр Услуги YouTube АКТИВНОСТЬ ➥ 8$ — Кастомные Комментарии Живые Юзеры ➥ 15$ — Кастом Позитивные Комментарии + Лайк + Просмотр Видео ➥ 10$ — Рандомные Позитивные Комментарии + Лайк + Просмотр Видео ➥ 0.55$ — Поделиться Видео Живые Юзеры ➥ 0.5$ — Зрители Эфира (15мин) Живые Юзеры ➥ 18$ — Живые Просмотры Видео 60мин+ Видео ➥ 5$ — Рандомные Позитивные Комментарии ➥ 0.5$ — Лайк под Видео ➥ 0.7$ — Просмотр Видео МИКС + Монетизация Услуги MAX ПОДПИСЧИКИ (LIFETIME) ➥ 22$ — Публичные Каналы ПОДПИСЧИКИ (Дневные) ➥ 15$ — 90 дней ➥ 12$ — 60 дней ➥ 8$ — 30 дней АКТИВНОСТЬ И БОТЫ ➥ 3.50$ — Просмотры на пост ➥ 7$ — Макс Репосты ➥ 8$ — Положительные Реакции ➥ 13$ — Реакция ➥ 13$ — Реакция ➥ 13$ — Реакция ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ БОНУСЫ И ОФФЕРЫ КЭШБЭК ДО 10% для крупных реселлеров API доступ для ваших панелей ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ОПЛАТА: Crypto | LOLZ Market САЙТ: SMMTOOL.ORG Telegram: SMMTOOL_ORG
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..