The teleport NPC lets you turn any NPC in the game into a "teleport station". The player clicks the NPC, a window appears to choose a destination; each destination can charge Zen and require a minimum level, reset count or VIP. The destination can be on the same sub-server or on a different sub-server.
Requirements
- The
PluginPlusfeature has been purchased andData\Plugin\Plugin.inihasPluginPlus = 1(see PluginPlus). Enable="1"inData\Plugin\NPCMoveMap.xml. If any of the three conditions is missing, the system is completely disabled (the NPC still stands there but opens nothing).- The client needs the new
Main.dlland two interface files:Data\Interface\GFx\NpcMoveMsg.ozg(message box style) andData\Interface\GFx\NpcMoveList.ozg(list style).
How to set up a teleport NPC
- Choose an NPC in
Data\Monster\MonsterList.xml(typeType = 4), for example ID583. - Make the NPC appear in
Data\Monster\MonsterSpawn.xmlwith the attributeNpcFunction="npc_move_map":<Spawn Index="583" StartX="130" StartY="123" Dir="3" NpcFunction="npc_move_map" /> - Add an
<Npc Index="583">block inNPCMoveMap.xml. Every spawn point of that NPC ID that hasNpcFunction="npc_move_map"shares this configuration. - Click the Reload plugin button in the GameServer control panel.
Configuration
File: Data\Plugin\NPCMoveMap.xml. Comments must not be written inside tags.
NPCMoveMap tag
| Key | Value | Default | Meaning |
|---|---|---|---|
Enable | 0 / 1 | 0 (when the attribute is missing) | Disables / enables the whole system. |
Npc tag
| Key | Value | Default | Meaning |
|---|---|---|---|
Index | number ≥ 0 | -1 (block is skipped) | NPC ID in MonsterList.xml. A block with a negative Index is skipped. |
Ui | 1 or 2 | 1 | Window style. 1 = message box (title + content + OK / Cancel buttons; OK teleports to the FIRST <Move>). 2 = list (a command window opens on the left of the screen, draggable; each <Move> is a button; the Text content is not shown). Any value other than 2 is treated as 1. |
Title | string | empty | Window title (up to 1000 bytes). |
Text | UTF-8 string | empty | Window content; /n = line break (up to 1000 bytes). |
Each <Npc> reads up to 11 <Move> tags (the number of buttons in the list window); extra tags are ignored. An <Npc> block with no valid <Move> is skipped and an error is written to the log.
Move tag
| Key | Value | Default | Meaning |
|---|---|---|---|
Name | string | empty | Text on the button (Ui="2" style); up to 60 bytes. |
Server | sub-server code, or -1 | -1 | Code of the sub-server to move to (ServerCode in GameServer.conf). -1 = the sub-server that holds that map (the current server itself if the map is located here). |
Gate | gate ID, or -1 | -1 | Gate ID in Data\World\GateTemplate.xml; a gate already has its map and coordinates. -1 = do not use a gate. When using Gate, do NOT write Map / X1 / Y1 / X2 / Y2: if both are written, GameServer writes an error to the log and uses Gate. A gate that does not exist → this destination is skipped. |
Map | map number | -1 | Used only when Gate = -1. If neither Gate nor Map is present → the destination is skipped. |
X1, Y1 | coordinates | 0 | First corner of the destination area (only when Gate = -1). |
X2, Y2 | coordinates | equal to X1 / Y1 | Last corner of the area. The character appears at a random walkable cell within the area. |
Zen | number ≥ 0 | 0 | Zen fee; 0 = free. When moving to a different sub-server, the Zen is deducted once the login server accepts the move. |
MinLevel | number | 0 | Minimum level (normal level + master / majestic level); 0 = no requirement. |
MinReset | number | 0 | Minimum reset count; 0 = no requirement. |
VIP | VIP ID, or -1 | -1 | Minimum VIP (ID in Data\VIPSystem.xml); -1 = no VIP needed. |
Conditions when the player selects a destination
In order: level, reset, VIP, enough Zen, then not being in self-defense state. In addition, the server rejects the request (silently, only writing a log) if the NPC is not near the player, or if the player is dead / respawning / teleporting.
Configuration example
<NPCMoveMap Enable="1">
<Npc Index="583" Ui="2" Title="Travel" Text="Where do you want to go?">
<Move Name="Lorencia" Server="-1" Gate="17" Zen="0" MinLevel="0" MinReset="0" VIP="-1" />
<Move Name="Noria" Server="-1" Gate="27" Zen="1000" MinLevel="10" MinReset="0" VIP="-1" />
<Move Name="Loren Market" Server="-1" Gate="-1" Map="79" X1="56" Y1="74" X2="58" Y2="77" Zen="0" MinLevel="0" MinReset="0" VIP="-1" />
</Npc>
<Npc Index="584" Ui="1" Title="Julia" Text="If you go to the market in Lorencia,/nyou'll find many items you need.../nWould you like to go to the market?">
<Move Name="Loren Market" Server="-1" Gate="333" Zen="0" MinLevel="0" MinReset="0" VIP="-1" />
</Npc>
</NPCMoveMap>
Error messages (Lang)
The red messages sent to the player are in the NPCMoveMap section of the Data\Lang\*.xml files:
| ID | Content (English) | When |
|---|---|---|
| 1 | You need level %d to move. | Level too low (MinLevel) |
| 2 | You need %d resets to move. | Not enough resets (MinReset) |
| 3 | You need VIP %d to move. | VIP too low |
| 4 | You need %d zen to move. | Not enough Zen |
| 5 | You can't move while self defense is active. | In self-defense |
| 6 | This destination is not available. | Destination gate / map does not exist |
Reloading the configuration
Click Reload plugin in the GameServer control panel. At startup, the file is loaded after GateTemplate.xml has been loaded (to validate Gate). The log writes a line [NPCMoveMap] NPCMoveMap.xml loaded ... showing the Enable state, PluginPlus and the number of NPCs.