L2JMobius

Recent Posts

41
Bug Reports / Re: problem with solved problem
« Last post by Galagard on April 30, 2024, 09:56:30 PM »


why not be more simple?
geting out is enough than create a whole section for it.
Because this is the correct way... nothing more
42
Work in Progress / Re: can you help me finish it?
« Last post by -KouGou on April 30, 2024, 07:54:59 PM »
Code: [Select]
/*
 * 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 2, 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */
package org.l2jmobius.gameserver.model.actor.instance;

import org.l2jmobius.gameserver.cache.HtmCache;
import org.l2jmobius.gameserver.data.xml.NpcData;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;

public class L2RaidBossStatusInstance extends Npc
{
    private static final int[] RBOSSES = {25418,25434,25126};
    private static int MBOSS = 25126;

    public L2RaidBossStatusInstance(NpcTemplate template)
    {
        super(template);
    }

    @Override
    public void showChatWindow(Player player)
    {
        generateFirstWindow(player);
    }

    private void generateFirstWindow(Player activeChar)
    {
        final StringBuilder sb = new StringBuilder();
        for(int rboss : RBOSSES)
        {

            final int info = GrandBossManager.getInstance().getBossStatus(rboss);
            String name = NpcData.getInstance().getTemplate(rboss).getName().toUpperCase();

            if (info==0)
            {
                sb.append("<font color=\"b09979\">"+ name +" IS ALIVE!</font><br1>");
            }
            else if (info>0)
            {
                sb.append("<font color=\"FF0000\"> "+ name +" IS DEAD.</font><br1>");
            }
            else
            {
                final StatSet ss = GrandBossManager.getInstance().getStatSet(rboss);
                final long respawnTime = ss.getLong("respawn_time");
                sb.append("<font color=\"b09979\">"+name+"</font> "+ ConverTime(respawnTime) +" <font color=\"b09979\">TO RESPAWN.</font><br1>");
            }
        }

        final int MbossInfo = GrandBossManager.getInstance().getBossStatus(MBOSS);
        String m_name = NpcData.getInstance().getTemplate(MBOSS).getName().toUpperCase();

        String mainBossInfo ="";

        if (MbossInfo==0)
        {
            mainBossInfo = "WE SHOULD HAVE ACTED<br1><font color=\"b09979\">"+m_name+" IS ALIVE!</font><br1>";
        }
        else if (MbossInfo>0)
        {
            mainBossInfo = "IT'S ALL OVER<br1><font color=\"FF0000\"> "+m_name+" IS DEAD.</font><br1>";
        }
        else
        {
            final StatSet ss = GrandBossManager.getInstance().getStatSet(MBOSS);
            final long respawnTime = ss.getLong("respawn_time");
            mainBossInfo = "<font color=\"b09979\">"+ ConverTime(respawnTime) +"</font><br1>UNTIL OBLIVION OPEN!";
        }

        NpcHtmlMessage html = new NpcHtmlMessage(1);
        html.setFile(activeChar, "path"); //FIXME: just set the path to your HTML (-KouGou) <--
        html.replace("%objectId%", getObjectId());
        html.replace("%bosslist%", sb.toString());
        html.replace("%mboss%", mainBossInfo);
        activeChar.sendPacket(html);
    }

    private static String ConverTime(long mseconds)
    {
        long remainder = mseconds;

        long hours = (long)Math.ceil((mseconds/(60*60*1000)));
        remainder = mseconds - (hours*60*60*1000);

        long minutes = (long)Math.ceil((remainder / (60*1000)));
        remainder = remainder -(minutes *(60*1000));

        long seconds = (long)Math.ceil((remainder / 1000));

        return hours+":"+minutes+":"+seconds;
    }

    public String getHtmlPath(int npcId, int val)
    {
        String filename;

        if (val == 0)
            filename = "data/html/mods/RaidBossStatus/" + npcId + ".htm";
        else
            filename = "data/html/mods/RaidBossStatus/" + npcId + "-" + val + ".htm";

        if (HtmCache.getInstance().isLoadable(filename))
            return filename;

        return "data/html/mods/RaidBossStatus/" + npcId + ".htm";
    }
}
43
Shares/Contributions / Aztacan's Temple Admin Command to wipe target's inventory
« Last post by Acacia on April 30, 2024, 10:44:27 AM »
Might be useful for someone (:
Works on any Chronicle

Code: [Select]
package handlers.admincommandhandlers;

import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;

public class AdminWipe implements IAdminCommandHandler {

    private static final String[] ADMIN_COMMANDS = {    "admin_wipe"    };

    @Override
    public String[] getAdminCommandList() { return ADMIN_COMMANDS;  }

    @Override
    public boolean useAdminCommand(String command, Player activeChar)
    {
        WorldObject target = activeChar.getTarget();

        if (target == null) {
            activeChar.sendMessage("Incorrect target");
            return false;
        }

        Player player = target.getActingPlayer();

        if (player == null || !player.isPlayer())
        {
            activeChar.sendMessage("Incorrect target");
            return false;
        }

        if (command.equalsIgnoreCase("admin_wipe")) {

            for (Item item : player.getInventory().getItems())  {

                if (item.isEquipped() || item.getId() == 57 || item.getId() == 97145 || item.getId() == 91663)  {
                    continue;
                }
                player.destroyItem("admin_wipe" , item , activeChar , true);
            }
            activeChar.sendMessage("Target's inventory has been cleared");
            player.sendMessage("Inventory has been cleared");

            return true;
        }
        return false;
    }
}

add to MasterHandler.java

Code: [Select]
AdminVitality.class,
+AdminWipe.class,
44
General Discussion / Re: PrimeShop
« Last post by midnight on April 30, 2024, 09:21:09 AM »
Thanks Galagard. yes , i had the PrimeShop.xsd
45
General Discussion / Re: Help connect the master class
« Last post by Pavlov on April 30, 2024, 08:33:20 AM »
What?  :o :o
46
General Discussion / Re: raid boss spawn time
« Last post by Galagard on April 30, 2024, 02:50:45 AM »
Kill the boss again, and restart the server to see timestamp changes...
47
General Discussion / Re: PrimeShop
« Last post by Galagard on April 30, 2024, 02:46:46 AM »
According to the timestamp there in startsale, it will start on the day
GMT: Tuesday, 1   January   1980   07:00:00
in theory it should be working as the end date is 2037
Do you have the file PrimeShop.xsd? review the install of mod
You convert time to timestamp here https://www.epochconverter.com/
48
General Discussion / Classic Seven Signs PrimeShop
« Last post by midnight on April 30, 2024, 12:18:05 AM »
Hi guys, hope you're well.
I have the Primeshop enable, and l2.ini configured as well, but i dont see any item in the primeshop.

<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/PrimeShop.xsd">


   <item id="2090044" cat="11" paymentType="0" price="30" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="85" minBirthday="0" maxBirthday="0" accountDailyLimit="0" accountBuyLimit="0">
      <item itemId="29505" count="1" /> <!-- Normal VIP Gain Scroll -->

I wonder if could be the startsale endsale or dayofweek as i'm not sure how that works, anybody can help me with that?
Kind regards!
49
General Discussion / Help connect the master class
« Last post by Bahik2009 on April 29, 2024, 10:44:58 PM »
Tell me how to connect the profession manager to the community, what needs to be registered or what to fix this
50
General Discussion / Re: raid boss spawn time
« Last post by dramaa on April 29, 2024, 11:06:54 AM »
what you mean with "correct numbers"?
Timestamp is formatted a Epoch time, it's used because precision, in milliseconds
is a local server? or hosted?
i mean that when i changed min and max spawn time and killed raid, in database spawn time was still 1714360778573