Tamira

Members
  • Content Count

    4
  • Joined

  • Last visited

  • Feedback

    N/A

Community Reputation

0 Neutral

About Tamira

  • Rank
    Vassal

Profile Information

  • Gender
    Female
  1. package mods.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; public final class LevelUpReward extends L2Script { // Misc private static final String HTML_PATH = "data/scripts/mods/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("data/xml/LevelReward/LevelReward.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(), "mods"); } } This is the mod i got. I want it to work this way: Example: When i get lvl 20 i receive one item. Then if i get lvl 20 again i receive it again. i Want it to give me itens everytime i get lvl 20.. doent matter if i Delevel or something else It is only working if i relog. Can someone help me please? this forum is dead?
  2. On the first login the player automaticaly get the quest I saw in some server players auto getting the three Olly quests and the quests to level up Soul Crystals
  3. Wts Titan Lv 69 Full TOP Grade Itens B With Coins Server L2 ESSENCE EU RED Price 35 Euro Only Login and Password.. i use that Email for Work... i disliked that server and i have no intention of returning there My email for contact tamiramortein@gmail.com
  4. Can someone please help me with this one? I saw it on others server but cant find it anywhere.. Example: When player get lvl 20.. a chat apears to the player giving him an option to teleport to the next Leveling zone Im working on a High Five custom server dont know the Rev's name package ai.npc.Teleports.UpTeleport; import ai.npc.AbstractNpcAI; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; public class UpTeleport extends AbstractNpcAI { // NPC private static final int NPC = IdNpc;//TERIA QUE SER AUTOMATICO SEM USO DE NPC // Lvl para teleportar private static final int Up_1 = 20;// Teleporta pra Zona 1 private static final int Up_2 = 40;// Teleporta pra Zona 2 private static final int Up_3 = 60;// Teleporta pra Zona 3 private static final int Up_4 = 85;// Teleporta pra Cidade //Esquema public String onTalk(L2Npc npc, L2PcInstance player) { if (player.getLevel() == Up_1) { player.teleToLocation(-55154, 107224, -3731); return null; } else if (player.getLevel() == Up_2) { player.teleToLocation(-55154, 107224, -3731); return null; } else if (player.getLevel() == Up_3) { player.teleToLocation(-55154, 107224, -3731); return null; } else if (player.getLevel() == Up_4) { player.teleToLocation(-55154, 107224, -3731); return null; } } private UpTeleport(String name, String descr) { super(name, descr); addStartNpc(NPC); addTalkId(NPC); } public static void main(String[] args) { new UpTeleport(UpTeleport.class.getSimpleName(), "ai/npc/Teleports"); } } How can i make it work without player having to talk to a NPC...?