Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Tutorial]Edit and Create Teleport Option

Experienced Elementalist
Joined
Jun 9, 2013
Messages
297
Reaction score
86
1° Create a new NPC ID in (Data/system/NPC.XML) and (GameServerData/system/NPC.xml)
Code:
<NPC id="123" Name="NewNPC" Grade="3" Type="npc" MeshPath="NPC/hm_fighter" MeshName="hm_fighter" VoiceType="male3" AniPrefix="none_" IdleAni="idle_npc2" MinLevel="8" MaxLevel="8" MaxHP="800" AP="440" MagicAP="456" FireAP="440" ColdAP="440" LightningAP="440" PoisonAP="440" HolyAP="440" UnholyAP="440" ArmorType="neutral" AutoAssist="False" SightRange="0" Huge="False" Speed="170" RunSpeed="450" RotateSpeed="0" Rooted="False" Attackable="NONE" CounterAttack="False" AA="NONE" Scale="1" Interact="True" AlignTerrain="False" BeatenModValue="1" TitleBone="dummy_ef_body" TitleHeight="70" PartsHair="10002018" PartsFace="10002106" PartsChest="9092" PartsLeg="9800092" PartsWeaponR="1200001" SkinColor="FDC689" HairColor="754C24" IType1="dialog" IAct1="123" />
this part in npc line will Link to DialogID = (IType1="dialog" IAct1="123") at end of NPC Line.

2° Create a name for this New NPC at
(Data/system/lang/en_us/name_npc.xml)
Code:
<STR key="NPC_NAME_123" string="Bart" />  <STR key="NPC_CLAN_123" string="Teleporter NPC" />

3° Create a DialogID for it (Data/system/Dialog.xml) and (GameServerData/system/Dialog.xml)
Code:
<DIALOG id="123" text="[Teleporter]">    <SAY text="DIALOG_SAY_TEXT_123_1">      <SELECT text="DIALOG_SELECT_TEXT_123_2" exit="1" />    </SAY>  </DIALOG>

4° Create the Name's of this new Dialogs
(Data/system/lang/en_us/name_dialog.xml)
Code:
<STR key="DIALOG_TEXT_123" string="Teleporter NPC" /><STR key="DIALOG_SAY_TEXT_123_1" string="{ani=positive}Write some texts here" /><STR key="DIALOG_SELECT_TEXT_123_2" string="[Move Me]" />

5° Create a .Lua file for the New NPC (GameServerData/script/npc/lua/npc_123.lua)
Code:
function NPC_123:OnDialogExit(Player, DialogID, ExitID)    if (123 == DialogID) then        if (1 == ExitID) then -- Exit Number of Dialog.xml            local NecessaryGold = 100                        -- Player:GetSilver() = Get the Money of Player            -- Player:CheckCondition(50) = Check if Player meets the Conditioon (Level 50)            -- Player:RemoveSilver(NecessaryGold) = Remove the Gold from Player            -- Player:GateToMarker(107, 2) = Teleport the Player Ex: 107 = Map ID , 2 = Marker ID                        if (Player:GetSilver() >= NecessaryGold) and (Player:CheckCondition(50) == true) then                Player:RemoveSilver(NecessaryGold)                Player:GateToMarker(107, 2)            else                this:Balloon("You dont have Enought Gold..")            end         endend
At the Dialog.xml the line with (Exit="1") trigger the teleport, you can create as many as you want just need add at npc_123.lua the "exit" option and for where the player will be teleported.

After this when you click at [Move me] you character will be moved if you meets the conditions (Level/Gold).

 
Last edited:
Back
Top