Jump to content
  • 0

Lvl5 Augment Skill Npc


Question

Posted (edited)

Hi , i am trying to make an npc which gives Lvl 5 Augment skills. I have some restrictions thought. I need help cause i am new to coding.

I have an error in L2NpcInstance, cannot resolve skill. {public void onBypassFeedback(final L2PcInstance player, final String command)}

if i add L2skill skill as a final into public void i ll get an error. As another fix i tried to add [L2Skill skill = null;] before command. but i have an error in Gameserver - BAD requestbypass. Any advice?? ^_^

		if(command.equalsIgnoreCase("MightAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3132, 5));
			player.sendMessage("Nice! You got Might Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
		else if(command.equalsIgnoreCase("EmpowerAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3133, 5));
			player.sendMessage("Nice! You got Empower Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
		else if(command.equalsIgnoreCase("DuelMightAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3134, 5));
			player.sendMessage("Nice! You got Duel Might Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
		else if(command.equalsIgnoreCase("ShieldAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3135, 5));
			player.sendMessage("Nice! You got Shield Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
		else if(command.equalsIgnoreCase("MagicBarrierAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3136, 5));
			player.sendMessage("Nice! You got Magic Barrier Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
		else if(command.equalsIgnoreCase("FocusAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3141, 5));
			player.sendMessage("Nice! You got Focus Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
		else if(command.equalsIgnoreCase("WildMagicAct"))
		{
		//add lvl 5 augm skill:
		if((skill.getId() != 3132) && (skill.getId() != 3133) && (skill.getId() != 3134) && (skill.getId() != 3135) && (skill.getId() != 3136) && (skill.getId() != 3141) && (skill.getId() != 3142))
		{			
			super.addSkill(SkillTable.getInstance().getInfo(3142, 5));
			player.sendMessage("Nice! You got Wild Magic Active Lv5. Check your Skills.");
		}
		else
		{
			player.sendMessage("You already have one of my Augment skills.");
			return;
		}
		}
Edited by tonac

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

Such a ugly code, lol.

super.addSkill(

What? It's player, not super.. You have to initialize it, if you want to use it like that. You can simply use player.getSkill(x). Also, why you mess npc instance with this code. Creater new instance.

Edited by SweeTs
  • 0
Posted

Such a ugly code, lol.

super.addSkill(

What? It's player, not super.. You have to initialize it, if you want to use it like that. You can simply use player.getSkill(x). Also, why you mess npc instance with this code. Creater new instance.

Thank you very much , I followed your advice and I managed to make that Npc. In another Instance of course :)

Guest
This topic is now closed to further replies.


  • Posts

    • why ban him, his name almost ressurected the forum   haiku: Kara walks in light, whispers drift like soft spring rain, time bows at his steps.   Arrays.stream(DeveloperBrain.getInstance().getThoughts()) .filter(Kara.class::isInstance) .map(Kara.class::cast) .filter(k -> Objects.nonNull(k.getCoffeeLevel())) .flatMap(k -> k.getExcuses().stream().map(e -> Map.entry(k, e))) .filter(e -> Optional.ofNullable(StackOverflow.getAnswerById( DeveloperBrain.getVariables().getInt("kara_ban_counter", 0))) .map(a -> a.isActuallyHelpful() == false) .orElse(true)) .findFirst() .filter(r -> Optional.ofNullable(Admin.getPatience()) .filter(p -> Admin.destroyPatience("KaraBanProcess", 1, true)) .isPresent()) .ifPresentOrElse(e -> { Admin.sendPacket(SystemMessage.sendString("Kara has been banned again.")); Admin.sendPacket(Sound.ITEMSOUND_ENCHANT_FAILURE.getPacket()); Admin.sendPacket(new MagicSkillUse(Admin, Kara.class, CommonSkill.BANHAMMER.getId(), 999, 1, 0)); }, () -> Admin.sendPacket(SystemMessage.sendString("Miracle! Kara survived without a ban... this time.")));
    • decrypt and encrypt is works...          
    • well,thx for your reply...i had solved my problem.its source data errors...the old Armorgrp.dat and Armorgrp-classic.dat exist errors...rly swired. about skillgrp-classic.dat,i decrypt and encrypt it,it works...but in Grand Crusade i didnot know if it exist Auto-cast.   BTW,i rly dont know why the Original .dat files exist lots errors.but my Client works good...rly sweird.   anyway,i didnot like Mobius L2ClientDat tool...but we need use it...coz there is no other tools to work with new l2 client. 客户端工具很难用,解密后加密不回去的,哪怕你不做任何修改都加密不回去。你可以试试台版客户端就知道了。
    • sell adena l2rebon signature x1 - 1kk = 1 dollars l2reborn x10 - 500kk = 4 dollars E-Global x Lu4 - 1kk = 2 dollars BOHPTS - x20-x500 TOP PRICE LINEAGE2DEX - TOP PRICE !!!!! DISCORD - GODDARDSHOP TELEGRAM - MMOPROMO Also on sale are Epic jewelry, Clothes at a very good price
    • I will search for.
  • 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