Jump to content
  • 0

[Help] Need dev help to develope 2 things (inside)


leomade

Question

hello i would like to know if some1 can help me with some scripts in l2j interlude :

1) make buff shop like any other private store what thats means? - when i press on buffer shop list of buffs appear show me player mana and buff cost - also player buffer can choose which buffs to put

 

2)make an enchant zone - put an npc in center of giran and players can only use enchant if they are stand near this npc

this npc is nothing the area is what important

 

thanks alot

Link to comment
Share on other sites

Recommended Posts

  • 0

easy to do, create new zone, in type write NoEnchant

now in zone>types create new class, name it L2NoEnchantZone, in method on enter write:

character.setInsideZone(L2Character.ZONE_NOENCHANT, true);

in method onExit, write: character.setInsideZone(L2Character.ZONE_NOENCHANT, false);

now go to L2Character, add new type: public static final byte ZONE_NOENCHANT = 22;

now go to RequestEnchantItem class, add there check:

if(activeChar.isInsideZone(L2Character.ZONE_NOENCHANT)){

activeChar.sendMessage("You can not enchant here");

return;

}

 

Its for h5, no idea how will it be in interlude, hf :)

Link to comment
Share on other sites

  • 0

easy to do, create new zone, in type write NoEnchant

now in zone>types create new class, name it L2NoEnchantZone, in method on enter write:

character.setInsideZone(L2Character.ZONE_NOENCHANT, true);

in method onExit, write: character.setInsideZone(L2Character.ZONE_NOENCHANT, false);

now go to L2Character, add new type: public static final byte ZONE_NOENCHANT = 22;

now go to RequestEnchantItem class, add there check:

if(activeChar.isInsideZone(L2Character.ZONE_NOENCHANT)){

activeChar.sendMessage("You can not enchant here");

return;

}

 

Its for h5, no idea how will it be in interlude, hf :)

 

oh its good this, i think i can work at first phase with this code and evolve it into something that will be work in interlude!!! thanks for your help :)

Link to comment
Share on other sites

  • 0

2nd request is really easy, creating new zone types is pointless tho.

 

Request enchant item, there is such java class, and in request enchant add check

 

get player known list and check if in certain radious this known list contains npc with xxx ID

Link to comment
Share on other sites

  • 0

thanks for the replies

Matin can u tell me please how to do that radius check because i couldn't find it?

 

Also i got another thing i need help with

i want to add to the "player killed player" announcements the location of the pvp, how can i do that?

So it'll be like: Colisum - Player1 killed Player2

 

Thanks for the help.

Link to comment
Share on other sites

  • 0
Collection<L2Character> knownNPC = activeChar.getKnownList().getKnownCharacters();

 

With this collection you will receive list of known characters in player knownlist.

 

Then by using checkIfInRange method, from Util class, you can check if character x is in radious to the character y

 

 

Link to comment
Share on other sites

  • 0

i tried it like that and it doesn't work, what did i do wrong ? (i can still enchant anywhere)

		for(L2Object obj : activeChar.getKnownList().getKnownCharacters())
	{
		if(obj.getName().equals("Holy Braizer"))
		{
	    	if (!Util.checkIfInRange(100, activeChar, obj, false))
	    	{
				activeChar.setActiveEnchantItem(null);
				activeChar.sendMessage("You can only enchant items near the Braizer of enchantments!");
				return;
	    	}
		}
	}

 

thanks for the help

Link to comment
Share on other sites

  • 0

Like Matim said, it's pointless to use a zone for such thing, just checking the range is enough. I have to say such method already exists and is normaly include to any L2Npc.canInteract( will check many conditions (depends of your chronicle), interaction range is one of them.

 

You don't have to use knownlist and such stuff aswell :P.

 

My current method is as following :

 

    /**
     * This method checks if the player given as argument can interact with the L2Npc.
     * @param player The player to test
     * @return true if the player can interact with the L2Npc
     */
    public boolean canInteract(L2PcInstance player)
    {
	if (player.isCastingNow() || player.isCastingSimultaneouslyNow())
		return false;
	if (player.isDead() || player.isFakeDeath())
		return false;
	if (player.isSitting())
		return false;
	if (player.getPrivateStoreType() != 0)
		return false;
	if (!isInsideRadius(player, INTERACTION_DISTANCE, true, false))
		return false;

        return true;
    }

 


 

Your first ask isn't possible. You have to use voicedcommands if you want that works. Basically people won't help you on that except if they're payed. And I don't think you can have a good result, that will look "homemade".

Link to comment
Share on other sites

  • 0

but how do i use it to acheive what i need ?:\

 

		for(L2Object obj : activeChar.getKnownList().getKnownCharacters())
	{
		if(!obj.getName().equals("Holy Brazier") && !Util.checkIfInRange(5, activeChar, obj, false))
		{
			activeChar.setActiveEnchantItem(null);
			activeChar.sendMessage("You can only enchant items near the Braizer of enchantments!");
			return;
		}
	}

 

didn't work out aswell

Link to comment
Share on other sites

  • 0

1) Question

 

class ShopBuffer extends Quest
{
private static final String qn = "ShopBuffer";
private static final int COST_ID = 0;
private static final int COST_AMOUNT = 0;

private FastList<L2Skill> _npcBuffs = new FastList<L2Skill>();

public ShopBuffer(int questId, String name, String descr)
{	
	super(questId, name, descr);
	// Buff loading, manual put, from db, whatever...
}

@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
	String content = getBuyHtml(npc.getObjectId());
	NpcHtmlMessage msg = new NpcHtmlMesage(npc.getObjectId());
	msg.setText(content);
	player.sendPakcet(content);
	updateMPStatus(player);
	return null;
}


private String getBuyHtml(final int objectId)
{
	StringBuilder sb = new StringBuilder();
	sb.append("<html><title>Shop Buffer</title><body><br> +
		"Welcome to the Shop buffer. Click on the buffs you wanna get!<br><br>");

	for(L2Skill sk : _npcBuffs)
	{
		final int id = sk.getId();
		String iconSkill = id > 1000? "icon.skill"+id : "icon.skill0"+id;
		sb.append("<a action=\"bypass -h Quest ShopBuffer addBuffToQueue_"+id+"\"><img src=\""+iconSkill+"\"> width=32 height=32></a>
	}

	sb.append("<br><br>");
	sb.append("Your selected buffs:<br>");

	List<L2Skill> playerBuffQueue = player.getBuffQueue(); 	// This should be created in pcisntance or another store class and will containt the
								// buffs that player has choosen, cleared once he has buff himself

	if(playerBuffQueue.size() > 0)
	{
		for(L2Skill sk : playerBuffQueue)	
		{
			final int id = sk.getId();
			String iconSkill = id > 1000? "icon.skill"+id : "icon.skill0"+id;
			sb.append("<img src=\""+iconSkill+"\" width=32 height=32>
		}
	}

	sb.append("</body></html>
	return sb.toString();
}

public double getConsumedMp(FastList<L2Skill> queue)
{
	double result = 0;
	for(L2Skill sk : queue)
	{
		result += sk.getMpConsume();
	}
	return result;

private void updateMPStatus(L2PcInstance player)
{
	double consume = getConsumeMp(player);
	ExDuelUpdateUserInfo eduui = new ExDuelUpdateUserInfo(player, consume);
	player.sendPacket(eduui); 
}

public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
	if(event.startsWith("addBuffToQueue"))
	{
		String[] split = event.split("_");
		if(split < 2)
			return null;

		int skillId = 0;
		try { skillId = Integer.parseInt(split[1]); } catch(Exception e) { e.printStackTrace(); }
		if(skillId > 0)
		{
			L2Skill choosen = null;
			for(L2Skill sk : _npcBuffs)
				if(sk.getId() == skillId)
				{
					choosen = sk;
					break;
				}
			if(choosen != null)
			{
				if(getConsumeMp(player.getBuffQueue) + choosen.getConsumeMp() > player.getMp())
					player.sendMessage("You dont have enough mana to use this skills!");
				else
				{
					player.addSkillToQueue(choosen);
					updateMpStatus(player);
				}
			}
	}
	else if(event.equals("buffMe"))
	{
		if(player.getBuffQueue().size() > 0)
		{
			if(getConsumeMp(player.getBuffQueue) > player.getMp())
				player.sendMessage("You dont have enough mana to buff yourself!");
			else if(player.destroyItem("Shop Buffer", COST_ID, COST_AMOUNT, npc, true))
			{
				for(L2Skil sk : player.getBuffQueue())
					sk.getEffects(player, player);
				player.clearBuffQueue();
				updateMPStatus(player);
			}
		}
	}
}
}

 

You will need to modify a little ExDuelUpdateUserInfo to build a constructor to pass a custom mp var.

Also, the script it self wont be working, is written using notepad, so it miss imports and im prolly will have any syntax error

Link to comment
Share on other sites

  • 0

I don't know if I or BigBoss misunderstood your first 1, but what is the goal ?

 

You want player sell their buffs as if they were on private shop ? So others players can buy from them ? Like a dwarven manufacture, where you see recipes and can craft from AFK guys ?

Link to comment
Share on other sites

  • 0
I don't know if I or BigBoss misunderstood your first 1, but what is the goal ?

 

You want player sell their buffs as if they were on private shop ? So others players can buy from them ? Like a dwarven manufacture, where you see recipes and can craft from AFK guys ?

 

Excactly, example below:

292uskn.jpg

Link to comment
Share on other sites

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

    • Hello everyone, I am making this post to advertise the following server:   DISCORD COMMUNITY SERVER: https://discord.gg/YCprWrnW5C SERVERS WEBSITE: https://lineage2expose.com/   LINEAGE ][ EXPOSE eXpose 100x is an unique server which has been worked on since 2020. Our goal is to provide you with a stable, lag-less, enjoyable as well as close-to-retail yet spiced Lineage II experience. The list below includes some of the custom features and various information about eXpose: Quick Overview - 100x Server. - Highly secured server. - Stable. No lag. - Somik's Interface - Client : https://somikpatch.com/Interfaces/Interface/2 - Auto Farm System. - Certification - Durability More Info. - Dressme System More Info.   Character - EXP: x100 - SP: x100 - Sub Class Max Lv: 85 - Max Sub Class: 5 - Durability in Sub: Yes - Certification Skills in Sub: Yes - Hero Skills in Sub: Yes   Party EXP Increases -Player in a party receive double EXP Rate.   Party EXP Decreases - 0-40 Level, the lowest party member will gain 100% of the XP that others receive. - 41-75 Level, the lowest party member will gain 80% of the XP that others receive. - 76-85 Level, the lowest party member will gain 60% of the XP that others receive.   Custom Gameplay - Custom Economy. - Custom Farm zones. - Custom Events. - Custom Stores.   Vote Reward - Vote Bracelet (Increases PV Damage by 5%). - Rune of Experience (Increases EXP Gain by 30%). - Vote Box (Random Various Rewards). - x10 Vote Coins (Special Currency).   Custom Economy System Custom currencies are used on expose to purchase equipment and various items. Adena is a currency used to purchase various rare items. Ancient Adena is a currency obtained in all custom Farm Zones. Team Cups is an item used to upgrade your clan level and skills. Dressme Stars can be obtained by farming mini-raids and raids or in spesific monsters. Can be used to purchase various dresses through Dressme Store at Community Board. Event Medals can be obtained while playing events. Bring that currency to Lilian (Event Shop Npc) at Giran Town to exchange them for various rewards. Vote Coins as well as Vote bracelet can be obtained by voting for eXpose on site banners. Bring These coins to Vote Shop to exchange them for various rewards. Command to open Vote Shop: (.getreward) and more...!   Double Prize Farming System In our effort to create an activity that will help players to collect their items faster, we created a kind of event. During the day, a zone will be announced in which the monsters will give a double prize! In this case we use three different zones which will alternately have this privacy! Τhese zones are: Monastery of Silence, Primeval Island, Giant's Cave, Antharas Lair, Seed of annihilation. The hours that the event will operate are the following (GMT+2): - 13: 30-14: 30 - 19: 30-20: 30 - 01: 30-02: 30 - 07: 30-08: 30   Enchant Information eXpose has a dynamic enchante rates, with Blessed & Normal Scrolls: - Safe: +4, Max: +20. - Enchant: 4 -> 8 Chance: 65% - Enchant 8 -> 12 Chance: 60% - Enchant: 12 -> 17 Chance: 55% - Enchant 17 -> 20 Chance: 45% - Blessed Scrolls: Fail reset to 0. - Normal Scrolls: Fail break the item.   Augmentation & Element Rates - Augments has been customized to work perfect. - Top Grade Life Stone 25%. - Medium Grade Life Stone 20%. - Low Grade Life Stone 15%. - Stones & Crystal 70%   Olympiad - Period: Weekly. - Heroes Date: Monday . - Games Required for Rank: 10. - Max Gear A-Grade. - Max Enchant Limit +20.   eXpose has implemented a daily system to serve every nationality regarding the opening hours of the Olympics. So, The opening hours of the Olympics are as follows (GMT+2): - 12:00-13:00 - 16:00-17:00 - 20:00-21:00 - 00:00-01:00 - 04:00-05:00 - 08:00-09:00 In advance, you can check Olympiad Manager (NPC) about start or end time of olympiad.   Sieges & Territory Wars As you know, the process of shingles and territories is a lot of fun since there are constant battles for the claim and preservation of your flag! for this reason we decided to make this process more intensive. on our server will be done every week and more specifically (GMT+2): - Sieges Date: 20:00 (Giran, Oren, Aden, Innadril, Goddard, Rune) - Sieges Date: 04:00 (Dion, Shuttgard, Gludion) - Territory Wars Date: Sunday 20:00 - Max Wards Per-Castle: 3   Raid Bosses Drops - Raid Heart: 1 - Adena: 200kk-400kk - Teamwork Cup: 75-150 - Dressme Star: 15-30 - Ancient Adena: 10k-40k - Giant's Codex: 20-40 - Giant's Codex Mastery: 5-10 - High Life Stone: 5-10 - Top Life Stone: 3-6 - BEA (S Grade): 10-20 - BEW (S Grade): 5-10   Grand Bosses Drops - Epic Jewel: Raid's Jewel - Raid Heart: 1 - Gold Bar: 1 - Adena: 300kk-500kk - Teamwork Cup: 150-300 - Dressme Star: 25-60 - Ancient Adena: 25k-60k - Giant's Codex: 25-60 - Giant's Codex Mastery: 10-15 - High Life Stone: 8-16 - Top Life Stone: 6-12 - BEA (S Grade): 15-40 - BEW (S Grade): 10-20   Respawn Time - Zaken: Instance (5 Members Minimum in party) - Freya: (5 Members Minimum in Party) - Beleth: 3 Days (5 Members Minimum in Party) - Frintezza: Instance (5 Members Minimum in Party) - Antharas: 5 Days (10 Minutes to spawn after 1st player enter) - Valakas: 5 Days (10 Minutes to spawn after 1st player enter) - Core: 1 Day - Queen Ant: 1 Day - Baium: 3 Days - Normal Raids: 6 Hours - Flame of Splendor Barakiel: 1 Hour [Become noblesse on kill]   Epic Jewelry Drop Chance: - Zaken: 100% Drop Chance Earring of Zaken / 10% Drop Chance Blessed Earring of Zaken - Freya: 100% Drop Chance Necklace of Freya / 10% Drop Chance Blessed Necklace of Freya - Beleth: 100% Chance (Talk to npc: Stone Coffin to receive the ring [retail]) - Frintezza: 100% Drop Chance Necklace of Frintezza - Antharas: 100% Drop Chance Earring of Antharas - Valakas: 100% Drop Chance Necklace of Valakas - Core: 100% Drop Chance Ring of Core - Queen Ant: 100% Drop Chance Ring of Queen Ant - Baium: 100% Drop Chance Ring of Baium   Unique Event System At Battles,Deathmatch and Survival Players who manage to kill 10,15,20 enemies in a row will receive a double or triple prize for each kill (x2 if you have 10 kills in a row and x3 if you have 15 kills in a row.). In addition to 10 kills you will get the buff Insane Spree where it will give them some extra strength. Players will know that you are in killing spree since you'll have a special blue aura with black animation arround you.At 15 kills this buff will become level 2 and at 20 kills level 3. As the level becomes higher level you become stronger! Finally, every time you reach 10,15,20 kills in a row, your HP,Mp and CP will be automatically at maximum and you will acquire the aura of heroes! If you die you lose all the boost! Μedals can be redeemed for unique things in lilian (Event Npc Shop) located at all Towns.   Deathmatch Ιn this event you compete alone against everyone else! The fight lasts 12 minutes and the player with the most kills wins a unique prize! But also during the battle every enemy you kill will offer you some coins! Prepare your gears, the fight is big and hard!   Battles Ιn this event you will have allies! the teams are divided equally and the battle begins! Τhe duration of the event is 12 minutes! Only the winning team wins a prize! But for every enemy you kill you earn Event Medals!   Survival The survivor! one of the most fun events! as long as you are strong enough to reach the end! fight with your strength to survive by killing everyone else! For each death you will win some unique coins! If you manage to reach the end you will get the big prize!   Clan Survival Ιn this event all the participants from each clan gather in different groups of the same zone! the players duel until the end! Whoever dies is excluded from the event! The last surviving clan wins the prize which is the Teamork Cup! Of course at the end of the competition the list of the best teams is announced according to how many times each clan has survived.   Hellbound Map [Party Zone] This event lasts 30 minutes and works every 4 hours! players have the opportunity to collect as many coins as possible! As in this zone the drops are more! of course you will need team spirit! The hours that the event will operate are the following (GMT+2): 14: 00-14: 30 18: 00-18: 30 22: 00-22: 30 02: 00-02: 30 06: 00-06: 30 10: 00-10: 30   Arena In this event everyone can declare to duel with the other participants and claim the first three places based on their score to win the Arena Box! Arena map last 15 minutes and it has 3 different types: Solo (unknown), Team vs Team, 4 Teams. The first Winener receives 3 Arena Box, the second 2 Arena Box and the third 1 Arena Box! The boxes contain various items such as: Elemental Stones, Elemental Crystals, Life Stones, Giant's Codex, Giant's Codex Masteries. In adition you receive x10 Fame, and 100.000 Adena for each kill.   Cancel and Steal Skills To ensure you do not run back to town once every few minutes to get back some buffs that were canceled and/or stolen during PvP, the steal and cancel effects were customized so that they only temporarily cancel/steal a target's effects instead of permanently.
    • Trusted and insanely talented Lineage 2 Uploader maker. Does the job wonderfully very fast. Quality oriented, helps if needed:) Totally recommend. 
  • Topics

×
×
  • Create New...