Jump to content
  • 0

[help][ri3te mia matia se enan java code]


UnSponsored

Question

kapoios na mou pei ti exw kanei la8os se afton ton code gt to psaxnw na dw ti la8os exw kanei apo tis 6 kai mou exei spasei ta nevra...einai apo to guide to Fanky..to pack pou xrisimopoiw einai aCis...den mou vgazei kapio error,apla den litourgei

Index: java/net/sf/l2j/gameserver/handler/itemhandlers/UnSponsored.java
===============================================================
package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;



/**
* @author UnSponsored
*
*/
public class PopUpItem implements IItemHandler
{
    private static final int[] ITEM_ID = { Config.AIO_ITEM_ID };

@Override
public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
    {
      if (!(playable instanceof L2PcInstance))
         return;
      L2PcInstance activeChar = (L2PcInstance)playable;
       int itemId = item.getItemId();

   if (itemId == Config.AIO_ITEM_ID)
       {
	String htmFile = "data/html/AIO/AIO.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);

		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
       }
    }
@Override
public int[] getItemIds()
{
	// TODO Auto-generated method stub
	return null;
}
/**
 * @return the itemId
 */
public static int[] getItemId()
{
	return ITEM_ID;
}

}   


Index: config/player.properties
==============================================================
# % regeneration of normal regeneration speed
HpRegenMultiplier = 100
MpRegenMultiplier = 100
CpRegenMultiplier = 100

+# Aio Item Configuration
+# When ActiveChar will use this item a html will pop up
+# Id Itemn Need's
+AioItemId = 6673

# Player Protection after teleporting or login in seconds, 0 for disabled
PlayerSpawnProtection = 0


Index: java/net/sf/l2j/Config.java
==============================================================
         public static boolean ALT_GAME_FREIGHTS;
            public static int ALT_GAME_FREIGHT_PRICE;
            +public static int AIO_ITEM_ID;
     
     
     
    ALT_GAME_DELEVEL = Boolean.parseBoolean(players.getProperty("Delevel", "True"));
    DEATH_PENALTY_CHANCE = Integer.parseInt(players.getProperty("DeathPenaltyChance", "20"));
    +AIO_ITEM_ID = Integer.parseInt(players.getProperty("AioItemId", "6673"));


Index: java/net/sf/l2j/gameserver/handler/itemhandlers.java
=============================================================
import net.sf.l2j.gameserver.handler.itemhandlers.PetFood;
+import net.sf.l2j.gameserver.handler.itemhandlers.PopUpItem;
import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;

registerItemHandler(new SummonItems());
registerItemHandler(new BeastSpice());
registerItemHandler(new Elixir());
+registerItemHandler(new PopUpItem());

Link to comment
Share on other sites

Recommended Posts

  • 0

αφενώς σβήσε αυτό lol :P

	@Override
public int[] getItemIds()
{
	// TODO Auto-generated method stub
	return null;
}
/**
 * @return the itemId
 */

 

επίσης,έτσι όπως φαίνεται στον κώδικα που έχεις κάνει edit για το patch του htm

 

πρέπει να έχεις έναν φάκελο που να λέγεται AIO μέσα στον φάκελο HTML και μέσα στον φάκελο ΑΙΟ να έχεις ένα htm που να λέγεται AIO.

 

το έχεις έτσι;

εαν έχεις μόνο ένα htm μέσα στον φάκελο HTML τότε πρέπει να γίνει έτσι:

String htmFile = "data/html/AIO.htm";

Link to comment
Share on other sites

  • 0

αφενώς σβήσε αυτό lol :P

	@Override
public int[] getItemIds()
{
	// TODO Auto-generated method stub
	return null;
}
/**
 * @return the itemId
 */

 

επίσης,έτσι όπως φαίνεται στον κώδικα που έχεις κάνει edit για το patch του htm

 

πρέπει να έχεις έναν φάκελο που να λέγεται AIO μέσα στον φάκελο HTML και μέσα στον φάκελο ΑΙΟ να έχεις ένα htm που να λέγεται AIO.

 

το έχεις έτσι;

εαν έχεις μόνο ένα htm μέσα στον φάκελο HTML τότε πρέπει να γίνει έτσι:

String htmFile = "data/html/AIO.htm";

to html to exw sta html/aio/aio.htm alla akou ti pezei..o Crystalia mou edose ton idio code mono pou eixe pros8esh mia sira(tin opoia tin pros8esa kai egw twra) kai stin consola otan aniga ton gameserver mou evgaze ItemHandlers 25 enw ton esvisa kai perasa to diko m kai mou vgazei 24...opote kati pezei sto eclipse..
Link to comment
Share on other sites

  • 0

το boolean forceuse που κολλάει στο void;

lol.

 

επίσης,ίσως σου έδωσε την σειρά που γίνεται register το itemhandler,εγώ δεν την είχα βάλει στον κώδικα που είχα κάνει στον οδηγό μου.

 

όταν χρησιμοποιείς το αντικείμενο(όταν το πατάς τέλος παντων) σου βγάζει τίποτα στο gameserver;

κάποιο error ή κάτι;

Link to comment
Share on other sites

  • 0

το boolean forceuse που κολλάει στο void;

lol.

 

επίσης,ίσως σου έδωσε την σειρά που γίνεται register το itemhandler,εγώ δεν την είχα βάλει στον κώδικα που είχα κάνει στον οδηγό μου.

 

όταν χρησιμοποιείς το αντικείμενο(όταν το πατάς τέλος παντων) σου βγάζει τίποτα στο gameserver;

κάποιο error ή κάτι;

den mou vgazei eror sto gameserver...to register to perasa monos mou..mia ali protash mou edose sto PopUpItem
Link to comment
Share on other sites

  • 0

den mou vgazei eror sto gameserver...to register to perasa monos mou..mia ali protash mou edose sto PopUpItem

δεν καταλαβαίνω,κάτι λάθος κάνεις τότε.
Link to comment
Share on other sites

  • 0

δεν καταλαβαίνω,κάτι λάθος κάνεις τότε.

to thema einai ti lathos kanw...exw psaksei ta panta..eida kai alla itemhandlers kai den exoun kamia diafora..
Link to comment
Share on other sites

  • 0

to thema einai ti lathos kanw...exw psaksei ta panta..eida kai alla itemhandlers kai den exoun kamia diafora..

κάνε μου μια paste εδώ τον κώδικα που χρησιμοποιείς τώρα.
Link to comment
Share on other sites

  • 0

κάνε μου μια paste εδώ τον κώδικα που χρησιμοποιείς τώρα.

afton pou ekana xrisimopoiw..ti enoeis?den exw perasei kapion alon
Link to comment
Share on other sites

  • 0

Index: java/net/sf/l2j/gameserver/handler/itemhandlers/UnSponsored.java
===============================================================
package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;



/**
* @author UnSponsored
*
*/
public class PopUpItem implements IItemHandler
{
    private static final int[] ITEM_ID = { Config.AIO_ITEM_ID };

@Override
public void useItem(L2Playable playable, L2ItemInstance item)
    {
      if (!(playable instanceof L2PcInstance))
         return;
   	
	String htmFile = "data/html/AIO/AIO.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);

		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
       
    }
public static int[] getItemId()
{
	return ITEM_ID;
}

}   


Index: config/player.properties
==============================================================
# % regeneration of normal regeneration speed
HpRegenMultiplier = 100
MpRegenMultiplier = 100
CpRegenMultiplier = 100

+# Aio Item Configuration
+# When ActiveChar will use this item a html will pop up
+# Id Itemn Need's
+AioItemId = 6673

# Player Protection after teleporting or login in seconds, 0 for disabled
PlayerSpawnProtection = 0


Index: java/net/sf/l2j/Config.java
==============================================================
         public static boolean ALT_GAME_FREIGHTS;
            public static int ALT_GAME_FREIGHT_PRICE;
            +public static int AIO_ITEM_ID;
     
     
     
    ALT_GAME_DELEVEL = Boolean.parseBoolean(players.getProperty("Delevel", "True"));
    DEATH_PENALTY_CHANCE = Integer.parseInt(players.getProperty("DeathPenaltyChance", "20"));
    +AIO_ITEM_ID = Integer.parseInt(players.getProperty("AioItemId", "6673"));


Index: java/net/sf/l2j/gameserver/handler/itemhandlers.java
=============================================================
import net.sf.l2j.gameserver.handler.itemhandlers.PetFood;
+import net.sf.l2j.gameserver.handler.itemhandlers.PopUpItem;
import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;

registerItemHandler(new SummonItems());
registerItemHandler(new BeastSpice());
registerItemHandler(new Elixir());
+registerItemHandler(new PopUpItem());

 

βάλε αυτό και πες μου.

Link to comment
Share on other sites

  • 0

Index: java/net/sf/l2j/gameserver/handler/itemhandlers/UnSponsored.java
===============================================================
package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.cache.HtmCache;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;



/**
* @author UnSponsored
*
*/
public class PopUpItem implements IItemHandler
{
    private static final int[] ITEM_ID = { Config.AIO_ITEM_ID };

@Override
public void useItem(L2Playable playable, L2ItemInstance item)
    {
      if (!(playable instanceof L2PcInstance))
         return;
   	
	String htmFile = "data/html/AIO/AIO.htm";
	String htmContent = HtmCache.getInstance().getHtm(htmFile);

		NpcHtmlMessage infoHtml = new NpcHtmlMessage(1);
		infoHtml.setHtml(htmContent);
		activeChar.sendPacket(infoHtml);
       
    }
public static int[] getItemId()
{
	return ITEM_ID;
}

}   


Index: config/player.properties
==============================================================
# % regeneration of normal regeneration speed
HpRegenMultiplier = 100
MpRegenMultiplier = 100
CpRegenMultiplier = 100

+# Aio Item Configuration
+# When ActiveChar will use this item a html will pop up
+# Id Itemn Need's
+AioItemId = 6673

# Player Protection after teleporting or login in seconds, 0 for disabled
PlayerSpawnProtection = 0


Index: java/net/sf/l2j/Config.java
==============================================================
         public static boolean ALT_GAME_FREIGHTS;
            public static int ALT_GAME_FREIGHT_PRICE;
            +public static int AIO_ITEM_ID;
     
     
     
    ALT_GAME_DELEVEL = Boolean.parseBoolean(players.getProperty("Delevel", "True"));
    DEATH_PENALTY_CHANCE = Integer.parseInt(players.getProperty("DeathPenaltyChance", "20"));
    +AIO_ITEM_ID = Integer.parseInt(players.getProperty("AioItemId", "6673"));


Index: java/net/sf/l2j/gameserver/handler/itemhandlers.java
=============================================================
import net.sf.l2j.gameserver.handler.itemhandlers.PetFood;
+import net.sf.l2j.gameserver.handler.itemhandlers.PopUpItem;
import net.sf.l2j.gameserver.handler.itemhandlers.Recipes;

registerItemHandler(new SummonItems());
registerItemHandler(new BeastSpice());
registerItemHandler(new Elixir());
+registerItemHandler(new PopUpItem());

 

βάλε αυτό και πες μου.

twra stin consola mou vgazei

ItemHandler: Loaded 25 handlers.

anti gia 24 pou mou evgaze...allap  pataw sto item kai den vgenei to html

Link to comment
Share on other sites

  • 0

lol.

 

 

στο config.java το ιτεμ το κάνεις 'register' στο config 'players.

 

όμως το config λέγετε player.properties όχι playerS.properties.

Link to comment
Share on other sites

  • 0

πωπω τι μαλακίες έχεις κάνει;

 

το class λέγεται PopUpItem και το έχεις ονομάσει unsposored.java?

 

καλα δεν έχεις κάνει σωστό checkout στο acis;

δεν σου βγάζει τα λάθη;

λολ..

Link to comment
Share on other sites

  • 0

loipon....1-1

lol.

 

 

στο config.java το ιτεμ το κάνεις 'register' στο config 'players.

 

όμως το config λέγετε player.properties όχι playerS.properties.

sta configs mou to exei players.properties

πωπω τι μαλακίες έχεις κάνει;

 

το class λέγεται PopUpItem και το έχεις ονομάσει unsposored.java?

 

καλα δεν έχεις κάνει σωστό checkout στο acis;

δεν σου βγάζει τα λάθη;

λολ..

kai den m vgazei error,gt diegrapsa to poup up kai evala afto.den eixa kanei la8os,apla eixa valei la8os ta Index: Net.sf kai ta loipa ston code pou s anevasa
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...