رد: اي حد يساعدني انا معنديش dbo.AddNewChar ممكن حل او مكانه بالضبط
كود PHP:
USE [SRO_VT_SHARD] GO /****** Object: StoredProcedure [dbo].[_AddNewChar] Script Date: 6/16/2015 7:30:46 PM ******/ 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 Albert 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
-- 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
-- Initial Equip Edit by Albert 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 Albert
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 = 1, MaxLevel = 1, Strength = 20, Intellect= 20, RemainStatPoint= 0, ExpOffset = 0, RemainGold = 50000000, RemainSkillPoint = 500000, InventorySize = 109 WHERE _Char.CharID = @NewCharID UPDATE _Items SET OptLevel=12 WHERE ID64 IN (SELECT ItemID FROM _Inventory WHERE Slot BETWEEN 0 AND 12 AND Slot Not LIKE '15' AND CharID=@NewCharID) exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_RENT_REVERSE_RETURN_SCROLL',10,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_MALL_RESURRECTION_SCROLL',10,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_MALL_PREMIUM_GLOBAL_GOLDTIME',1,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E090930_SPEED_UP_SUPER_SCROLL',10,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_COS_P_MYOWON_SCROLL',1,0 IF (@RefCharID >= 1907 AND @RefCharID <= 1919) -- MALE CH BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_M_NASRUN',1,0 END ELSE IF (@RefCharID >= 14875 AND @RefCharID <= 14887) -- MALE EU BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_M_NASRUN',1,0 END ELSE IF (@RefCharID >= 1920 AND @RefCharID <= 1931) -- FEMALE CH BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_W_NASRUN',1,0 END ELSE IF (@RefCharID >= 14888 AND @RefCharID <= 14900) -- FEMALE EU BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_W_NASRUN',1,0 END
-- Quick Slot ء¤؛¸ ہْہه؟ë!!! exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
رد: اي حد يساعدني انا معنديش dbo.AddNewChar ممكن حل او مكانه بالضبط
اقتباس:
المشاركة الأصلية كتبت بواسطة M.HADAD
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
كود PHP:
USE [SRO_VT_SHARD] GO /****** Object: StoredProcedure [dbo].[_AddNewChar] Script Date: 6/16/2015 7:30:46 PM ******/ 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 Albert 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
-- 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
-- Initial Equip Edit by Albert 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 Albert
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 = 1, MaxLevel = 1, Strength = 20, Intellect= 20, RemainStatPoint= 0, ExpOffset = 0, RemainGold = 50000000, RemainSkillPoint = 500000, InventorySize = 109 WHERE _Char.CharID = @NewCharID UPDATE _Items SET OptLevel=12 WHERE ID64 IN (SELECT ItemID FROM _Inventory WHERE Slot BETWEEN 0 AND 12 AND Slot Not LIKE '15' AND CharID=@NewCharID) exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_RENT_REVERSE_RETURN_SCROLL',10,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_MALL_RESURRECTION_SCROLL',10,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_MALL_PREMIUM_GLOBAL_GOLDTIME',1,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E090930_SPEED_UP_SUPER_SCROLL',10,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_COS_P_MYOWON_SCROLL',1,0 IF (@RefCharID >= 1907 AND @RefCharID <= 1919) -- MALE CH BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_M_NASRUN',1,0 END ELSE IF (@RefCharID >= 14875 AND @RefCharID <= 14887) -- MALE EU BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_M_NASRUN',1,0 END ELSE IF (@RefCharID >= 1920 AND @RefCharID <= 1931) -- FEMALE CH BEGIN exec _ADD_ITEM_EXTERN @CharName,'ITEM_EVENT_AVATAR_W_NASRUN',1,0 END ELSE IF (@RefCharID >= 14888 AND @RefCharID <= 14900) -- FEMALE EU BEGIN 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
هو لو استخدم الكويرى كدة هيجبلو ايرور و مش هيشتغل
لان انت جيبو Alter عدل عليها و خليها Create
و علشان السهولة اهى استخدم دا اكنو كويرى عادى و هو
هيعملك البروسيدجر لوحدة