Jump to content

Recommended Posts

Posted

Special Gatekeeper

 


 

Description: Normal Gatekeeper, but with special ability, to show how many players are inside those locations.

 

It may be easily edited,  for default it has only 3 locations, without subcategories etc, but if u wish may be added.

 

Its quest based, not an instance.

 

Also more statistics like player killers inside etc may be added (...) Sample screenshot:

 

fs6qp.jpg

 


 

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.
*/
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;

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>" +
                   "<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");
}
}

Posted

sry , SpecialGatekeeper.java ? no need Scripts? custom/SpecialGatekeeper.java ?

 

Simply look at package.

Posted

wtf ?

 

[Hidden post: You need 200 posts to see it. You currently have 130.]

 

RapBoy,

Comment: nc work...nc share :)

Posts: 181

?

 

 

when the post was created, wasn't hidden at 200 post

Posted

when the post was created, wasn't hidden at 200 post

 

true, I do it after his reply.

 

Anyway. Matim awesome work. ;)

Posted

Matim, i haven't got 200 posts. Can u give me link to this share? I'll be very happy. I saw this gk 1 year ago and it was very nice.

 

1 year ago and the post was created on:

« on: August 25, 2011, 01:26:19 AM »

 

 

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
Reply to this topic...

×   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

    • It's not because I'm an admin that he treated me differently. I actually gave him several clients from my side without him even knowing they came from me, and most of them had no issues. I was also waiting 3–4 weeks at times for things I bought from AvE, even when I was in a rush. He still delivered in the end. That said, I'm not defending him blindly. I'm just saying it's unlikely he’d risk scamming someone over 60–100€, especially knowing how quickly word spreads here.
    • For exact same reason - there were accusation that I scammed. When was it? 2016? But in that time, admins actually didn't listen. I got banned, then unbaned (when I prooved I've refunded) but I was trash talking to mods. When few months later same shit happened, Grisom (?) old global mod, banned me anyway. You can read somewhere on forum how I was shitting on him for doing that (from other account because original account was banned) - which was banned too. He is not here anymore I think. Back in the days I was well know for not carring that much if I was talking to mod or admin, I didn't hold my tongue. Now You know. Just like You know - if I delay, I deliver or refund. I'm not a scammer, even if my old time haterz love to repeat themselfs like mantra. I don't care.
    • Okay I respect that but why is your other account banned?   I don't think this happened just because you delayed somebodys work even in 2012
    • Do You understand the fact, I won't scam anyone? Can You grasp such idea?  Second of all, if a random restaurant on Google Maps has 599 positive reviews and few negative ones with 4,8* score, do You ask Google to block it's profile and burn the place down? No? Then why the fuck You are crying about my random delays? If someone can't get a CUSTOM DESIGN on time, I refund. I'm not 16  y.o. anymore. I don't make living out of this L2 bullshit. Never did. Since 2012 I've made shit tons of projects. How many delays did I have? 12? 15? Out of hundrets of projects. Calm Your tits please. If I would actually take 4k euro and NOT deliver and NOT refund - admins can ban me. So don't compare me to Simple. And just so You know, Celestine sent me customers, so it's not like I've worked with him on his account all the time. That's another thing You won't understand. I won't waste anymore time on You and any other cunt who never was my customer but is bitching just because he has nothing better to do in his life. You don't like my work? Hove along, I don't give a shit. 
  • Topics

×
×
  • Create New...