Jump to content
  • 0

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


Question

Posted

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

Recommended Posts

  • 0
Posted

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.

  • 0
Posted

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

  • 0
Posted

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;
			}
		}
	}

  • 0
Posted

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

  • 0
Posted

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

  • 0
Posted

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

  • 0
Posted

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?
  • 0
Posted

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);

  • 0
Posted

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

  • 0
Posted

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

try with this

  • 0
Posted

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

 

 

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.


×
×
  • Create New...