Jump to content
MMO Society

Search the Community

Showing results for tags 'teleporter'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News and Announcements
    • News
  • General
    • Suggestions & Feedback
    • General Chat
    • GFX
    • VFX
  • MMO Hub
    • Gamer's Lounge
    • Member's Lounge
    • Developer Lounge
    • Premium Lounge
  • MMO Corner
    • World of Warcraft
    • Lineage 2
    • Minecraft
    • Host Listing
    • Server Listing
    • Server Recruitment
    • Server Reviews
    • The Underground
  • User Hub
    • Support
    • Report
    • Contact Staff
  • Merchant Corner
    • Marketplace
  • General Development Releases
  • Wasteland

Categories

  • Creative Corner
    • GFX Releases
    • VFX Releases
    • Resources
  • MMO and MMORPG
    • World of Warcraft
    • Lineage 2
    • Minecraft
  • Webmasters
    • Content Management Systems
    • Addons
    • Scripts
    • Designs
    • HTML
  • Applications
  • Marketplace
    • Marsh Designs
    • iDarts

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. Images Preview: P.S. Preview Images are from the original code for H5 this code is adapted to aCis, it's tested and working! Core Part: [hide] diff --git config/custom.properties config/custom.properties +++ config/custom.properties @@ -0,0 +1,33 @@ +#============================================================= +# Npc Party Teleporter +#============================================================= +# Enable the Character Killing Monuments +# NPC Id +NpcPtTeleporterId= 36613 + +# Teleport coordinates +PtTeleportX = -56781 +PtTeleportY = 140545 +PtTeleportZ = -2629 + +# ZoneId NpcPtZoneID default: 911 +# Select the id of your zone. +# If you dont know how to find your zone id is simple. +# Go to data/zones/(your zone file).xml and find your zone +# E.g: <zone name="dion_monster_pvp" id="6" type="ArenaZone" shape="NPoly" minZ="-3596" maxZ="0"> +NpcPtZoneID = 255 + +# Min party members +NpcPtMinPartyMembers = 2 + +# Consume Item Id +NpcPtConsumeItemId = 57 + +# Consume Item Quantity +NpcPtConsumeItemQt = 100 + +# Show Inside players in zone +NpcPtShowInsidePlayers = True + +# Show Inside Parties in zone +NpcPtShowInsideParties = True \ No newline at end of file diff --git java/net/sf/l2j/Config.java java/net/sf/l2j/Config.java new file mode 100644 index 0000000..477b1a3 --- /dev/null +++ java/net/sf/l2j/Config.java @@ -0,0 +1,1513 @@ + public static final String CUSTOM_FILE = "./config/custom.properties"; + + // -------------------------------------------------- + // Custom settings + // -------------------------------------------------- + public static int NPC_ID_PT_TELEPORTER; + public static int NPC_PT_TELEPORTER_X; + public static int NPC_PT_TELEPORTER_Y; + public static int NPC_PT_TELEPORTER_Z; + public static int NPC_PT_ZONEID; + public static int NPC_PT_MINPT_MEMBERS; + public static int NPC_PT_ITEMCONSUME_ID; + public static int NPC_PT_ITEMCOMSUME_QT; + public static boolean NPC_PT_SHOWINSIDE_PLAYERS; + public static boolean NPC_PT_SHOWINSIDE_PARTIES; + FLOOD_PROTECTOR_SENDMAIL = new FloodProtectorConfig("SendMailFloodProtector"); FLOOD_PROTECTOR_CHARACTER_SELECT = new FloodProtectorConfig("CharacterSelectFloodProtector"); _log.info("Loading gameserver configuration files."); + // Custom settings + ExProperties custom = load(CUSTOM_FILE); + NPC_ID_PT_TELEPORTER = custom.getProperty("NpcPtTeleporterId", 36614); + NPC_PT_TELEPORTER_X = custom.getProperty("PtTeleportX", -56742); + NPC_PT_TELEPORTER_Y = custom.getProperty("PtTeleportY", 140569); + NPC_PT_TELEPORTER_Z = custom.getProperty("PtTeleportZ", -2625); + NPC_PT_ZONEID = custom.getProperty("NpcPtZoneID", 155); + NPC_PT_MINPT_MEMBERS = custom.getProperty("NpcPtMinPartyMembers", 2); + NPC_PT_ITEMCONSUME_ID = custom.getProperty("NpcPtConsumeItemId", 57); + NPC_PT_ITEMCOMSUME_QT = custom.getProperty("NpcPtConsumeItemQt", 100); + NPC_PT_SHOWINSIDE_PLAYERS = custom.getProperty("NpcPtShowInsidePlayers", true); + NPC_PT_SHOWINSIDE_PARTIES = custom.getProperty("NpcPtShowInsideParties", true); + // Clans settings ExProperties clans = load(CLANS_FILE); diff --git java/net/sf/l2j/gameserver/model/actor/instance/L2PartyTeleporterInstance.java java/net/sf/l2j/gameserver/model/actor/instance/L2PartyTeleporterInstance.java +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PartyTeleporterInstance.java @@ -0,0 +1,234 @@ +package net.sf.l2j.gameserver.model.actor.instance; + +import java.util.StringTokenizer; + +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.datatables.ItemTable; +import net.sf.l2j.gameserver.instancemanager.ZoneManager; +import net.sf.l2j.gameserver.model.L2Party; +import net.sf.l2j.gameserver.model.actor.L2Character; +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; +import net.sf.l2j.gameserver.model.zone.L2ZoneType; +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; +import net.sf.l2j.gameserver.network.serverpackets.InventoryUpdate; +import net.sf.l2j.gameserver.network.serverpackets.ItemList; +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; +import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate; + + +/** + * @author `Heroin Adapter Gandalf PartyTeleporter, Lucas Fernandes + */ +public class L2PartyTeleporterInstance extends L2NpcInstance +{ + private static final int npcid = Config.NPC_ID_PT_TELEPORTER; // npc id + // ------------------------------------- + // Teleport Location Coordinates X,Y,Z. + // Use /loc command in game to find them. + private static final int locationX = Config.NPC_PT_TELEPORTER_X; // npc id + private static final int locationY = Config.NPC_PT_TELEPORTER_Y; // npc id + private static final int locationZ = Config.NPC_PT_TELEPORTER_Z; // npc id + // ------------------------------------- + // ------------------------------------- + // Select the id of your zone. + // If you dont know how to find your zone id is simple. + // Go to data/zones/(your zone file).xml and find your zone + // E.g: <zone name="dion_monster_pvp" id="6" type="ArenaZone" shape="NPoly" minZ="-3596" maxZ="0"> + /** The id of your zone is id="6" */ + /** --------------------------------------------------------------------------- */ + /** WARNING: If your zone does not have any id or your location is not on any zone in data/zones/ folder, you have to add one by your self */ // required to calculate parties & players + /** --------------------------------------------------------------------------- */ + private static final int ZoneId = Config.NPC_PT_ZONEID; // Here you have to set your zone Id + // ------------------------------------- + private static final int MinPtMembers = Config.NPC_PT_MINPT_MEMBERS; // Minimum Party Members Count For Enter on Zone. + private static final int ItemConsumeId = Config.NPC_PT_ITEMCONSUME_ID; // Item Consume id. + private static final int ItemConsumeNum = Config.NPC_PT_ITEMCOMSUME_QT; // Item Consume Am.ount. + private static final boolean ShowPlayersInside = Config.NPC_PT_SHOWINSIDE_PLAYERS; // If you set it true, NPC will show how many players are inside area. + private static final boolean ShowPartiesInside = Config.NPC_PT_SHOWINSIDE_PARTIES; // If you set it true, NPC will show how many parties are inside area. + private static String ItemName = ItemTable.getInstance().getTemplate(ItemConsumeId).getName(); // Item name, Dont Change this + private String htmContent; + + public L2PartyTeleporterInstance(int objectId, NpcTemplate template) + { + super(objectId, template); + } + + @Override + public void onBypassFeedback(L2PcInstance player, String command) + { + player.sendPacket(ActionFailed.STATIC_PACKET); + + StringTokenizer st = new StringTokenizer(command, " "); + String actualCommand = st.nextToken(); // Get actual command + + if (actualCommand.equalsIgnoreCase("partytp")) + { + TP(player); + } + super.onBypassFeedback(player, command); + } + + public int getPartiesInside(int zoneId)// Calculating parties inside party area. + { + int i = 0; + for (L2ZoneType zone : ZoneManager.getInstance().getZones(locationX, locationY, locationZ)) + { + if (zone.getId() == zoneId) + { + for (L2Character character : zone.getCharactersInside()) + { + if ((character instanceof L2PcInstance) && (!((L2PcInstance) character).getClient().isDetached()) && (((L2PcInstance) character).getParty() != null) && ((L2PcInstance) character).getParty().isLeader((L2PcInstance) character)) + { + i++; + } + } + } + } + return i; + } + + public int getPlayerInside(int zoneId)// Calculating players inside party area. + { + int i = 0; + for (L2ZoneType zone : ZoneManager.getInstance().getZones(locationX, locationY, locationZ)) + { + if (zone.getId() == zoneId) + { + for (L2Character character : zone.getCharactersInside()) + { + if ((character instanceof L2PcInstance) && (!((L2PcInstance) character).getClient().isDetached())) + { + i++; + } + } + } + } + return i; + } + + private static boolean PartyItemsOk(L2PcInstance player) + // Checks if all party members have the item in their inventory. + // If pt member has not enough items, party not allowed to enter. + { + try + { + for (L2PcInstance member : player.getParty().getPartyMembers()) + { + if (member.getInventory().getItemByItemId(ItemConsumeId) == null) + + { + player.sendMessage("Your party member " + member.getName() + " does not have enough items."); + return false; + } + if (member.getInventory().getItemByItemId(ItemConsumeId).getCount() < ItemConsumeNum) + { + player.sendMessage("Your party member " + member.getName() + " does not have enough items."); + return false; + } + } + return true; + + } + catch (Exception e) + { + player.sendMessage("Something went wrong try again."); + return true; + } + } + + private static void proccessTP(L2PcInstance player) // Teleporting party members to zone + { + for (L2PcInstance member : player.getParty().getPartyMembers()) + { + member.teleToLocation(locationX, locationY, locationZ, 1);// Location X, Y ,Z + } + } + + private static void TP(L2PcInstance player) // Teleport player & his party + { + try + { + L2Party pt = player.getParty(); + if (pt == null) + { + player.sendMessage("You are not currently on party."); + return; + } + if (!pt.isLeader(player)) + { + player.sendMessage("You are not party leader."); + return; + } + if (pt.getMemberCount() < MinPtMembers) + { + player.sendMessage("You are going to need a bigger party " + "in order to enter party area."); + return; + } + if (!PartyItemsOk(player)) + { + return; + } + proccessTP(player); + for (L2PcInstance ppl : pt.getPartyMembers()) + { + if (ppl.getObjectId() != player.getObjectId()) // Dont send this message to pt leader. + { + ppl.sendMessage("Your party leader asked to teleport on party area!");// Message only to party members + } + ppl.sendMessage(ItemConsumeNum + " " + ItemName + " have been dissapeared.");// Item delete from inventory message + ppl.getInventory().destroyItemByItemId("Party_Teleporter", ItemConsumeId, ItemConsumeNum, ppl, ppl);// remove item from inventory + ppl.sendPacket(new InventoryUpdate());// Update + ppl.sendPacket(new ItemList(ppl, false));// Update + ppl.sendPacket(new StatusUpdate(ppl));// Update + + } + // Sends message to party leader. + player.sendMessage((ItemConsumeNum * player.getParty().getMemberCount()) + " " + ItemName + " dissapeard from your party."); + + } + catch (Exception e) + { + player.sendMessage("Something went wrong try again."); + } + } + + @Override + public void showChatWindow(L2PcInstance player) + { + final int npcId = Config.NPC_ID_PT_TELEPORTER; + if (npcId == npcid) + { + htmContent = "data/html/mods/PartyTeleporter/PartyTeleporter.htm"; + if (htmContent != null) + { + final NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId()); + npcHtmlMessage.setHtml(htmContent); + npcHtmlMessage.replace("%objectId%", String.valueOf(getObjectId())); + npcHtmlMessage.replace("%player%", player.getName());// Replaces %player% with player name on html + npcHtmlMessage.replace("%itemname%", ItemName);// Item name replace on html + npcHtmlMessage.replace("%price%", player.getParty() != null ? "" + (ItemConsumeNum * player.getParty().getMemberCount()) + "" : "0");// Price calculate replace + npcHtmlMessage.replace("%minmembers%", "" + MinPtMembers);// Mimum entry party members replace + npcHtmlMessage.replace("%allowed%", isAllowedEnter(player) ? "<font color=00FF00>allowed</font>" : "<font color=FF0000>not allowed</font>");// Condition checker replace on html + npcHtmlMessage.replace("%parties%", ShowPartiesInside ? "<font color=FFA500>Parties Inside: " + getPartiesInside(ZoneId) + "</font><br>" : "");// Parties inside + npcHtmlMessage.replace("%players%", ShowPlayersInside ? "<font color=FFA500>Players Inside: " + getPlayerInside(ZoneId) + "</font><br>" : "");// Players Inside + player.sendPacket(npcHtmlMessage); + } + + player.sendPacket(ActionFailed.STATIC_PACKET); + } + } + + private static boolean isAllowedEnter(L2PcInstance player) // Checks if player & his party is allowed to teleport. + { + if (player.getParty() != null) + { + if ((player.getParty().getMemberCount() >= MinPtMembers) && PartyItemsOk(player)) // Party Length & Item Checker + { + return true; + } + return false; + } + return false; + } + +} \ No newline at end of file [/hide] DP Part: [hide] +++ data/html/mods/PartyTeleporter/PartyTeleporter.htm @@ -0,0 +1,21 @@ +<html> +<title>%player%</title> +<body><center> +<center> +You have to be a party leader in order to ask from me to teleport you and your party inside party area.<br> +Minimum number of members in party: <font color="LEVEL">%minmembers%</font>.<br> +You are currently %allowed% to enter party area with your party.<br> +Party teleport will cost you total: <font color="LEVEL">%price% %itemname%</font><br> +</center> +<center> +%parties% +%players% + +<table><tr> +<td><a action="bypass -h npc_%objectId%_partypt">Teleport me & My party!</td> +</tr></table> + + +<br><br> +<center> +</body></html> \ No newline at end of file diff --git data/xml/npcs/36000-36099.xml data/xml/npcs/36000-36099.xml +++ data/xml/npcs/36000-36099.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<list> + <npc id="36613" name="Hector" title=""> + <set name="level" val="67"/> + <set name="radius" val="8"/> + <set name="height" val="24"/> + <set name="rHand" val="128"/> + <set name="lHand" val="628"/> + <set name="type" val="L2PartyTeleporter"/> + <set name="exp" val="449"/> + <set name="sp" val="1"/> + <set name="hp" val="2295.48154"/> + <set name="mp" val="1251"/> + <set name="hpRegen" val="7.5"/> + <set name="mpRegen" val="2.7"/> + <set name="pAtk" val="624.93199"/> + <set name="pDef" val="281.55251"/> + <set name="mAtk" val="426.74754"/> + <set name="mDef" val="206.02791"/> + <set name="crit" val="4"/> + <set name="atkSpd" val="253"/> + <set name="str" val="40"/> + <set name="int" val="21"/> + <set name="dex" val="30"/> + <set name="wit" val="20"/> + <set name="con" val="43"/> + <set name="men" val="20"/> + <set name="corpseTime" val="7"/> + <set name="walkSpd" val="50"/> + <set name="runSpd" val="195"/> + <set name="dropHerbGroup" val="0"/> + <set name="attackRange" val="40"/> + <ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" clan="door_clan;mercenary_siege_clan" clanRange="1200" canMove="true" seedable="false"/> + <skills> + <skill id="4045" level="1"/> + <skill id="4416" level="23"/> + </skills> + </npc> + </list> \ No newline at end of file [hide] Credits for the original code `Heroin Adapter Gandalf PartyTeleporter, Lucas Fernandes Enjoy!
  2. How to make an SQL teleporter with SmartAI In HeidiSQL Hi there today I am going to show you how to make an SQL teleporter with smartai – during this I will provide demonstrational images of what it should look like in the database. Firstly you are going to need to make a new gossip NPC in the creature_template section of your database to do this you can follow my other guide located: https://www.lordcraft.net/index.php/topic/3599-creating-a-npc-in-heidisql Remember to make a gossip NPC you will need to set the field “npcflag” to 1. Now that you have created your NPC let’s search for an ID in the gossip_menu_option that is not being used. For this tutorial I am going to choose the ID 51899. So now in the creature_template I am going to put that ID (51899) in the field called gossip_menu_id. Now, we need to start setting up the gossip_menu_option section of the teleporter, so let’s navigate to that table in the database and select “Data View”. You will now see all of the gossip_menu_option data. As you can see you have the following fields: From here we are going to create a new record by clicking on the button. Menu_ID: This is where we are going to put in the ID for our gossip (remember we chose to use ID 51899) so in this field we put in 51899 ID: In here we are going to put a 1. Should you wish to add more then I shall show you how to do this later on in the tutorial (but should you want more, then the ID would increase by 1 each time) Option_Icon: So in here you can put a number that determines what sort of icon that will be shown. You can use the following table to decide what icon you would like to use. For this tutorial I am just going to set it to 0. Option_Text: This is the text that you want to show on your gossip when you talk to the NPC. In here for the sake of this tutorial I am going to put the text “Sanctuary”. OptionBroadcastTextId: Just set this to 0. Option_ID: Now we need to make sure that the gossip_menu_option shows in the NPC so we have to set this field to 1. Npc_Option_NPCFlag: This field needs to show that the NPC that we are applying the gossip_menu_option to is a gossip NPC so in here we put a 1. Action_Menu_ID: Here we can do a couple of things; we can set it to 0, or for example - say we had named this one “Cities” and wanted to have it open a sub menu where the cities would be listed - then we can place the Menu_Id for that list to show. For the case of this tutorial we are simply going to set this to 0. Action_POI_ID: Set this to 0. Box_Coded: Set this to 0. Box_Money: In here you can set a cost/price. For example if you wanted the cost of travelling to Dalaran to be 1g then you would set it here. For this tutorial though I am not going to set a cost so I will simply put “0” in here. Box_Text: This is where you would put a confirmation – for example if I was to put in this field “Are you sure you want to travel to Sanctuary” then this message would come up and ask the player to accept whether they want to travel to Sanctuary or not. BoxBroadcastTextID: Set this to 0.   Well now that we have set up our first gossip_menu_option let me explain how to go about adding more. When adding more you would have to repeat the process but the ID field will change. In the first one that we created we placed a number 1 for the next one we would use the same Menu_ID but for the ID we would make it number 2 (+1 for each gossip_menu_option you make) until you have made all the menu’s that you want to show on that page. Referring to a sub menu: If you have created a menu that will then direct to another menu then you will need to use a new Menu_ID and then start with the ID set as 1 again. As you can see in the example that I have placed above, I have a main menu that then directs to a sub menu. In this, I have 13 options to choose from. The action_menu_id in this case points to a new selection of options except number 13 which has a 0 for the action_menu-id this is because I want this one so when players click on it they will be teleported instead of being taken to a different menu selection. Please also notice that in the option_text I have the name “Sanctuary” for example, that points to a new menu however in mine it shows as |TInterface/icons/Spell_Holy_Fanaticism:25|t |rSantuary. You don’t have to put the |TInterface/icons/Spell_Holy_Fanaticism:25|t |r piece in this just shows a picture icon before the name “Sanctuary”. If you want to have icons then you will need to put |TInterface/icons/Spell_Holy_Fanaticism:25|t |r this in. The icons are changeable and you can find the icons here: http://wowprogramming.com/utils/artbrowser/Interface/ICONS.list. To choose the icon you wish to use I suggest you open the one you wish to use in a new tab, then in the navigation bar you would copy the highlighted part only. See the example below: Should you want to change the icon then you will need to replace where it says “Spell_Holy_Fanaticism” with the text “ABILITY_POISON” as seen highlighted in the image above. You don’t have to use the icons and you can just leave the field with the word “Sanctuary”. Setting the smart_script First of all, let us take a look at the fields in the smart_scripts and I will explain how to set this up as we go along. We are now going to use the gossip_menu_option that you created to make the smart_script. As you may remember, we didn’t set the gossip_menu_option up to be a menu to then go to a sub menu. Entryorguid: In here you will need to set the value to your creature/NPC ID. Source_type: Just set this to 0. ID: This works in the same way as the field ID in the gossip_menu_option, for this we are going to use 1. If you want to add any more then it would increase by 1. Link: Set this to 0. Event_type: Set this to 62. This tells the script that it is activated on gossip select. Event_phase_mask: Set this to 0. Event_chance: Set this to 100. This makes sure that the event happens 100% of the time when the gossip menu is clicked. Event_flag: Set this to 0. Event_param1: This is the gossip_menu_option. In this case it would be set to 51899. Event_param2: This is the gossip_menu_option (Id Field). So in this case it would be set to 1. Event_param3: Set this to 0. Event_param4: Set this to 0. Action_type: Set this to 62. This now tells it that it is a teleport when the menu is clicked. Action_param1: For this you will need to go in-game and get the map ID by typing .gps - Set this field to the map ID for where you want the players to spawn. At this time it would be worth writing down the XYZ coordinates and the orientation or getting a screenshot as you will need these later. As you can see in the image above the map is 1 so if I wanted this as my location I would put a 1 in the Action_param1 and then set the target_x, target_y, target_z with the XYZ coordinates and the target_o to the orientation. Action_param2: Set to 0. Action_param3: Set to 0. Action_param4: Set to 0. Action_param5: Set to 0. Action_param6: Set to 0. Target_type: Set this to 7 (Action Invoker). This now tells it that when the player clicks that menu that they will be teleported. Now you have to continue through the tutorial and set up the target locations. Target_param1: Set to 0. Target_param2: Set to 0. Target_param3: Set to 0. Target_x: This is the x coordinate from doing the command .gps in-game. (This should be easy if you wrote it down as suggested when you got the map id.) Target_y: This is the y coordinate from doing the command .gps in-game. (This should be easy if you wrote it down as suggested when you got the map id.) Target_z: This is the z coordinate from doing the command .gps in-game. (This should be easy if you wrote it down as suggested when you got the map id.) Target_o: This is the orientation from doing the command .gps in game. (This should be easy if you wrote it down as suggested when you got the map id.) Comment: In here put a comment that will help you to find the script again should you ever want or need to change anything. For the sake of this tutorial I will be setting the comment to “Sanctuary Teleport” Once you have done that make sure to save the script in your database. Either click on the Green tick or on the row above. You have now added the first gossip_menu_option: “Sanctuary” and made it so when a player uses your teleporter NPC to click on the menu: “Sanctuary” then they will be teleported to the XYZ location that you have set. REMEMBER: AFTER ADDING GOSSIP_MENU_OPTION YOU WILL NEED TO GO IN-GAME AND USE THE COMMAND .RELOAD GOSSIP_MENU_OPTION. AFTER ADDING THE SMART_SCRIPT YOU WILL HAVE TO RESTART YOUR SERVER TO LOAD IT IN. //Tutorial By DPCoder //Lordcraft.net Special Thanks Katos for reading through the tutorial and checking
×
×
  • Create New...