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.




  • Posts

    • My official facebook profile!: https://www.facebook.com/spectrumL2 Specifications: Revamped L2JACIS revision FROM the core Private project!!! Revision that has been receiving corrections for over 3 years!!! Events already installed in the revision: TVT CTF KTB PARTY FARM SPOIL EVENT CRAZY RATES TOURNAMENT TIME ZONE (INSTANCE) All working correctly!!! SIEGE ESSENTIAL FEATURES: Walls fix Gates fix Flags fix 100% functional: OLYMPIADS: Implemented settings Hero receives enchanted Weapons with equal status PvP Weapons Optional /true/false Hero can acquire all Hero Weapons Optional true/false OTHER IMPLEMENTATIONS: Teleport fixed (directly to Giran) Teleport effect classic Vip skins vip collor name Pack NPCs with effect already configured BOSES already configured Mobs already configured CLASS BALANCE SPECIAL SYSTEM We have a SPECIAL system developed for Class Balance with only 1 digit in XML %tage of configurable debuffs Player limitation system in BOSES or PvP zones BS blocking system in FLEG zones or events Among others dozens of improvements made in the review... price: 390 USD !  OBS: WE CAN CHANGE THE BANNER AND NAME OF THE SERVICE TO THE ONE OF YOUR PREFERENCE BUT THE SETTINGS MUST BE KEPT ANY CHANGES REQUIRE ADDITION        
    • Server is Online – 1,000+ Active Players! We’re excited to announce the addition of a Europe Proxy to improve connectivity for our EU players! Clans can now benefit from VIP Access to help you catch up faster. 🎯 If you're a clan leader with at least 9 active members, join our Discord and open a ticket to claim your VIP rewards!  
    • The Telegram team is rolling out a new batch of Stars-only gifts you’ll be able to mint as NFTs. Don’t miss your chance to join the next Telegram trend and earn from it! Buy Telegram Stars cheap and KYC-free 1 Star from $0.0149 (min. 50 Stars, bulk discounts available) Promo code STARS5 — 5 % off Pay any way you like: bank cards · crypto · other popular methods How to purchase: ➡Online Store — Click ➡ Telegram bot — Click Other services: ➡ SMM panel — Click Regular buyers get extra discounts and promo codes. Support: ➡ Telegram: https://t.me/solomon_bog ➡ Telegram channel: https://t.me/accsforyou_shop ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store Use these contacts to discuss wholesale orders, partnerships (current list: https://socnet.bgng.io/partners) or to become a supplier. SocNet — your shop for digital goods and premium subscriptions
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock