InFocus
Members-
Posts
306 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Everything posted by InFocus
-
How i can set L2Npc.Java for add %playername& to add this in texts? I have edited this method public void showChatWindow(L2PcInstance player, String filename) { // Send a Server->Client NpcHtmlMessage containing the text of the L2NpcInstance to the L2PcInstance final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId()); html.setFile(player.getHtmlPrefix(), filename); html.replace("%objectId%", String.valueOf(getObjectId())); html.replace("%exp%", String.valueOf((Config.RATE_XP))); html.replace("%sp%", String.valueOf((Config.RATE_SP))); html.replace("%drop%", String.valueOf((Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER))); html.replace("%type%", String.valueOf(player.isPremium() ? "Premium" : "Normal")); player.sendPacket(html); // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); } and in game html says %exp% not the exp rate
-
I wish and i want to understand this method. But if you have patience with me, i will understand. So please, Explain me in exemple, i post here code. Please have patience ! Please Please Please !!!!!!!!!!
-
Ok, it is appear just msg. Now i want to make to work that method. Code is here package handlers.voicedcommandhandlers; import java.util.HashMap; import java.util.Map; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.itemcontainer.Inventory; import com.l2jserver.gameserver.model.items.instance.L2ItemInstance; import com.l2jserver.gameserver.model.items.type.CrystalType; import com.l2jserver.gameserver.network.clientpackets.Say2; import com.l2jserver.gameserver.network.serverpackets.CreatureSay; /** * @author L2Amyra */ public class FarmZone implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "easy", "mid", "hard", "dungeon" }; private static final long delay = 5000; // Millisecounds private static Map<Integer, Long> _reuse = new HashMap<>(); @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (_reuse.containsKey(activeChar.getObjectId())) { if (_reuse.get(activeChar.getObjectId()) > System.currentTimeMillis()) { activeChar.sendMessage("Sorry, you can not use this command. You can use it within " + ((_reuse.get(activeChar.getObjectId()) - System.currentTimeMillis()) / 1000) + " sec's"); return false; } } { if (activeChar.isDead()) { activeChar.sendMessage("You can't teleport while you are dead!"); return false; } else if (activeChar.isInOlympiadMode()) { activeChar.sendMessage("You can't use this command durring olympiad!"); return false; } else if (activeChar.isInDuel()) { activeChar.sendMessage("You can't use this command when you are in duel!"); return false; } else if (activeChar.isInCombat()) { activeChar.sendMessage("You can't use this command when you are in combat!"); return false; } else if (activeChar.getPvpFlag() > 0) { CreatureSay i = new CreatureSay(activeChar.getObjectId(), Say2.PARTY, "admin", "You can't use this command when you are flagged. Try again...!"); activeChar.sendPacket(i); return false; } else if (activeChar.isJailed()) { activeChar.sendMessage("You can't use this command when you are in jail"); return false; } else if (activeChar.getInventory().getInventoryItemCount(57, 0) < 50000) { activeChar.sendMessage("No enough Adena!"); return false; } else if (activeChar.getKarma() > 0) { activeChar.sendMessage("Go away. You are not welcome here !"); return false; } else if (!activeChar.isNoble()) { activeChar.sendMessage("Only Noblesse players can teleport."); return false; } else if (activeChar.getLevel() < 80) { activeChar.sendMessage("You can only use the command after level 80"); return false; } { if (command.startsWith("easy")) { if (!activeChar.isNoble()) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); } if (!checkItemGrade(activeChar, Inventory.PAPERDOLL_CHEST) || !checkItemGrade(activeChar, Inventory.PAPERDOLL_RHAND)) { activeChar.sendMessage("S-Grade gear is required in order to enter the zone."); } if (!(activeChar.getLevel() < 80)) { activeChar.sendMessage("You have been teleported to easy zone "); activeChar.teleToLocation(89006, 27373, -15691); } _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } else if (command.startsWith("mid")) { if (!activeChar.isNoble()) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); } if (!(activeChar.getLevel() < 80)) { activeChar.sendMessage("You have been teleported to mid zone "); activeChar.teleToLocation(89006, 27373, -15691); } _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } else if (command.startsWith("hard")) { if (!activeChar.isNoble()) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); } if (!(activeChar.getLevel() < 80)) { activeChar.sendMessage("You have been teleported to hard zone "); activeChar.teleToLocation(89006, 27373, -15691); } _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } else if (command.startsWith("dungeon")) { if (!activeChar.isNoble()) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); } if (!(activeChar.getLevel() < 80)) { activeChar.sendMessage("WARNING !! You have been teleported to dungeon zone. "); activeChar.teleToLocation(89006, 27373, -15691); } _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } } return true; } } public static final boolean checkItemGrade(L2PcInstance player, int slotId) { final L2ItemInstance item = player.getInventory().getPaperdollItem(slotId); if ((item != null) && (item.getItem().getCrystalType() == CrystalType.S)) { return true; } return false; } @Override public String[] getVoicedCommandList() { return VOICED_COMMANDS; } } Tell me Sweets what's wrong.
-
if (command.startsWith("easy")) { if (!activeChar.isNoble()) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); } if (!(activeChar.getLevel() < 80)) { activeChar.sendMessage("You have been teleported to easy zone "); activeChar.teleToLocation(89006, 27373, -15691); } _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } if (activeChar.checkItemGrade()) { if (!checkItemGrade(activeChar, Inventory.PAPERDOLL_CHEST) || !checkItemGrade(activeChar, Inventory.PAPERDOLL_RHAND)) { activeChar.sendMessage("S-Grade gear is required in order to enter the zone."); } } It is ok now?
-
I put command Here 1 if (command.startsWith("easy")) I put command Here 2 { if (!activeChar.isNoble()) { activeChar.destroyItemByItemId("consume", 57, 50000, activeChar, true); } I Put Command Here 3 if (!(activeChar.getLevel() < 80)) { activeChar.sendMessage("You have been teleported to easy zone "); activeChar.teleToLocation(89006, 27373, -15691); } _reuse.put(activeChar.getObjectId(), System.currentTimeMillis() + delay); } Or I Put command Here 4? Can tell me please?
-
http:// and i have in L2PcInstance private static final boolean checkItemGrade(L2PcInstance player, int slotId) { final L2ItemInstance item = player.getInventory().getPaperdollItem(slotId); if ((item != null) && (item.getItem().getCrystalType() == CrystalType.S)) { return true; } return false; } Why it not complete?
-
What's now? http:// I try to put L2PcInstance but don't work :)
-
Yup, now i understand. I check now if it's working
-
I can replace with CheckItemManipulation or CheckItemExist?
-
Wel wel, i have laptop I7 Gen 7 :) octa core? :)
-
After Change to L2ItemInstance another kind of error http://
-
I change with L2PcInstance that `player` , now error is in ItemInstance http://
-
What i must choice here? http://
-
SO, final syntax is from SweeTs?
-
Help *Info VoiceCommand
InFocus replied to InFocus's question in Request Server Development Help [L2J]
Well, and what bypass i need to open that Rate link? -
Close topic. I cannot do this !
-
SweeTs, When u understand me? I can't use player cuz i don't have player.class
-
Hi all, i add info voice command with "Info". All goods, but i want to know what bypass i can use after Chat 1. I make this <td align=center><button value="Rates" action="bypass -h npc_%objectId%_Chat 1" width=90 height=26 back="l2ui_ct1.windows_df_drawer_bg_darker" fore="l2ui_ct1.windows_df_drawer_bg_darker"></td> and it is looking like that, http:// and this is code /* * 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 3 of the License, 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, see http://www.gnu.org/licenses/ */ package handlers.voicedcommandhandlers; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; /** * @author L2Amyra */ public class Info implements IVoicedCommandHandler { private static String[] VOICED_COMMANDS = { "info" }; /* * (non-Javadoc) * @see com.l2jfree.gameserver.handler.IVoicedCommandHandler#useVoicedCommand(java.lang.String, com.l2jfree.gameserver.model.actor.instance.L2PcInstance, java.lang.String) */ @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { NpcHtmlMessage html = new NpcHtmlMessage(); html.setFile(activeChar.getHtmlPrefix(), "data/html/merchant/Info.htm"); activeChar.sendPacket(html); return true; } @Override public String[] getVoicedCommandList() { return VOICED_COMMANDS; } } Now, the question is how i can open that `Rates` like that window, but looks like that?
-
Kara`, i want if player don't have S grade equiped, he can't use command. And i prefer to have set + weapon equiped to teleport in that zone. NOT IN INVENTORY ! EQUIPED to can use teleport. It is about slots i think
-
For exemple, if player have full Draconic armor (Doesn't metter if it's light or heavy) and no have weapon (S grade:) ) he can not enter
-
Melron , Melron :) I want to say IF player have the LAST item S grade in inventory CAN teleport in that zone!!! With 0 items s grade, i want player can't enter ! :)
-
What's wrong :))))))))))))))) except my english
-
else if (activeChar.hasGradeEquipped(CrystalType.S)) { activeChar.sendMessage("You don't have equiped with S grade"); return false; } + public boolean hasGradeEquipped(CrystalType s) { return Arrays.asList(getInventory().getItems()).stream().filter(i -> i.isEquipped() && (i.getItem().getCrystalType() == s)).findAny().isPresent(); } I no have any items S in inventory and i can teleport. Why?
-
Well, i must select TYPE like parameter?
-
http://
