|
• الانـتـسـاب » Jun 2013
|
• رقـم العـضـويـة » 112274
|
• المشـــاركـات » 98
|
• الـدولـة » Qena
|
• الـهـوايـة »
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
اقتباس:
المشاركة الأصلية كتبت بواسطة Nour_Eldin
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
New Query
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_AddNewChar] Script Date: 11/21/2014 7:52:07 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
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
-----------------------------------------------------------------------------
-- 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
|
فيه 4 add new char and add new char_original and add new char_thing and add new char_vechi
|