|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة [ قسم خاص لأسئلة واستفسارات عمل السيرفرات الخاصة ] [ يرجى الالتزام بقوانين قسم الأسئلة والاستفسارات ] |
|
|
07-01-2017, 04:59 AM
|
#16
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
حضرتك الكويرى دا مش شغال بيجيب كدا
Msg 208, Level 16, State 1, Line 2
Invalid object name 'sys.sql_moudels'.
|
تمام عدلت عليها بالاسم الصح قولتلك مش فاكر اوى :D
كود PHP:
USE SRO_VT_SHARD SELECT * FROM sys.all_sql_modules WHERE definition like '%_AddTimedJob%'
نتايجها عندى
وده اللى المفروض هتعمله بعد ماتمسح اللى عندك
كود PHP:
CREATE procedure [dbo].[_AddTimedJob]
كود PHP:
CREATE procedure [dbo].[_AddTimedJob] @CharID int, @Category tinyint, @JobID int, @TimeToKeep int, @Data1 int, @Data2 int, --##begin due to develop composite item @Data3 int, @Data4 int, @Data5 int, @Data6 int, @Data7 int, @Data8 int, @Serial64 bigint, @JID int --##end due to develop composite item as if (not exists (select CharID from _Char with (nolock) where CharID = @CharID)) return -1 if (@TimeToKeep <= 0) return -2 declare @NewJobID int set @NewJobID = 0 --##begin due to develop composite item insert into _TimedJob(CharID,Category,JobID,TimeToKeep,Data1,Data2,Data3,Data4,Data5,Data6,Data7,Data8,Serial64,JID) values(@CharID, @Category, @JobID, @TimeToKeep, @Data1, @Data2, @Data3, @Data4, @Data5, @Data6, @Data7, @Data8, @Serial64, @JID) --##end due to develop composite item set @NewJobID = @@identity if (@@error <> 0 or @@rowcount = 0) return -3 return @NewJobID
كود PHP:
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- pet_skill_item (أƒأ–¼±أˆ£) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CREATE PROCEDURE [dbo].[_AddTimedJobForPet] @CharID int, @Category tinyint, @JobID int, @TimeToKeep int, @Data1 int, @Data2 int, @Data3 int, @Data4 int, @Data5 int, @Data6 int, @Data7 int, @Data8 int, @Serial64 bigint as if (not exists (select ID from _CharCOS with (nolock) where ID = @CharID)) return -1
if (@TimeToKeep <= 0) return -2
declare @NewJobID int set @NewJobID = 0
insert into _TimedJobForPet values(@CharID, @Category, @JobID, @TimeToKeep, @Data1, @Data2, @Data3, @Data4, @Data5, @Data6, @Data7, @Data8, @Serial64, 0) set @NewJobID = @@identity
if (@@error <> 0 or @@rowcount = 0) return -3
return @NewJobID
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
كود PHP:
USE SRO_VT_SHARD SELECT * FROM sys.all_sql_modules WHERE definition like '%_AddNewChar%'
نتايجها عندى
كود PHP:
-- أ„³¸¯أ…أچ¸¦ »أ½¼آ؛أ‡أڈ´أ‚ أ‡أپ·أژ½أƒأ€أ؛¸¦ ¼أ¶أپ¤أ‡أڈآ؟© أ„³¸¯أ…أچ »أ½¼آ؛ ½أƒ, _CharTrijobآ؟آ، ·¹أ„أڑµأ¥¸¦ أƒأں°آ،أ‡أڈµµ·أڈ أ‡أ‘´أ™. CREATE PROCEDURE [dbo].[_AddNewChar_THINH] @UserJID INT, @Accname Varchar(64), --@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, @DurMail tinyINT, @DurPants tinyINT, @DurBoots tinyINT, @DurWeapon tinyINT, @DefaultArrow INT AS SET NOCOUNT ON DECLARE @temp INT DECLARE @NewCharID INT SET @NewCharID = 0 ----------------------------------------------------------------------------- -- 1. أ„³¸¯أ…أچ ½½·أ” ³أ‘¹أ¶°آ، validأ‡أ‘ °أچأ€أژأپأ¶, ±×¸®°أ* آ؛أ³½½·أ”أ€أŒ ¸أ‚´أ‚أپأ¶ ¸أ•أ€أ؛ أƒ¼أ…©أ‡أ‘´أ™. ----------------------------------------------------------------------------- /* -- commented by novice. for server integration. IF (@CharSlot = 0) BEGIN SELECT @temp = CharID1 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END ELSE IF (@CharSlot = 1) BEGIN SELECT @temp = CharID2 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END ELSE IF (@CharSlot = 2) BEGIN SELECT @temp = CharID3 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END ELSE BEGIN -- °آ،´أ‰أ‡أ‘ أ„³¸¯أ…أچ ½½·أ”أ€آ؛ 1,2,3 أ€أŒ·¸°أ” 3°³ »أ“أ€أŒ¶أ³°أ*! ROLLBACK TRANSACTION RETURN -1 END IF (@temp <> 0) BEGIN -- آ؛أ³ ½½·أ”أ€أŒ ¾أ†´أڈ¹أ‡·أژ ¹«أˆآ؟! ROLLBACK TRANSACTION RETURN -2 END */ -- start by novice. SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID IF (@temp >= 3) 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
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) 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) SET @NewCharID = @@IDENTITY
-- INSERT INTO _User VALUES (@UserJID, @NewCharID)
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0) BEGIN -- أ„³¸¯أ…أچ »أ½¼آ؛ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -5 END INSERT INTO _User VALUES (@UserJID, @NewCharID)
/* -- commented by novice. for server integration. IF (@CharSlot = 0) BEGIN UPDATE _User SET CharID1 = @NewCharID WHERE UserJID= @UserJID END ELSE IF (@CharSlot = 1) BEGIN UPDATE _User SET CharID2 = @NewCharID WHERE UserJID= @UserJID END ELSE IF (@CharSlot = 2) BEGIN UPDATE _User SET CharID3 = @NewCharID WHERE UserJID = @UserJID END IF (@@ERROR <> 0) BEGIN -- 'Userأ…×أ€أŒآ؛أ*أ€أ‡ أ„³¸¯أ…أچ ½½·أ” ¼¼أ†أƒ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -6 END */ -- start by novice. -- أ€أŒأپ¦ Slot ¾أˆ¾´´أ™.. ±×³أ‰ Insert ¸¸.. -- INSERT INTO _User VALUES (@UserJID, @NewCharID) -- finish by novice. ----------------------------------------------------------------------------- -- 3. أ€أ¥آ؛أ± ½½·أ” أƒ¤آ؟أ¬±â -- [أ€أژآ؛¥أ…أ¤¸® ½½·أ” 48°³] + [أ€أ¥آ؛أ±½½·أ” 13°³] ----------------------------------------------------------------------------- INSERT INTO _Inventory(CharID, Slot, ItemID) SELECT @NewCharID, CNT, 0 FROM _RefDummySlot WITH (NOLOCK) WHERE CNT < 61
IF (@@ERROR <> 0) BEGIN -- أ€أژآ؛¥أ…أ¤¸® »أ½¼آ؛ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -7 END -- µأ°أ†أ؛أ†®·أژ ¼±أ…أƒأ‡أ‘ ¾أ†أ€أŒأ…أ›أ€» ´أ™½أƒ ³أ–¾îأپأ–أ€أڑ... /* آ؟أ¤·± ¼أ¸¼*·أژ أپ¤أ€أ‡µأ‡¾î أ€أ–´أ™. 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, */ DECLARE @ItemID BIGINT SET @ItemID = 0
-- »أ³°© IF (@RefMailID <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -8 END END -- ¹أ™أپأ¶ 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 -- أˆ¤½أƒ default·أژ ¼±أ…أƒأ‡أ‘ ¹«±â°آ، أˆ°أ€أŒ¶أ³¸é أˆ*»أ¬ 250°³µéأ€أŒ أˆ°أ…ëµµ أ‡أ”²² أپأک´أ™. أپأ’أ„آ،? IF (@DefaultArrow <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250 IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -12 END END ----------------------------------------------------------------------------- -- 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 -13 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 -14 END
----------------------------------------------------------------------------- -- TutorialQuest³أ–¾îأپأ–±â ----------------------------------------------------------------------------- INSERT INTO _CharQuest (CharID, QuestID, Status, AchievementCount, StartTime, EndTime, QuestData1, QuestData2) SELECT @NewCharID, QuestID, 4, 0, getdate(), getdate(), 0, 0 FROM _RefCharDefault_Quest WITH (NOLOCK) WHERE Race = @country or Race = 3 IF (@@error <> 0) BEGIN ROLLBACK TRANSACTION RETURN -15 END ----------------------------------------------------------------------------- -- Static Avatar Initial Record ³أ–±â ----------------------------------------------------------------------------- INSERT INTO _StaticAvatar(CharID) values(@NewCharID) IF (@@ERROR <> 0) BEGIN ROLLBACK TRANSACTION RETURN -16 END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- PATCH_READY ¹«آ؟آھ°أ؛ »ï°¢´ë¸³2 (أƒأ–أ€أژأˆ£) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ----------------------------------------------------------------------------- -- Trijob أƒ¤آ؟أ¶³أ–±â!!!!! ----------------------------------------------------------------------------- INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0) IF (@@ERROR <> 0) BEGIN -- أ€أژآ؛¥أ…أ¤¸® »أ½¼آ؛ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -17 END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- PATCH_READY ¹«آ؟آھ°أ؛ »ï°¢´ë¸³2 (أƒأ–أ€أژأˆ£) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ insert _AccountJID values(@Accname, @UserJID,0) ----------------------------------------------------------------------------- -- CharListآ؟آ، ID ³أ–¾îأپأ–±â ----------------------------------------------------------------------------- INSERT _CharNameList VALUES(@CharName, @NewCharID) COMMIT TRANSACTION
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1
-- Quick Slot أپ¤آ؛¸ أ€أ؛أ€أ¥آ؟ë!!! exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
RETURN @NewCharID
وده برضو اللى المفروض هتعمله بعد ماتمسح اللى عندك من نتايجك انت !
كود PHP:
CREATE PROCEDURE [dbo].[_AddNewChar]
كود PHP:
CREATE 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 ----------------------------------------------------------------------------- -- 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, */ DECLARE @ItemID BIGINT SET @ItemID = 0 -- »أ³°© IF (@RefMailID <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -8 END END -- ¹أ™أپأ¶ 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 -- ¹أ¦أ†أگ IF (@RefShield <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @RefShield, @DurShield IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -12 END END -- أˆ¤½أƒ default·أژ ¼±أ…أƒأ‡أ‘ ¹«±â°آ، أˆ°أ€أŒ¶أ³¸é أˆ*»أ¬ 250°³µéأ€أŒ أˆ°أ…ëµµ أ‡أ”²² أپأک´أ™. أپأ’أ„آ،? IF (@DefaultArrow <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250 IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -13 END END
----------------------------------------------------------------------------- -- 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) exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_SCROLL_RETURN_NEWBIE_01',20,1 -- Quick Slot أپ¤آ؛¸ أ€أ؛أ€أ¥آ؟ë!!! exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
COMMIT TRANSACTION RETURN @NewCharID
كود PHP:
-- 2008.12.19 woos0 ---------------------------------------------------------------------------------- -- أˆ®أ€أ¥أ‡أڈ´أ‚ أ€أژآ؛¥أ…أ¤¸®آ؟آ، ¸أ‚أƒç أƒأ–´ë أ‡أ‘µµ¼أ¶آ؟آ، ´ëأ‡أ‘ DummySlot (_RefDummySlot) أ€» -- أ‡أ¶أ€ç±îأپأ¶ »أ½¼آ؛أ‡أ‘ أ„³¸¯أ…أچآ؟آ، ³أ–¾îأپأک´أ™. (أ€أŒأˆأ„ »أ½¼آ؛أ‡أڈ´أ‚ أ„³¸¯أ…أچ´أ‚ ¼أ¶أپ¤µأˆ _AddNewCharآ؟آ،¼* أƒ³¸®) -- -- ±âأپ¸ 61°³ ( 13(أ€أ¥آ؛أ±) + 32(±âآ؛»أ€أژآ؛¥) + 16(أ„ù½آ؛أ†®أˆ®أ€أ¥) ) آ؟آ،¼* أˆ®أ€أ¥أ‡أڈآ؟© -- أ‡أ¶أ€ç 109°³ ( 13(أ€أ¥آ؛أ±) + 32(±âآ؛»أ€أژآ؛¥) + 20(أ„ù½آ؛أ†®أˆ®أ€أ¥) + 32(½أ‡أ…© أˆ®أ€أ¥ ¾أ†أ€أŒأ…أ›) + 10(أƒأںأˆأ„ ±âأˆ¹) ) ---------------------------------------------------------------------------------- ---------------------------------------------------------------------------------- -- أ€أŒ¹أ¸ أˆ®أ€أ¥أ€¸·أژ 109°³ ±îأپأ¶ °آ،¹أ‡·أژ, أ‡أپ·أژ½أƒأ€أ؛ »أ³أ€¸·أژ أ€أژµ¦½آ؛ °آھأ€أژ 61 ~ 108 ¸¦ أ€أ”·أ‚أ‡أکµµ µأ‡أپأ¶¸¸, -- أƒأںأˆأ„ أ‡أ‘¹أ¸ ´أµ أˆ®أ€أ¥أ‡أ’ °آ،´أ‰¼آ؛أ€» آ؟°µأژأ‡أڈآ؟© ½أƒأ€أ›½أƒ آ؛¯¼أ¶ µأژ°³¸¦ ´أµ ¹أµµ·أڈ أ‡أڈآ؟´´أ™. ----------------------------------------------------------------------------------
CREATE PROCEDURE _InsertDummySlotForExtention @BeginIndex tinyint, @EndIndex tinyint AS
-- أ€أ”·أ‚أ‡أ‘ أ€أژµ¦½آ؛ ¹أ¸أˆ£ أ€¯أˆآ؟¼آ؛ °أ‹»ç --------------------------------- IF(@BeginIndex > @EndIndex) BEGIN PRINT('½أƒأ€أ› أ€أژµ¦½آ؛ ¹أ¸أˆ£°آ، ³آ، أ€أژµ¦½آ؛ ¹أ¸أˆ£آ؛¸´أ™ أ…©´أ™!!!') RETURN END
-- أƒأں°آ،أ‡أ’ ´أµ¹أŒ½½·أ”آ؟آ، أ€أŒ¹أŒ ´أ™¸¥ ¾أ†أ€أŒأ…أ›أ€أŒ أ€أ–´أ‚أپأ¶ أˆ®أ€أژ --------------------------------------------------- IF EXISTS (SELECT CharID FROM _Inventory WHERE Slot >= @BeginIndex AND Slot <= @EndIndex AND ItemID <> 0) BEGIN PRINT('أƒأں°آ،أ‡أ’ ´أµ¹أŒ½½·أ”آ؟آ، أ€أŒ¹أŒ ´أ™¸¥ ¾أ†أ€أŒأ…أ›أ€أŒ أ€أ–´أ™!!!') RETURN END
-- ±âأپ¸ أ€أژآ؛¥أ…أ¤¸®آ؟آ، أ€أژµ¦½آ؛ ¹üأ€§آ؟آ، أ‡أک´çأ‡أڈ´أ‚ ½½·أ”أ€أŒ أ€أ–أ€»°أ¦آ؟أ¬ »èأپ¦ -------------------------------------------------------------- DELETE _Inventory WHERE Slot >= @BeginIndex AND Slot <= @EndIndex
BEGIN TRANSACTION
-- ±âأپ¸ _Inventoryآ؟آ، أƒأں°آ،µأ‡´أ‚ DummySlot أƒأں°آ، -------------------------------------------- INSERT _Inventory (CharID, Slot, ItemID) SELECT _Char.CharId, _RefDummySlot.cnt, 0 FROM _Char, _RefDummySlot WHERE _RefDummySlot.cnt >= @BeginIndex and _RefDummySlot.cnt <= @EndIndex and _Char.CharId <> 0 ORDER BY _Char.charid ASC
IF(@@ERROR = 0) BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END
لو ظهرتلك النتايج زى ديه تقدر تمسح وتدخلهم من جديد :)
بس برضو قبل ماتعمل حاجه عاوزك تاخد نسخه من الداتا بيز وتجيب النتايج زى منا جايبهالك كده نشوفها الاول سوا :)
طبعاً ده مثال على اللى عندى انا :)
|
|
التعديل الأخير تم بواسطة Dev.Myth ; 07-01-2017 الساعة 05:12 AM
|
إعلانات google |
|
07-01-2017, 05:08 AM
|
#17
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: استفسار بخصوص _AddNewChar
اول حاجه _AddNewChar
كود PHP:
55059332 -- ij¸¯Å͸¦ »ý¼ºÇÏ´Â ÇÁ·Î½ÃÀú¸¦ ¼öÁ¤ÇÏ¿© ij¸¯ÅÍ »ý¼º ½Ã, _CharTrijob¿¡ ·¹Äڵ带 Ãß°¡Çϵµ·Ï ÇÑ´Ù.
CREATE PROCEDURE [dbo].[_AddNewChar_THINH]
@UserJID INT,
@Accname Varchar(64),
--@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,
@DurMail tinyINT,
@DurPants tinyINT,
@DurBoots tinyINT,
@DurWeapon tinyINT,
@DefaultArrow INT
AS
SET NOCOUNT ON
DECLARE @temp INT
DECLARE @NewCharID INT
SET @NewCharID = 0
-----------------------------------------------------------------------------
-- 1. ij¸¯ÅÍ ½½·Ô ³Ñ¹ö°¡ validÇÑ °ÍÀÎÁö, ±×¸®°í ºó½½·ÔÀÌ ¸Â´ÂÁö ¸ÕÀú üũÇÑ´Ù.
-----------------------------------------------------------------------------
/* -- commented by novice. for server integration.
IF (@CharSlot = 0)
BEGIN SELECT @temp = CharID1 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END
ELSE IF (@CharSlot = 1)
BEGIN SELECT @temp = CharID2 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END
ELSE IF (@CharSlot = 2)
BEGIN SELECT @temp = CharID3 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END
ELSE
BEGIN -- °¡´ÉÇÑ Ä³¸¯ÅÍ ½½·ÔÀº 1,2,3 ÀÌ·¸°Ô 3°³ »ÓÀ̶ó°í!
ROLLBACK TRANSACTION
RETURN -1
END
IF (@temp <> 0)
BEGIN
-- ºó ½½·ÔÀÌ ¾Æ´Ï¹Ç·Î ¹«È¿!
ROLLBACK TRANSACTION
RETURN -2
END
*/
-- start by novice.
SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID
IF (@temp >= 3)
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
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)
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)
SET @NewCharID = @@IDENTITY
-- INSERT INTO _User VALUES (@UserJID, @NewCharID)
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
-- ij¸¯ÅÍ »ý¼º ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -5
END
INSERT INTO _User VALUES (@UserJID, @NewCharID)
/* -- commented by novice. for server integration.
IF (@CharSlot = 0)
BEGIN
UPDATE _User SET CharID1 = @NewCharID WHERE UserJID= @UserJID
END
ELSE IF (@CharSlot = 1)
BEGIN
UPDATE _User SET CharID2 = @NewCharID WHERE UserJID= @UserJID
END
ELSE IF (@CharSlot = 2)
BEGIN
UPDATE _User SET CharID3 = @NewCharID WHERE UserJID = @UserJID
END
IF (@@ERROR <> 0)
BEGIN
-- 'UserÅ×À̺íÀÇ Ä³¸¯ÅÍ ½½·Ô ¼¼Æà ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -6
END
*/
-- start by novice.
-- ÀÌÁ¦ Slot ¾È¾´´Ù.. ±×³É Insert ¸¸..
-- INSERT INTO _User VALUES (@UserJID, @NewCharID)
-- finish by novice.
-----------------------------------------------------------------------------
-- 3. Àåºñ ½½·Ô ä¿ì±â
-- [Àκ¥Å丮 ½½·Ô 48°³] + [Àåºñ½½·Ô 13°³]
-----------------------------------------------------------------------------
INSERT INTO _Inventory(CharID, Slot, ItemID)
SELECT @NewCharID, CNT, 0
FROM _RefDummySlot WITH (NOLOCK)
WHERE CNT < 61
IF (@@ERROR <> 0)
BEGIN
-- Àκ¥Å丮 »ý¼º ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -7
END
-- µðÆúÆ®·Î ¼±ÅÃÇÑ ¾ÆÀÌÅÛÀ» ´Ù½Ã ³Ö¾îÁÖÀÚ...
/* ¿ä·± ¼ø¼*·Î Á¤ÀǵǾî ÀÖ´Ù.
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,
*/
DECLARE @ItemID BIGINT
SET @ItemID = 0
-- »ó°©
IF (@RefMailID <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -8
END
END
-- ¹ÙÁö
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
-- Ȥ½Ã default·Î ¼±ÅÃÇÑ ¹«±â°¡ È°À̶ó¸é È*»ì 250°³µéÀÌ È°Åëµµ ÇÔ²² ÁØ´Ù. ÁÒÄ¡?
IF (@DefaultArrow <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -12
END
END
-----------------------------------------------------------------------------
-- 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 -13
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 -14
END
-----------------------------------------------------------------------------
-- TutorialQuest³Ö¾îÁÖ±â
-----------------------------------------------------------------------------
INSERT INTO _CharQuest (CharID, QuestID, Status, AchievementCount, StartTime, EndTime, QuestData1, QuestData2)
SELECT @NewCharID, QuestID, 4, 0, getdate(), getdate(), 0, 0
FROM _RefCharDefault_Quest WITH (NOLOCK)
WHERE Race = @country or Race = 3
IF (@@error <> 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -15
END
-----------------------------------------------------------------------------
-- Static Avatar Initial Record ³Ö±â
-----------------------------------------------------------------------------
INSERT INTO _StaticAvatar(CharID) values(@NewCharID)
IF (@@ERROR <> 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -16
END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- PATCH_READY ¹«¿ª°ú »ï°¢´ë¸³2 (ÃÖÀÎÈ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-----------------------------------------------------------------------------
-- Trijob ä¿ö³Ö±â!!!!!
-----------------------------------------------------------------------------
INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0)
IF (@@ERROR <> 0)
BEGIN
-- Àκ¥Å丮 »ý¼º ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -17
END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- PATCH_READY ¹«¿ª°ú »ï°¢´ë¸³2 (ÃÖÀÎÈ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
insert _AccountJID values(@Accname, @UserJID,0)
-----------------------------------------------------------------------------
-- CharList¿¡ ID ³Ö¾îÁÖ±â
-----------------------------------------------------------------------------
INSERT _CharNameList VALUES(@CharName, @NewCharID)
COMMIT TRANSACTION
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1
-- Quick Slot Á¤º¸ ÀúÀå¿ë!!!
exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
RETURN @NewCharID
1 1 0 0 0 0 NULL 0
_____
كود PHP:
1827133900
-- 2008.12.19 woos0
----------------------------------------------------------------------------------
-- È®ÀåÇÏ´Â Àκ¥Å丮¿¡ ¸ÂÃç ÃÖ´ë Çѵµ¼ö¿¡ ´ëÇÑ DummySlot (_RefDummySlot) À»
-- ÇöÀç±îÁö »ý¼ºÇÑ Ä³¸¯ÅÍ¿¡ ³Ö¾îÁØ´Ù. (ÀÌÈÄ »ý¼ºÇϴ ij¸¯ÅÍ´Â ¼öÁ¤µÈ _AddNewChar¿¡¼* ó¸®)
--
-- ±âÁ¸ 61°³ ( 13(Àåºñ) + 32(±âº»Àκ¥) + 16(Äù½ºÆ®È®Àå) ) ¿¡¼* È®ÀåÇÏ¿©
-- ÇöÀç 109°³ ( 13(Àåºñ) + 32(±âº»Àκ¥) + 20(Äù½ºÆ®È®Àå) + 32(½ÇÅ© È®Àå ¾ÆÀÌÅÛ) + 10(ÃßÈÄ ±âȹ) )
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
-- À̹ø È®ÀåÀ¸·Î 109°³ ±îÁö °¡¹Ç·Î, ÇÁ·Î½ÃÀú »óÀ¸·Î À妽º °ªÀÎ 61 ~ 108 ¸¦ ÀÔ·ÂÇصµ µÇÁö¸¸,
-- ÃßÈÄ Çѹø ´õ È®ÀåÇÒ °¡´É¼ºÀ» ¿°µÎÇÏ¿© ½ÃÀ۽à º¯¼ö µÎ°³¸¦ ´õ ¹Þµµ·Ï ÇÏ¿´´Ù.
----------------------------------------------------------------------------------
CREATE PROCEDURE _InsertDummySlotForExtention
@BeginIndex tinyint,
@EndIndex tinyint
AS
-- ÀÔ·ÂÇÑ À妽º ¹øÈ£ À¯È¿¼º °Ë»ç
---------------------------------
IF(@BeginIndex > @EndIndex)
BEGIN
PRINT('½ÃÀÛ À妽º ¹øÈ£°¡ ³¡ À妽º ¹øÈ£º¸´Ù Å©´Ù!!!')
RETURN
END
-- Ãß°¡ÇÒ ´õ¹Ì½½·Ô¿¡ ÀÌ¹Ì ´Ù¸¥ ¾ÆÀÌÅÛÀÌ ÀÖ´ÂÁö È®ÀÎ
---------------------------------------------------
IF EXISTS (SELECT CharID FROM _Inventory WHERE Slot >= @BeginIndex AND Slot <= @EndIndex AND ItemID <> 0)
BEGIN
PRINT('Ãß°¡ÇÒ ´õ¹Ì½½·Ô¿¡ ÀÌ¹Ì ´Ù¸¥ ¾ÆÀÌÅÛÀÌ ÀÖ´Ù!!!')
RETURN
END
-- ±âÁ¸ Àκ¥Å丮¿¡ À妽º ¹üÀ§¿¡ ÇØ´çÇÏ´Â ½½·ÔÀÌ ÀÖÀ»°æ¿ì »èÁ¦
--------------------------------------------------------------
DELETE _Inventory
WHERE Slot >= @BeginIndex AND Slot <= @EndIndex
BEGIN TRANSACTION
-- ±âÁ¸ _Inventory¿¡ Ãß°¡µÇ´Â DummySlot Ãß°¡
--------------------------------------------
INSERT _Inventory (CharID, Slot, ItemID)
SELECT _Char.CharId, _RefDummySlot.cnt, 0
FROM _Char, _RefDummySlot
WHERE _RefDummySlot.cnt >= @BeginIndex and _RefDummySlot.cnt <= @EndIndex and _Char.CharId <> 0
ORDER BY _Char.charid ASC
IF(@@ERROR = 0)
BEGIN
COMMIT TRANSACTION
END
ELSE
BEGIN
ROLLBACK TRANSACTION
END
0 0 0 0 0 0 NULL 0
بس ملحوظه
عندى بروسيدور نفس الاسم الى طلع من الكويرى الى انتا مديهولى
_AddNewChar_THINH
|
|
التعديل الأخير تم بواسطة thedeathlist ; 07-01-2017 الساعة 05:21 AM
|
07-01-2017, 05:24 AM
|
#18
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
كود PHP:
55059332 -- ij¸¯Å͸¦ »ý¼ºÇÏ´Â ÇÁ·Î½ÃÀú¸¦ ¼öÁ¤ÇÏ¿© ij¸¯ÅÍ »ý¼º ½Ã, _CharTrijob¿¡ ·¹Äڵ带 Ãß°¡Çϵµ·Ï ÇÑ´Ù.
CREATE PROCEDURE [dbo].[_AddNewChar_THINH]
@UserJID INT,
@Accname Varchar(64),
--@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,
@DurMail tinyINT,
@DurPants tinyINT,
@DurBoots tinyINT,
@DurWeapon tinyINT,
@DefaultArrow INT
AS
SET NOCOUNT ON
DECLARE @temp INT
DECLARE @NewCharID INT
SET @NewCharID = 0
-----------------------------------------------------------------------------
-- 1. ij¸¯ÅÍ ½½·Ô ³Ñ¹ö°¡ validÇÑ °ÍÀÎÁö, ±×¸®°í ºó½½·ÔÀÌ ¸Â´ÂÁö ¸ÕÀú üũÇÑ´Ù.
-----------------------------------------------------------------------------
/* -- commented by novice. for server integration.
IF (@CharSlot = 0)
BEGIN SELECT @temp = CharID1 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END
ELSE IF (@CharSlot = 1)
BEGIN SELECT @temp = CharID2 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END
ELSE IF (@CharSlot = 2)
BEGIN SELECT @temp = CharID3 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END
ELSE
BEGIN -- °¡´ÉÇÑ Ä³¸¯ÅÍ ½½·ÔÀº 1,2,3 ÀÌ·¸°Ô 3°³ »ÓÀ̶ó°í!
ROLLBACK TRANSACTION
RETURN -1
END
IF (@temp <> 0)
BEGIN
-- ºó ½½·ÔÀÌ ¾Æ´Ï¹Ç·Î ¹«È¿!
ROLLBACK TRANSACTION
RETURN -2
END
*/
-- start by novice.
SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID
IF (@temp >= 3)
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
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)
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)
SET @NewCharID = @@IDENTITY
-- INSERT INTO _User VALUES (@UserJID, @NewCharID)
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
-- ij¸¯ÅÍ »ý¼º ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -5
END
INSERT INTO _User VALUES (@UserJID, @NewCharID)
/* -- commented by novice. for server integration.
IF (@CharSlot = 0)
BEGIN
UPDATE _User SET CharID1 = @NewCharID WHERE UserJID= @UserJID
END
ELSE IF (@CharSlot = 1)
BEGIN
UPDATE _User SET CharID2 = @NewCharID WHERE UserJID= @UserJID
END
ELSE IF (@CharSlot = 2)
BEGIN
UPDATE _User SET CharID3 = @NewCharID WHERE UserJID = @UserJID
END
IF (@@ERROR <> 0)
BEGIN
-- 'UserÅ×À̺íÀÇ Ä³¸¯ÅÍ ½½·Ô ¼¼Æà ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -6
END
*/
-- start by novice.
-- ÀÌÁ¦ Slot ¾È¾´´Ù.. ±×³É Insert ¸¸..
-- INSERT INTO _User VALUES (@UserJID, @NewCharID)
-- finish by novice.
-----------------------------------------------------------------------------
-- 3. Àåºñ ½½·Ô ä¿ì±â
-- [Àκ¥Å丮 ½½·Ô 48°³] + [Àåºñ½½·Ô 13°³]
-----------------------------------------------------------------------------
INSERT INTO _Inventory(CharID, Slot, ItemID)
SELECT @NewCharID, CNT, 0
FROM _RefDummySlot WITH (NOLOCK)
WHERE CNT < 61
IF (@@ERROR <> 0)
BEGIN
-- Àκ¥Å丮 »ý¼º ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -7
END
-- µðÆúÆ®·Î ¼±ÅÃÇÑ ¾ÆÀÌÅÛÀ» ´Ù½Ã ³Ö¾îÁÖÀÚ...
/* ¿ä·± ¼ø¼*·Î Á¤ÀǵǾî ÀÖ´Ù.
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,
*/
DECLARE @ItemID BIGINT
SET @ItemID = 0
-- »ó°©
IF (@RefMailID <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -8
END
END
-- ¹ÙÁö
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
-- Ȥ½Ã default·Î ¼±ÅÃÇÑ ¹«±â°¡ È°À̶ó¸é È*»ì 250°³µéÀÌ È°Åëµµ ÇÔ²² ÁØ´Ù. ÁÒÄ¡?
IF (@DefaultArrow <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -12
END
END
-----------------------------------------------------------------------------
-- 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 -13
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 -14
END
-----------------------------------------------------------------------------
-- TutorialQuest³Ö¾îÁÖ±â
-----------------------------------------------------------------------------
INSERT INTO _CharQuest (CharID, QuestID, Status, AchievementCount, StartTime, EndTime, QuestData1, QuestData2)
SELECT @NewCharID, QuestID, 4, 0, getdate(), getdate(), 0, 0
FROM _RefCharDefault_Quest WITH (NOLOCK)
WHERE Race = @country or Race = 3
IF (@@error <> 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -15
END
-----------------------------------------------------------------------------
-- Static Avatar Initial Record ³Ö±â
-----------------------------------------------------------------------------
INSERT INTO _StaticAvatar(CharID) values(@NewCharID)
IF (@@ERROR <> 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -16
END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- PATCH_READY ¹«¿ª°ú »ï°¢´ë¸³2 (ÃÖÀÎÈ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-----------------------------------------------------------------------------
-- Trijob ä¿ö³Ö±â!!!!!
-----------------------------------------------------------------------------
INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0)
IF (@@ERROR <> 0)
BEGIN
-- Àκ¥Å丮 »ý¼º ½ÇÆÐ!
ROLLBACK TRANSACTION
RETURN -17
END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- PATCH_READY ¹«¿ª°ú »ï°¢´ë¸³2 (ÃÖÀÎÈ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
insert _AccountJID values(@Accname, @UserJID,0)
-----------------------------------------------------------------------------
-- CharList¿¡ ID ³Ö¾îÁÖ±â
-----------------------------------------------------------------------------
INSERT _CharNameList VALUES(@CharName, @NewCharID)
COMMIT TRANSACTION
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1
-- Quick Slot Á¤º¸ ÀúÀå¿ë!!!
exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
RETURN @NewCharID
1 1 0 0 0 0 NULL 0
1827133900
-- 2008.12.19 woos0
----------------------------------------------------------------------------------
-- È®ÀåÇÏ´Â Àκ¥Å丮¿¡ ¸ÂÃç ÃÖ´ë Çѵµ¼ö¿¡ ´ëÇÑ DummySlot (_RefDummySlot) À»
-- ÇöÀç±îÁö »ý¼ºÇÑ Ä³¸¯ÅÍ¿¡ ³Ö¾îÁØ´Ù. (ÀÌÈÄ »ý¼ºÇϴ ij¸¯ÅÍ´Â ¼öÁ¤µÈ _AddNewChar¿¡¼* ó¸®)
--
-- ±âÁ¸ 61°³ ( 13(Àåºñ) + 32(±âº»Àκ¥) + 16(Äù½ºÆ®È®Àå) ) ¿¡¼* È®ÀåÇÏ¿©
-- ÇöÀç 109°³ ( 13(Àåºñ) + 32(±âº»Àκ¥) + 20(Äù½ºÆ®È®Àå) + 32(½ÇÅ© È®Àå ¾ÆÀÌÅÛ) + 10(ÃßÈÄ ±âȹ) )
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
-- À̹ø È®ÀåÀ¸·Î 109°³ ±îÁö °¡¹Ç·Î, ÇÁ·Î½ÃÀú »óÀ¸·Î À妽º °ªÀÎ 61 ~ 108 ¸¦ ÀÔ·ÂÇصµ µÇÁö¸¸,
-- ÃßÈÄ Çѹø ´õ È®ÀåÇÒ °¡´É¼ºÀ» ¿°µÎÇÏ¿© ½ÃÀ۽à º¯¼ö µÎ°³¸¦ ´õ ¹Þµµ·Ï ÇÏ¿´´Ù.
----------------------------------------------------------------------------------
CREATE PROCEDURE _InsertDummySlotForExtention
@BeginIndex tinyint,
@EndIndex tinyint
AS
-- ÀÔ·ÂÇÑ À妽º ¹øÈ£ À¯È¿¼º °Ë»ç
---------------------------------
IF(@BeginIndex > @EndIndex)
BEGIN
PRINT('½ÃÀÛ À妽º ¹øÈ£°¡ ³¡ À妽º ¹øÈ£º¸´Ù Å©´Ù!!!')
RETURN
END
-- Ãß°¡ÇÒ ´õ¹Ì½½·Ô¿¡ ÀÌ¹Ì ´Ù¸¥ ¾ÆÀÌÅÛÀÌ ÀÖ´ÂÁö È®ÀÎ
---------------------------------------------------
IF EXISTS (SELECT CharID FROM _Inventory WHERE Slot >= @BeginIndex AND Slot <= @EndIndex AND ItemID <> 0)
BEGIN
PRINT('Ãß°¡ÇÒ ´õ¹Ì½½·Ô¿¡ ÀÌ¹Ì ´Ù¸¥ ¾ÆÀÌÅÛÀÌ ÀÖ´Ù!!!')
RETURN
END
-- ±âÁ¸ Àκ¥Å丮¿¡ À妽º ¹üÀ§¿¡ ÇØ´çÇÏ´Â ½½·ÔÀÌ ÀÖÀ»°æ¿ì »èÁ¦
--------------------------------------------------------------
DELETE _Inventory
WHERE Slot >= @BeginIndex AND Slot <= @EndIndex
BEGIN TRANSACTION
-- ±âÁ¸ _Inventory¿¡ Ãß°¡µÇ´Â DummySlot Ãß°¡
--------------------------------------------
INSERT _Inventory (CharID, Slot, ItemID)
SELECT _Char.CharId, _RefDummySlot.cnt, 0
FROM _Char, _RefDummySlot
WHERE _RefDummySlot.cnt >= @BeginIndex and _RefDummySlot.cnt <= @EndIndex and _Char.CharId <> 0
ORDER BY _Char.charid ASC
IF(@@ERROR = 0)
BEGIN
COMMIT TRANSACTION
END
ELSE
BEGIN
ROLLBACK TRANSACTION
END
0 0 0 0 0 0 NULL 0
|
للأسف مش ده !
واضح انهم مقفولين من كل حته :(
كده مفيش غير انك تمسح اللى عندك _AddNewChar و _AddTimeJob وتضيف دول بعد ماتمسحهم عن طريق New Query على SRO_VT_SHARD ولو مرضاش يتمسح معاك يبقى انا كده حلولى خلصت :D
التحميل فى المرفقات علشان المنتدى مش هيطلع الاكواد مظبوطه :)
|
|
|
07-01-2017, 05:27 AM
|
#19
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
اول حاجه _AddNewChar
كود PHP:
55059332 -- أ„³¸¯أ…أچ¸¦ »أ½¼آ؛أ‡أڈ´أ‚ أ‡أپ·أژ½أƒأ€أ؛¸¦ ¼أ¶أپ¤أ‡أڈآ؟© أ„³¸¯أ…أچ »أ½¼آ؛ ½أƒ, _CharTrijobآ؟آ، ·¹أ„أڑµأ¥¸¦ أƒأں°آ،أ‡أڈµµ·أڈ أ‡أ‘´أ™. CREATE PROCEDURE [dbo].[_AddNewChar_THINH] @UserJID INT, @Accname Varchar(64), --@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, @DurMail tinyINT, @DurPants tinyINT, @DurBoots tinyINT, @DurWeapon tinyINT, @DefaultArrow INT AS SET NOCOUNT ON DECLARE @temp INT DECLARE @NewCharID INT SET @NewCharID = 0 ----------------------------------------------------------------------------- -- 1. أ„³¸¯أ…أچ ½½·أ” ³أ‘¹أ¶°آ، validأ‡أ‘ °أچأ€أژأپأ¶, ±×¸®°أ* آ؛أ³½½·أ”أ€أŒ ¸أ‚´أ‚أپأ¶ ¸أ•أ€أ؛ أƒ¼أ…©أ‡أ‘´أ™. ----------------------------------------------------------------------------- /* -- commented by novice. for server integration. IF (@CharSlot = 0) BEGIN SELECT @temp = CharID1 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END ELSE IF (@CharSlot = 1) BEGIN SELECT @temp = CharID2 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END ELSE IF (@CharSlot = 2) BEGIN SELECT @temp = CharID3 FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID END ELSE BEGIN -- °آ،´أ‰أ‡أ‘ أ„³¸¯أ…أچ ½½·أ”أ€آ؛ 1,2,3 أ€أŒ·¸°أ” 3°³ »أ“أ€أŒ¶أ³°أ*! ROLLBACK TRANSACTION RETURN -1 END IF (@temp <> 0) BEGIN -- آ؛أ³ ½½·أ”أ€أŒ ¾أ†´أڈ¹أ‡·أژ ¹«أˆآ؟! ROLLBACK TRANSACTION RETURN -2 END */ -- start by novice. SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID IF (@temp >= 3) 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
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) 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) SET @NewCharID = @@IDENTITY
-- INSERT INTO _User VALUES (@UserJID, @NewCharID)
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0) BEGIN -- أ„³¸¯أ…أچ »أ½¼آ؛ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -5 END INSERT INTO _User VALUES (@UserJID, @NewCharID)
/* -- commented by novice. for server integration. IF (@CharSlot = 0) BEGIN UPDATE _User SET CharID1 = @NewCharID WHERE UserJID= @UserJID END ELSE IF (@CharSlot = 1) BEGIN UPDATE _User SET CharID2 = @NewCharID WHERE UserJID= @UserJID END ELSE IF (@CharSlot = 2) BEGIN UPDATE _User SET CharID3 = @NewCharID WHERE UserJID = @UserJID END IF (@@ERROR <> 0) BEGIN -- 'Userأ…×أ€أŒآ؛أ*أ€أ‡ أ„³¸¯أ…أچ ½½·أ” ¼¼أ†أƒ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -6 END */ -- start by novice. -- أ€أŒأپ¦ Slot ¾أˆ¾´´أ™.. ±×³أ‰ Insert ¸¸.. -- INSERT INTO _User VALUES (@UserJID, @NewCharID) -- finish by novice. ----------------------------------------------------------------------------- -- 3. أ€أ¥آ؛أ± ½½·أ” أƒ¤آ؟أ¬±â -- [أ€أژآ؛¥أ…أ¤¸® ½½·أ” 48°³] + [أ€أ¥آ؛أ±½½·أ” 13°³] ----------------------------------------------------------------------------- INSERT INTO _Inventory(CharID, Slot, ItemID) SELECT @NewCharID, CNT, 0 FROM _RefDummySlot WITH (NOLOCK) WHERE CNT < 61
IF (@@ERROR <> 0) BEGIN -- أ€أژآ؛¥أ…أ¤¸® »أ½¼آ؛ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -7 END -- µأ°أ†أ؛أ†®·أژ ¼±أ…أƒأ‡أ‘ ¾أ†أ€أŒأ…أ›أ€» ´أ™½أƒ ³أ–¾îأپأ–أ€أڑ... /* آ؟أ¤·± ¼أ¸¼*·أژ أپ¤أ€أ‡µأ‡¾î أ€أ–´أ™. 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, */ DECLARE @ItemID BIGINT SET @ItemID = 0
-- »أ³°© IF (@RefMailID <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -8 END END -- ¹أ™أپأ¶ 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 -- أˆ¤½أƒ default·أژ ¼±أ…أƒأ‡أ‘ ¹«±â°آ، أˆ°أ€أŒ¶أ³¸é أˆ*»أ¬ 250°³µéأ€أŒ أˆ°أ…ëµµ أ‡أ”²² أپأک´أ™. أپأ’أ„آ،? IF (@DefaultArrow <> 0) BEGIN EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250 IF (@ItemID <= 0) BEGIN ROLLBACK TRANSACTION RETURN -12 END END ----------------------------------------------------------------------------- -- 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 -13 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 -14 END
----------------------------------------------------------------------------- -- TutorialQuest³أ–¾îأپأ–±â ----------------------------------------------------------------------------- INSERT INTO _CharQuest (CharID, QuestID, Status, AchievementCount, StartTime, EndTime, QuestData1, QuestData2) SELECT @NewCharID, QuestID, 4, 0, getdate(), getdate(), 0, 0 FROM _RefCharDefault_Quest WITH (NOLOCK) WHERE Race = @country or Race = 3 IF (@@error <> 0) BEGIN ROLLBACK TRANSACTION RETURN -15 END ----------------------------------------------------------------------------- -- Static Avatar Initial Record ³أ–±â ----------------------------------------------------------------------------- INSERT INTO _StaticAvatar(CharID) values(@NewCharID) IF (@@ERROR <> 0) BEGIN ROLLBACK TRANSACTION RETURN -16 END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- PATCH_READY ¹«آ؟آھ°أ؛ »ï°¢´ë¸³2 (أƒأ–أ€أژأˆ£) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ----------------------------------------------------------------------------- -- Trijob أƒ¤آ؟أ¶³أ–±â!!!!! ----------------------------------------------------------------------------- INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0) IF (@@ERROR <> 0) BEGIN -- أ€أژآ؛¥أ…أ¤¸® »أ½¼آ؛ ½أ‡أ†أگ! ROLLBACK TRANSACTION RETURN -17 END
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -- PATCH_READY ¹«آ؟آھ°أ؛ »ï°¢´ë¸³2 (أƒأ–أ€أژأˆ£) --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ insert _AccountJID values(@Accname, @UserJID,0) ----------------------------------------------------------------------------- -- CharListآ؟آ، ID ³أ–¾îأپأ–±â ----------------------------------------------------------------------------- INSERT _CharNameList VALUES(@CharName, @NewCharID) COMMIT TRANSACTION
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1 exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1
-- Quick Slot أپ¤آ؛¸ أ€أ؛أ€أ¥آ؟ë!!! exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
RETURN @NewCharID
1 1 0 0 0 0 NULL 0
_____
كود PHP:
1827133900 -- 2008.12.19 woos0 ---------------------------------------------------------------------------------- -- أˆ®أ€أ¥أ‡أڈ´أ‚ أ€أژآ؛¥أ…أ¤¸®آ؟آ، ¸أ‚أƒç أƒأ–´ë أ‡أ‘µµ¼أ¶آ؟آ، ´ëأ‡أ‘ DummySlot (_RefDummySlot) أ€» -- أ‡أ¶أ€ç±îأپأ¶ »أ½¼آ؛أ‡أ‘ أ„³¸¯أ…أچآ؟آ، ³أ–¾îأپأک´أ™. (أ€أŒأˆأ„ »أ½¼آ؛أ‡أڈ´أ‚ أ„³¸¯أ…أچ´أ‚ ¼أ¶أپ¤µأˆ _AddNewCharآ؟آ،¼* أƒ³¸®) -- -- ±âأپ¸ 61°³ ( 13(أ€أ¥آ؛أ±) + 32(±âآ؛»أ€أژآ؛¥) + 16(أ„ù½آ؛أ†®أˆ®أ€أ¥) ) آ؟آ،¼* أˆ®أ€أ¥أ‡أڈآ؟© -- أ‡أ¶أ€ç 109°³ ( 13(أ€أ¥آ؛أ±) + 32(±âآ؛»أ€أژآ؛¥) + 20(أ„ù½آ؛أ†®أˆ®أ€أ¥) + 32(½أ‡أ…© أˆ®أ€أ¥ ¾أ†أ€أŒأ…أ›) + 10(أƒأںأˆأ„ ±âأˆ¹) ) ---------------------------------------------------------------------------------- ---------------------------------------------------------------------------------- -- أ€أŒ¹أ¸ أˆ®أ€أ¥أ€¸·أژ 109°³ ±îأپأ¶ °آ،¹أ‡·أژ, أ‡أپ·أژ½أƒأ€أ؛ »أ³أ€¸·أژ أ€أژµ¦½آ؛ °آھأ€أژ 61 ~ 108 ¸¦ أ€أ”·أ‚أ‡أکµµ µأ‡أپأ¶¸¸, -- أƒأںأˆأ„ أ‡أ‘¹أ¸ ´أµ أˆ®أ€أ¥أ‡أ’ °آ،´أ‰¼آ؛أ€» آ؟°µأژأ‡أڈآ؟© ½أƒأ€أ›½أƒ آ؛¯¼أ¶ µأژ°³¸¦ ´أµ ¹أµµ·أڈ أ‡أڈآ؟´´أ™. ----------------------------------------------------------------------------------
CREATE PROCEDURE _InsertDummySlotForExtention @BeginIndex tinyint, @EndIndex tinyint AS
-- أ€أ”·أ‚أ‡أ‘ أ€أژµ¦½آ؛ ¹أ¸أˆ£ أ€¯أˆآ؟¼آ؛ °أ‹»ç --------------------------------- IF(@BeginIndex > @EndIndex) BEGIN PRINT('½أƒأ€أ› أ€أژµ¦½آ؛ ¹أ¸أˆ£°آ، ³آ، أ€أژµ¦½آ؛ ¹أ¸أˆ£آ؛¸´أ™ أ…©´أ™!!!') RETURN END
-- أƒأں°آ،أ‡أ’ ´أµ¹أŒ½½·أ”آ؟آ، أ€أŒ¹أŒ ´أ™¸¥ ¾أ†أ€أŒأ…أ›أ€أŒ أ€أ–´أ‚أپأ¶ أˆ®أ€أژ --------------------------------------------------- IF EXISTS (SELECT CharID FROM _Inventory WHERE Slot >= @BeginIndex AND Slot <= @EndIndex AND ItemID <> 0) BEGIN PRINT('أƒأں°آ،أ‡أ’ ´أµ¹أŒ½½·أ”آ؟آ، أ€أŒ¹أŒ ´أ™¸¥ ¾أ†أ€أŒأ…أ›أ€أŒ أ€أ–´أ™!!!') RETURN END
-- ±âأپ¸ أ€أژآ؛¥أ…أ¤¸®آ؟آ، أ€أژµ¦½آ؛ ¹üأ€§آ؟آ، أ‡أک´çأ‡أڈ´أ‚ ½½·أ”أ€أŒ أ€أ–أ€»°أ¦آ؟أ¬ »èأپ¦ -------------------------------------------------------------- DELETE _Inventory WHERE Slot >= @BeginIndex AND Slot <= @EndIndex
BEGIN TRANSACTION
-- ±âأپ¸ _Inventoryآ؟آ، أƒأں°آ،µأ‡´أ‚ DummySlot أƒأں°آ، -------------------------------------------- INSERT _Inventory (CharID, Slot, ItemID) SELECT _Char.CharId, _RefDummySlot.cnt, 0 FROM _Char, _RefDummySlot WHERE _RefDummySlot.cnt >= @BeginIndex and _RefDummySlot.cnt <= @EndIndex and _Char.CharId <> 0 ORDER BY _Char.charid ASC
IF(@@ERROR = 0) BEGIN COMMIT TRANSACTION END ELSE BEGIN ROLLBACK TRANSACTION END
0 0 0 0 0 0 NULL 0
بس ملحوظه
عندى بروسيدور نفس الاسم الى طلع من الكويرى الى انتا مديهولى
_AddNewChar_THINH
|
عارف ملكش دعوه بده
شوف ردى عليك وقول يارب بس يرضو يتمسحو معاك
وبعد كده ابقى عدل على البروسيدور لو رضى بتاعك يتمسح فى الايتم اللى هينزل بيها الاكونت والفل والحاجات ديه المهم يتمسح اللى عندك الاول وتعمل ريفرش للداتا بيز او ريستارت لل SQL بعد كده روح على SRO_VT_SHARD و اعمل New Query ودخل واحد واحد من اللى اديتهملك ورستر البرنامج تانى او اعمل ريفرش وان شاء الله كله هيبقى تمام لأنى بصراحه عاوز انام :D
|
|
|
07-01-2017, 05:33 AM
|
#20
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: استفسار بخصوص _AddNewChar
كويرى AddTimedJob
جابلى succefly بعد ممسحت التاني
اما كويري _AddNewChar
جابلى كدا
Msg 213, Level 16, State 1, Procedure _AddNewChar, Line 256
Column name or number of supplied values does not match table definition.
|
|
التعديل الأخير تم بواسطة thedeathlist ; 07-01-2017 الساعة 05:37 AM
|
07-01-2017, 05:49 AM
|
#21
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
كويرى AddTimedJob
جابلى succefly بعد ممسحت التاني
اما كويري _AddNewChar
جابلى كدا
Msg 213, Level 16, State 1, Procedure _AddNewChar, Line 256
Column name or number of supplied values does not match table definition.
|
جرب تانى بده كده
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_AddTimedJob] Script Date: 07/01/2017 04:48:23 ص ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE 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
-----------------------------------------------------------------------------
-- 1. ?³¸¯?? ½½·O ³?¹?°? validC? °?AI??, ±×¸®°? ??½½·OA? ¸A´A?? ¸?A? ?¼?©C?´U.
-----------------------------------------------------------------------------
-- start by novice.
SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID
IF (@temp >= 4)
BEGIN
-- ³E¹« ¸¹A?³?
RETURN -2
END
-- finish by novice.
-----------------------------------------------------------------------------
-- 2. ?³¸¯?? ??°?CI±â
-----------------------------------------------------------------------------
IF (@CharScale > 68) -- 0100 0100 --> 68 A?´U!
BEGIN
-- ?³¸¯?? »?¼? ½C??! ½??EAI °?A? A?»?CI´U!
RETURN -3
END
EXEC @temp = _IsExistingCharName @CharName
IF (@temp <> 0)
BEGIN
-- A?¹? »ç?ë??AI A?¸§A?¶?´Aµ¥?
RETURN -4
END
BEGIN TRANSACTION
-- AI´?½?½??UA? Aû?ëµC¸é¼* ¸¶??¸·?? WorldID?? 1°?A» ´? ³?¾î ??¾?´U!
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
-- ?³¸¯?? »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -5
END
-- start by novice.
-- A??¦ Slot ¾E¾´´U.. ±×³E Insert ¸¸..
INSERT INTO _User VALUES (@UserJID, @NewCharID)
-- finish by novice.
-----------------------------------------------------------------------------
-- 3-1. A??? ½½·O ?¤??±â
-- [AI?¥??¸® ½½·O 96°³] + [A???½½·O 13°³] <- AI?¥??¸® E®A? ¼*??½? E? 48°³??¼* 96°³·I ??°?!!!(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
-- AI?¥??¸® »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -7
END
--PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!
-- µ????®·I ¼±??C? ¾?A??UA» ´U½? ³?¾î??A?...
/* ??·± ¼?¼*·I ?¤ACµC¾î A?´U.
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,
*/
DECLARE @ItemID BIGINT
SET @ItemID = 0
-- »?°©
IF (@RefMailID <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -8
END
END
-- ¹U??
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
-- ¹???
IF (@RefShield <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @RefShield, @DurShield
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -12
END
END
-- E¤½? default·I ¼±??C? ¹«±â°? E°A?¶?¸é E*»? 250°³µéA? E°?ëµµ CO²² ??´U. ?????
IF (@DefaultArrow <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -13
END
END
-----------------------------------------------------------------------------
-- 3-2. ¾?¹U?¸ Inventory ½½·O ?¤??±â
-- [¾?¹U?¸ AI?¥??¸® ½½·O 5°³]
-- APPLY_AVATAR_SYSTEMA? Aû?ëµC¸é¼* ??°?µC´A ?I??
-----------------------------------------------------------------------------
--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
-- ¾?¹U?¸ AI?¥??¸® »?¼? ½C??!
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
-- AI?¥??¸® »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -19
END
-----------------------------------------------------------------------------
-- CharList?? ID ³?¾î??±â
-----------------------------------------------------------------------------
INSERT _CharNameList VALUES(@CharName, @NewCharID)
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_SCROLL_RETURN_NEWBIE_01',20,1
-- Quick Slot ?¤?¸ A?A??ë!!!
exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
COMMIT TRANSACTION
RETURN @NewCharID
|
|
|
07-01-2017, 05:54 AM
|
#22
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: استفسار بخصوص _AddNewChar
نفس المشكله
Msg 213, Level 16, State 1, Procedure _AddNewChar, Line 259
Column name or number of supplied values does not match table definition.
|
|
|
07-01-2017, 06:02 AM
|
#23
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
نفس المشكله
Msg 213, Level 16, State 1, Procedure _AddNewChar, Line 259
Column name or number of supplied values does not match table definition.
|
جرب ديه كمان معلش المشكله انى مسحته وعملته تانى اكتر من مره ومعنديش اى مشكله انا مش فاهم الداتا بتاعتك ديه فيها ايه بالظبط تكونش ملبوسه ؟ :D
كود PHP:
CREATE 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
-----------------------------------------------------------------------------
-- 1. ?³¸¯?? ½½·O ³?¹?°? validC? °?AI??, ±×¸®°? ??½½·OA? ¸A´A?? ¸?A? ?¼?©C?´U.
-----------------------------------------------------------------------------
-- start by novice.
SELECT @temp = count(CharID) FROM _User WITH (NOLOCK) WHERE UserJID = @UserJID
IF (@temp >= 4)
BEGIN
-- ³E¹« ¸¹A?³?
RETURN -2
END
-- finish by novice.
-----------------------------------------------------------------------------
-- 2. ?³¸¯?? ??°?CI±â
-----------------------------------------------------------------------------
IF (@CharScale > 68) -- 0100 0100 --> 68 A?´U!
BEGIN
-- ?³¸¯?? »?¼? ½C??! ½??EAI °?A? A?»?CI´U!
RETURN -3
END
EXEC @temp = _IsExistingCharName @CharName
IF (@temp <> 0)
BEGIN
-- A?¹? »ç?ë??AI A?¸§A?¶?´Aµ¥?
RETURN -4
END
BEGIN TRANSACTION
-- AI´?½?½??UA? Aû?ëµC¸é¼* ¸¶??¸·?? WorldID?? 1°?A» ´? ³?¾î ??¾?´U!
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
-- ?³¸¯?? »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -5
END
-- start by novice.
-- A??¦ Slot ¾E¾´´U.. ±×³E Insert ¸¸..
INSERT INTO _User VALUES (@UserJID, @NewCharID)
-- finish by novice.
-----------------------------------------------------------------------------
-- 3-1. A??? ½½·O ?¤??±â
-- [AI?¥??¸® ½½·O 96°³] + [A???½½·O 13°³] <- AI?¥??¸® E®A? ¼*??½? E? 48°³??¼* 96°³·I ??°?!!!(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
-- AI?¥??¸® »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -7
END
--PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!PATCH WARNING!!!
-- µ????®·I ¼±??C? ¾?A??UA» ´U½? ³?¾î??A?...
/* ??·± ¼?¼*·I ?¤ACµC¾î A?´U.
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,
*/
DECLARE @ItemID BIGINT
SET @ItemID = 0
-- »?°©
IF (@RefMailID <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 1, @RefMailID, @DurMail
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -8
END
END
-- ¹U??
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
-- ¹???
IF (@RefShield <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @RefShield, @DurShield
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -12
END
END
-- E¤½? default·I ¼±??C? ¹«±â°? E°A?¶?¸é E*»? 250°³µéA? E°?ëµµ CO²² ??´U. ?????
IF (@DefaultArrow <> 0)
BEGIN
EXEC @ItemID = _FN_ADD_INITIAL_EQUIP @NewCharID, 7, @DefaultArrow, 250
IF (@ItemID <= 0)
BEGIN
ROLLBACK TRANSACTION
RETURN -13
END
END
-----------------------------------------------------------------------------
-- 3-2. ¾?¹U?¸ Inventory ½½·O ?¤??±â
-- [¾?¹U?¸ AI?¥??¸® ½½·O 5°³]
-- APPLY_AVATAR_SYSTEMA? Aû?ëµC¸é¼* ??°?µC´A ?I??
-----------------------------------------------------------------------------
--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
-- ¾?¹U?¸ AI?¥??¸® »?¼? ½C??!
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
-- AI?¥??¸® »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -19
END
*/
-----------------------------------------------------------------------------
-- CharList?? ID ³?¾î??±â
-----------------------------------------------------------------------------
INSERT _CharNameList VALUES(@CharName, @NewCharID)
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_60EXP_HELP',1,1
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_E060118_100EXP_HELP',1,1
exec _ADD_ITEM_EXTERN @CharName,'ITEM_ETC_SCROLL_RETURN_NEWBIE_01',20,1
-- Quick Slot ?¤?¸ A?A??ë!!!
exec _AddNewClientConfig @NewCharID -- by novice...... for saving client configurations...
COMMIT TRANSACTION
RETURN @NewCharID
|
|
|
07-01-2017, 06:06 AM
|
#24
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: استفسار بخصوص _AddNewChar
done اجرب بقا ومعلشى تعبتك معايا يا برنس الراسيس :D
|
|
|
07-01-2017, 06:11 AM
|
#25
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
done اجرب بقا ومعلشى تعبتك معايا يا برنس الراسيس :D
|
ولا يهمك تعبك راحه :D
بوص انا وقفتلك السطر ده اللى كان عامل معاك مشاكل
كود PHP:
/*-- Trijob ?¤??³?±â!!!!!
-----------------------------------------------------------------------------
INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0)
IF (@@ERROR <> 0)
BEGIN
-- AI?¥??¸® »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -19
END
*/
ابقى روح افتح البروسيدور وشيل منه العلامه اللى فوق ديه */
واللى تحت ديه */
ده لو قابلك مشاكل
|
|
|
07-01-2017, 06:15 AM
|
#26
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: استفسار بخصوص _AddNewChar
تمام انا الداتا الى انا شغال عليها دى عليها سيستم ان اللبس بيتجدد اوتوماتيك مع اللفل فهل الى احنا عملناه دا هياثر على حاجه من الكلام دا ؟؟
|
|
|
07-01-2017, 06:18 AM
|
#27
|
مشرف قسم CrossFire
|
• الانـتـسـاب » May 2010
|
• رقـم العـضـويـة » 70996
|
• المشـــاركـات » 3,556
|
• الـدولـة » مــصــر
|
• الـهـوايـة » Silkroad Service
|
• اسـم الـسـيـرفـر » Private Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 15
|
|
|
رد: استفسار بخصوص _AddNewChar
اقتباس:
المشاركة الأصلية كتبت بواسطة thedeathlist
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
تمام انا الداتا الى انا شغال عليها دى عليها سيستم ان اللبس بيتجدد اوتوماتيك مع اللفل فهل الى احنا عملناه دا هياثر على حاجه من الكلام دا ؟؟
|
جرب وشوف
يالا تصبح على خير :D ولو قابلتك مشاكل تانيه اعمل موضوع جديد بيها واحنا معاك :)
|
|
التعديل الأخير تم بواسطة Dev.Myth ; 07-01-2017 الساعة 06:21 AM
|
07-01-2017, 06:20 AM
|
#28
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: استفسار بخصوص _AddNewChar
الف شكر يا باشا وانتا من اهلو ^_^
|
|
|
07-01-2017, 07:42 AM
|
#29
|
|
• الانـتـسـاب » Jan 2017
|
• رقـم العـضـويـة » 131869
|
• المشـــاركـات » 99
|
• الـدولـة »
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
مشكله فى new account
اقتباس:
المشاركة الأصلية كتبت بواسطة Dev.Myth
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
ولا يهمك تعبك راحه :D
بوص انا وقفتلك السطر ده اللى كان عامل معاك مشاكل
كود PHP:
/*-- Trijob ?¤??³?±â!!!!!
-----------------------------------------------------------------------------
INSERT INTO _CharTrijob VALUES (@NewCharID, 0, 1, 0, 0, 0)
IF (@@ERROR <> 0)
BEGIN
-- AI?¥??¸® »?¼? ½C??!
ROLLBACK TRANSACTION
RETURN -19
END
*/
ابقى روح افتح البروسيدور وشيل منه العلامه اللى فوق ديه */
واللى تحت ديه */
ده لو قابلك مشاكل
|
مبدايا قابلنى مشكله
عملت اكونت جديد اتكريت بس مرديش يفتح وبيجبلى كدا
وجربت اشيل العلمات زى محضرتك اولت مرضاش جاب كدا
Msg 213, Level 16, State 1, Procedure _AddNewChar, Line 264
Column name or number of supplied values does not match table definition.
|
|
|
يتصفح الموضوع حالياً : 1 (0 عضو و 1 زائر)
|
|
ضوابط المشاركة
|
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك
كود HTML معطلة
|
|
|
الساعة الآن 09:52 PM.
|