[SQL] Add full equip +5 to new chars [Better way]

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Account Upgraded | Title Enabled! lemoniscool is offline
    MemberRank
    Nov 2009 Join Date
    GermanyLocation
    579Posts

    [SQL] Add full equip +5 to new chars [Better way]

    Hi!
    Today i sent this sp to several people that are likely to release it, so i will release it first as its my work .. This procedure will add a full +5 9dg set (including weapon and accessory) along with other items to new created chars. Till now nothing new huh? Well.. the items will be directly equipped and only male or female and only the equipment class (garment, protector, armor, robe, light armor, heavy armor) and the weapon the player chose at the character creation screen will be added, unlike the old way that simply filled the chars inventory with all items of all classes and all weapons etc.

    I hope there are enough comments for you to edit it to any degree you want, the numbers defined for the items are the IDs from _RefObjCommon


    Video:


    _AddNewChar:
    Code:
    USE [SRO_VT_SHARD]
    GO
    /****** Object:  StoredProcedure [dbo].[_AddNewChar]    Script Date: 11/27/2013 09:59:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    
    
    ALTER   PROCEDURE [dbo].[_AddNewChar]    
    @UserJID   INT,    
    --@CharSlot   INT,    
    @RefCharID   INT,    
    @CharName   varchar (64),    
    @CharScale   tinyINT,    
    @StartRegionID  INT,    
    @StartPos_X   real,    
    @StartPos_Y   real,    
    @StartPos_Z   real,    
    @DefaultTeleport INT,    
    @RefMailID   INT,    
    @RefPantsID   INT,    
    @RefBootsID   INT,    
    @RefWeaponID  INT,    
    @RefShield   INT,    
    @DurMail   tinyINT,    
    @DurPants   tinyINT,    
    @DurBoots   tinyINT,    
    @DurWeapon   tinyINT,    
    @DurShield   tinyINT,    
    @DefaultArrow  INT      
    AS    
    -- Server Migration 2008 #1st version for taiwan    
    SET NOCOUNT ON    
     DECLARE @Slot  INT    
     DECLARE @temp  INT    
         
     DECLARE @NewCharID  INT    
     SET @NewCharID = 0    
     
     -- Initial Equip Edit by LemoniscooL
     DECLARE @RefHandID INT
     DECLARE @RefHatID INT
     DECLARE @RefShoulderID INT
     DECLARE @RefEarringID INT
     DECLARE @RefRingID INT
     DECLARE @RefNeckID INT
     DECLARE @DurHand INT
     DECLARE @DurHat INT
     DECLARE @DurShoulder INT
     DECLARE @DurEarring INT
     DECLARE @DurRing INT
     DECLARE @DurNeck INT
     
     --Male Clothes Chinese
     IF (@RefMailID = 3643) BEGIN
    	SET @RefHandID = 4938
    	SET @RefMailID = 4866
    	SET @RefBootsID = 4974
    	SET @RefHatID = 4758
    	SET @RefPantsID = 4902
    	SET @RefShoulderID = 4830
    	
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Male Heavy Armor Chinese
     IF (@RefMailID = 3637) BEGIN
    	SET @RefHandID = 4434
    	SET @RefMailID = 4362
    	SET @RefBootsID = 4470
    	SET @RefHatID = 4254
    	SET @RefPantsID = 4398
    	SET @RefShoulderID = 4326
    	
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Male Light Armor Chinese
     IF (@RefMailID = 3640) BEGIN
    	SET @RefHandID = 4686
    	SET @RefMailID = 4614
    	SET @RefBootsID = 4722
    	SET @RefHatID = 4506
    	SET @RefPantsID = 4650
    	SET @RefShoulderID = 4578
    	
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Female Clothes Chinese
     IF (@RefMailID = 3652) BEGIN
    	SET @RefHandID = 5694
    	SET @RefMailID = 5622
    	SET @RefBootsID = 5730
    	SET @RefHatID = 5514
    	SET @RefPantsID = 5658
    	SET @RefShoulderID = 5586
    	
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Female Heavy Armor Chinese
     IF (@RefMailID = 3646) BEGIN
    	SET @RefHandID = 5190
    	SET @RefMailID = 5118
    	SET @RefBootsID = 5226
    	SET @RefHatID = 5010
    	SET @RefPantsID = 5154
    	SET @RefShoulderID = 5082
    	
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Female Light Armor Chinese
     IF (@RefMailID = 3649) BEGIN
    	SET @RefHandID = 5442
    	SET @RefMailID = 5370
    	SET @RefBootsID = 5478
    	SET @RefHatID = 5262
    	SET @RefPantsID = 5406
    	SET @RefShoulderID = 5334
    	
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Male Clothes Europe
     IF (@RefMailID = 11674) BEGIN
    	SET @RefHandID = 13150
    	SET @RefMailID = 13078
    	SET @RefBootsID = 13186
    	SET @RefHatID = 12970
    	SET @RefPantsID = 13114
    	SET @RefShoulderID = 13042
    	
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Male Heavy Armor Europe
     IF (@RefMailID = 11668) BEGIN
    	SET @RefHandID = 12646
    	SET @RefMailID = 12574
    	SET @RefBootsID = 12682
    	SET @RefHatID = 12466
    	SET @RefPantsID = 12610
    	SET @RefShoulderID = 12538
    	
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Male Light Armor Europe
     IF (@RefMailID = 11671) BEGIN
    	SET @RefHandID = 12898
    	SET @RefMailID = 12826
    	SET @RefBootsID = 12934
    	SET @RefHatID = 12718
    	SET @RefPantsID = 12862
    	SET @RefShoulderID = 12790
    	
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Female Clothes Europe
     IF (@RefMailID = 11683) BEGIN
    	SET @RefHandID = 14662
    	SET @RefMailID = 14590
    	SET @RefBootsID = 14698
    	SET @RefHatID = 14482
    	SET @RefPantsID = 14626
    	SET @RefShoulderID = 14554
    	
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Female Heavy Armor Europe
     IF (@RefMailID = 11677) BEGIN
    	SET @RefHandID = 14158
    	SET @RefMailID = 14086
    	SET @RefBootsID = 14194
    	SET @RefHatID = 13978
    	SET @RefPantsID = 14122
    	SET @RefShoulderID = 14050
    	
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Female Light Armor Europe
     IF (@RefMailID = 11680) BEGIN
    	SET @RefHandID = 14410
    	SET @RefMailID = 14338
    	SET @RefBootsID = 14446
    	SET @RefHatID = 14230
    	SET @RefPantsID = 14374
    	SET @RefShoulderID = 14302
    	
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Shield Chinese
     IF (@RefShield = 10937) BEGIN
    	SET @RefShield = 4218
     END
     
     --Shield Europe
     IF (@RefShield = 10947) BEGIN
    	SET @RefShield = 11656
     END
     
     --Blade Chinese
     IF (@RefWeaponID = 3633) BEGIN
    	SET @RefWeaponID = 4074
     END
     
     --Bow Chinese
     IF (@RefWeaponID = 3636) BEGIN
    	SET @RefWeaponID = 4182
     END
     
     --Spear Chinese
     IF (@RefWeaponID = 3634) BEGIN
    	SET @RefWeaponID = 4110
     END
     
     --Sword Chinese
     IF (@RefWeaponID = 3632) BEGIN
    	SET @RefWeaponID = 4038
     END
     
     --Glavie Chinese
     IF (@RefWeaponID = 3635) BEGIN
    	SET @RefWeaponID = 4146
     END
     
     --Axe Europe
     IF (@RefWeaponID = 10941) BEGIN
    	SET @RefWeaponID = 11404
     END
     
     --XBow Europe
     IF (@RefWeaponID = 10942) BEGIN
    	SET @RefWeaponID = 11440
     END
     
     --Dagger Europe
     IF (@RefWeaponID = 10938) BEGIN
    	SET @RefWeaponID = 11296
     END
     
     --Darkstaff Europe
     IF (@RefWeaponID = 10943) BEGIN
    	SET @RefWeaponID = 11476
     END
     
     --Harp Europe
     IF (@RefWeaponID = 10945) BEGIN
    	SET @RefWeaponID = 11548
     END
     
     --Cleric Rod Europe
     IF (@RefWeaponID = 10946) BEGIN
    	SET @RefWeaponID = 11584
     END
     
     --Sword Europe
     IF (@RefWeaponID = 10939) BEGIN
    	SET @RefWeaponID = 11332
     END
     
     --Staff Europe
     IF (@RefWeaponID = 10944) BEGIN
    	SET @RefWeaponID = 11512
     END
     
     --Twohand Sword Europe
     IF (@RefWeaponID = 10940) BEGIN
    	SET @RefWeaponID = 11368
     END
     
     --Select Durability
     SET @DurHand = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefHandID))
     SET @DurMail = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefMailID))
     SET @DurBoots = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefBootsID))
     SET @DurHat = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefHatID))
     SET @DurPants = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefPantsID))
     SET @DurShoulder = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefShoulderID))
     SET @DurWeapon = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefWeaponID))
     SET @DurShield = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefShield))
     SET @DurEarring = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefEarringID))
     SET @DurRing = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefRingID))
     SET @DurNeck = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefNeckID))
     -- Initial Equip Edit by LemoniscooL
     
     --set @StartRegionID=25000
     -----------------------------------------------------------------------------    
     -- 1. ??? ?? ??? valid? ???, ??? ???? ??? ?? ????.    
     -----------------------------------------------------------------------------    
        
     -- start by novice.    
     SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID    
        
     IF (@temp >= 4)    
     BEGIN    
      -- ?? ???    
      RETURN -2    
     END    
     -- finish by novice.    
        
     -----------------------------------------------------------------------------    
     -- 2. ??? ????    
     -----------------------------------------------------------------------------    
     IF (@CharScale > 68) -- 0100 0100 --> 68 ??!    
     BEGIN    
      -- ??? ?? ??! ??? ?? ????!     
      RETURN -3    
     END    
     EXEC @temp = _IsExistingCharName @CharName    
     IF (@temp <> 0)    
     BEGIN    
      -- ?? ???? ???????    
      RETURN -4    
     END    
        
    BEGIN TRANSACTION    
     -- ?????? ????? ???? WorldID? 1?? ? ?? ???!    
     INSERT INTO _Char ( RefObjID, CharName16, Scale, Strength, Intellect, LatestRegion, PosX, PosY, PosZ, AppointedTeleport, InventorySize,     
          LastLogout, CurLevel, MaxLevel, RemainGold, RemainStatPoint, RemainSkillPoint, HP, MP, JobLvl_Trader, JobLvl_Hunter, JobLvl_Robber, WorldID )    
        VALUES (@RefCharID, @CharName, @CharScale, 20, 20, @StartRegionID, @StartPos_X, @StartPos_Y, @StartPos_Z, @DefaultTeleport, 45,    
          GetDate(), 1, 1, 0, 0, 0, 200, 200, 1, 1, 1, 1)    
         
     SET @NewCharID = @@IDENTITY    
     IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)    
     BEGIN    
      -- ??? ?? ??!    
      ROLLBACK TRANSACTION    
      RETURN -5    
     END    
         
     -- start by novice.    
     -- ?? Slot ???.. ?? Insert ?..    
     INSERT INTO _User VALUES (@UserJID, @NewCharID)    
     -- finish by novice.    
        
        
     -----------------------------------------------------------------------------        
     -- 3-1. ?? ?? ???        
     -- [???? ?? 96?] + [???? 13?] <- ???? ?? ??? ? 48??? 96?? ??!!!(woos0)
     -----------------------------------------------------------------------------        
     --PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!        
     INSERT INTO _Inventory(CharID, Slot, ItemID)        
      SELECT @NewCharID, cnt, 0        
       FROM _RefDummySlot with( nolock )       
        WHERE cnt < 109        
         
     IF (@@ERROR <> 0)    
     BEGIN    
      -- ???? ?? ??!    
      ROLLBACK TRANSACTION    
      RETURN -7    
     END     
     -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!    
         
     -- ???? ??? ???? ?? ????...    
     /* ?? ???  ???? ??.    
      0: EQUIP_SLOT_HELM    
      1: EQUIP_SLOT_MAIL,    
      2: EQUIP_SLOT_SHOULDERGUARD,    
      3: EQUIP_SLOT_GAUNTLET,    
      4: EQUIP_SLOT_PANTS,    
      5: EQUIP_SLOT_BOOTS,    
      6: EQUIP_SLOT_WEAPON,    
      7: EQUIP_SLOT_SHIELD or ARROW,    
      8: EQUIP_SLOT_EARRING,    
      9: EQUIP_SLOT_NECKLACE,    
     10: EQUIP_SLOT_L_RING,    
     11: EQUIP_SLOT_R_RING,    
     */    
    
     -- Initial Equip Edit by LemoniscooL
     DECLARE @ItemID BIGINT    
     SET @ItemID = 0    
     -- Chest
     IF (@RefMailID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Hand
     IF (@RefHandID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 3, @RefHandID, @DurHand, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Hat
     IF (@RefHatID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 0, @RefHatID, @DurHat, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Shoulder
     IF (@RefShoulderID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 2, @RefShoulderID, @DurShoulder, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Pants 
     IF (@RefPantsID <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 4, @RefPantsID, @DurPants, 5
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -9    
    	END    
     END    
     -- Boots    
     IF (@RefBootsID <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 5, @RefBootsID, @DurBoots, 5    
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -10    
    	END    
     END    
     -- Weapon    
     IF (@RefWeaponID <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 6, @RefWeaponID, @DurWeapon, 5   
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -11    
    	END    
     END    
     -- Shield
     IF (@RefShield <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @RefShield, @DurShield, 5    
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -12    
    	END    
     END    
     -- Arror/Bolt
     IF (@DefaultArrow <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250, 0  
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -13    
    	END    
     END
     -- Earring
     IF (@RefEarringID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 9, @RefEarringID, @DurEarring, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Ring 1
     IF (@RefRingID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 11, @RefRingID, @DurRing, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Ring 2
     IF (@RefRingID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 12, @RefRingID, @DurRing, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Necklace
     IF (@RefNeckID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 10, @RefNeckID, @DurNeck, 5
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Initial Equip Edit by LemoniscooL
         
     -----------------------------------------------------------------------------          
     -- 3-2. ??? Inventory ?? ???          
     -- [??? ???? ?? 5?]  
     -- APPLY_AVATAR_SYSTEM? ????? ???? ??  
     -----------------------------------------------------------------------------          
     --PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!          
     INSERT INTO _InventoryForAvatar(CharID, Slot, ItemID)          
      SELECT @NewCharID, cnt, 0  
       FROM _RefDummySlot with( nolock )         
        WHERE cnt < 5  
        
     IF (@@ERROR <> 0)    
      BEGIN    
      -- ??? ???? ?? ??!            
      ROLLBACK TRANSACTION    
      RETURN -14    
     END    
     -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!    
    
    -----------------------------------------------------------------------------        
    -- 3-3. ?? ?? ???        
    -- [?? ??? ?? 50?]
    -- Define ADD_TRADE_BAG_INVENTORY ? ????? ???? ??
    -----------------------------------------------------------------------------        
    -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!
    INSERT INTO _TradeBagInventory(CharID, Slot, ItemID)
      SELECT @NewCharID, cnt, 0
       FROM _RefDummySlot with( nolock )
        WHERE cnt < 50
    
    IF (@@ERROR <> 0)
     BEGIN
      -- ?? ?? ??!        
      ROLLBACK TRANSACTION
      RETURN -20
     END
    -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!
    
    
    -----------------------------------------------------------------------------        
    -- 3-4. ?? ?? ?? ???        
    -- [?? ??? ?? 11?]
    -- Define ADD_TRADE_EQUIP_INVENTORY? ????? ???? ??
    -----------------------------------------------------------------------------        
    -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!
    INSERT INTO _TradeEquipInventory(CharID, Slot, ItemID)
     SELECT @NewCharID, cnt, 0
      FROM _RefDummySlot with( nolock )
        WHERE cnt < 11
    
    IF (@@ERROR <> 0)
      BEGIN
      -- ?? ?? ???? ?? ??!        
      ROLLBACK TRANSACTION	
      RETURN -21
     END
     -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!  
        
     -----------------------------------------------------------------------------    
     -- default skill????    
     -----------------------------------------------------------------------------    
     DECLARE @country tinyINT    
     EXEC @country = _GetObjCountry @RefCharID    
         
     INSERT INTO _CharSkillMastery (CharID, MasteryID, Level)    
     SELECT @NewCharID, MasteryID, 0    
     FROM _RefCharDefault_SkillMastery with(nolock)    
     WHERE Race = @country or Race = 3    
     IF (@@error <> 0)    
     BEGIN    
      ROLLBACK TRANSACTION    
      RETURN -15    
     END    
     INSERT INTO _CharSkill (CharID,SkillID,Enable)    
     SELECT @NewCharID, SkillID, 1    
     FROM  _RefCharDefault_Skill with(nolock)    
     WHERE Race = @country or Race = 3    
     IF (@@error <> 0)    
     BEGIN    
      ROLLBACK TRANSACTION    
      RETURN -16    
     END    
     -----------------------------------------------------------------------------            
     -- ?? ??? ????    
     -----------------------------------------------------------------------------            
     INSERT INTO _CharQuest (CharID, QuestID, Status, AchievementCount, StartTime, EndTime, QuestData1, QuestData2)            
     SELECT @NewCharID, ID, 1, 0, getdate(), getdate(), 0, 0            
     FROM _RefQuest    
     WHERE CodeName in (SELECT CodeName FROM _RefCharDefault_Quest  with(nolock) WHERE (Race = @country or Race = 3) and RequiredLevel = 1 and Service = 1)    
     IF (@@error <> 0)    
     BEGIN    
      ROLLBACK TRANSACTION            
      RETURN -17            
     END    
     -----------------------------------------------------------------------------    
     -- Static Avatar Initial Record ??    
     -----------------------------------------------------------------------------    
     INSERT INTO _StaticAvatar(CharID) values(@NewCharID)    
     IF (@@ERROR <> 0)    
     BEGIN    
      ROLLBACK TRANSACTION    
      RETURN -18    
     END     
     -----------------------------------------------------------------------------            
     -- Trijob ????!!!!!            
     -----------------------------------------------------------------------------            
     INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0)            
     IF (@@ERROR <> 0)       
     BEGIN            
     -- ???? ?? ??!    
     ROLLBACK TRANSACTION            
     RETURN -19            
     END 
     -----------------------------------------------------------------------------          
     -- TradeConflictJob ????!!!!!          
     -----------------------------------------------------------------------------          
    INSERT INTO _CharTradeConflictJob VALUES (@NewCharID, GetDate(), 1, 0, 0, 0, 0, 0 ,0)          
    IF (@@ERROR <> 0)          
    BEGIN          
      	-- ??? ???? ??? ?? ??...!
    	ROLLBACK TRANSACTION          
    RETURN -22         
    END
    
     -----------------------------------------------------------------------------          
     -- NewTrade ????!!!!!          
     -----------------------------------------------------------------------------          
     INSERT INTO _CharNewTrade VALUES (@NewCharID, 0, 0)          
     IF (@@ERROR <> 0)          
     BEGIN          
      -- ??? ???? ??? ?? ??...!
      ROLLBACK TRANSACTION          
      RETURN -23         
     END   
    
    
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    -- ???? ?? ??
    -----------------------------------------------------------------------------          
    INSERT _FriendGroup Values (@NewCharID, 0, '???')		-- ?? ?? by bkh
    IF (@@ERROR <> 0)          
    BEGIN          
    	ROLLBACK TRANSACTION          
    	RETURN -20          -- ???? ??!
    END
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    
    -- ?? ??? ??
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    -- ??? ??? ??? ? ?? ???? ???!!!
    -----------------------------------------------------------------------------          
    --  ReqType? 1?? ??? ??
    INSERT _CharAlchemy_MK_Recipe
    SELECT @NewCharID, MR.RC_ID FROM _RefLearnRecipeByReqType AS LR
    JOIN _RefAlchemy_MK_Recipe AS MR ON LR.RecipeCodeName = MR.RC_CodeName128
    WHERE LR.ReqType = 1 AND LR.ReqValue = 1 AND LR.Service = 1
    
    IF (@@ERROR <> 0)          
    BEGIN          
    	ROLLBACK TRANSACTION          
    	RETURN -21          -- ??? ?? ??
    END
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    
     -----------------------------------------------------------------------------    
     -- CharList? ID ????    
     -----------------------------------------------------------------------------    
     INSERT _CharNameList VALUES(@CharName, @NewCharID)    
         
     COMMIT TRANSACTION    
         
     -----------------------------------------------------------------------------    
     -- New Char Add Item at first Once!    
     -----------------------------------------------------------------------------    
     UPDATE _Char SET CurLevel = 90, MaxLevel = 90, ExpOffset = 281672372, RemainGold = 5000000, RemainSkillPoint = 5000000, InventorySize = 109 WHERE _Char.CharID = @NewCharID
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_RENT_REVERSE_RETURN_SCROLL',50,1
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_MALL_RESURRECTION_SCROLL',50,1
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_GLOBAL_CHATTING',50,1
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_COS_P_MYOWON_SCROLL',1,0
     IF (@RefCharID<=14970 AND @RefCharID>=14958) or (@RefCharID<=1919 AND @RefCharID>=1907) BEGIN --male
    	exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_M_NASRUN',1,0
     END
    
     IF (@RefCharID<=14983 AND @RefCharID>=14971) or (@RefCharID<=1932 AND @RefCharID>=1920) BEGIN --female
    	exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_W_NASRUN',1,0
     END
     
                
     -- Quick Slot ?? ???!!!    
     exec _AddNewClientConfig @NewCharID  -- by novice...... for saving client configurations...    
         
     RETURN @NewCharID
    _FN_ADD_INITIAL_EQUIP
    Code:
    USE [SRO_VT_SHARD]
    GO
    /****** Object:  StoredProcedure [dbo].[_FN_ADD_INITIAL_EQUIP]    Script Date: 11/27/2013 20:43:21 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------------------------------------------------------------------
    ALTER PROCEDURE [dbo].[_FN_ADD_INITIAL_EQUIP]
    	@CharID		AS INT,
    	@Slot		AS TINYINT,
    	@RefItemID	AS INT,
    	@Data		AS INT,
    	@OptLevel	AS INT
    AS
    	DECLARE @ItemInSlot	BIGINT
    	SET @ItemInSlot = 0
    	SELECT @ItemInSlot = ItemID FROM _Inventory WHERE CharID = @CharID AND Slot = @Slot
    	IF (@ItemInSlot <> 0)
    	BEGIN
    		RETURN -1
    	END
    	
    	DECLARE @NewItem	BIGINT
    	DECLARE @Serial		BIGINT
    	SET @Serial = 0
    	
    	EXEC @NewItem = _STRG_ALLOC_ITEM_NoTX @Serial OUTPUT
    	IF (@NewItem = 0)
    	BEGIN
    		RETURN -2
    	END
    
    	UPDATE _Items SET RefItemID = @RefItemID, OptLevel = @OptLevel, Variance = 0, Data = @Data WHERE ID64 = @NewItem
    	IF (@@ERROR <> 0)
    	BEGIN
    		RETURN -3
    	END
    	
    	UPDATE _Inventory SET ItemID = @NewItem WHERE CharID = @CharID AND Slot = @Slot
    	IF (@@ERROR <> 0)
    	BEGIN
    		RETURN -4
    	END
    	
    	RETURN @NewItem

    Note: Please dont share this on any other Forum, if you want to do so please ask me via PM
    Im also not giving support for this release, you can ask for support but i wont answere to it, maybe others will


    greetz
    LemoniscooL
    Attached Files Attached Files
    Last edited by lemoniscool; 27-11-13 at 08:48 PM.


  2. #2
    SkullCrasher Neliel Tu is offline
    MemberRank
    Jul 2012 Join Date
    Japan, TokyoLocation
    1,240Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    thank you lemon,
    i looking for this a long time.

  3. #3
    very nice B1QB0SS is offline
    MemberRank
    Jul 2013 Join Date
    518Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    SRO_TW_SHARD ?


    Can you give me TW Server Files ? Please :D

  4. #4
    Account Upgraded | Title Enabled! lemoniscool is offline
    MemberRank
    Nov 2009 Join Date
    GermanyLocation
    579Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    Quote Originally Posted by B1QB0SS View Post
    SRO_TW_SHARD ?


    Can you give me TW Server Files ? Please :D
    oh sorry forgot to change that .. it was written for twsro files ... but it should be working for any files (br and vsro) as long as the item ids are the same.. but to answere your question: i cant share them sorry (i do not own them)

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

    Re: [SQL] Add full equip +5 to new chars [Better way]

    Good job

  6. #6
    Valued Member Crue is offline
    MemberRank
    Dec 2012 Join Date
    105Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    awesome :)

  7. #7
    Account Upgraded | Title Enabled! CoderWaxy is offline
    MemberRank
    Aug 2012 Join Date
    Russia, SPBurgLocation
    315Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    Good Work

  8. #8
    AssassinS Silkroad arabcart is offline
    MemberRank
    Sep 2011 Join Date
    664Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    when i use it i cant create Character
    Failed to creat a character. please try to connect again.(S1030)
    Any Help ??
    Last edited by arabcart; 27-11-13 at 07:30 PM.

  9. #9
    Account Upgraded | Title Enabled! lemoniscool is offline
    MemberRank
    Nov 2009 Join Date
    GermanyLocation
    579Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    added a video showing it work because many people asked for it
    also added the sql as a download

  10. #10
    AssassinS Silkroad arabcart is offline
    MemberRank
    Sep 2011 Join Date
    664Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    not work with VSRO 1.88

  11. #11
    Account Upgraded | Title Enabled! lemoniscool is offline
    MemberRank
    Nov 2009 Join Date
    GermanyLocation
    579Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    should be working, as long as the item ids inside the sql are the same
    even tho i said i wont give support for this, what errors do you get arabcart? just curious

  12. #12
    Moderator Blacksheep25 is offline
    ModeratorRank
    Jan 2009 Join Date
    AustraliaLocation
    715Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    Quote Originally Posted by arabcart View Post
    not work with VSRO 1.88
    Its going to need to be edited to work with other databases, pretty sure his is 1.193 database.

  13. #13
    AssassinS Silkroad arabcart is offline
    MemberRank
    Sep 2011 Join Date
    664Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    Worked now with my Edit
    Code:
    USE [SRO_VT_SHARD]
    GO
    /****** Object:  StoredProcedure [dbo].[_AddNewChar]    Script Date: 11/27/2013 09:59:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER OFF
    GO
    ALTER   PROCEDURE [dbo].[_AddNewChar]    
    @UserJID   INT,    
    --@CharSlot   INT,    
    @RefCharID   INT,    
    @CharName   varchar (64),    
    @CharScale   tinyINT,    
    @StartRegionID  INT,    
    @StartPos_X   real,    
    @StartPos_Y   real,    
    @StartPos_Z   real,    
    @DefaultTeleport INT,    
    @RefMailID   INT,    
    @RefPantsID   INT,    
    @RefBootsID   INT,    
    @RefWeaponID  INT,    
    @RefShield   INT,    
    @DurMail   tinyINT,    
    @DurPants   tinyINT,    
    @DurBoots   tinyINT,    
    @DurWeapon   tinyINT,    
    @DurShield   tinyINT,    
    @DefaultArrow  INT      
    AS    
        
    SET NOCOUNT ON      
    
    	DECLARE @Slot  INT        
    	DECLARE @temp  INT        
    	        
    	DECLARE @NewCharID  INT        
    	SET @NewCharID = 0        
     
     -- Initial Equip Edit by LemoniscooL
     DECLARE @RefHandID INT
     DECLARE @RefHatID INT
     DECLARE @RefShoulderID INT
     DECLARE @RefEarringID INT
     DECLARE @RefRingID INT
     DECLARE @RefNeckID INT
     DECLARE @DurHand INT
     DECLARE @DurHat INT
     DECLARE @DurShoulder INT
     DECLARE @DurEarring INT
     DECLARE @DurRing INT
     DECLARE @DurNeck INT
     
     --Male Clothes Chinese
     IF (@RefMailID = 3643) BEGIN
    	SET @RefHandID = 4938
    	SET @RefMailID = 4866
    	SET @RefBootsID = 4974
    	SET @RefHatID = 4758
    	SET @RefPantsID = 4902
    	SET @RefShoulderID = 4830
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Male Heavy Armor Chinese
     IF (@RefMailID = 3637) BEGIN
    	SET @RefHandID = 4434
    	SET @RefMailID = 4362
    	SET @RefBootsID = 4470
    	SET @RefHatID = 4254
    	SET @RefPantsID = 4398
    	SET @RefShoulderID = 4326
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Male Light Armor Chinese
     IF (@RefMailID = 3640) BEGIN
    	SET @RefHandID = 4686
    	SET @RefMailID = 4614
    	SET @RefBootsID = 4722
    	SET @RefHatID = 4506
    	SET @RefPantsID = 4650
    	SET @RefShoulderID = 4578
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Female Clothes Chinese
     IF (@RefMailID = 3652) BEGIN
    	SET @RefHandID = 5694
    	SET @RefMailID = 5622
    	SET @RefBootsID = 5730
    	SET @RefHatID = 5514
    	SET @RefPantsID = 5658
    	SET @RefShoulderID = 5586
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Female Heavy Armor Chinese
     IF (@RefMailID = 3646) BEGIN
    	SET @RefHandID = 5190
    	SET @RefMailID = 5118
    	SET @RefBootsID = 5226
    	SET @RefHatID = 5010
    	SET @RefPantsID = 5154
    	SET @RefShoulderID = 5082
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Female Light Armor Chinese
     IF (@RefMailID = 3649) BEGIN
    	SET @RefHandID = 5442
    	SET @RefMailID = 5370
    	SET @RefBootsID = 5478
    	SET @RefHatID = 5262
    	SET @RefPantsID = 5406
    	SET @RefShoulderID = 5334
    	SET @RefEarringID = 5802
    	SET @RefNeckID = 5838
    	SET @RefRingID = 5766
     END
     
     --Male Clothes Europe
     IF (@RefMailID = 11674) BEGIN
    	SET @RefHandID = 13150
    	SET @RefMailID = 13078
    	SET @RefBootsID = 13186
    	SET @RefHatID = 12970
    	SET @RefPantsID = 13114
    	SET @RefShoulderID = 13042
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Male Heavy Armor Europe
     IF (@RefMailID = 11668) BEGIN
    	SET @RefHandID = 12646
    	SET @RefMailID = 12574
    	SET @RefBootsID = 12682
    	SET @RefHatID = 12466
    	SET @RefPantsID = 12610
    	SET @RefShoulderID = 12538
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Male Light Armor Europe
     IF (@RefMailID = 11671) BEGIN
    	SET @RefHandID = 12898
    	SET @RefMailID = 12826
    	SET @RefBootsID = 12934
    	SET @RefHatID = 12718
    	SET @RefPantsID = 12862
    	SET @RefShoulderID = 12790
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Female Clothes Europe
     IF (@RefMailID = 11683) BEGIN
    	SET @RefHandID = 14662
    	SET @RefMailID = 14590
    	SET @RefBootsID = 14698
    	SET @RefHatID = 14482
    	SET @RefPantsID = 14626
    	SET @RefShoulderID = 14554
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Female Heavy Armor Europe
     IF (@RefMailID = 11677) BEGIN
    	SET @RefHandID = 14158
    	SET @RefMailID = 14086
    	SET @RefBootsID = 14194
    	SET @RefHatID = 13978
    	SET @RefPantsID = 14122
    	SET @RefShoulderID = 14050
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Female Light Armor Europe
     IF (@RefMailID = 11680) BEGIN
    	SET @RefHandID = 14410
    	SET @RefMailID = 14338
    	SET @RefBootsID = 14446
    	SET @RefHatID = 14230
    	SET @RefPantsID = 14374
    	SET @RefShoulderID = 14302
    	SET @RefEarringID = 14878
    	SET @RefNeckID = 14914
    	SET @RefRingID = 14842
     END
     
     --Shield Chinese
     IF (@RefShield = 10937) BEGIN
    	SET @RefShield = 4218
     END
     
     --Shield Europe
     IF (@RefShield = 10947) BEGIN
    	SET @RefShield = 11656
     END
     
     --Blade Chinese
     IF (@RefWeaponID = 3633) BEGIN
    	SET @RefWeaponID = 4074
     END
     
     --Bow Chinese
     IF (@RefWeaponID = 3636) BEGIN
    	SET @RefWeaponID = 4182
     END
     
     --Spear Chinese
     IF (@RefWeaponID = 3634) BEGIN
    	SET @RefWeaponID = 4110
     END
     
     --Sword Chinese
     IF (@RefWeaponID = 3632) BEGIN
    	SET @RefWeaponID = 4038
     END
     
     --Glavie Chinese
     IF (@RefWeaponID = 3635) BEGIN
    	SET @RefWeaponID = 4146
     END
     
     --Axe Europe
     IF (@RefWeaponID = 10941) BEGIN
    	SET @RefWeaponID = 11404
     END
     
     --XBow Europe
     IF (@RefWeaponID = 10942) BEGIN
    	SET @RefWeaponID = 11440
     END
     
     --Dagger Europe
     IF (@RefWeaponID = 10938) BEGIN
    	SET @RefWeaponID = 11296
     END
     
     --Darkstaff Europe
     IF (@RefWeaponID = 10943) BEGIN
    	SET @RefWeaponID = 11476
     END
     
     --Harp Europe
     IF (@RefWeaponID = 10945) BEGIN
    	SET @RefWeaponID = 11548
     END
     
     --Cleric Rod Europe
     IF (@RefWeaponID = 10946) BEGIN
    	SET @RefWeaponID = 11584
     END
     
     --Sword Europe
     IF (@RefWeaponID = 10939) BEGIN
    	SET @RefWeaponID = 11332
     END
     
     --Staff Europe
     IF (@RefWeaponID = 10944) BEGIN
    	SET @RefWeaponID = 11512
     END
     
     --Twohand Sword Europe
     IF (@RefWeaponID = 10940) BEGIN
    	SET @RefWeaponID = 11368
     END
     
     --Select Durability
     SET @DurHand = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefHandID))
     SET @DurMail = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefMailID))
     SET @DurBoots = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefBootsID))
     SET @DurHat = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefHatID))
     SET @DurPants = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefPantsID))
     SET @DurShoulder = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefShoulderID))
     SET @DurWeapon = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefWeaponID))
     SET @DurShield = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefShield))
     SET @DurEarring = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefEarringID))
     SET @DurRing = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefRingID))
     SET @DurNeck = (Select Dur_L from _RefObjItem where ID in (Select Link from _RefObjCommon where ID = @RefNeckID))
     -- Initial Equip Edit by LemoniscooL
     
     --set @StartRegionID=25000
     -----------------------------------------------------------------------------    
     -- 1. ??? ?? ??? valid? ???, ??? ???? ??? ?? ????.    
     -----------------------------------------------------------------------------    
        
    	-- start by novice.        
    	SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID        
    	      
    	IF (@temp >= 4)        
    	BEGIN        
    		-- ³Ê¹« ¸¹ÀÚ³ª        
    		RETURN -2        
    	END        
    	-- finish by novice.        
        
    	-----------------------------------------------------------------------------        
    	-- 2. ij¸¯ÅÍ Ãß°¡Ç챉        
    	-----------------------------------------------------------------------------        
    	IF (@CharScale > 68) -- 0100 0100 --> 68 ÀÌ´Ù!        
    	BEGIN        
    		-- ij¸¯ÅÍ »ý¼º ½ÇÆÐ! ½ºÄÉÀÏ °ªÀÌ ÀÌ»óÇÏ´Ù!         
    		RETURN -3        
    	END
            
    	EXEC @temp = _IsExistingCharName @CharName        
    	IF (@temp <> 0)        
    	BEGIN        
    		-- ÀÌ¹Ì »ç¿ëÁßÀÎ À̸§À̶ó´Âµ¥?        
    		RETURN -4        
    	END        
        
    BEGIN TRANSACTION
        
    	-- Àδø½Ã½ºÅÛÀÌ Àû¿ëµÇ¸é¼­ ¸¶Áö¸·¿¡ WorldID¿Í 1°ªÀ» ´õ ³Ö¾î ÁÖ¾ú´Ù!      
    	INSERT INTO _Char (RefObjID, CharName16, Scale, Strength, Intellect, LatestRegion,PosX, PosY, PosZ, AppointedTeleport, InventorySize,      
    				LastLogout, CurLevel, MaxLevel, RemainGold, RemainStatPoint, RemainSkillPoint, HP, MP, JobLvl_Trader, JobLvl_Hunter, JobLvl_Robber, WorldID, DailyPK)      
    	VALUES (@RefCharID, @CharName, @CharScale, 20, 20, @StartRegionID, @StartPos_X, @StartPos_Y, @StartPos_Z, @DefaultTeleport, 45,      
    				GetDate(), 1, 1, 25000000, 0, 0, 200,200, 1, 1, 1, 1, 50)      
        
    	SET @NewCharID = @@IDENTITY        
    	IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)        
    	BEGIN        
    		-- ij¸¯ÅÍ »ý¼º ½ÇÆÐ!        
    		ROLLBACK TRANSACTION        
    		RETURN -5        
    	END        
    	-- start by novice.        
    	-- ÀÌÁ¦ Slot ¾È¾´´Ù.. ±×³É Insert ¸¸..        
    	INSERT INTO _User VALUES (@UserJID, @NewCharID)        
    	-- finish by novice.        
        
        
    	 -----------------------------------------------------------------------------        
    	 -- 3-1. Àåºñ ½½·Ô ä¿ì±â        
    	 -- [Àκ¥Å丮 ½½·Ô 96°³] + [Àåºñ½½·Ô 13°³] <- Àκ¥Å丮 È®Àå ¼­ºñ½º ÈÄ 48°³¿¡¼­ 96°³·Î Áõ°¡!!!(woos0)
    	 -----------------------------------------------------------------------------        
    	 --PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!        
    	 INSERT INTO _Inventory(CharID, Slot, ItemID)        
    	  SELECT @NewCharID, cnt, 0        
    	   FROM _RefDummySlot with( nolock )       
    	    WHERE cnt < 109        
    
    	      
    	IF (@@ERROR <> 0)        
    	BEGIN        
    		-- Àκ¥Å丮 »ý¼º ½ÇÆÐ!        
    		ROLLBACK TRANSACTION        
    		RETURN -7         
    	END        
     -- PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!    
         
     -- ???? ??? ???? ?? ????...    
     /* ?? ???  ???? ??.    
      0: EQUIP_SLOT_HELM    
      1: EQUIP_SLOT_MAIL,    
      2: EQUIP_SLOT_SHOULDERGUARD,    
      3: EQUIP_SLOT_GAUNTLET,    
      4: EQUIP_SLOT_PANTS,    
      5: EQUIP_SLOT_BOOTS,    
      6: EQUIP_SLOT_WEAPON,    
      7: EQUIP_SLOT_SHIELD or ARROW,    
      8: EQUIP_SLOT_EARRING,    
      9: EQUIP_SLOT_NECKLACE,    
     10: EQUIP_SLOT_L_RING,    
     11: EQUIP_SLOT_R_RING,    
     */    
    
     -- Initial Equip Edit by LemoniscooL
     DECLARE @ItemID BIGINT    
     SET @ItemID = 0    
     -- Chest
     IF (@RefMailID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Hand
     IF (@RefHandID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 3, @RefHandID, @DurHand
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Hat
     IF (@RefHatID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 0, @RefHatID, @DurHat
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Shoulder
     IF (@RefShoulderID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 2, @RefShoulderID, @DurShoulder
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Pants 
     IF (@RefPantsID <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 4, @RefPantsID, @DurPants
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -9    
    	END    
     END    
     -- Boots    
     IF (@RefBootsID <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 5, @RefBootsID, @DurBoots
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -10    
    	END    
     END    
     -- Weapon    
     IF (@RefWeaponID <> 0) BEGIN   
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 6, @RefWeaponID, @DurWeapon
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -11    
    	END    
     END    
     -- Shield
     IF (@RefShield <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @RefShield, @DurShield
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -12    
    	END    
     END    
     -- Arror/Bolt
     IF (@DefaultArrow <> 0) BEGIN    
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250
    	IF (@ItemID <= 0) BEGIN    
    		ROLLBACK TRANSACTION    
    		RETURN -13    
    	END    
     END
     -- Earring
     IF (@RefEarringID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 9, @RefEarringID, @DurEarring
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Ring 1
     IF (@RefRingID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 11, @RefRingID, @DurRing
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Ring 2
     IF (@RefRingID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 12, @RefRingID, @DurRing
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Necklace
     IF (@RefNeckID <> 0) BEGIN
    	EXEC @ItemID =  _FN_ADD_INITIAL_EQUIP @NewCharID, 10, @RefNeckID, @DurNeck
    	IF (@ItemID <= 0) BEGIN
    		ROLLBACK TRANSACTION
    		RETURN -8
    	END
     END
     -- Initial Equip Edit by LemoniscooL
         
    	 -----------------------------------------------------------------------------        
    	 -- 3-2. ¾Æ¹ÙŸ Inventory ½½·Ô ä¿ì±â        
    	 -- [¾Æ¹ÙŸ Àκ¥Å丮 ½½·Ô 5°³]
    	 -- APPLY_AVATAR_SYSTEMÀÌ Àû¿ëµÇ¸é¼­ Ãß°¡µÇ´Â ºÎºÐ
    	 -----------------------------------------------------------------------------        
    	 --PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!        
    	 INSERT INTO _InventoryForAvatar(CharID, Slot, ItemID)        
    	  SELECT @NewCharID, cnt, 0
    	   FROM _RefDummySlot with( nolock )       
    	    WHERE cnt < 5
    
    	      
    	IF (@@ERROR <> 0)        
    	BEGIN        
    		-- ¾Æ¹ÙŸ Àκ¥Å丮 »ý¼º ½ÇÆÐ!        
    		ROLLBACK TRANSACTION        
    		RETURN -14
    	END        
    	--PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!        
    	      
    	-----------------------------------------------------------------------------        
    	-- default skill³Ö¾îÁÖ±â        
    	-----------------------------------------------------------------------------        
    	DECLARE @country tinyINT        
    	EXEC @country = _GetObjCountry @RefCharID        
    	       
    	INSERT INTO _CharSkillMastery (CharID, MasteryID, Level)        
    	SELECT @NewCharID, MasteryID, 0        
    	FROM _RefCharDefault_SkillMastery  with(nolock)      
    	WHERE Race = @country or Race = 3        
    	IF (@@error <> 0)        
    	BEGIN        
    		ROLLBACK TRANSACTION        
    		RETURN -15        
    	END        
    	INSERT INTO _CharSkill (CharID,SkillID,Enable)        
    	SELECT @NewCharID, SkillID, 1        
    	FROM  _RefCharDefault_Skill  with(nolock)      
    	WHERE Race = @country or Race = 3        
    	IF (@@error <> 0)        
    	BEGIN        
    		ROLLBACK TRANSACTION        
    		RETURN -16        
    	END        
    	-----------------------------------------------------------------------------        
    	-- ±âº» Äù½ºÆ® ³Ö¾îÁÖ±â
    	-----------------------------------------------------------------------------        
    	INSERT INTO _CharQuest (CharID, QuestID, Status, AchievementCount, StartTime, EndTime, QuestData1, QuestData2)        
    	SELECT @NewCharID, ID, 1, 0, getdate(), getdate(), 0, 0        
    	FROM _RefQuest
    	WHERE CodeName in (SELECT CodeName FROM _RefCharDefault_Quest  with(nolock) WHERE (Race = @country or Race = 3) and RequiredLevel = 1 and Service = 1)
    	IF (@@error <> 0)
    	BEGIN
    		ROLLBACK TRANSACTION        
    		RETURN -17        
    	END    
    	-----------------------------------------------------------------------------        
    	-- Static Avatar Initial Record ³Ö±â        
    	-----------------------------------------------------------------------------        
    	INSERT INTO _StaticAvatar(CharID) values(@NewCharID)        
    	IF (@@ERROR <> 0)        
    	BEGIN        
    		ROLLBACK TRANSACTION        
    		RETURN -18        
    	END         
    	      
    	-----------------------------------------------------------------------------        
    	-- Trijob ä¿ö³Ö±â!!!!!        
    	-----------------------------------------------------------------------------        
    	INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0)        
    	IF (@@ERROR <> 0)        
    	BEGIN        
    		-- Àκ¥Å丮 »ý¼º ½ÇÆÐ!        
    		ROLLBACK TRANSACTION        
    		RETURN -19        
    	END         
    	      
    	-----------------------------------------------------------------------------        
    	-- CharList¿¡ ID ³Ö¾îÁÖ±â        
    	-----------------------------------------------------------------------------        
    	INSERT _CharNameList VALUES(@CharName, @NewCharID)        
     UPDATE _Char SET CurLevel = 90, MaxLevel = 90, ExpOffset = 281672372, RemainGold = 5000000, RemainSkillPoint = 5000000, InventorySize = 109 WHERE _Char.CharID = @NewCharID
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_RENT_REVERSE_RETURN_SCROLL',50,1
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_MALL_RESURRECTION_SCROLL',50,1
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_GLOBAL_CHATTING',50,1
     exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_COS_P_MYOWON_SCROLL',1,0
     IF (@RefCharID<=14970 AND @RefCharID>=14958) or (@RefCharID<=1919 AND @RefCharID>=1907) BEGIN --male
    	exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_M_NASRUN',1,0
     END
    
     IF (@RefCharID<=14983 AND @RefCharID>=14971) or (@RefCharID<=1932 AND @RefCharID>=1920) BEGIN --female
    	exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_W_NASRUN',1,0
     END
     
                
    	-- Quick Slot Á¤º¸ ÀúÀå¿ë!!!        
    	exec _AddNewClientConfig @NewCharID  -- by novice...... for saving client configurations...        
    
    COMMIT TRANSACTION        
    	      
    RETURN @NewCharID
    Last edited by arabcart; 27-11-13 at 08:39 PM.

  14. #14
    Account Upgraded | Title Enabled! lemoniscool is offline
    MemberRank
    Nov 2009 Join Date
    GermanyLocation
    579Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    oh just saw i forgot a change i made to _FN_ADD_INITIAL_EQUIP sorry for that, added the edited procedure to first post

  15. #15
    Proficient Member P0kemonMast is offline
    MemberRank
    Jun 2012 Join Date
    156Posts

    Re: [SQL] Add full equip +5 to new chars [Better way]

    This works good , only thing is if you're going to use it for blackrogue 110 you must change the Euro's @RefMailID. They are not the same as Vsro. Just a head's up for you guys


    This is are the ID for blackrogue 110

    Code:
      -- Male Clothes EU
     (@RefMailID = 11465)
     
     
     -- Male Armor EU
     (@RefMailID = 11459)
     
     
     -- Male Protector EU
     (@RefMailID = 11462)
     
     
     -- Female Clothes EU
     (@RefMailID = 11474)
     
     
     -- Female Armor EU
     (@RefMailID = 11468)
     
     
     -- Female Protector EU
     (@RefMailID = 11471)



Page 1 of 2 12 LastLast

Advertisement