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

    • Sure. This is the AbnormalStatusWnd.uc file with ability of removing buff with ALT + click https://pastebin.com/iVWpYysq
    • Hello, I add this code here https://maxcheaters.com/topic/248730-agathions-acis-401-does-not-interfere-with-summons-or-pets/.     but i have problem with agathion movement, agathion does not move when the player moves. The player must stop moving for Agathion to come close him.   i think the problem is here at < _followTask = ThreadPool.scheduleAtFixedRate(new Follow(this), 1000, 1000); >>       public void followToOwner()     {                  if (_followTask == null)             _followTask = ThreadPool.scheduleAtFixedRate(new Follow(this), 1000, 1000);                                  int rnd = Rnd.get(-30, +30);         SpawnLocation loc = _owner.getPosition();                          if (!checkIfInRange(1000, this, _owner))             teleport(_owner, 30);                  if (_owner.isMoving())             getAI().tryToFollow(_owner, false);         else         {             if (!checkIfInRange(75, this, _owner))                 getAI().tryToMoveTo(new Location(loc.getX()+rnd, loc.getY()+rnd, loc.getZ()), null);             else if (checkIfInRange(30, this, _owner))                 getAI().tryToIdle();                              if (Config.AGATHION_HEAL_OWNER && !getCast().isCastingNow())             {                 if (_owner.isInOlympiadMode() || _owner.isInDuel() || _owner.getPvpFlag() != 0 || _owner.isInsideZone(ZoneId.PVP) || _owner.getKarma() != 0)                     return;                                  if ((_owner.getStatus().getHpRatio() < Config.AGATHION_PERCENT_TO_HEAL))                     getAI().tryToCast(_owner, 1011, 18);             }             else if (!Config.AGATHION_ONLY_FOLLOW && Config.AGATHION_ALLOW_SOCIAL && !isMoving() && !getCast().isCastingNow())                 broadcastPacket(new SocialAction(this, 1));         }  
    • 🌟 EMERLAND.PW — Open Beta Testing Has Begun! 🎉 Friends! We are excited to announce that the Open Beta Testing of our Lineage 2 Interlude server, based on the new Classic client, has officially started! 🚀 📌 Key Information Server Rates: x50 New client, new possibilities Numerous improvements for a more comfortable gameplay We invite everyone to join the OBT, test the game, and help us make the server even better before the official launch! Your feedback and active participation are very important to us. 🎁 Participation Bonus! After the OBT ends, all active participants will receive a special bonus on their Master Account! 📅 Join now at EMERLAND.PW and become part of our project's history! 🔥 Server Rates Exp/SP: x50 Raid Exp/SP: x50 Adena: x25 Seal Stones: x5 Drop/Spoil: x5 Quest/Quest Adena: x1 RB Drop Rate: x5 Quest Item Drop Rate: x5 Siege Guard Drop Rate: x5 Clan Reputation Rate: x5 Mob Spawn Rate: x2 Manor Rate: x5 ⚙ Server Settings Auto-loot (disabled for bosses) Players with karma cannot use NPC shops Auto skill learning Subclass addition without quest (max. 10 subclasses) Warsmith & Overlord can be added as subclasses Elf & Dark Elf subclasses available for all Heroic skills remain when switching to a subclass Alternative protection for characters after teleport (Celestial Shield for 15 sec) Clan warehouse item withdrawal rights can be given to members, not just CL Catacomb teleportation for Adena Buff limit: 60 (duration: 60 min) Dance/Song limit: 24 (duration: 60 min) Enchanted items can be traded and sold Max enchant level: 20 Multiple character login from one account is allowed Two types of champion mobs: x10, x50 (Drop: 0.5% Gold Einhasad, 5% Silver Shilen) 🛍 In-Game Shop Gear up to B-Grade included Mana Potion, Mana Drug available for Adena Accessories, Costumes, Mounts, Belts, Cloaks – for Silver Shilen & Gold Einhasad (cosmetic only, no P2W) 💰 Main Server Currencies Silver Shilen – earned through events, champion mob drops, voting Gold Einhasad – obtained through server support, events, voting, champion mob drops 🏆 Game Commands .cfg — Game settings .exp — XP to next level .time — Server date & time .clan — Clan panel .relog — Quick relog .ping — Check ping .rb — Raid boss statistics .topclan — Clan rankings .whoiam — Character stats .rcm — Clan recall (CL only) ⚔ In-Game Events The server features 3 events: TvT, DM, CTF. 🔹 Rewards for participation & victories 🕒 Event Schedule (server time .time😞 TvT: 03:00, 08:00, 13:00, 16:00, 19:00, 22:00 DM: 04:00, 10:00, 14:00, 17:00, 20:00, 23:00 CTF: 06:00, 12:00, 15:00, 18:00, 21:00, 00:00 🤖 Auto-Farm Cost: 2 Silver Shilen/hour Limit: 24 hours Activation: .autofarm 🎟 Premium Account Premium boosts all rates x2. 1 day — 1 Gold Einhasad 7 days — 4 Gold Einhasad 30 days — 10 Gold Einhasad ⭐ Server Features Chronicles: Interlude Game Client: Classic Updated Core/Orfen stats (upgraded to level 3) Core Ring 2 lvl: +3% M. Atk, +1 MEN Core Ring 3 lvl: +6% M. Atk, +1 MEN, +1 WIT Orfen Earring 2 lvl: +3% P. Atk, +1 CON Orfen Earring 3 lvl: +6% P. Atk, +1 CON, +1 DEX New Skills Added: Spoilers — Festive Sweeper (AoE sweep) PP, EE, SE, BP — Might of Heaven (PvP skill) Horse Tamers — Hydro Blast (weakened power, 1 Cursed Bone) Cat Tamers — Prominence (weakened power, 1 Cursed Bone) Shadow Tamers — Hurricane (weakened power, 1 Cursed Bone) 🎮 Join us now at EMERLAND.PW and start your adventure today! 🚀
    • Price reduction for Google accounts from 6-12 months after registration - only 0.3157$ each. Top up with Gmail accounts with activated 2FA - 0.3507$ each!
  • Topics

×
×
  • Create New...