I'm looking for someone who can make this code as ext.jar.
Also I am looking for tutorial how to compile java codes for lucera as ext.jar.
Second code
Also I am looking for tutorial how to compile java codes for lucera as ext.jar.
Code:
import l2.gameserver.model.Player;
import l2.gameserver.model.Skill;
import l2.gameserver.model.instances.NpcInstance;
import l2.gameserver.model.quest.Quest;
import l2.gameserver.model.quest.QuestState;
import l2.gameserver.scripts.ScriptFile;
import l2.gameserver.tables.SkillTable;
public class _998_MobBuff extends Quest implements ScriptFile {
private final int mobIdOne = 9988;
private final Skill skillOne = SkillTable.getInstance().getInfo(9001, 1);
private final int mobIdTwo = 9989;
private final Skill skillTwo = SkillTable.getInstance().getInfo(9002, 1);
public _998_MobBuff() {
super(-1);
this.addKillId(new int[]{9988, 9989});
System.out.println("Loading mob buffs");
// Add null checks for skills
if (skillOne == null || skillTwo == null) {
System.out.println("Error: One or more skills not found in SkillTable.");
}
}
public String onKill(NpcInstance npc, QuestState questState) {
Player player = questState.getPlayer();
switch(npc.getNpcId()) {
case 9988:
this.applyEffect(this.skillOne, player);
break;
case 9989:
this.applyEffect(this.skillTwo, player);
break;
default:
return "";
}
return null;
}
private void applyEffect(Skill skill, Player target) {
skill.getEffects(target, target, false, false);
}
public void onLoad() {
}
public void onReload() {
}
public void onShutdown() {
}
}
Second code
Code:
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import l2.gameserver.model.Player;
import l2.gameserver.model.instances.MerchantInstance;
import l2.gameserver.network.l2.s2c.NpcHtmlMessage;
import l2.gameserver.templates.npc.NpcTemplate;
public class TeleporterInstance extends MerchantInstance {
public TeleporterInstance(int i, NpcTemplate npcTemplate) {
super(i, npcTemplate);
}
public void showChatWindow(Player player, int val, Object... arg) {
NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
msg.setFile("mods/globalgk/40035.htm");
try {
// Get the current day of the week (1 = Sunday, 2 = Monday, ..., 7 = Saturday)
SimpleDateFormat dayFormat = new SimpleDateFormat("u");
int currentDay = Integer.parseInt(dayFormat.format(new Date(System.currentTimeMillis())));
// Check if it's Saturday (day 7)
if (currentDay == 6) {
// Show the PvP warzone teleporter button for Saturday
NpcHtmlMessage var12 = msg.replace("%pvp_warzone%", "<button value=\"PvP Warzone\" action=\"bypass -h scripts_Util:Gatekeeper -53855 179302 -4640 0\" width=300 height=40 back=\"Iwanoff.ebtn\" fore=\"Iwanoff.01\">");
} else {
// Hide the PvP warzone teleporter button for other days
msg.replace("%pvp_warzone%", "");
}
// Add an additional button with different teleport locations for every day
String teleportButton = "<button value=\"Farm zone 1\" action=\"bypass -h scripts_Util:Gatekeeper 123213 123213 -4012\" width=300 height=40 back=\"l2evo.ebtn\" fore=\"Iwanoff.01\">";
teleportButton += "<button value=\"Farm Zone 2\" action=\"bypass -h scripts_Util:Gatekeeper 1232 13123 -1411\" width=300 height=40 back=\"l2evo.ebtn\" fore=\"l2evo.01\">";
teleportButton += "<button value=\"Farm zone 3\" action=\"bypass -h scripts_Util:Gatekeeper 491237 28312 -1231\" width=300 height=40 back=\"l2evo.ebtn\" fore=\"l2evo.01\">";
msg.replace("%additional_teleport%", teleportButton);
} catch (Exception e) {
e.printStackTrace();
}
// Send the modified message to the player
player.sendPacket(msg);
}
}