I find this code but it's designed for archid pack i would like to know how apply to L2j, i know how apply a patch manually, change the imports, etc.. but on this package say "custom.SpecialGatekeeper" l2j don't have the mentioned package where i should create the .java?
package custom.SpecialGatekeeper;
import com.l2jarchid.Config;
import com.l2jarchid.gameserver.instancemanager.ZoneManager;
import com.l2jarchid.gameserver.model.actor.L2Character;
import com.l2jarchid.gameserver.model.actor.L2Npc;
import com.l2jarchid.gameserver.model.actor.L2Player;
import com.l2jarchid.gameserver.model.quest.Quest;
import com.l2jarchid.gameserver.model.quest.QuestState;
import com.l2jarchid.gameserver.model.zone.L2ZoneType;
/**
* @author Matim
* <br>Special Gatekeeper NPC.
* <br>Show current players count from zone.
* <br>This code may be easily edited.
* <br>By default it has few arenas teleports.
*
* TODO price for teleports, config.
*/
public class SpecialGatekeeper extends Quest
{
protected static L2Player player;
private final static String qn = "SpecialGatekeeper";
private final static int NPC = Config.SPECIAL_GK_NPC_ID;
//private final static int teleportPrice = 1000;
//private final static int priceItemId = 57;
public SpecialGatekeeper(int questId, String name, String descr)
{
super(questId, name, descr);
addFirstTalkId(NPC);
addStartNpc(NPC);
addTalkId(NPC);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2Player player)
{
String htmltext = "";
if(event.equalsIgnoreCase("1"))
player.teleToLocation(73890, 142656, -3778);
else if (event.equalsIgnoreCase("2"))
player.teleToLocation(-86979, 142402, -3643);
else if (event.equalsIgnoreCase("3"))
player.teleToLocation(147451, 46728, -3410);
else if (event.equalsIgnoreCase("4"))
player.teleToLocation(12312, 182752, -3558);
else
htmltext = "Error, check whole GK code!";
return htmltext;
}
@Override
public String onFirstTalk(L2Npc npc, L2Player player)
{
String htmltext = "";
QuestState qs = player.getQuestState(qn);
if (qs == null)
qs = newQuestState(player);
htmltext = "<html><title>Special Gatekeeper</title><head><body><center>" +
"<br><img src=l2ui.bbs_lineage2 height=16 width=80>" +
"<font color=AAAAAA>Special Gatekeeper</font><br>" +
"Teleport costs: <font color=\"LEVEL\">" + teleportPrice + "</font> adena" +
"<img src=L2UI_CH3.herotower_deco width=256 height=32>" +
"Players Inside: <font color=\"LEVEL\">" + getPlayerInsideCount(11600) + "</font>" +
"<button value=\"Aden\" action=\"bypass -h Quest SpecialGatekeeper 1\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" +
"Players Inside: <font color=\"LEVEL\">" + getPlayerInsideCount(10500) + "</font>" +
"<button value=\"Giran\" action=\"bypass -h Quest SpecialGatekeeper 2\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" +
"Players Inside: <font color=\"LEVEL\">" + getPlayerInsideCount(11012) + "</font>" +
"<button value=\"MOS\" action=\"bypass -h Quest SpecialGatekeeper 3\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" +
"Players Inside: <font color=\"LEVEL\">" + getPlayerInsideCount(11013) + "</font>" +
"<button value=\"VARKA\" action=\"bypass -h Quest SpecialGatekeeper 4\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" +
"Players Inside: <font color=\"PI\">" + getPlayerInsideCount(11013) + "</font>" +
"<button value=\"VARKA\" action=\"bypass -h Quest SpecialGatekeeper 4\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\" width=95 height=21><br>" +
"<font color=\"cc9900\"><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32></font><br1></center></body></head></html>";
return htmltext;
}
/**
* @param zoneId
* @return player count from given zone ID
*/
public static int getPlayerInsideCount(int zoneId)
{
int i = 0;
for (L2ZoneType zone : ZoneManager.getInstance().getAllZones())
if (zone.getId() == zoneId)
{
for (L2Character character : zone.getCharactersInside().values())
if (character instanceof L2Player)
i++;
return i;
}
return -1;
}
public static void main(String[] args)
{
new SpecialGatekeeper(-1, qn, "SpecialGatekeeper");
}
}
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.
The server is running in l2house.com.ar with C4 mode and in L2Tekila within the same login you can also test it in C5, if you want me to raise another chronicle to test, just let me know.
I have a system where Accounts are saved on login screen for fast login. I am playing a server where this feature is not on the logic screen. How I can try to add this feature to the system?
I don't know what files I would have to touch.
Thanks!!
Hello everyone,
Given that he has lots of different projects but no concrete opinions..
I pose my request here.
Which serious Lineage2 HighFive project is the best choice?
For a server that can be custom and which can be suitable for a classic x10 server and an x1000 server for example?
L2J
Or we ideally have the source, in order to be able to add the farming systems, weapons and armor, npc...
Free or paid, it doesn't matter.
THANKS
Hello everyone,
Given that he has lots of different projects
but no concrete opinions..
I pose my request here.
Which serious Lineage2 HighFive project/emulator
is the best choice?
For a server that can be custom and
which can be suitable for a classic x10 server
and an x1000 server for example?
L2Java ideally
Or we ideally have the source,
in order to be able to add the farming systems,
weapons and armor, npc...
Free or paid, it doesn't matter.
THANKS
Question
Chakl22
I find this code but it's designed for archid pack i would like to know how apply to L2j, i know how apply a patch manually, change the imports, etc.. but on this package say "custom.SpecialGatekeeper" l2j don't have the mentioned package where i should create the .java?
2 answers to this question
Recommended Posts
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.