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

Excactly, example below:

292uskn.jpg

 

This script used 2 voice commands:

.buffshop - players choosing which buffs they want to sell

.buffprice - players submit the price they want for every buff - for example : if they enter 1000 so every buff will cost 1000 adena.

Link to comment
Share on other sites

  • 0

to get such shops all you need to do is to mod the PrivateStoreListBuy and PrivateStoreListSell, by diferencing when player is in normal mode or selling buffs (like player.isSellingBuffs()) and sending then the regular answer or your custom answer, in this case, a html

 

PD: The 3009 / 3009 Mp way to show the cur mp is very seedy

Link to comment
Share on other sites

  • 0

Guys please look at the following code and tell me whats wrong with it

 

1) making Enchanting possible near a choosen NPC -  [glow=red,2,300]works[/glow]

2) making Enchanting near any other NPC not possible - [glow=red,2,300]works[/glow]

3) making enchanting in an empty area not possible - [glow=red,2,300]doesnt work![/glow]

 

code:

		Collection<L2Character> knownNPC = activeChar.getKnownList().getKnownCharactersInRadius(80);
	if(knownNPC == null)
	{
		activeChar.setActiveEnchantItem(null);
		activeChar.sendMessage("You can only enchant items near the Brazier of Luck!");
		return;
	}
	else
	{
		for(L2Character obj : knownNPC)
		{
			if(!(obj instanceof L2NpcInstance))
			{
				activeChar.setActiveEnchantItem(null);
				activeChar.sendMessage("You can only enchant items near the Brazier of Luck!");
				return;
			}
			else if(((L2NpcInstance) obj).getNpcId() != 32027)
			{
				activeChar.setActiveEnchantItem(null);
				activeChar.sendMessage("You can only enchant items near the Brazier of Luck!");
				return;
			}
		}
	}

Link to comment
Share on other sites

  • 0

boolean thereIsNpc = false;
...
for(L2Character obj : knownNPC){
			if((obj instanceof L2NpcInstance))
			             if ( ( (L2NpcInstance) obj).getNpcId() == 32027)
                                                         thereIsNpc = true;
}
if (!thereIsNpc)
activeChar.set...

smth like that

Link to comment
Share on other sites

  • 0

Nvm it worked with knownNPC.IsEmpty() check

 

I wanna do 1 more thing, I want to add all castle registrations NPCs in 1 town, the problem is that when i spawn for example Aden reg manager in giran, then it'll act like its giran castle reg NPC, how can i change that?

 

thanks for the help

Link to comment
Share on other sites

  • 0

im not sure that it will work

if im not wrong getKnownCharactersInRadius(80) will return all the characters, not only npc, so lets try this:

you have another player in the known list (its in radius) so

if(!(obj instanceof L2NpcInstance))

thats true and you cant enchant, if there is or there is not the npc_enchanter

Link to comment
Share on other sites

  • 0

ok i got that problem with enchant zone solved thanks for notifying :)

 

Can any1 help me with the problem above?

I wanna do 1 more thing, I want to add all castle registrations NPCs in 1 town, the problem is that when i spawn for example Aden reg manager in giran, then it'll act like its giran castle reg NPC, how can i change that?
Link to comment
Share on other sites

  • 0

if you try to do

(L2NpcInstance) obj).getNpcId() == 32027

and obj is not L2NpcInstance (is L2PcInstance for example) you will have problems so you need to check if its instanceof

 

about the siege npc

java/com/l2jserver/gameserver/model/actor/instance/L2SiegeNpcInstance.java

 

/**
 * If siege is in progress shows the Busy HTML<BR>
 * else Shows the SiegeInfo window
 * @param player
 */
public void showSiegeInfoWindow(L2PcInstance player)
{
	if (validateCondition(player))
		[color=red]getCastle().getSiege().listRegisterClan(player);[/color]
	else
	{
		NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
		html.setFile(player.getHtmlPrefix(), "data/html/siege/" + getNpcId() + "-busy.htm");
		html.replace("%castlename%",getCastle().getName());
		html.replace("%objectId%",String.valueOf(getObjectId()));
		player.sendPacket(html);
		player.sendPacket(ActionFailed.STATIC_PACKET);
	}
}

there are 1 npc for each castle?

if yes, then make a switch of getNpcId() and go to each Castle().getSiege()...

edit: cant color inside the code, but you will need to change this line:

getCastle().getSiege().listRegisterClan(player);

Link to comment
Share on other sites

  • 0

Thanks for the reply,

I came up with something like this, but still i dont understand how to make it so they'll see the castle by NPCs and not by region?

 

		if(validateCondition(player))
	{
		switch(getTemplate().npcId)
		{
			case 35278: 
				getCastle().getSiege().listRegisterClan(player); // aden
			case 35367:
				getCastle().getSiege().listRegisterClan(player); // goddard
			case 35188:
				getCastle().getSiege().listRegisterClan(player); // giran
			default:
				getCastle().getSiege().listRegisterClan(player);
		}
	}

Link to comment
Share on other sites

  • 0

			case 35278: 
				CastleManager.getInstance().getCastle("aden").getSiege().listRegisterClan(player); // aden
                                           break;
			case 35367:
				...

try with this

Link to comment
Share on other sites

  • 0

nvm, it works now :) i think i forgot to add Break in the previous time thats what caused the problem, thanks for your help :)

 

I want to do another thing now :P i want to make a fortrees event, basically fortreeses are already working (im using IL pack) but my question is how to add for example a reward, that will be added every xx hours to the owning clan CWH?

 

thanks again for the help

 

 

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

    • Yes, it is, it's not hard to do (if you know what you're doing); just time consuming.   To make some things clear: 1. You can not create .ukx files with animated skeletalmeshes inside, by using any of the freeshared L2Editors (basically, no support for .psa files) 2. You need a patched UT2003/UT2004. You can either get your own ut2004 and download Gildor's patch from his web, or use any of these: When you use these, you should be able to import both .psk and .psa animations > link the skeletalmesh to the psa > save as .ukx > use ut2down to convert the file to l2 format > encrypt the .ukx with standard l2 encryption (you can use mxc encdec, you can find it in the folder of the l2editor i shared). Your best bet is to use pawnviewer (aka dev mode) to test that. If you have troubles with that process then leave a reply here, otherwise, if it works correctly, you can move on to adding missing animnotify classes to you unrealed, then proper animnotifies, sounds, effects or w/e is missing from your .ukx files. Keep in mind that this is overall not difficult but a huge amount of work (unless you're good at scripting/macros) since you'd need to manually re-create every single animnotify, by hand. If you have doubts or i wasn't clear enough let me know here. (in case you don't know what an animnotify is: UDN - Two - AnimNotifies (unrealengine.com) )  
    • Welcome to JewStor Service!!!   ❖Ready-made verified wallets, exchanges, business banks and to order accounts. ❖EU/UK/US/DE Stuff: 100% Verified! Reliable financial tools for your business. ❖Popular items available include: Stripe business + Payoneer, Deutshce Bank, BBVA ES, Xapo Bank, Revolut business / personal, Santander Bank, Wallester business, Bitsa EU, Binance EU, Qonto Business, Blackcatcard EU, Shopify Payments, ICard EU, N26 EU, Naga Pay EU, Paysera EU, Mistertango Business and many others.
    • Custom = everything that is not part of my H5 client, such as Aegis skin, Death Knight skin, Constructor skin, Golden Valakas skin, an example is the pack containing 3 Golden Valakas skins+cloaks, to give you an idea, this pack consumes almost 200MB within the system, another example of custom is the Hunter Head set made by Asuki, almost 100MB within the system, every custom item added to the client, specifically within the system folder will increase the consumption of your client's virtual ram memory, the more custom added there, the faster your client will close due to critical. Around 4 to 5 custom packs that I removed from the system and made my client reach the ram virtual limit only after more than 40 hours online, in other words; It is only worth adding custom items to the system folder if it is very well compressed, maximum up to 10MB per custom pack (This pack below in the photo, only it inside your client - system consumes almost 200MB, when I removed this pack inside the system it increased the game's lifespan by almost 4h during my tests)
    • ready pack for sale with lucera files made from scratch price is 350 euros without the license the server is x30 rate the server is there to see everything test ie.. there have been several changes everything works there will be support for everything for as long as possible please, can you send me a message here, there is complete transparency in everything
    • The author has been using an alternate account under the name @project166 to promote their services, which violates our RULES. Additionally, the author does not adhere to our guidelines regarding the inclusion of pricing information.     Topic Locked.
  • Topics

×
×
  • Create New...