Jump to content

Voqus

Members
  • Posts

    688
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

About Voqus

Contact Methods

  • Website URL
    http://voqus.deviantart.com/

Profile Information

  • Current Mood
    Wacky
  • Gender
    Male
  • Country
    Japan
  • Interests
    Unique

Recent Profile Visitors

1,040 profile views

Voqus's Achievements

Newbie

Newbie (1/16)

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

Recent Badges

0

Reputation

  1. After a long time being absent from gfx, I made this tag as a gift for a guy I met in another forum. Hope you guys like it.
  2. Index: /trunk/L2E_Server/java/com/l2jserver/gameserver/network/serverpackets/ExColosseumFenceInfoPacket.java =================================================================== --- /trunk/L2E_Server/java/com/l2jserver/gameserver/network/serverpackets/ExColosseumFenceInfoPacket.java (revision 126) +++ /trunk/L2E_Server/java/com/l2jserver/gameserver/network/serverpackets/ExColosseumFenceInfoPacket.java (revision 126) @@ -0,0 +1,60 @@ +/* + * 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 com.l2jserver.gameserver.network.serverpackets; + +import com.l2jserver.gameserver.model.actor.instance.L2FenceInstance; + +/** + * Format: (ch)ddddddd + * d: object id + * d: type (00 - no fence, 01 - only 4 columns, 02 - columns with fences) + * d: x coord + * d: y coord + * d: z coord + * d: width + * d: height + */ +public class ExColosseumFenceInfoPacket extends L2GameServerPacket +{ + private static final String _S__FE_03_EXCOLOSSEUMFENCEINFOPACKET = "[S] FE:03 ExColosseumFenceInfoPacket"; + private L2FenceInstance _fence; + + public ExColosseumFenceInfoPacket(L2FenceInstance fence) + { + _fence = fence; + } + + @Override + protected void writeImpl() + { + writeC(0xfe); + writeH(0x03); + + writeD(_fence.getObjectId()); + writeD(_fence.getType()); + writeD(_fence.getX()); + writeD(_fence.getY()); + writeD(_fence.getZ()); + writeD(_fence.getWidth()); + writeD(_fence.getLength()); + } + + @Override + public String getType() + { + return _S__FE_03_EXCOLOSSEUMFENCEINFOPACKET; + } +} Index: /trunk/L2E_Server/java/com/l2jserver/gameserver/model/actor/instance/L2FenceInstance.java =================================================================== --- /trunk/L2E_Server/java/com/l2jserver/gameserver/model/actor/instance/L2FenceInstance.java (revision 126) +++ /trunk/L2E_Server/java/com/l2jserver/gameserver/model/actor/instance/L2FenceInstance.java (revision 126) @@ -0,0 +1,86 @@ +/* + * 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 com.l2jserver.gameserver.model.actor.instance; + +import com.l2jserver.gameserver.model.L2Object; +import com.l2jserver.gameserver.model.actor.L2Character; +import com.l2jserver.gameserver.network.L2GameClient; +import com.l2jserver.gameserver.network.serverpackets.ActionFailed; +import com.l2jserver.gameserver.network.serverpackets.ExColosseumFenceInfoPacket; +import com.l2jserver.gameserver.network.serverpackets.MyTargetSelected; + +public final class L2FenceInstance extends L2Object +{ + private int _type; + private int _width; + private int _length; + + public L2FenceInstance(int objectId, int type, int width, int length) + { + super(objectId); + _type = type; + _width = width; + _length = length; + } + + @Override + public void sendInfo(L2PcInstance activeChar) + { + activeChar.sendPacket(new ExColosseumFenceInfoPacket(this)); + } + + public int getType() + { + return _type; + } + + public int getWidth() + { + return _width; + } + + public int getLength() + { + return _length; + } + + @Override + public boolean isAutoAttackable(L2Character attacker) + { + return false; + } + + public void onActionShift(L2GameClient client) + { + L2PcInstance player = client.getActiveChar(); + if (player == null) + return; + + if (player.getAccessLevel().isGm()) + { + // Set the target of the L2PcInstance player + player.setTarget(this); + + // Send a Server->Client packet MyTargetSelected to the L2PcInstance player + MyTargetSelected my = new MyTargetSelected(getObjectId(), 0); + player.sendPacket(my); + + //player.sendMessage("ObjectId of targeted fence: " + getObjectId()); + } + else + player.sendPacket(ActionFailed.STATIC_PACKET); + } +} Index: /trunk/L2E_Datapack/sql/server/admin_command_access_rights.sql =================================================================== --- /trunk/L2E_Datapack/sql/server/admin_command_access_rights.sql (revision 125) +++ /trunk/L2E_Datapack/sql/server/admin_command_access_rights.sql (revision 126) @@ -609,4 +609,10 @@ ('admin_clanskills',1,'false'), +-- FENCE +('admin_spawnfence','1','false'), +('admin_deletefence','1','false'), +('admin_delefeallfence','1','false'), +('admin_listfence','1','false'), + -- VOICE COMMANDS ('banchat', 7,'false'), @@ -615,6 +621,6 @@ -- BOT REPORT -('admin_checkBots', '1', 'false'), -('admin_readBot', '1', 'false'), -('admin_markBotReaded', '1', 'false'), -('admin_punish_bot', '1', 'false'); +('admin_checkBots', '1','false'), +('admin_readBot', '1', false'), +('admin_markBotReaded', '1','false'), +('admin_punish_bot', '1','false'); Index: /trunk/L2E_Datapack/data/scripts/handlers/admincommandhandlers/AdminSpawn.java =================================================================== --- /trunk/L2E_Datapack/data/scripts/handlers/admincommandhandlers/AdminSpawn.java (revision 125) +++ /trunk/L2E_Datapack/data/scripts/handlers/admincommandhandlers/AdminSpawn.java (revision 126) @@ -15,4 +15,6 @@ package handlers.admincommandhandlers; +import java.util.ArrayList; +import java.util.List; import java.util.NoSuchElementException; import java.util.StringTokenizer; @@ -28,4 +30,5 @@ import com.l2jserver.gameserver.datatables.TeleportLocationTable; import com.l2jserver.gameserver.handler.IAdminCommandHandler; +import com.l2jserver.gameserver.idfactory.IdFactory; import com.l2jserver.gameserver.instancemanager.DayNightSpawnManager; import com.l2jserver.gameserver.instancemanager.InstanceManager; @@ -37,5 +40,7 @@ import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.L2World; +import com.l2jserver.gameserver.model.L2WorldRegion; import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.instance.L2FenceInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.Instance; @@ -46,5 +51,4 @@ import com.l2jserver.gameserver.util.Broadcast; import com.l2jserver.util.StringUtil; - /** @@ -58,28 +62,9 @@ { - private static final String[] ADMIN_COMMANDS = - { - "admin_show_spawns", - "admin_spawn", - "admin_spawn_monster", - "admin_spawn_index", - "admin_unspawnall", - "admin_respawnall", - "admin_spawn_reload", - "admin_npc_index", - "admin_spawn_once", - "admin_show_npcs", - "admin_teleport_reload", - "admin_spawnnight", - "admin_spawnday", - "admin_instance_spawns", - "admin_list_spawns", - "admin_list_positions", - "admin_spawn_debug_menu", - "admin_spawn_debug_print", - "admin_spawn_debug_print_menu" - }; + private static final String[] ADMIN_COMMANDS = { "admin_show_spawns", "admin_spawn", "admin_spawn_monster", "admin_spawn_index", "admin_unspawnall", "admin_respawnall", "admin_spawn_reload", "admin_npc_index", "admin_spawn_once", "admin_show_npcs", "admin_teleport_reload", "admin_spawnnight", "admin_spawnday", "admin_spawnfence", "admin_deletefence", "admin_listfence", "admin_deleteallfence", "admin_instance_spawns", "admin_list_spawns", "admin_list_positions", "admin_spawn_debug_menu", "admin_spawn_debug_print", "admin_spawn_debug_print_menu" }; public static Logger _log = Logger.getLogger(AdminSpawn.class.getName()); - + private static List<L2FenceInstance> _fences = new ArrayList<L2FenceInstance>(); + + @SuppressWarnings("cast") public boolean useAdminCommand(String command, L2PcInstance activeChar) { @@ -96,5 +81,5 @@ StringTokenizer st = new StringTokenizer(command, " "); L2Object target = activeChar.getTarget(); - if(target instanceof L2Npc) + if (target instanceof L2Npc) { try @@ -103,6 +88,6 @@ int type = Integer.parseInt(st.nextToken()); printSpawn((L2Npc) target, type); - if(command.contains("_menu")) - AdminHelpPage.showHelpPage(activeChar, "spawns_debug.htm"); + if (command.contains("_menu")) + AdminHelpPage.showHelpPage(activeChar, "spawns_debug.htm"); } catch (Exception e) @@ -168,27 +153,21 @@ st.nextToken(); int instance = Integer.parseInt(st.nextToken()); - if(instance >= 300000) - { - final StringBuilder html = StringUtil.startAppend(500 + 1000, - "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>", - "<font color=\"LEVEL\">Spawns for "+String.valueOf(instance)+"</font>", - "</td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br>", - "<table width=\"100%\"><tr><td width=200>NpcName</td><td width=70>Action</td></tr>"); + if (instance >= 300000) + { + final StringBuilder html = StringUtil.startAppend(500 + 1000, "<html><table width=\"100%\"><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>", "<font color=\"LEVEL\">Spawns for " + String.valueOf(instance) + "</font>", "</td><td width=45><button value=\"Back\" action=\"bypass -h admin_current_player\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br>", "<table width=\"100%\"><tr><td width=200>NpcName</td><td width=70>Action</td></tr>"); int counter = 0; int skiped = 0; Instance inst = InstanceManager.getInstance().getInstance(instance); - if(inst != null) + if (inst != null) { - for(L2Npc npc : inst.getNpcs()) + for (L2Npc npc : inst.getNpcs()) { - if(!npc.isDead()) + if (!npc.isDead()) { // Only 50 because of client html limitation - if(counter < 50) + if (counter < 50) { - StringUtil.append(html,"<tr><td>"+npc.getName()+"</td><td>", - "<a action=\"bypass -h admin_move_to "+npc.getX()+" "+npc.getY()+" "+npc.getZ()+"\">Go</a>", - "</td></tr>"); - counter++; + StringUtil.append(html, "<tr><td>" + npc.getName() + "</td><td>", "<a action=\"bypass -h admin_move_to " + npc.getX() + " " + npc.getY() + " " + npc.getZ() + "\">Go</a>", "</td></tr>"); + counter++; } else @@ -196,5 +175,5 @@ } } - StringUtil.append(html, "<tr><td>Skipped:</td><td>"+String.valueOf(skiped)+"</td></tr></table></body></html>"); + StringUtil.append(html, "<tr><td>Skipped:</td><td>" + String.valueOf(skiped) + "</td></tr></table></body></html>"); NpcHtmlMessage ms = new NpcHtmlMessage(1); ms.setHtml(html.toString()); @@ -202,5 +181,5 @@ } else - activeChar.sendMessage("Cannot find instance "+instance); + activeChar.sendMessage("Cannot find instance " + instance); } else @@ -249,4 +228,90 @@ GmListTable.broadcastMessageToGMs("Teleport List Table reloaded."); } + else if (command.startsWith("admin_spawnfence")) + { + StringTokenizer st = new StringTokenizer(command, " "); + try + { + st.nextToken(); // command + int type = Integer.parseInt(st.nextToken()); + int width = Integer.parseInt(st.nextToken()); + int length = Integer.parseInt(st.nextToken()); + int height = 1; + if (st.hasMoreTokens()) + height = Math.min(Integer.parseInt(st.nextToken()), 3); + for (int i = 0; i < height; i++) + { + L2FenceInstance fence = new L2FenceInstance(IdFactory.getInstance().getNextId(), type, width, length); + fence.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ()); + //activeChar.sendMessage("Spawned fence with id " + fence.getObjectId()); + _fences.add(fence); + } + } + catch (Exception e) + { + activeChar.sendMessage("Usage: //spawnfence <type> <width> <length> [<height>]"); + } + } + else if (command.startsWith("admin_deletefence")) + { + StringTokenizer st = new StringTokenizer(command, " "); + st.nextToken(); + try + { + L2Object fence = null; + if (activeChar.getTarget() instanceof L2FenceInstance) + { + fence = (L2FenceInstance) activeChar.getTarget(); + } + else if (st.hasMoreTokens()) + { + L2Object object = L2World.getInstance().findObject(Integer.parseInt(st.nextToken())); + if (object instanceof L2FenceInstance) + fence = (L2FenceInstance) object; + } + + if (fence != null) + { + L2WorldRegion region = fence.getWorldRegion(); + fence.decayMe(); + + if (region != null) + region.removeVisibleObject(fence); + + fence.getKnownList().removeAllKnownObjects(); + L2World.getInstance().removeObject(fence); + _fences.remove(fence); + } + else + throw new RuntimeException(); + } + catch (Exception e) + { + activeChar.sendMessage("No fence targeted with shift+click or //deletefence <fence_objectId>"); + } + } + else if (command.startsWith("admin_deleteallfence")) + { + for (L2FenceInstance fence : _fences) + { + L2WorldRegion region = fence.getWorldRegion(); + fence.decayMe(); + + if (region != null) + region.removeVisibleObject(fence); + + fence.getKnownList().removeAllKnownObjects(); + L2World.getInstance().removeObject(fence); + } + _fences.clear(); + activeChar.sendMessage("All fences removed."); + } + else if (command.startsWith("admin_listfence")) + { + activeChar.sendMessage("Spawned fences:"); + for (L2FenceInstance fence : _fences) + activeChar.sendMessage("Fence id: " + fence.getObjectId() + " coords: " + fence.getX() + " " + fence.getY() + " " + fence.getZ()); + } + else if (command.startsWith("admin_spawn_monster") || command.startsWith("admin_spawn")) { @@ -295,5 +360,5 @@ activeChar.sendMessage("Command format is //list_spawns <npcId|npc_name> [tele_index]"); } - if(command.startsWith("admin_list_positions")) + if (command.startsWith("admin_list_positions")) SpawnTable.getInstance().findNPCInstances(activeChar, npcId, teleportIndex, true); else @@ -315,16 +380,16 @@ int z = target.getSpawn().getLocz(); int h = target.getSpawn().getHeading(); - switch(type) + switch (type) { default: case 0: - _log.info("('',1,"+i+","+x+","+y+","+z+",0,0,"+h+",60,0,0),"); - break; + _log.info("('',1," + i + "," + x + "," + y + "," + z + ",0,0," + h + ",60,0,0),"); + break; case 1: - _log.info("<spawn npcId=\""+i+"\" x=\""+x+"\" y=\""+y+"\" z=\""+z+"\" heading=\""+h+"\" respawn=\"0\" />"); - break; + _log.info("<spawn npcId=\"" + i + "\" x=\"" + x + "\" y=\"" + y + "\" z=\"" + z + "\" heading=\"" + h + "\" respawn=\"0\" />"); + break; case 2: - _log.info("{ "+i+", "+x+", "+y+", "+z+", "+h+" },"); - break; + _log.info("{ " + i + ", " + x + ", " + y + ", " + z + ", " + h + " },"); + break; } } @@ -398,10 +463,5 @@ { L2NpcTemplate[] mobs = NpcTable.getInstance().getAllMonstersOfLevel(level); - final StringBuilder tb = StringUtil.startAppend(500 + mobs.length * 80, - "<html><title>Spawn Monster:</title><body><p> Level : ", - Integer.toString(level), - "<br>Total Npc's : ", - Integer.toString(mobs.length), - "<br>"); + final StringBuilder tb = StringUtil.startAppend(500 + mobs.length * 80, "<html><title>Spawn Monster:</title><body><p> Level : ", Integer.toString(level), "<br>Total Npc's : ", Integer.toString(mobs.length), "<br>"); // Loop @@ -421,10 +481,5 @@ { L2NpcTemplate[] mobs = NpcTable.getInstance().getAllNpcStartingWith(starting); - final StringBuilder tb = StringUtil.startAppend(500 + mobs.length * 80, - "<html><title>Spawn Monster:</title><body><p> There are ", - Integer.toString(mobs.length), - " Npcs whose name starts with ", - starting, - ":<br>"); + final StringBuilder tb = StringUtil.startAppend(500 + mobs.length * 80, "<html><title>Spawn Monster:</title><body><p> There are ", Integer.toString(mobs.length), " Npcs whose name starts with ", starting, ":<br>"); // Loop Index: /trunk/L2E_Datapack/data/scripts/hellbound/Engine.java =================================================================== --- /trunk/L2E_Datapack/data/scripts/hellbound/Engine.java (revision 125) +++ /trunk/L2E_Datapack/data/scripts/hellbound/Engine.java (revision 126) @@ -48,5 +48,5 @@ private static final int[] MAX_TRUST = { - 0, 300000, 600000, 1000000, 1010000, 1400000, 1490000, 2000000, 2000001, 2500000, 4000000, 0 } + 0, 300000, 600000, 1000000, 1010000, 1400000, 1490000, 2000000, 2000001, 2500000, 4000000 }; Index: /trunk/L2E_Datapack/data/scripts/hellbound/BaseTower/BaseTower.java =================================================================== --- /trunk/L2E_Datapack/data/scripts/hellbound/BaseTower/BaseTower.java (revision 125) +++ /trunk/L2E_Datapack/data/scripts/hellbound/BaseTower/BaseTower.java (revision 126) @@ -62,4 +62,5 @@ } + @Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { This is what you're asking for, got this 4 years back from my project. You can adapt it and work on it instead of doing it from scratch.
  3. It also depends on pack, for example l2j transfered to git as far as i know so you may need to install Gradle/Git as well. If it's not l2j and does not use gradle/git then do what SweeTs said, as an alternative for subclipse you can also install Eclipse Subversive .
  4. said the guy who used OS username cheap comparison to change the variable value. We both cheated. :happyforever:
  5. I simply deleted your if statement and set my selectedNumber to 13 good sir. *check the console message*
  6. :you serious?:
  7. Hello there buds, it's been 4-5 months since i last submitted, i know, but i've had a lot of stuff going on iRL. Hope i haven't lost my edge and hope you like it.
  8. Unfortunately, that seems to be the case.
  9. I've never smoked weed, and never will. Cigarettes i've smoked, addicted, and quitted for life. Most people 18-20+ smoke just because they started to smoke at some age just to look cool or for the fun of it, and eventually turned into a bad habbit.
  10. On that matter, i suffer along with you. Not too long ago i was paid to write an application for someone who was attending to a college here in greece(paid university degree) while they had every knowledge they needed, he just didn't pay any attention to his classes. But not all of them are like that, keep in mind that many bright people in history(whatever part of it you want to refer to) were greeks.
  11. About the university part, here in greece as in most countries teenagers want to have fun. They do not focus on studying because there's a big difference in education between greece and other countries. In greece kindergarden - high school and EVEN university education is FREE, on the contrary with other countries. And that's why they haven't learn to appreciate this oportunity(not all of them, but most of them), by your point of view you can describe it as lazyness. (edit: even msc, ph.D is free)
  12. The majority of this forum's users is greeks. What you said cannot be taken as troll, but as a provocation hence the - reputation.
  13. Ideas are good so far. But i'd suggest you work on the clan system a bit more or it will just end up on the classic one-clan-each-faction on the server. Edit: A quick idea, revert double-war effect to default clan member vs other factions to give X clan points for each kill.
  14. If you want to add effect on the people that are INSIDE an area, you dont really need to check radius but just check if the player is in that zone. So, while he is in that zone he receives the effect. snippet ex. while(player.isInsidePvPZone()){ // i do not know if the method exists in your pack. startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE);} //this will give non stop magic_circle effect on the player while he is inside the pvp zone. If you want to add effect on the people that get close to a NPC for example, there you need to use isInsideRadius method of the npc and the player. And then of course invoke the effect on the player that is actually inside the radius. int _range = 800; if(isInsideRadius(player,npc,_range)) // i do not know if the method exists in your pack. { startAbnormalEffect(AbnormalEffect.MAGIC_CIRCLE); } Last, i do not know if these methods exist or not, but thats a logic approach i believe.
×
×
  • Create New...