Jump to content
  • 0

Question

6 answers to this question

Recommended Posts

  • 0
Posted

You can create new TASK, take a look at tasks from:

 

\gameserver\taskmanager\tasks

 

And take a look about how does it work.

 

Also there is guide about task manager shared already aswell.

 

Use search.

  • 0
Posted

package custom.Test;

import java.util.Calendar;

import com.l2jserver.Config;
import com.l2jserver.gameserver._announcements;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;

public class Test extends Quest
{
  private static final boolean _announce = true; 
  private static final int _event_duration = 2;
  private static final int _event_delay = 3;

  private static final Byte _start_hour = 0;
                                                                    
  private static final Byte _start_minute = 0;

  private static final int _event_frequency = 360;

  public Test(int questId, String name, String descr)
  {
     super(questId, name, descr);

     if (loadGlobalQuestVar("") == "")
     {
        if (_start_hour > 0)
           startQuestTimer("START", setStartTime(_start_hour, _start_minute), null, null);
        else
           startQuestTimer("START", _event_delay * 60000, null, null);
     }
     else 
        startQuestTimer("RESTORE", 60000, null, null);
  }

  private long setStartTime(Byte minute, Byte hour)
  {
     Calendar starttime = Calendar.getInstance();
     if (hour > 0 && hour < 24)
        starttime.set( Calendar.HOUR_OF_DAY, hour );
     else _log.info("Skipped.");
     if (minute > 0 && minute < 60)
        starttime.set( Calendar.MINUTE, minute );
     else if (minute > 60)
        starttime.set( Calendar.MINUTE, minute % 60 );
     if ((starttime.getTimeInMillis() - Calendar.getInstance().getTimeInMillis()) > 0)
        return (starttime.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
     else return 60000L;
  }

  public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  {
     if (event.equalsIgnoreCase("START"))
     {
        
     }

     if (event.equalsIgnoreCase("RESTORE"))
     {
        
        if (_start_hour > 0)
           startQuestTimer("START", setStartTime(_start_hour, _start_minute), null, null);
        else if (_event_frequency > 0)
           startQuestTimer("START", _event_frequency * 60000, null, null);
     }
     return "";
  }

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

 

example for your spawn. now just add spawn func to it. look at event "elpys" in DP side if you use freya

  • 0
Posted

public void spawnSevenSignsNPC()

 

eKo, such a big code for a little thing o_o.

 

just as an example o_o, i had it on my files was used for smth else

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: APRIL (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Okay, I understand. First, to get started by contributing to open projects and learning along the way. Then, when you mention starting my own project privately, do you mean taking a free datapack like L2jMobius and trying to make it functional for an online server? Great, thank you very much — all this information is really helpful. I’ve been reaching out to several server admins here in Argentina, but it seems like none of them have the time or interest to take on an intern or assistant. xd   P.S.: Are you the creator of Hopzone? Brings back memories of when I was a kid, downloading servers at the cyber café. For two dollars, I could spend the whole day playing and eating candy like crazy.   Another question: between L2jMobius, L2jServer, and aCis, which one has ALL of its code free? As you probably noticed, I'm using ChatGPT to help me translate things, lol, and it suggested the following: Project Status Open Source Accepts Juniors? Difficulty L2JMobius Very active Semi-closed Partially (with patches) Medium-High L2JServer Active Fully open Yes (directly on GitHub) Medium aCis Semi-active Unofficial Not very clear Low
    • @Logan22 Are you logan from mmo-dev forum?
  • Topics

×
×
  • Create New...