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

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

  • 0
Posted

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

  • 0
Posted

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

  • 0
Posted

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.

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

 

 

  • 0
Posted

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

  • 0
Posted

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".

  • 0
Posted

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

  • 0
Posted

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

  • 0
Posted

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 ?

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

  • 0
Posted

Well it can wait, i want to finish thing by thing first

 

I've still didnt find any solution to the enchant zone problem, any1 got any idea about it?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • General Trackers :   IPTorrents invite IPTorrents account 1 tb TorrentLeech invite Torrentleech account 1 tb buffer  InTheShaDow ( ITS ) account Torrentday invite Crnaberza account Abn.Lol account Limit-of-eden account Norbits account Xspeeds account Xspeeds invite Bemaniso invite Wigornot account Turkseed.com account Bithumen invite Filelist account Funfile invite AvistaZ invite Greek-Team invite LinkoManija invite Fano.in account tracker.czech-server.com Speed.cd invite Arab-torrents.net account Arabscene.me account Scenetime account 4thd.xyz invite Btarg.com.ar account Dedbit invite Estone.cc account Speedapp invite Fluxzone account GigaTorrents account Gimmepeers account Haidan.video invite Mojblink account Mycarpathians invite Newinsane.info account Oscarworld.xyz account Peers.FM invite Pt.msg.vg account Ransackedcrew account Redemption invite Scene-rush account Seedfile.io invite Torrent.ai account Torrentmasters invite Ttsweb invite X-files invite X-ite invite Ncore account TorrentHR account Rptorrents account BwTorrents account Superbits invite Krazyzone account Immortalseed account Tntracker invite Pt.eastgame.org account Bitturk account Rstorrent account Tracker.btnext invite Torrent-turk.de account BeiTai.PT account Pt.keepfrds account 52pt.site account Pthome account Aystorrent account Blues-brothers.biz invite Divteam account Thesceneplace invite CinemaMovies.pl account Brasiltracker account Patiodebutacas account Newheaven.nl account  Swarmazon.club invite Bc-reloaded account Crazyspirits account Silentground invite Omg.wtftrackr invite Milkie.cc invite Breathetheword invite Madsrevolution account Chilebt account Yubraca account Uniongang.tv account Frboard account Exvagos account Diablotorrent account Microbit account Carp-hunter.hu account Majomparade.eu account Theshinning.me account Youiv.info account Dragonworld-reloaded account Sharewood.tv account Partis.si account Digitalcore.club invite Fuzer.me account R3vuk.wtf invite Ztracker account 1 tb buffer 3changtrai account Best-core.info account Bitsite.us account Eliteunitedcrew invite Exitorrent.org account Tophos invite Torrent.lt account Sktorrent.eu account Oshen account Pirata.digital account Esharenet account Ohmenarikgi.la Pirate-share account Immortuos account Kiesbits account Cliente.amigos-share.club account Broadcity invite Ilovetorzz account Torrentbytes account Polishsource account Portugas account Shareisland account ArabaFenice account Hudbt.hust.edu.cn account Audiences account Nanyangpt account Pt.sjtu.edu.cn account Pt.zhixing.bjtu.edu.cn account Byr.pt invite Ptfiles invite Red-bits account Pt.hdpost.top account Irrenhaus.dyndns.dk (NewPropaganda) account Mnvv2.info (MaxNewVision V2) account 1ptba.com account Spidertk.top account Film-paleis account Generation-free account Aftershock-tracker account Twilightsdreams account Back-ups.me invite Sor-next.tk ( Spirit Of Revolution ) account Tfa.tf ( The Falling Angels ) account Hdmayi account S-f-p.dyndns.dk ( Share Friends Projekt ) account Unlimitz.biz account Pttime account St-tracker.eu account New-retro.eu account Zbbit account Tigers-dl.net account Jptvts.us account Lat-team account Club.hares.top account Falkonvision-team account Concen account Drugari account T.ceskeforum account Peeratiko.org account Zamunda.se account Central-torrent.eu account h-o-d.org account Torrentleech.pl account Demonoid invite Lst.gg account Fakedoor.store account LaidBackManor account Vrbsharezone.co.uk invite Torrenteros account Arenaelite account Datascene account Tracker.0day.community Tapochek.net invite Ptchina invite Lesaloon account Exyusubs account Therebels.tv account Ubits.club invite Zmpt.cc account Turktorrent.us account Dasunerwarte account Hawke.uno account Monikadesign account Fearnopeer account Alpharatio account Wukongwendao.top account Chinapyg account Azusa.wiki account Yggtorrent.top account Torrentdd account Cyanbug.net invite Hhanclub.top account Wintersakura.net account Tctg.pm account Finelite invite Agsvpt.com account Pt.0ff.cc invite Qingwapt.com account Xingtan.one account Ptcafe.club invite W-o-t.pro account Coastal-crew.bounceme.net account Darkpeers.org account Pianyuan.org account Seedpool.org  account Tempelbox account Pt.itzmx.com account Itatorrents.xyz  account Letseed.org account The-new-fun.com  account Malayabits.cc account Trellas.me account Yu-scene.net account Futuretorrent.org account Bitpt.cn account Tocashare.biz  account Videoteka.org  account White-angel.hu account Xbytesv2.li account Torr9  account Desitorrents account Okpt.net account Samaritano.cc account Polishtorrent.top  account C411.org account Bigcore.eu account Infinitylibrary.net account Beload.org account Emuwarez.com account Yhpp.cc account Rastastugan account Tlzdigital account account Upscalevault account Bluraytracker.cz account Torrenting.com account Infire.si account Dasunerwartete.biz invite The-torrent-trader account New-asgard.xyz account Pandapt account Deildu account Tmpt.top invite Pt.gtk.pw account Media.slo-bitcloud.eu account P.t-baozi.cc account 13city.org account Cangbao.ge account Cc.mypt.cc invite Dubhe.site invite Hdbao.cc account Kufei.org invite Mooko.org account Pt.aling.de invite Pt.lajidui.top invite Longpt.org invite Pt.luckpt.de invite Ptlover.cc invite Raingfh.top account Sewerpt.com account Huntorrent.org account Xtremebytes.net account Bitbazis.net account Mundo-pirata.org account Homiehelpdesk.net account Torrentheaven.org account Rotorrent.info account Sunnypt.top account 52movie.top account Bilibili.download invite Avetorrents.com account V6.nexushd.org account Myfunzone.org account Onfire.si account Revott.me account    Movies Trackers :   Secret-cinema account Anthelion account Pixelhd account Cinemageddon account Cinemaz account Retroflix account Punck-tracker.net account Tmghub account Cathode-ray.tube account Greatposterwall account Arabicsource.net account Upload.cx account Crabpt.vip invite Onlyencodes.cc account Exyusubs account Hellashut.net invite Nordichd.sytes.net invite Locadora.cc account Retro-movies.club account HD Trackers :   Blutopia buffered account Hd-olimpo buffered account Hdf.world account Torrentland.li account HdSky account Chdbits account Totheglory account Hdroute account Hdhome account TorrentCCF aka et8.org account 3DTorrents invite HD-Torrents account Bit-HDTV account Hdarea.co account Asiancinema.me account JoyHD invite HDSpace invite Bluebird-hd invite Htpt.cc account Hdtime invite Ourbits.club account Hd4fans account Siambit account Privatehd account Springsunday account Tjupt account Hdcity.leniter invite Ccfbits account Discfan account Pt.btschool.club account Ptsbao.club invite Hdzone.me invite Danishbytes account Zonaq.pw account Tracker.tekno3d account Arabp2p account Hd-united account Reelflix.xyz account Hdatmos.club account Tigris-t account Nethd.org account Hitpt.com account Hdmonkey account Dragonhd.xyz account Hdclub.eu account Forum.bluraycd.com account Carpt account Hdfun.me invite Pt.hdupt invite Puntotorrent account Ultrahd account Rousi.zip account Bearbit account Hdturk.club account Asiandvdclub account Star-space.net account Nordicq.org account Hdkyl.in account Utp.to account Hdzero account Novahd account Hdtorrents.eu account 4k3dyptt account Duckboobee.org invite Si-qi.xyz account Hdfans.org account Ptfans.cc invite   Music Trackers :   Orpheus.network account Dicmusic account Music-Vid account Open.cd account LzTr account ProAudioTorrents invite Jpopsuki invite TranceTraffic invite Audionews invite Kraytracker invite Libble.me invite Losslessclub invite Indietorrents.com invite Dimeadozen account Funkytorrents invite Karaokedl account zombtracker.the-zomb account Concertos account Sugoimusic account Satclubbing.club invite Metal.iplay invite Psyreactor invite Panda.cd account Adamsfile account Freehardmusic account Tracker.hqmusic.vn accouunt Twilightzoom account 3 tb buffer Hiresmusic account Metalguru account Musictorrents.org account Musebootlegs.com invite Zappateers.com account Jungleland.dnsalias.com account Naftamusic account Bemusic account Lp-bits.com account   E-Learning Trackers :   Theplace account Thevault account Myanonamouse account Libranet account 420Project account Learnflakes account Pt.soulvoice.club account P2pelite account Aaaaarg.fail invite Ebooks-shares.org account Abtorrents account Pt.tu88.men invite Docspedia.world invite   TV-Trackers :   Skipthecommercials.xyz account Cryptichaven account TV-Vault invite Shazbat.TV account Myspleen account Tasmanit.es invite Tvstore.me account Tvchaosuk account Jptv.club account   XXX - Porn Trackers :   Homeporntorrents.club account FemdomCult account Pussytorrents account Adult-cinema-network account Bootytape account 1 Tb buffer Exoticaz account Bitporn account Kufirc account Gaytorrent.ru invite Nicept account Gay-torrents.org invite Ourgtn account Pt.hdbd.us account BitSexy account Happyfappy.org account Kamept.com account Lesbians4u.org account Fappaizuri.me account Sextorrent.myds.me account Clearjav account   Gaming Trackers :   Pixelcove account Mteam.fr account BitGamer invite Retrowithin invite Gamegamept account   Cartoon/Anime/Comic Trackers :   Animez account Animeworld account Oldtoons.world account U2.dmhy account CartoonChaos invite Mononoke account Totallykids.tv account Bakabt.me invite Revanime account Ansktracker account Tracker.shakaw.com.br invite Bt.mdan.org account Skyey2.com account Animetracker.cc Adbt.it.cx invite Tracker.uniotaku.com account Mousebits.com account   Sports Trackers :   MMA-Tracker invite T3nnis.tv invite AcrossTheTasman account RacingForMe invite Sportscult invite Ultimatewrestlingtorrents account Worldboxingvideoarchive invite CyclingTorrents account Xtremewrestlingtorrents account Tc-boxing invite Mma-torrents account Aussierul invite Xwt-classics account Racing4everyone account Talk.tenyardtracker account Stalker.societyglitch invite Extremebits invite Rgfootball.net account F1carreras.xyz account Pwtorrents.net invite   Software/Apps Trackers :   Brokenstones account Appzuniverse invite Teamos.xyz account Macbb.org account Phoenixproject.app account Tormac.org account   Graphics Trackers:   Forum.Cgpersia account Cgfxw account   Others   Hduse.net account Fora.snahp.eu account Makingoff.org/forum account Xrel.to account Undergunz.su account Corebay account Endoftheinter.net ( EOTI ) account Thismight.be invite Skull.facefromouter.space account Avxhm.se (AvaxHome) account Ssdforum account Notfake.vip account Intotheinter.net account Tildes.net invite Thetoonz account Usinavirtual account Hdclasico invite HispaShare account Valentine.wtf account Adit-hd account Forum-andr.net account Warezforums account Justanothermusic.site account Forbiddenlibrary.moe account Senturion.to account Movieparadise account Dcdnet.ru account Sftdevils.net account Heavy-r.com account New-team.org account Ddl.tv account Filewarez.club account Hispamula.org account Hubwarez.tv account Ultim-zone.in account Leprosorium.ru account Planet-ultima.org account The-dark-warez.com account Koyi.pub account Tehparadox.net account Forumophilia account Torrentinvite.fr account Gmgard.com account Board4all.biz account Gentoo-zh.org account Releasyee.to account   NZB :   Ninjacentral account Tabula-rasa.pw account Drunkenslug account Drunkenslug invite Usenet-4all account Dognzb.cr invite Kleverig account Nzb.cat account Nzbplanet.net invite Ng4you.com account NZB.to account Samuraiplace account Abhdtv.net account Abook.link account Comix.pw account House-of-usenet Secretbinaries.net account Vnext.to account Stockboxx.top account Sky-of-use.net account Indexer.codeshy.com account Oldboys.pw account Uhd100.com account Wtfnzb.pw account   Prices start from 3 $ to 100 $   Payment methods: Crypto, Neteller, Revolut   If you want to buy something send me a pm or contact me on:   Email: morrison2102@gmail.com   Discord: LFC4LIFE#4173   Telegram: https://t.me/LFC4LIFE4173   Skype: morrison2102@hotmail.com
    • can code it free for u , add me banshee1019 
    • Don’t worry about me. am ok enough, even without taking drugs  
    • sorry, for my inexperienced response but here's how far i've got. in my source i found the following things: 1 > source code file location package: net.sf.l2j.gameserver.model.actor.instance; > Player.class, but honestly i have no idea how/what type of code should i put in the source in order to make it parse multiple classIDs in order to make it follow .xml file with the conditions necessary for not allowing X class to use X armor.
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..