[SQL] Query to add a new custom Teleport with options very easy and very fast

Page 1 of 6 123456 LastLast
Results 1 to 15 of 77
  1. #1
    __F0X__ arabianfox is offline
    MemberRank
    Nov 2011 Join Date
    292Posts

    wink [SQL] Query to add a new custom Teleport with options very easy and very fast

    This query will add a new custom teleport (that is not already exist) at any place in the game in just a minute.

    all you have to do is to log in to the game with two characters
    *character 1 >> will be place of teleport [the query just take coordinates from characters].
    *character 2 >> will be near character 1 and this for the spawn position.

    **thats makes teleport position and spawn position not the same.

    then log out with the two characters and put the names of the two characters at the settings area.

    *this query will create a link between the created teleport and any teleport you need [two ways teleport] and the linked teleport is @OwnTeleport at the settings area.

    **example: if we set @OwnTeleport = 1 then after creating the new teleport ,query will add link between it and JANGAN teleport that means you will be able to teleport from JANGAN to your new teleport and from your new teleport to JANGAN too.

    *the fee is the gold required to teleport.

    *if you set @RequiredLVL = 0 > any character with any level can teleport

    *if you set @RequiredLVL = 60 for example > only characters with lvl 60 and above can teleport.

    **If you set @RequiredLVL more than 0 >> the query will create just one link [one way teleport only] from the ownteleport to the new teleport

    **Query will generate all media lines and tell you where to put every line to media you will only copy this lines and past in the media text files..

    Code:
    USE SRO_VT_SHARD /* Add new Teleport By Arabianfox */
    
    
    DECLARE @Teleport VARCHAR (64)
    DECLARE @CHARNAME1 VARCHAR (30)
    DECLARE @CHARNAME2 VARCHAR (30)
    DECLARE @OwnTeleport INT
    DECLARE @Fee INT
    DECLARE @RequiredLVL INT
    
    /* Put your settings here */
    SET @Teleport = 'PVP_ZONE' -- any name you want ex: PK_ZONE or PVP_ZONE
    SET @CHARNAME1 = 'CHARNAME1' -- Teleport position
    SET @CHARNAME2 = 'CHARNAME2' -- Spawn position after teleport
    SET @OwnTeleport = 1  -- Target teleport ID ex: 1 for Jangan - 5 for Hotan - 20 for Constantinople
    SET @Fee = 50000  -- Gold amount to Pass the teleport
    SET @RequiredLVL = 0  -- minimum level required to teleport 0 for no restriction - ex:90 lvl 90 and higher can teleport
    /* settings area end here */
    
    IF EXISTS (SELECT CodeName128 FROM _RefObjCommon WHERE CodeName128 = 'STORE_'+@Teleport)
     BEGIN
      raiserror('The stated teleportname of %s is already exist!',11,1,@Teleport);
      RETURN;
     END
        
        DECLARE @MAXOBJ INT = (SELECT MAX (ID) FROM _RefObjCommon)+1
        DECLARE @REGION1 INT SET @REGION1 = (SELECT (LatestRegion) FROM _Char WHERE CharName16 = @CHARNAME1)
        DECLARE @POSX1 INT SET @POSX1 = (SELECT (POSX) FROM _Char WHERE CharName16 = @CHARNAME1)
        DECLARE @POSY1 INT SET @POSY1 = (SELECT (POSY) FROM _Char WHERE CharName16 = @CHARNAME1)
        DECLARE @POSZ1 INT SET @POSZ1 = (SELECT (POSZ) FROM _Char WHERE CharName16 = @CHARNAME1)
        DECLARE @LINK INT = (SELECT MAX (ID) FROM _RefObjStruct)+1
         
    	SET IDENTITY_INSERT _RefObjCommon ON
        INSERT INTO _RefObjCommon (Service,ID,CodeName128,ObjName128,OrgObjCodeName128,NameStrID128,DescStrID128,CashItem,Bionic,TypeID1,TypeID2,TypeID3,TypeID4,DecayTime,Country,Rarity,CanTrade,CanSell,CanBuy,CanBorrow,CanDrop,CanPick,CanRepair,CanRevive,CanUse,CanThrow,Price,CostRepair,CostRevive,CostBorrow,KeepingFee,SellPrice,ReqLevelType1,ReqLevel1,ReqLevelType2,ReqLevel2,ReqLevelType3,ReqLevel3,ReqLevelType4,ReqLevel4,MaxContain,RegionID,Dir,OffsetX,OffsetY,OffsetZ,Speed1,Speed2,Scale,BCHeight,BCRadius,EventID,AssocFileObj128,AssocFileDrop128,AssocFileIcon128,AssocFile1_128,AssocFile2_128,Link) VALUES
        (1,@MAXOBJ,'STORE_'+@Teleport,@Teleport,'xxx','SN_STORE_'+@Teleport,'xxx',0,0,4,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,-1,0,-1,0,-1,@REGION1,0,@POSX1,@POSY1,@POSZ1,0,0,50,50,30,0,'quest\teleport01.bsr','xxx','xxx','xxx','xxx',@link)
        SET IDENTITY_INSERT _RefObjCommon OFF
    	
    	print ''
    	print 'Add the following line to teleportbuilding.txt @server_dep\silkroad\textdata folder'
        print '1	'+CONVERT(varchar(max),@MAXOBJ)+'	'+'STORE_'+@Teleport+'	'+@Teleport+'	xxx	'+'SN_STORE_'+@Teleport+'	xxx	0	0	4	1	1	0	0	3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	-1	0	-1	0	-1	0	-1	0	-1	'+CONVERT(varchar(max),@REGION1)+'	0	'+CONVERT(varchar(max),@POSX1)+'	'+CONVERT(varchar(max),@POSY1)+'	'+CONVERT(varchar(max),@POSZ1)+'	0	0	50	50	30	0	quest\teleport01.bsr	xxx	xxx	xxx	xxx	'+CONVERT(varchar(max),@link)
    	print ''
    	print 'Add the following line to textdata_object.txt @server_dep\silkroad\textdata folder'
    	print ''
    	print '1	'+'SN_STORE_'+@Teleport+'								'+@Teleport
    	print ''
      	print ''
    
      SET IDENTITY_INSERT _RefObjStruct ON
      INSERT INTO _RefObjStruct (ID,Dummy_Data) VALUES
      (@LINK,0)
      SET IDENTITY_INSERT _RefObjStruct OFF
      
      DECLARE @MAXTELID INT = (SELECT MAX (ID) FROM _RefTeleport)+1
      DECLARE @WORLDID INT = (SELECT (WorldID) FROM _Char where CharName16 = @CHARNAME2)
      DECLARE @REGION2 INT SET @REGION2 = (SELECT (LatestRegion) FROM _Char WHERE CharName16 = @CHARNAME2)
      DECLARE @POSX2 INT SET @POSX2 = (SELECT (POSX) FROM _Char WHERE CharName16 = @CHARNAME2)
      DECLARE @POSY2 INT SET @POSY2 = (SELECT (POSY) FROM _Char WHERE CharName16 = @CHARNAME2)
      DECLARE @POSZ2 INT SET @POSZ2 = (SELECT (POSZ) FROM _Char WHERE CharName16 = @CHARNAME2)
    
      INSERT INTO _RefTeleport (Service,ID,CodeName128,AssocRefObjCodeName128,AssocRefObjID,ZoneName128,GenRegionID,GenPos_X,GenPos_Y,GenPos_Z,GenAreaRadius,CanBeResurrectPos,CanGotoResurrectPos,GenWorldID,BindInteractionMask,FixedService) VALUES
      (1,@MAXTELID,'GATE_'+@Teleport,'STORE_'+@Teleport,@MAXOBJ,'SN_STORE_'+@Teleport,@REGION2,@POSX2,@POSY2,@POSZ2,30,0,0,@WORLDID,1,0)
      
      print ''
      print 'Add the following line to teleportdata.txt @server_dep\silkroad\textdata folder'
      print '1	'+CONVERT(varchar(max),@MAXTELID)+'	'+'GATE_'+@Teleport+'	'+CONVERT(varchar(max),@MAXOBJ)+'	'+'SN_STORE_'+@Teleport+'	'+CONVERT(varchar(max),@REGION2)+'	'+CONVERT(varchar(max),@POSX2)+'	'+CONVERT(varchar(max),@POSY2)+'	'+CONVERT(varchar(max),@POSZ2)+'	30	0	0	'+CONVERT(varchar(max),@WORLDID)+'	1	0'
      print ''
      print ''
    
      IF @RequiredLVL = 0
      BEGIN
        INSERT INTO _RefTeleLink (Service,OwnerTeleport,TargetTeleport,Fee,RestrictBindMethod,RunTimeTeleportMethod,CheckResult,Restrict1,Data1_1,Data1_2,Restrict2,Data2_1,Data2_2,Restrict3,Data3_1,Data3_2,Restrict4,Data4_1,Data4_2,Restrict5,Data5_1,Data5_2) VALUES
        (1,@OwnTeleport,@MAXTELID,@Fee,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
    	INSERT INTO _RefTeleLink (Service,OwnerTeleport,TargetTeleport,Fee,RestrictBindMethod,RunTimeTeleportMethod,CheckResult,Restrict1,Data1_1,Data1_2,Restrict2,Data2_1,Data2_2,Restrict3,Data3_1,Data3_2,Restrict4,Data4_1,Data4_2,Restrict5,Data5_1,Data5_2) VALUES
        (1,@MAXTELID,@OwnTeleport,@Fee,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
    	
    print ''
    	print 'Add the following lines to teleportlink.txt @server_dep\silkroad\textdata folder'
        print '1	'+CONVERT(varchar(max),@OwnTeleport)+'	'+CONVERT(varchar(max),@MAXTELID)+'	'+CONVERT(varchar(max),@Fee)+'	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0'
        print '1	'+CONVERT(varchar(max),@MAXTELID)+'	'+CONVERT(varchar(max),@OwnTeleport)+'	'+CONVERT(varchar(max),@Fee)+'	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0'
    	print ''
      END
      ELSE BEGIN
    	INSERT INTO _RefTeleLink (Service,OwnerTeleport,TargetTeleport,Fee,RestrictBindMethod,RunTimeTeleportMethod,CheckResult,Restrict1,Data1_1,Data1_2,Restrict2,Data2_1,Data2_2,Restrict3,Data3_1,Data3_2,Restrict4,Data4_1,Data4_2,Restrict5,Data5_1,Data5_2) VALUES
        (1,@OwnTeleport,@MAXTELID,@Fee,0,0,0,1,@RequiredLVL,999,0,0,0,0,0,0,0,0,0,0,0,0)
    	
    	print ''
    	print ''
    	print 'Add the following line to teleportlink.txt @server_dep\silkroad\textdata folder'
    	print '1	'+CONVERT(varchar(max),@OwnTeleport)+'	'+CONVERT(varchar(max),@MAXTELID)+'	'+CONVERT(varchar(max),@Fee)+'	0	0	0	1	'+CONVERT(varchar(max),@RequiredLVL)+'	999	0	0	0	0	0	0	0	0	0	0	0	0'
        print ''
    
      END
    
    print ''
    print 'Done!'
    I hope this help many people here to put custom teleports very easy and very fast
    please if you have any notice or bug or questions,just let me know...
    Last edited by arabianfox; 07-07-12 at 04:55 PM.


  2. #2
    Enthusiast firat0912 is offline
    MemberRank
    Feb 2012 Join Date
    29Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Thx very good but i need for mssql 2005 -,-

  3. #3
    Learning denise456 is offline
    MemberRank
    Feb 2012 Join Date
    BrasilLocation
    318Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Very Very Good Bro Thanks

  4. #4
    NewEvolust.Com xxNukertube is offline
    MemberRank
    Jul 2012 Join Date
    Ceres, Goias, BLocation
    215Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Thx Bro
    Very Much Thx

  5. #5
    (⌐■_■) NourAyman is offline
    MemberRank
    Feb 2012 Join Date
    Behind you :PLocation
    683Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Thank you very much dude

    I Got That Error while Executing :


    Msg 8106, Level 16, State 1, Line 33
    Table '_RefObjCommon' does not have the identity property. Cannot perform SET operation.
    Last edited by NourAyman; 06-07-12 at 12:29 AM.

  6. #6
    __F0X__ arabianfox is offline
    MemberRank
    Nov 2011 Join Date
    292Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Quote Originally Posted by nourayman View Post
    Thank you very much dude

    I Got That Error while Executing :


    Msg 8106, Level 16, State 1, Line 33
    Table '_RefObjCommon' does not have the identity property. Cannot perform SET operation.
    set identity property at _Refobjcommon table

  7. #7
    (⌐■_■) NourAyman is offline
    MemberRank
    Feb 2012 Join Date
    Behind you :PLocation
    683Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Bro i can Read English

    But The Q is How not What ^^

    Can you help me ?

  8. #8
    __F0X__ arabianfox is offline
    MemberRank
    Nov 2011 Join Date
    292Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Quote Originally Posted by nourayman View Post
    Bro i can Read English

    But The Q is How not What ^^

    Can you help me ?
    from SQL menu >> tools >> options >> designers then un-check "prevent saving changes that required table re-creation" then go to

    _refobjcommon table > right click > design

    set ID as primary key (right click > set as primary key) and from the properties at bottom set identity to "YES"

  9. #9
    (⌐■_■) NourAyman is offline
    MemberRank
    Feb 2012 Join Date
    Behind you :PLocation
    683Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Done but with errors :

    Msg 544, Level 16, State 1, Line 60
    Cannot insert explicit value for identity column in table '_RefTeleport' when IDENTITY_INSERT is set to OFF.

    Which Column Must i Set the IDENTITY_Insert to on ?

  10. #10
    Proficient Member safty0202 is offline
    MemberRank
    Dec 2011 Join Date
    174Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    awesome script !

  11. #11
    Account Upgraded | Title Enabled! VanSoR is offline
    MemberRank
    May 2012 Join Date
    279Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Your The Best

  12. #12
    Banned NoMore is offline
    BannedRank
    Oct 2011 Join Date
    Alexandria, EgyLocation
    268Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    thanks but when i see Teleport i get crash

  13. #13
    (⌐■_■) NourAyman is offline
    MemberRank
    Feb 2012 Join Date
    Behind you :PLocation
    683Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Quote Originally Posted by NoMore View Post
    thanks but when i see Teleport i get crash
    Itz Easy man , But You must Think and give me like ^^

    look , The execute Process when finish it give you the line to add them to the Media

    so , you must Edit the spaces between them

  14. #14
    NewEvolust.Com xxNukertube is offline
    MemberRank
    Jul 2012 Join Date
    Ceres, Goias, BLocation
    215Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    Work 100%

  15. #15
    Apprentice shawky is offline
    MemberRank
    Jan 2012 Join Date
    19Posts

    Re: [SQL] Query to add a new custom Teleport with options very easy and very fast

    and if i want to create a teleport between from all towns to the area i want what settings should i set ? :)



Page 1 of 6 123456 LastLast

Advertisement