Jump to content

Recommended Posts

Posted

A npc where players go give an item (anything id) and he say anything on HV for 1 time !

Thanks..

Can you do it? Bro

 

Posted

A npc where players go give an item (anything id) and he say anything on HV for 1 time !

Thanks..

Can you do it? Bro

 

Done

20kvmf5.jpg

 

 

And code:

 

 


### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2HeroMessageInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2HeroMessageInstance.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2HeroMessageInstance.java	(revision 0)
@@ -0,0 +1,56 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.model.actor.instance;
+
+import javolution.text.TextBuilder;
+import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
+import net.sf.l2j.gameserver.templates.L2NpcTemplate;
+
+/**
+ *
+ * @author  iracundus
+ */
+public class L2HeroMessageInstance extends L2NpcInstance
+{
+
+	public L2HeroMessageInstance(int objectId, L2NpcTemplate template)
+	{
+		super(objectId, template);
+	}
+	
+	@Override
+	public void showChatWindow(L2PcInstance player, int val){
+		if(player == null)
+			return;
+		
+		TextBuilder textBuilder = new TextBuilder();
+		NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());
+		
+		textBuilder.append("<html><head><title>L2 Hero chat message Npc</title></head>");
+		textBuilder.append("<body>");
+		textBuilder.append("<center>Hello i am the Hero Chat Message Npc.<br>");
+		textBuilder.append("I Need 50 adena to talk for you in hero voice</center><br>");
+		textBuilder.append("Enter your message here:<br>");
+		textBuilder.append("<multiedit var=\"hmess\" width=175 height=90><br><br>");
+		textBuilder.append("<button value=\"Message\" action=\"bypass -h hmesit $hmess\" width=204 height=20");
+		textBuilder.append("</body></html>");
+		npcHtmlMessage.setHtml(textBuilder.toString());
+		player.sendPacket(npcHtmlMessage);
+	}
+	
+}
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)
@@ -18,6 +18,7 @@
  */
package net.sf.l2j.gameserver.clientpackets;

+import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

@@ -33,6 +34,7 @@
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.L2Event;
import net.sf.l2j.gameserver.serverpackets.ActionFailed;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;

/**
@@ -89,6 +91,34 @@
			{
				playerHelp(activeChar, _command.substring(12));
			}
+			else if(_command.startsWith("hmesit")){
+				String heroMessage = "";
+				int itemId = 57 , itemCount = 500;
+				StringTokenizer stringTokenizer = new StringTokenizer(_command);
+				stringTokenizer.nextToken();
+				
+						while(stringTokenizer.hasMoreTokens())
+							heroMessage = heroMessage + stringTokenizer.nextToken() + " ";
+				
+				if(heroMessage == "")
+					return;
+				
+				if(heroMessage.length() >= 100)
+				{
+					activeChar.sendMessage("too much big");
+					return;
+				}
+				
+				if(activeChar.getInventory().getItemByItemId(itemId) == null || activeChar.getInventory().getItemByItemId(itemId).getCount() < itemCount){
+					activeChar.sendMessage("You don't have enought items to use this npc instance");
+					return;
+				}
+				
+				activeChar.getInventory().destroyItemByItemId("done", itemId, itemCount, activeChar, null);
+				for(L2PcInstance heroTakers : L2World.getInstance().getAllPlayers())
+					if(heroTakers != null)
+					heroTakers.sendPacket(new CreatureSay(activeChar.getObjectId(),Say2.HERO_VOICE,activeChar.getName(),heroMessage));
+			}
			else if (_command.startsWith("npc_"))
			{
				if(!activeChar.validateBypass(_command))

Posted

Thelw..enan java code...otan kaneis vote..kai meta ingame patas .getreward..na sou dinei ta vote rewards :)

αυτό δεν είναι μόνο java side,ειναι και php που πρέπει να έχεις στο site σου.
Posted

αυτό δεν είναι μόνο java side,ειναι και php που πρέπει να έχεις στο site σου.

Tote..ena java code...na patas ingame kai na sou dinei ta vote rewards :)
Posted

ναι αλλά δεν θα checkarei εαν έχουνε κάνει vote..εκτος π.χ εαν βάλω στο java code να δίνει ένα votereward,και να του δίνει ένα buff p.x ή να του δίνει άλλα ίτεμ..θες κάτι τέτοιο;

Posted

ναι αλλά δεν θα checkarei εαν έχουνε κάνει vote..εκτος π.χ εαν βάλω στο java code να δίνει ένα votereward,και να του δίνει ένα buff p.x ή να του δίνει άλλα ίτεμ..θες κάτι τέτοιο;

Oxi..dn peirazei me ta votes...as pairnoun oloi an simplirothoun ta votes...aaa mipws mporeis na mou valeis sto GM menu..na tin exw on/off tin command dld an simlirothoun ta votes pou zhtaw..na tin energopoiw..kai na patane :) .getreward
Posted

κάτι τέτοιο,βασικά όχι ίδιο αλλά based σε αυτό που λες πρέπει να έχει γίνει share,ψάξτο λίγο.

Posted

Θα ήταν καλύτερα απο το gm menu ο gm να ανοίγει to getreward αλλά όταν θα το ανοίγει να πετάγεται ένα παραθυράκι σε όλους,

Να μην υπάρχει το command.

Posted

Θα ήταν καλύτερα απο το gm menu ο gm να ανοίγει to getreward αλλά όταν θα το ανοίγει να πετάγεται ένα παραθυράκι σε όλους,

Να μην υπάρχει το command.

Protimo na to anoigei..kai na to patane osoi einai active oxi afk...
Posted

Amazing you did it !

GOD what I can say, THANKS you are the best.

Can I ask for more stuff?? Or just 1 per person?!

Done

20kvmf5.jpg

 

 

And code:

 

 


### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2HeroMessageInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2HeroMessageInstance.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2HeroMessageInstance.java	(revision 0)
@@ -0,0 +1,56 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.model.actor.instance;
+
+import javolution.text.TextBuilder;
+import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
+import net.sf.l2j.gameserver.templates.L2NpcTemplate;
+
+/**
+ *
+ * @author  iracundus
+ */
+public class L2HeroMessageInstance extends L2NpcInstance
+{
+
+	public L2HeroMessageInstance(int objectId, L2NpcTemplate template)
+	{
+		super(objectId, template);
+	}
+	
+	@Override
+	public void showChatWindow(L2PcInstance player, int val){
+		if(player == null)
+			return;
+		
+		TextBuilder textBuilder = new TextBuilder();
+		NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());
+		
+		textBuilder.append("<html><head><title>L2 Hero chat message Npc</title></head>");
+		textBuilder.append("<body>");
+		textBuilder.append("<center>Hello i am the Hero Chat Message Npc.<br>");
+		textBuilder.append("I Need 50 adena to talk for you in hero voice</center><br>");
+		textBuilder.append("Enter your message here:<br>");
+		textBuilder.append("<multiedit var=\"hmess\" width=175 height=90><br><br>");
+		textBuilder.append("<button value=\"Message\" action=\"bypass -h hmesit $hmess\" width=204 height=20");
+		textBuilder.append("</body></html>");
+		npcHtmlMessage.setHtml(textBuilder.toString());
+		player.sendPacket(npcHtmlMessage);
+	}
+	
+}
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)
@@ -18,6 +18,7 @@
  */
package net.sf.l2j.gameserver.clientpackets;

+import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;

@@ -33,6 +34,7 @@
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.entity.L2Event;
import net.sf.l2j.gameserver.serverpackets.ActionFailed;
+import net.sf.l2j.gameserver.serverpackets.CreatureSay;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;

/**
@@ -89,6 +91,34 @@
			{
				playerHelp(activeChar, _command.substring(12));
			}
+			else if(_command.startsWith("hmesit")){
+				String heroMessage = "";
+				int itemId = 57 , itemCount = 500;
+				StringTokenizer stringTokenizer = new StringTokenizer(_command);
+				stringTokenizer.nextToken();
+				
+						while(stringTokenizer.hasMoreTokens())
+							heroMessage = heroMessage + stringTokenizer.nextToken() + " ";
+				
+				if(heroMessage == "")
+					return;
+				
+				if(heroMessage.length() >= 100)
+				{
+					activeChar.sendMessage("too much big");
+					return;
+				}
+				
+				if(activeChar.getInventory().getItemByItemId(itemId) == null || activeChar.getInventory().getItemByItemId(itemId).getCount() < itemCount){
+					activeChar.sendMessage("You don't have enought items to use this npc instance");
+					return;
+				}
+				
+				activeChar.getInventory().destroyItemByItemId("done", itemId, itemCount, activeChar, null);
+				for(L2PcInstance heroTakers : L2World.getInstance().getAllPlayers())
+					if(heroTakers != null)
+					heroTakers.sendPacket(new CreatureSay(activeChar.getObjectId(),Say2.HERO_VOICE,activeChar.getName(),heroMessage));
+			}
			else if (_command.startsWith("npc_"))
			{
				if(!activeChar.validateBypass(_command))

Posted

Goldex you can ask everything. Speak greek.

 

Shadow, αποφασισε και καντο ποστ γιατι εχω μπερδευτει

Posted

;) :)

Twra tha ithela ena npc pou na kanei +(enchant) ta items opws to agument pou bazeis to Weapon p thes alla sthn prokumenh periptwsh thelw na bazeis mono to item pou tha ginei enchant oxi to blesed (thelw na diagrapsw t blesed apo ton server)

To npc tha auxanei to ++ kata 1 dld +3 meta +4 +5 k loipa

Ama m katalaves. Ama boreis n baleis ena config oste na allazw to enchant rate pou tha kanei ++ to npc

Px : 100% 90% 60%

Euxaristw ek ton proteron...

;)

Posted

;) :)

Twra tha ithela ena npc pou na kanei +(enchant) ta items opws to agument pou bazeis to Weapon p thes alla sthn prokumenh periptwsh thelw na bazeis mono to item pou tha ginei enchant oxi to blesed (thelw na diagrapsw t blesed apo ton server)

To npc tha auxanei to ++ kata 1 dld +3 meta +4 +5 k loipa

Ama m katalaves. Ama boreis n baleis ena config oste na allazw to enchant rate pou tha kanei ++ to npc

Px : 100% 90% 60%

Euxaristw ek ton proteron...

;)

το βρισκω useless.

Αυτο που λες μαλλον θελει client edit, anyway εκανα το εξης αν το θες:

Πανε στο Npc πατανε το κουμπι και μετα  μπορουν να πατησουν οποιοδηποτε weapon(weapon μονο) και αυτο εχει 70% πιθανοτητα να γινει +1 αλλιως γινεται 0(σαν blessed), μετα για να το ξανακανουν πρεπει να ξαναπατησουν στο npc.

 

Tested


### Eclipse Workspace Patch 1.0
#P Chr.6GMS
Index: java/net/sf/l2j/gameserver/clientpackets/UseItem.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/UseItem.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/clientpackets/UseItem.java	(working copy)
@@ -37,6 +37,7 @@
import net.sf.l2j.gameserver.templates.L2Weapon;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.FloodProtector;
+import net.sf.l2j.util.Rnd;

/**
  * This class ...
@@ -149,6 +150,28 @@
                 sm = null;
                 return;
             }
+            
+            if(activeChar.isAbility()){
+            	if(item.getItem().getItemType() instanceof L2WeaponType){
+            		int chance = 70;
+            		if(Rnd.get(100) < chance){
+            			item.setEnchantLevel(item.getEnchantLevel() + 1);
+            			item.updateDatabase();
+            			activeChar.sendMessage("Successfully enchanted");
+            		}
+            		else{
+            			if(item.getEnchantLevel() == 0){}
+            			else{
+            			item.setEnchantLevel(0);
+            			item.updateDatabase();
+            			activeChar.sendMessage("Unsuccessfully enchanted");
+            			}
+            		}
+            		activeChar.setAbility(false);
+            		return;
+            	}
+            }
+            

			// Char cannot use item when dead
			if (activeChar.isDead())
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 5263)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -451,6 +451,8 @@

	private boolean _noble = false;
	private boolean _hero = false;
+	
+	private boolean _ability = false;

	/** The L2FolkInstance corresponding to the last Folk wich one the player talked. */
	private L2FolkInstance _lastFolkNpc = null;
@@ -8215,6 +8217,16 @@
		return true;
	}

+	public boolean isAbility()
+	{
+		return _ability;
+	}
+	
+	public void setAbility(boolean newValue)
+	{
+		_ability = newValue;
+	}
+	
     public boolean isNoble()
     {
     	return _noble;
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2EnchanterInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2EnchanterInstance.java	(revision 0)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2EnchanterInstance.java	(revision 0)
@@ -0,0 +1,56 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package net.sf.l2j.gameserver.model.actor.instance;
+
+import javolution.text.TextBuilder;
+import net.sf.l2j.gameserver.model.L2ItemInstance;
+import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
+import net.sf.l2j.gameserver.templates.L2NpcTemplate;
+import net.sf.l2j.gameserver.templates.L2WeaponType;
+
+/**
+ *
+ * @author  iracundus
+ */
+public class L2EnchanterInstance extends L2NpcInstance
+{
+
+
+	public L2EnchanterInstance(int objectId, L2NpcTemplate template)
+	{
+		super(objectId, template);
+	}
+	
+	@Override
+	public void showChatWindow(L2PcInstance player, int val)
+	{
+		if(player == null)
+			return;
+		TextBuilder tb = new TextBuilder();
+		NpcHtmlMessage nhm = new NpcHtmlMessage(1);
+		
+		tb.append("<html><body>");
+		tb.append("I can enchant weapons for you,clik the button<br>");
+		tb.append("and then double-click on the weapon you want<br>");
+		tb.append("<button value=\"Give enchanting ability\" action=\"bypass -h enchantab\"");
+		tb.append("</body></html>");
+		nhm.setHtml(tb.toString());
+		player.sendPacket(nhm);
+	}
+	
+}
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)
@@ -85,6 +85,14 @@
			{
				comeHere(activeChar);
			}
+			else if(_command.startsWith("enchantab")){
+				if(activeChar.isAbility()){
+				activeChar.sendMessage("You have already the ability to double click a weapon and enchant");
+				return;
+				}
+				activeChar.setAbility(true);
+				activeChar.sendMessage("Now you have the ability to double click a weapona and enchant it");
+		}
			else if (_command.startsWith("player_help "))
			{
				playerHelp(activeChar, _command.substring(12));

Posted

Dn boreis na to knc toulaxiston gia ola t items? Armor jewels tatou

Opws k n xei euxaristw!!

 

Guest
This topic is now closed to further replies.



×
×
  • Create New...