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());
The heavy lifting is done in the client, because while you can get away with small imperfections in the java, everything in the client must be impecable.
So, if you haven't touched the client, I'd say pick the newest protocol version you can find the client editing tools and Interface.u (mandatory) / NWindow.dll (better to have it) / Engine.dll (optional) sources for.
At the very least, you need the Interface.u to fix the Clan Window and enable skill enchanting on Classic/Essence versions, if you decide to use to one of them instead of MAIN/LIVE.
Thanks for clarification. Do you think the newest clients offer solid advantages compared to the classic ones like Salvation?
I'm also in the process of porting h5 to one of them just for the sake of it, so I was wondering if I should just attempt to go to the newest possible.
Upgrading to Salvation is exactly the same as upgrading to the newest client with the only difference being access to free-shared client editing tools and resources.
I am speaking from experience. I have upgraded my HF source to one of the newest clients by myself (in terms of server side. got help with the client) and hit every single wall there was in the process.
Now, I already have several multi-protocool server cores so I can easily compare different approaches to tackling the same issue, which also helped the learning process.
Best way to learn would be to use this one (link below) to snoop around and figure out what has been changed in the server side (the packet structure will be different, for sure, but works for understanding/figuring the process out in general terms).
https://github.com/iBezneR/L2J_SunriseProject_Purity
The client side will always be the same, always the same files, only the DAT structure will be different. I personally wrote myself some parsers for the data of the DAT files from OLD -> NEW client.
I guess if you want to learn the whole process, your best bet is to start with a classic client (like salvation? also must be easy to modify so that you don't get stuck behind paywalls) and check how the network communication is implemented. L2jmobius has a lot of sources that use classic clients.
Question
UnSponsored
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
Link to comment
Share on other sites
47 answers to this question
Recommended Posts