Jump to content

[Share]Requested Augment Seller


Recommended Posts

Ζητήθηκε απο τον LegendaryBeast στο τόπικ

http://maxcheaters.com/forum/index.php?topic=238011.0

 

Tested

 

Περιγραφή

Hello MxC k pali..

I8ela na rotiso an kapoios edo sto forum mporei na m di3ei ena guide-share gia to pos mporo na kano ena npc pou na "poulaei" skills.

enow dld na perneis ena skill (p.x me Gold Bar) na mpenei sta skills s na to kaneis (an einai active) an einai passive na kolaei(sta skills) kai meta to rr na feugei to skill

 

Για περισσοτερα augment skills δε χρειάζεται τίποτα html, βάλτε το Id του skill εδώ απλά:

private final int[] SKILL_IDS =
{3134,3132,3124,3125,3133,3135,3136,3137,3138,3139,
	3140,3141,3134
};

 


### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2NpcInstance.java	(working copy)
@@ -589,6 +589,16 @@
     @Override
     public void onAction(L2PcInstance player)
     {
+    	if(getNpcId() == L2SkillSellerInstance.NPC_ID){
+    		L2ItemInstance i = player.getInventory().getItemByItemId(L2SkillSellerInstance.ITEM_ID);
+    		
+    		if(i == null || i.getCount() < L2SkillSellerInstance.ITEM_COUNT){
+    			player.sendMessage("You need "+L2SkillSellerInstance.ITEM_COUNT+" Gold Bars to use this Npc.");
+    			player.sendPacket(new ActionFailed());
+    			return;
+    		}
+    	}
+    	
         if (!canTarget(player)) return;

         // Check if the L2PcInstance already target the L2NpcInstance
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2SkillSellerInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2SkillSellerInstance.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2SkillSellerInstance.java	(revision 0)
@@ -0,0 +1,56 @@
+package net.sf.l2j.gameserver.model.actor.instance;
+
+import javolution.text.TextBuilder;
+import net.sf.l2j.gameserver.datatables.SkillTable;
+import net.sf.l2j.gameserver.model.L2ItemInstance;
+import net.sf.l2j.gameserver.model.L2Skill;
+import net.sf.l2j.gameserver.serverpackets.ActionFailed;
+import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
+import net.sf.l2j.gameserver.templates.L2NpcTemplate;
+
+public class L2SkillSellerInstance extends L2NpcInstance{
+
+	public final static int NPC_ID = 24246;
+	public final static int ITEM_ID = 2807;
+	public final static int ITEM_COUNT = 5;
+	private final int[] SKILL_IDS =
+	{3134,3132,3124,3125,3133,3135,3136,3137,3138,3139,
+		3140,3141,3134
+	};
+	
+	public L2SkillSellerInstance(int objectId, L2NpcTemplate template){
+		super(objectId, template);
+	}
+	
+	@Override
+	public void showChatWindow(L2PcInstance j, int val){
+		if(j == null)
+			return;
+		
+		TextBuilder t = new TextBuilder();
+		NpcHtmlMessage n = new NpcHtmlMessage(getObjectId());
+		sendHtml(t,n,j);
+	}
+	
+	private void sendHtml(TextBuilder t , NpcHtmlMessage n , L2PcInstance j){
+		t.append("<html><head><title>");
+		t.append("L2Skill Seller : Iracundus");
+		t.append("</title</head>");
+		t.append("<body><center>");
+		t.append("<br>Hello , do you want some special skills?");
+		t.append("<br>Choose whatever you want but don't forget");
+		t.append("<br>you need 5 Gold Bars for each one");
+		for(int i : SKILL_IDS){
+			L2Skill s = SkillTable.getInstance().getInfo(i, 10);
+			String name = "";
+			if(s != null)
+			 name = s.getName();
+			if(name != "")
+			t.append("<center><button value=\""+name+" LvL:10\" action=\"bypass -h skill"+i+"\" width=204 height=20 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"><br>");
+		}
+		t.append("</center></body></html>");
+		n.setHtml(t.toString());
+		j.sendPacket(n);
+	}
+	
+}
Index: java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/clientpackets/RequestBypassToServer.java	(working copy)
@@ -24,13 +24,17 @@
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.communitybbs.CommunityBoard;
+import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.handler.AdminCommandHandler;
import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
import net.sf.l2j.gameserver.model.L2CharPosition;
+import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2Object;
+import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2NpcInstance;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.actor.instance.L2SkillSellerInstance;
import net.sf.l2j.gameserver.model.entity.L2Event;
import net.sf.l2j.gameserver.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
@@ -89,6 +93,31 @@
			{
				playerHelp(activeChar, _command.substring(12));
			}
+			else if(_command.startsWith("skill")){
+				String b = _command.substring(5);
+				int id = 0;
+				try{
+				 id = Integer.parseInt(b);
+				}
+				catch(Exception e){
+					e.printStackTrace();
+				}
+				
+				if(id == 0)
+					return;
+				
+				L2Skill s = SkillTable.getInstance().getInfo(id, 10);
+				L2ItemInstance i = activeChar.getInventory().getItemByItemId(L2SkillSellerInstance.ITEM_ID);
+				
+				if(i == null || i.getCount() < L2SkillSellerInstance.ITEM_COUNT){
+					activeChar.sendMessage("You don't have enought gold bars");
+					return;
+				}
+				
+				activeChar.getInventory().destroyItemByItemId("",  L2SkillSellerInstance.ITEM_ID, L2SkillSellerInstance.ITEM_COUNT , activeChar, null);
+				activeChar.sendMessage("You rewarded successfully with "+s.getName()+" Lvl:10, 5 Gold Bar dissapeared");
+				activeChar.addSkill(s, false);
+			}
			else if (_command.startsWith("npc_"))
			{
				if(!activeChar.validateBypass(_command))

 

2vmfyti.jpg

width=1024 height=578http://i45.tinypic.com/2cdzfqq.jpg[/img]

width=1024 height=578http://i47.tinypic.com/55m5v5.jpg[/img]

Link to comment
Share on other sites

File Mou Den Exw Logia!!!!Einai Apla Yperoxo An Mporousa 8a Edina +1 karma alla den mporo...

Mono Pes mou giati pack einai.kai an mporeis na to kaneis addapt 

για IL είναι..τώρα τι εννοείς για τι pack;

δεν έχει σημασία,μόνο τα imports θα αλλάξεις και θα είσαι κομπλέ.

Link to comment
Share on other sites

  • 2 weeks later...

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
Reply to this topic...

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