Jump to content

la2betdrema

Members
  • Posts

    14
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

About la2betdrema

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

la2betdrema's Achievements

Newbie

Newbie (1/16)

  • One Month Later Rare
  • One Year In Rare
  • Week One Done Rare

Recent Badges

0

Reputation

  1. So that the item does not disappear from the inventory by double-clicking and put a buff.
  2. Here's the code. package net.sf.l2j.gameserver.handler.itemhandlers; import net.sf.l2j.gameserver.data.SkillTable; import net.sf.l2j.gameserver.handler.IItemHandler; import net.sf.l2j.gameserver.handler.ItemHandler; import net.sf.l2j.gameserver.model.actor.Playable; import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.item.instance.ItemInstance; import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse; import java.util.HashMap; public class DonateScrolls implements IItemHandler { private final static HashMap<Integer, Integer[]> SCROLLS = new HashMap<Integer, Integer[]>(); private static int[] ITEM_IDS = null; public DonateScrolls() { /** * SCROLLS.put(item_id, new Integer[] { id_buffa, buffa level, id_skilla_animation, animation duration(ms)), take the item(1 yes, 0 no)) }); */ SCROLLS.put(11986, new Integer[] { 8001, 1, 7038, 1, 1 }); SCROLLS.put(11987, new Integer[] { 8002, 1, 7038, 1, 1 }); SCROLLS.put(11988, new Integer[] { 8003, 1, 7038, 1, 1 }); SCROLLS.put(11989, new Integer[] { 8004, 1, 7038, 1, 1 }); SCROLLS.put(11469, new Integer[] { 11510, 1, 7038, 1, 0 }); SCROLLS.put(11470, new Integer[] { 11510, 2, 7038, 1, 0 }); SCROLLS.put(11471, new Integer[] { 11510, 3, 7038, 1, 0 }); SCROLLS.put(11472, new Integer[] { 11510, 4, 7038, 1, 0 }); SCROLLS.put(11473, new Integer[] { 11510, 5, 7038, 1, 0 }); SCROLLS.put(11474, new Integer[] { 11515, 1, 7038, 1, 0 }); SCROLLS.put(11475, new Integer[] { 11515, 2, 7038, 1, 0 }); SCROLLS.put(11476, new Integer[] { 11515, 3, 7038, 1, 0 }); SCROLLS.put(11477, new Integer[] { 11515, 4, 7038, 1, 0 }); SCROLLS.put(11478, new Integer[] { 11515, 5, 7038, 1, 0 }); SCROLLS.put(11479, new Integer[] { 11520, 1, 7038, 1, 0 }); SCROLLS.put(11480, new Integer[] { 11520, 2, 7038, 1, 0 }); SCROLLS.put(11481, new Integer[] { 11520, 3, 7038, 1, 0 }); SCROLLS.put(11482, new Integer[] { 11520, 4, 7038, 1, 0 }); SCROLLS.put(11483, new Integer[] { 11520, 5, 7038, 1, 0 }); SCROLLS.put(11484, new Integer[] { 11525, 1, 7038, 1, 0 }); SCROLLS.put(11485, new Integer[] { 11525, 2, 7038, 1, 0 }); SCROLLS.put(11486, new Integer[] { 11525, 3, 7038, 1, 0 }); SCROLLS.put(11487, new Integer[] { 11525, 4, 7038, 1, 0 }); SCROLLS.put(11488, new Integer[] { 11525, 5, 7038, 1, 0 }); SCROLLS.put(11489, new Integer[] { 11530, 1, 7038, 1, 0 }); SCROLLS.put(11490, new Integer[] { 11530, 2, 7038, 1, 0 }); SCROLLS.put(11491, new Integer[] { 11530, 3, 7038, 1, 0 }); SCROLLS.put(11492, new Integer[] { 11530, 4, 7038, 1, 0 }); SCROLLS.put(11493, new Integer[] { 11530, 5, 7038, 1, 0 }); SCROLLS.put(11494, new Integer[] { 11535, 1, 7038, 1, 0 }); SCROLLS.put(11495, new Integer[] { 11535, 2, 7038, 1, 0 }); SCROLLS.put(11496, new Integer[] { 11535, 3, 7038, 1, 0 }); SCROLLS.put(11497, new Integer[] { 11535, 4, 7038, 1, 0 }); SCROLLS.put(11498, new Integer[] { 11535, 5, 7038, 1, 0 }); SCROLLS.put(11499, new Integer[] { 11540, 1, 7038, 1, 0 }); SCROLLS.put(11500, new Integer[] { 11540, 2, 7038, 1, 0 }); SCROLLS.put(11501, new Integer[] { 11540, 3, 7038, 1, 0 }); SCROLLS.put(11502, new Integer[] { 11540, 4, 7038, 1, 0 }); SCROLLS.put(11503, new Integer[] { 11540, 5, 7038, 1, 0 }); // Integer[] tmp_ids = (Integer[]) SCROLLS.keySet().toArray(new Integer[SCROLLS.size()]); ITEM_IDS = toIntArray(tmp_ids); tmp_ids = null; ItemHandler.getInstance().getHandler(null); } public static void main (String... arguments ) { new DonateScrolls(); } public void useItem(Playable playable, ItemInstance item, boolean forceUse) { if (playable instanceof Player) return; Player player = (Player) playable; if (player.isAllSkillsDisabled()) { player.sendMessage(""); return; } if (player.isInOlympiadMode()) { player.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT); player.sendMessage(""); return; } Integer[] data = SCROLLS.get(item.getItemId()); if(data != null) { player.stopSkillEffects(data[0]); SkillTable.getInstance().getInfo(data[0], data[1]).getEffects(player, player); player.broadcastPacket(new MagicSkillUse(player, player, data[2], 1, data[3], 0)); if (data[4] == 1) { player.destroyItem("Consume", item.getObjectId(), 1, null, false); } } } private int[] toIntArray(Integer[] arr) { int[] ret = new int[arr.length]; int i = 0; for (Integer e : arr) ret[i++] = e.intValue(); return ret; } public int[] getItemIds() { return ITEM_IDS; } } Here are some xml items should remain in inventory <item id="11469" type="EtcItem" name="MIGHT1"> <set name="default_action" val="capsule" /> <set name="material" val="PAPER" /> <set name="weight" val="100" /> <set name="is_stackable" val="true" /> <set name="is_oly_restricted" val="true" /> <set name="handler" val="DonateScrolls" /> <set name="item_skill" val="11510-1" /> </item> this one should disappear. <item id="11987" type="EtcItem" name="Speed"> <set name="default_action" val="capsule" /> <set name="material" val="PAPER" /> <set name="weight" val="100" /> <set name="is_stackable" val="true" /> <set name="is_oly_restricted" val="true" /> <set name="handler" val="DonateScrolls" /> <set name="item_skill" val="8002-1" /> </item> This code must make the object constant which lies in the inventory and, when using it, imposes a buffer if the value 0 is set in the code. If the value is set to 1, the item puts a buffer and disappears. How to make the code work. You need help.
  3. Indicate first. What version of the acis build? And then ask the question because the xml component of the assembly is different.
  4. Please tell us how to remove _nameColor _titleColor output from AccesLevel. Made a record of nick color and title in the database.
  5. Hello. Please prompt how in acis assembly to make preservation of colour of a title and a nick so that after a log it wasn't made former.
  6. It's all decided. You can close the topic.
  7. I made a sale. CommynityBoard.java else if (command.startsWith("_bbssell")) { player.setIsBBSUse(true); player.sendPacket(new SellList(player)); } Player.java private boolean is_bbs_use = false; public void setIsBBSUse(boolean value) { is_bbs_use = value; } public boolean isBBSUse() { return is_bbs_use; } RequestSellItem.java Replace this. if (merchant == null || !merchant.canInteract(player)) return; using this if ( !player.isBBSUse() && ( merchant == null || !merchant.canInteract( player ) ) ) return; Just one more question. How to make this function player.setIsBBSUse(true) change to player.setIsBBSUse(false) Could be a problem, I guess.
  8. final Npc merchant = (player.getTarget() instanceof Merchant || player.getTarget() instanceof MercenaryManagerNpc) ? (Npc) player.getTarget() : null; if (merchant == null || !merchant.canInteract(player)) return; I'm sorry, but this condition is not working. ((
  9. You can tell me how to make this condition so that it is determined when an NPC and when the CommunityBoard
  10. I guess I have to dig into RequestSellItem, but I can't figure out where...
  11. I did it like this. else if (command.startsWith("_bbssell")) { player.sendPacket(new SellList(player)); } A sales window opens but doesn't sell stuff, and if you come up to any nps, L2Merchant sells. How to do not need a npc?
×
×
  • Create New...