hi guys. can anyone help me with re-code java script for h5 l2jmobius? from l2j h5
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack 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, see <http://www.gnu.org/licenses/>.
*/
package custom.LevelUpReward;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Node;
import com.l2jserver.gameserver.engines.DocumentParser;
import com.l2jserver.gameserver.model.PlayerVariables;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.ItemHolder;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.scripting.scriptengine.events.PlayerLevelChangeEvent;
import com.l2jserver.gameserver.scripting.scriptengine.impl.L2Script;
/**
* This is a simple custom mod which allows you to give players some items when they level up.<br>
* Note: rewardAll attribute if set to true means if player is level 50 and has not yet recieved reward for level 45 he will recieve it.<br
* If rewardAll is set to false and new reward was added for level 45 and he is level 50 he will not recieve it.
* @author xban1x
*/
public final class LevelUpReward extends L2Script
{
// Misc
private static final String HTML_PATH = "data/scripts/custom/LevelUpReward/";
protected static boolean rewardAll = false;
protected static final Map<Integer, LevelData> REWARDS = new HashMap<>();
private LevelUpReward(String name, String descr)
{
super(name, descr);
addPlayerLevelNotify(null);
new LevelUpRewardData();
}
@Override
public void onPlayerLevelChange(PlayerLevelChangeEvent event)
{
final L2PcInstance player = event.getPlayer();
if (player == null)
{
return;
}
final int newLevel = event.getNewLevel();
for (int oldLevel = (rewardAll) ? 1 : (event.getOldLevel() + 1); oldLevel <= newLevel; oldLevel++)
{
if (!REWARDS.containsKey(oldLevel))
{
continue;
}
final PlayerVariables vars = player.getVariables();
if (vars.getBool("LEVEL_UP_REWARD_" + oldLevel, false))
{
continue;
}
final LevelData rewards = REWARDS.get(oldLevel);
for (ItemHolder item : rewards.getItems())
{
player.addItem("Quest", item, player, true);
}
vars.set("LEVEL_UP_REWARD_" + oldLevel, true);
if (rewards.getMessage() != "")
{
player.sendMessage(rewards.getMessage());
}
if (rewards.getHtmlFile() != "")
{
final NpcHtmlMessage html = new NpcHtmlMessage(player.getObjectId());
html.setFile(player.getHtmlPrefix(), HTML_PATH + rewards.getHtmlFile());
player.sendPacket(html);
}
}
}
protected final class LevelUpRewardData extends DocumentParser
{
public LevelUpRewardData()
{
load();
}
@Override
public void load()
{
parseDatapackFile(HTML_PATH + "rewards.xml");
}
@Override
protected void parseDocument()
{
for (Node n = getCurrentDocument().getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equals(n.getNodeName()))
{
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if ("rewards".equals(d.getNodeName()))
{
LevelData data = new LevelData();
for (Node e = d.getFirstChild(); e != null; e = e.getNextSibling())
{
if ("item".equals(e.getNodeName()))
{
data.addItem(parseInteger(e.getAttributes(), "id"), parseLong(e.getAttributes(), "count"));
}
}
data.setMessage(parseString(d.getAttributes(), "message"));
data.setHtmlFile(parseString(d.getAttributes(), "htmlFile"));
REWARDS.put(parseInteger(d.getAttributes(), "level"), data);
}
}
rewardAll = parseBoolean(n.getAttributes(), "rewardAll");
}
}
}
}
protected final class LevelData
{
private String html;
private final List<ItemHolder> items;
private String message;
public LevelData()
{
html = "";
items = new ArrayList<>();
message = "";
}
public void addItem(int itemId, long itemCount)
{
items.add(new ItemHolder(itemId, itemCount));
}
public void setHtmlFile(String htmlFile)
{
html = htmlFile;
}
public void setMessage(String message)
{
this.message = message;
}
public String getHtmlFile()
{
return html;
}
public List<ItemHolder> getItems()
{
return items;
}
public String getMessage()
{
return message;
}
}
public static void main(String[] args)
{
new LevelUpReward(LevelUpReward.class.getSimpleName(), "custom");
}
}
in l2jmobius many classes are renamed and removed with changed methods, with my java skills i cant recode this :(
help pls
Hello everyone,
This topic has been created to report any content that is considered illegal under applicable law or in violation of the forum rules.
This includes, but is not limited to:
Illegal software (pirated, cracked, or unauthorized software)
Copyright-infringing material
Malware, viruses, or any harmful code
Scams, fraud, phishing attempts, or impersonation
Illegal banking or financial services
Money laundering activities or related instructions
Any other illegal, unethical, or rule-violating activity — you name it
If you encounter any such content, please report it here so it can be reviewed and removed promptly.
Legal Disclaimer
All content published on this forum is created and posted by its users.
The forum administration does not take responsibility for user-generated content.
However, we make every reasonable effort to monitor, review, remove, and maintain the forum by deleting illegal or rule-violating content as soon as it is reported or identified.
By using this forum, you acknowledge and agree to these terms.
If anyone is reading this, until we find the 488 protocol system that works with AuthD + Authgated from High Five (HF), just use L2Filter included in the leak as the login server to be able to play.
hAuthd does not works with this chronicle, @Hint. do you happen to know about this?
Be aware of the system you use!
If UseEMailAccount is set as true in l2.ini, your user_info table linked to your account must have email column not NULL with a valid e-mail, and you will use that e-mail to login instead of the account name.
(Post merged)
OKAY! Nevermind about the above, I just figured it out, AuthD and Authgated from HF requires GameGuard to be enabled and UseEMailAccount set to false.
Enable GameGuard at server side as per Fyyre instructions,
Add the missing GameGuard files in your client system:
https://mega.nz/file/xZMWQBjK#triEj7My9B9roiLqAKk32HOLcLmPynoOm-QhBI_Ligw
Question
1d3x
hi guys. can anyone help me with re-code java script for h5 l2jmobius? from l2j h5
in l2jmobius many classes are renamed and removed with changed methods, with my java skills i cant recode this :(
Edited by 1d3xhelp pls
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now