[MU] QUerry thế hệ NBB Ai rành vào giúp mình với nhé
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Kết quả 1 đến 3 của 3
  1. #1
    Thành Viên
    Ngày tham gia
    Dec 2011
    Bài viết
    85
    Thanks
    89
    Thanked 5 Times in 5 Posts

    QUerry thế hệ NBB Ai rành vào giúp mình với nhé

    CREATE TRIGGER TheHe
    ON [dbo].[MEMB_STAT]
    FOR UPDATE
    AS
    BEGIN
    DECLARE
    @slg_thehe tinyint,
    @Acc nvarchar(10),
    @TheHe nvarchar(50),
    @SV nvarchar (20)

    SET @slg_thehe =2


    -- Check tai khoan adm_block
    IF NOT EXISTS (SELECT memb___id FROM MEMB_INFO WHERE memb___id='adm_block')
    BEGIN
    INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name) VALUES ('adm_block',[dbo].[fn_md5]('132465798','adm_block'),'ADMBLOCK')
    END

    -- Block tai khoan
    UPDATE MEMB_INFO SET bloc_code=1 WHERE memb___id='adm_block' AND bloc_code<>1

    -- Tao nhan vat 1
    IF NOT EXISTS (SELECT Name FROM Character WHERE Name='NhamSV1' AND AccountID='adm_block')
    BEGIN
    DELETE Character WHERE Name='NhamSV1' AND AccountID<>'adm_block'
    EXEC WZ_CreateCharacter 'adm_block', 'NhamSV1', 0
    END
    -- Tao nhan vat 2
    IF NOT EXISTS (SELECT Name FROM Character WHERE Name='NhamSV2' AND AccountID='adm_block')
    BEGIN
    DELETE Character WHERE Name='NhamSV2' AND AccountID<>'adm_block'
    EXEC WZ_CreateCharacter 'adm_block', 'NhamSV2', 32
    END
    -- Tao nhan vat 3
    IF NOT EXISTS (SELECT Name FROM Character WHERE Name='NhamSV3' AND AccountID='adm_block')
    BEGIN
    DELETE Character WHERE Name='NhamSV3' AND AccountID<>'adm_block'
    EXEC WZ_CreateCharacter 'adm_block', 'NhamSV3', 64
    END
    -- Tao nhan vat 4
    IF NOT EXISTS (SELECT Name FROM Character WHERE Name='NhamSV4' AND AccountID='adm_block')
    BEGIN
    DELETE Character WHERE Name='NhamSV4' AND AccountID<>'adm_block'
    EXEC WZ_CreateCharacter 'adm_block', 'NhamSV4', 80
    END
    -- Tao nhan vat 5
    IF NOT EXISTS (SELECT Name FROM Character WHERE Name='NhamSV5' AND AccountID='adm_block')
    BEGIN
    DELETE Character WHERE Name='NhamSV5' AND AccountID<>'adm_block'
    EXEC WZ_CreateCharacter 'adm_block', 'NhamSV5', 16
    END

    -- Block nhan vat thuoc tai khoan adm_block
    UPDATE Character SET CtlCode=99 WHERE AccountID='adm_block' AND CtlCode<>99
    -- END CHECK ACC ADM_BLOCK

    SELECT @Acc=memb___id,@SV=ServerName FROM inserted WHERE ConnectStat='1'
    SELECT @TheHe=thehe FROM MEMB_INFO WHERE memb___id=@Acc

    -- BEGIN Khong ap dung The he
    if(@slg_thehe=2)
    BEGIN
    UPDATE Character SET CtlCode=0 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=0 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE Character SET CtlCode=18 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=1 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE AccountCharacter SET GameID1='' WHERE GameID1='NhamSV1' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID2='' WHERE GameID2='NhamSV2' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID3='' WHERE GameID3='NhamSV3' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID4='' WHERE GameID4='NhamSV4' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID5='' WHERE GameID5='NhamSV5' AND Id=@Acc AND Id!='adm_block'
    END
    -- END Khong ap dung The he
    ELSE
    BEGIN
    -- BEGIN Ap dung the he
    -- The he 1
    IF( @TheHe=1 )
    BEGIN
    IF( @SV='SV1-1' OR @SV='SV1-2' OR @SV='SV1-3' OR @SV='SV1-4' OR @SV='SV1-5' OR @SV='LSV-CS' OR @SV='SV1-6' OR @SV='SV1-7' OR @SV='SV1-8' )
    BEGIN
    UPDATE Character SET CtlCode=0 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=0 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE Character SET CtlCode=18 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=1 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE AccountCharacter SET GameID1='' WHERE GameID1='NhamSV1' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID2='' WHERE GameID2='NhamSV2' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID3='' WHERE GameID3='NhamSV3' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID4='' WHERE GameID4='NhamSV4' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID5='' WHERE GameID5='NhamSV5' AND Id=@Acc AND Id!='adm_block'
    END
    ELSE
    BEGIN
    UPDATE Character SET CtlCode=99 WHERE AccountID!='adm_block' AND AccountID=@Acc AND (CtlCode=0 OR CtlCode=18) AND ErrorSubBlock!=99 AND AccountID NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID1='NhamSV1' WHERE Id=@Acc AND (GameID1 IS NULL OR GameID1='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID2='NhamSV2' WHERE Id=@Acc AND (GameID2 IS NULL OR GameID2='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID3='NhamSV3' WHERE Id=@Acc AND (GameID3 IS NULL OR GameID3='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID4='NhamSV4' WHERE Id=@Acc AND (GameID4 IS NULL OR GameID4='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID5='NhamSV5' WHERE Id=@Acc AND (GameID5 IS NULL OR GameID5='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    END
    END
    -- The he 2
    ELSE IF( @TheHe=2 )
    BEGIN
    IF( @SV='SV2-1' OR @SV='SV2-2' OR @SV='SV2-3' OR @SV='SV2-4' OR @SV='SV2-5' )
    BEGIN
    UPDATE Character SET CtlCode=0 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=0 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE Character SET CtlCode=18 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=1 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE AccountCharacter SET GameID1='' WHERE GameID1='NhamSV1' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID2='' WHERE GameID2='NhamSV2' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID3='' WHERE GameID3='NhamSV3' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID4='' WHERE GameID4='NhamSV4' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID5='' WHERE GameID5='NhamSV5' AND Id=@Acc AND Id!='adm_block'
    END
    ELSE
    BEGIN
    UPDATE Character SET CtlCode=99 WHERE AccountID!='adm_block' AND AccountID=@Acc AND (CtlCode=0 OR CtlCode=18) AND ErrorSubBlock!=99 AND AccountID NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID1='NhamSV1' WHERE Id=@Acc AND (GameID1 IS NULL OR GameID1='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID2='NhamSV2' WHERE Id=@Acc AND (GameID2 IS NULL OR GameID2='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID3='NhamSV3' WHERE Id=@Acc AND (GameID3 IS NULL OR GameID3='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID4='NhamSV4' WHERE Id=@Acc AND (GameID4 IS NULL OR GameID4='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID5='NhamSV5' WHERE Id=@Acc AND (GameID5 IS NULL OR GameID5='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    END
    END
    -- The he 3
    ELSE IF( @TheHe=3 )
    BEGIN
    IF( @SV='SV3-1' OR @SV='SV3-2' OR @SV='SV3-3' OR @SV='SV3-4' OR @SV='SV3-CS' OR @SV='SVEvent-1' )
    BEGIN
    UPDATE Character SET CtlCode=0 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=0 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE Character SET CtlCode=18 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=1 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE AccountCharacter SET GameID1='' WHERE GameID1='NhamSV1' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID2='' WHERE GameID2='NhamSV2' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID3='' WHERE GameID3='NhamSV3' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID4='' WHERE GameID4='NhamSV4' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID5='' WHERE GameID5='NhamSV5' AND Id=@Acc AND Id!='adm_block'
    END
    ELSE
    BEGIN
    UPDATE Character SET CtlCode=99 WHERE AccountID!='adm_block' AND AccountID=@Acc AND (CtlCode=0 OR CtlCode=18) AND ErrorSubBlock!=99 AND AccountID NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID1='NhamSV1' WHERE Id=@Acc AND (GameID1 IS NULL OR GameID1='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID2='NhamSV2' WHERE Id=@Acc AND (GameID2 IS NULL OR GameID2='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID3='NhamSV3' WHERE Id=@Acc AND (GameID3 IS NULL OR GameID3='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID4='NhamSV4' WHERE Id=@Acc AND (GameID4 IS NULL OR GameID4='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID5='NhamSV5' WHERE Id=@Acc AND (GameID5 IS NULL OR GameID5='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    END
    END
    -- The he 5 : Event
    ELSE IF( @TheHe=5 )
    BEGIN
    IF( @SV='SvEvent-1' OR @SV='SvEvent-2' OR @SV='SvEvent-3' )
    BEGIN
    UPDATE Character SET CtlCode=0 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=0 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE Character SET CtlCode=18 WHERE AccountID=@Acc AND CtlCode=99 AND khoado=1 AND AccountID!='adm_block' AND ErrorSubBlock!=99
    UPDATE AccountCharacter SET GameID1='' WHERE GameID1='NhamSV1' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID2='' WHERE GameID2='NhamSV2' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID3='' WHERE GameID3='NhamSV3' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID4='' WHERE GameID4='NhamSV4' AND Id=@Acc AND Id!='adm_block'
    UPDATE AccountCharacter SET GameID5='' WHERE GameID5='NhamSV5' AND Id=@Acc AND Id!='adm_block'
    END
    ELSE
    BEGIN
    UPDATE Character SET CtlCode=99 WHERE AccountID!='adm_block' AND AccountID=@Acc AND (CtlCode=0 OR CtlCode=18) AND ErrorSubBlock!=99 AND AccountID NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID1='NhamSV1' WHERE Id=@Acc AND (GameID1 IS NULL OR GameID1='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID2='NhamSV2' WHERE Id=@Acc AND (GameID2 IS NULL OR GameID2='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID3='NhamSV3' WHERE Id=@Acc AND (GameID3 IS NULL OR GameID3='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID4='NhamSV4' WHERE Id=@Acc AND (GameID4 IS NULL OR GameID4='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID5='NhamSV5' WHERE Id=@Acc AND (GameID5 IS NULL OR GameID5='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    END
    END
    -- The he khac : block all sv
    ELSE
    BEGIN
    UPDATE Character SET CtlCode=99 WHERE AccountID!='adm_block' AND AccountID=@Acc AND (CtlCode=0 OR CtlCode=18) AND ErrorSubBlock!=99 AND AccountID NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID1='NhamSV1' WHERE Id=@Acc AND (GameID1 IS NULL OR GameID1='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID2='NhamSV2' WHERE Id=@Acc AND (GameID2 IS NULL OR GameID2='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID3='NhamSV3' WHERE Id=@Acc AND (GameID3 IS NULL OR GameID3='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID4='NhamSV4' WHERE Id=@Acc AND (GameID4 IS NULL OR GameID4='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    UPDATE AccountCharacter SET GameID5='NhamSV5' WHERE Id=@Acc AND (GameID5 IS NULL OR GameID5='') AND Id!='adm_block' AND Id NOT IN (SELECT DISTINCT AccountID FROM Character WHERE CtlCode = 32)
    END
    -- END Ap dung the he
    END
    END












    Mình làm theo cái này.
    Web đã tách thế hệ 2 rồi.
    Và mình không biết làm sao trong game nó tách thế hệ 2.
    Vì ở web đăg ký + ok. Còn đăng nhập cả 2 sv đều ko khóa.
    Thế hệ 1 login thế hệ 2 đều ok
    Ai Biết config chỉ mình với làm sao để mình dùng thế hệ 1 và thế hệ 2 ok

    Tên SV mình đặt đúng
    Thế hệ 1 = SV1-1 đến SV1-5
    Thế hệ 2 = SV2-1 đến SV2-5

    Ai giúp mìh với
    Tks nhiều
    Khách viếng thăm hãy cùng prono1 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Vi phạm quy định
    Ngày tham gia
    Mar 2012
    Đang ở
    Nhà Nghỉ
    Bài viết
    1,861
    Thanks
    480
    Thanked 774 Times in 510 Posts

    Ðề: QUerry thế hệ NBB Ai rành vào giúp mình với nhé

    Bạn sang bài hướng dẫn của mình tham khảo xem

    [Only registered and activated users can see links. ]
    Khách viếng thăm hãy cùng heroviet2301 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  3. #3
    Thành Viên
    Ngày tham gia
    Dec 2011
    Bài viết
    85
    Thanks
    89
    Thanked 5 Times in 5 Posts

    Ðề: QUerry thế hệ NBB Ai rành vào giúp mình với nhé

    Trích dẫn Gửi bởi heroviet2301 [Only registered and activated users can see links. ]
    Bạn sang bài hướng dẫn của mình tham khảo xem

    [Only registered and activated users can see links. ]
    Query của bạn khác với bản mới này
    Bạn xem thử mình sai ở đâu với trigger mới của nbb này
    Khách viếng thăm hãy cùng prono1 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

Các Chủ đề tương tự

  1. [MU] Xin querry này ai có cho nhé
    Bởi membermoi trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 7
    Bài viết cuối: 21-09-12, 05:12 AM
  2. [MU] Xin Querry đổi tên nhân vật ss6.3
    Bởi thusinh198xx trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 3
    Bài viết cuối: 23-08-12, 10:35 AM
  3. [MU] Xin hỏi querry tạo nhân vật GM
    Bởi luutrunhac trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 2
    Bài viết cuối: 02-06-12, 11:31 AM
  4. Cho Hỏi Về Querry
    Bởi dianguc.vn trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 0
    Bài viết cuối: 25-10-11, 12:39 PM
  5. Cách Tặng Zen Vào Thùng Đồ - Hoặc Querry tặng Zen Vào Thùng Đồ
    Bởi mrrainnt trong diễn đàn Hỏi Đáp/ Yêu Cầu
    Trả lời: 8
    Bài viết cuối: 07-09-11, 05:06 PM

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 09:16 AM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.