Jump to content

Recommended Posts

Posted

ayto edw einai ena npc opoy kani ta PvP coins kai to antistrofo

 

shot00002aa.jpg

 

shot00004q.jpg

 

Download

 

create on  net.sf.l2j.gameserver.model.actor.instance       L2PVPManagerInstance.java
=====================================================================================

package net.sf.l2j.gameserver.model.actor.instance;

import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;

public class L2PVPManagerInstance extends L2NpcInstance
{
public L2PVPManagerInstance(int objectId, L2NpcTemplate template)
{
	super(objectId, template);
}

@Override
public void onBypassFeedback(L2PcInstance player, String command)
{
	int itemId = 25000; // item id 
	int itemA-beep-t = 100; // A-beep-t of items that will give or give
	int pvpA-beep-t = 100; // A-beep-t of pvps to take or give
	final String[] subCommand = command.split("_");

	if (player == null )  return;


	if (command.startsWith("pvpToCoin"))
	{
		if (player.getPvpKills() >= pvpA-beep-t)
		{
			player.setPvpKills(player.getPvpKills() - pvpA-beep-t);
			player.addItem("pvpToCoin", itemId, itemA-beep-t, player, true);
			player.broadcastUserInfo();
		}
		else
			player.sendMessage("Not enough PvPs.");
	}
	else if (command.startsWith("coinToPvp"))
	{
		if (player.getInventory().getItemByItemId(itemId).getCount() >= itemA-beep-t)
		{
			player.setPvpKills(player.getPvpKills() + pvpA-beep-t);
			player.destroyItemByItemId("coinToPvp", itemId, itemA-beep-t, player, true);
			player.broadcastUserInfo();
		}
		else
			player.sendMessage("Not enough coins.");
	}
	else if(command.startsWith("Chat"))
	{
		if(subCommand[1].isEmpty() || subCommand[1] == null) return;
		NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
		html.setFile("data/html/default/"+subCommand[1]);
		html.replace("%objectId%", String.valueOf(getObjectId()));
		player.sendPacket(html);
	}
}
}


create html    on data/html/default               102.htm
===============================================================================
<html>
<head>
	<title>PvP Shop Manager</title>
</head>
<body>
<tr>
<center><img src="L2UI_CH3.inventory_outline_over" width=0.1 height=20></center>
</tr>
<center><img src="sek.gui001" width=258 height=64.2></center>
<br>
<center><font color="LEVEL">Hello strainger </font></center>
<tr>
<br>
<center><img src="L2UI_CH3.inventory_outline_over" width=100 height=3></center>
</tr>
<br>
<br>
<tr><td></td></tr>
<center><button value="Exchange" action="bypass -h npc_%objectId%_Chat_104-2.htm" width=88 height=15 back="l2ui.SystemWindowButton" fore="l2ui.SystemWindowButton_click"></td>
<tr><td></td></tr>
<br>
<br>
<tr>
<center><img src="L2UI_CH3.inventory_outline_over" width=100 height=3></center>
</tr>
<tr>
<center><img src="L2UI_CH3.inventory_outline_over" width=0.1 height=10></center>
</tr>
<center><font color="fcd209">Lineage II Pirama</font></center>
<br>
<center><img src="sek.ui03" width=210 height=50></center>
<center><font color="fcd209"></font></center>
</body>
</html>

create html     102-1.htm
===============================================================================

<html><title>PvP Shop Manager</title>
<body>
<br>
<br>
<center><font color="LEVEL">Exchange Your PvP : 100 PvP = 100 PvPCoin's</font></center><br><br>
<tr><td></td></tr>
<tr>
<center><img src="L2UI_CH3.inventory_outline_over" width=100 height=3></center>
</tr>
<br>
<center><button value="Get Coin's" action="bypass -h npc_%objectId%_pvpToCoin" width=88 height=15 back="l2ui.SystemWindowButton" fore="l2ui.SystemWindowButton_click"></td>
<tr><td></td></tr>
<br>
<tr><td></td></tr>
<center><button value="Get PvP's" action="bypass -h npc_%objectId%_coinToPvp" width=88 height=15 back="l2ui.SystemWindowButton" fore="l2ui.SystemWindowButton_click"></td>
<tr><td></td></tr>
<br>
<tr>
<br>
<center><img src="L2UI_CH3.inventory_outline_over" width=100 height=3></center>
</tr>
<br>
<br>
<br>
<tr><td></td></tr>
<center><button value="Return" action="bypass -h npc_%objectId%_Chat _104.htm" width=88 height=15 back="l2ui.SystemWindowButton" fore="l2ui.SystemWindowButton_click"></td>
<tr><td></td></tr>
</body></html>

create sql file
=========================================================================

INSERT INTO `npc` VALUES ('102','31324','Trader','1','PvP Trade','1','NPC.a_casino_FDarkElf','8.00','23.00','70','female','L2PVPManager','40','3862','1493','11.85','2.78','40','43','30','21','20','10','0','0','1314','470','780','382','278','333','0','0','55','132','0','7','0');


ayta edw ta bazete sto system sto arxio   ectitemgrp
=========================================================================

2	25000	0	5	4	1	0	DropItems.coin_m00			DropItemsTex.coin_t00	DropItemsTex.coin_t01		icon.etc_adena_i00					0	0	3	0	0	1		1		ItemSound2.itemdrop_etc_money_2		3	0	0


ayta edw ta bazete sto system sto arxio      itemname-e
==========================================================================
25000	PvPCoin's		a,	-1	a,	a,	a,	a,	0	0	0	a,


Server\gameserver\data\xml\items   25000-25001.xml
===========================================================================

<?xml version="1.0" encoding="UTF-8"?>
<list>
<item id="25000" type="EtcItem" name="PvPCoin">
	<set name="material" val="gold" />
	<set name="price" val="1" />
	<set name="is_stackable" val="true" />
</item>
</list>

 

 

Credits: valanths1990  ( gia ton code )

Credits: Me ( gia ta ypolipa :P)

 

 

 

  • 3 months later...
Posted

nai mporis na balis enan trader kai na ta xrisimopihsis ... apla anti sta multisell na exeis ta adena bazis ta pvp coin ...

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