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

    • Hello Friends . I would like to introduce that i have found a method to avoid league hwid ban ( van 152 ) you will get perma ban when detected only at the account you are using like before vanguard release with the method you can script or use the tools you want at many accs as you wish unstoppable without caring about headache or wasting time and energy of flashing bios reset your pc installing fresh windows and using spoofer to change your hardware infos to unlock the hwid ban i have tested it on 5 accs i got them perma banned for using third party tools but not a hwid ban at all hint : ppl regulary get hwid ban in 2nd ban after got banned once before as vanguard working like that only 1 chance free then hwid ban. its so easy to achieve if you are interested dm for details
    • Trustworthy person; hope you find what you're looking for!
    • Customs being added to systextures/animation/texture influences the increase in virtual ram by a very small amount, which means you won't have a headache in the future with critical error issues, unless it's a dubious custom, there are 2 custom weapon packs available for H5 that are "compromised", they didn't make a very good adaptation, one of the packages is the weapons from the goddess of destruction for H5, another is the hero weapons from the goddess of destruction for H5, avoid these customs for your H5 server if you see it on any forum.   Now coming back to your question; one thing that the NCSoft developers never did was add files to their system, probably because they were aware of what could happen when doing that, now think about one thing: the game's system retail itself is no more than 70MB, every time there was an update made by NCSoft they always added the equipment/items/cloaks etc. in their folders intended for that, so why do we do this? I still have my client containing a system with almost 1GB, 1-2h online is the time I can stay online before the ram memory limit, but I have already redone my entire client with customs being destined for textures/systexture/animations, almost all the customs that I had on that client containing a 1GB system I have on my current server, with the difference that I removed everything from the system and critical error is now nothing more than legends, my current server has a total of 220MB in the system folder And theoretically speaking, based on what I've seen, especially on many forums, I believe that the heavier the system folder is, the faster we accelerate the consumption of the client's virtual ram memory, causing countless different types of critical error in one short period of time, in many forums that I've seen on topics involving critical, the solution that stands out the most is about downloading a new clean "system"
    • Do you think that everything on the system is loaded regardless if you use it or not ? or even worst, are they loaded even if they exist as textures/meshes but not defined on the DAT files ?
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...