Fix bug sheild and towhand

M3ar8C

عضو
2 فبراير 2017
30
13
1
11
Giza

المستوي:

موضوع بسيط كدا في ناس بتعمل بج بيمسكوا سلاح twohand مع الـ Shield فى نفس الوقت أياً كان بقا 2h , axe , dagger , xbow , staff , etc
والاكونت بياخد كراش بعد ميعمل البج

الكيوري بتحطها فى AddLogChar فى الشارد لوج ،، هتمنع البج دا خالص ،،

كود:
IF @EventID in (4,6)
Begin
 Declare @WeaponID Int , @ShieldID Int , @RefWeaponID Int , @Slot Int
 Set @WeaponID = (Select ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and Slot = 6)
 Set @ShieldID = (Select ItemID From [SRO_VT_SHARD].[dbo].[_Inventory] Where CharID = @CharID and Slot = 7)
 IF @ShieldID > 0 and @WeaponID > 0
  Begin
   Set @RefWeaponID = (Select RefItemID From [SRO_VT_SHARD].[dbo].[_Items] Where ID64 = @WeaponID)
   IF @RefWeaponID Is Not Null and @RefWeaponID in
   (Select ID From [SRO_VT_SHARD].[dbo].[_RefObjCommon] Where CodeName128 Like 'ITEM_CH_SPEAR_%'
   Or CodeName128 Like 'ITEM_CH_TBLADE_%' Or CodeName128 Like 'ITEM_CH_BOW_%'
   Or CodeName128 Like 'ITEM_EU_TSWORD_%' Or CodeName128 Like 'ITEM_EU_AXE_%'
   Or CodeName128 Like 'ITEM_EU_DAGGER_%' Or CodeName128 Like 'ITEM_EU_CROSSBOW_%'
   Or CodeName128 Like 'ITEM_EU_TSTAFF_%' Or CodeName128 Like 'ITEM_EU_HARP_%')
   Begin
    Set @Slot = (Select Top 1 Slot From [SRO_VT_SHARD].[dbo].[_Inventory] Where ItemID = 0 and CharID = @CharID and Slot > 12 Order by Slot)
    IF @Slot Is Not Null
     Begin
      Update [SRO_VT_SHARD].[dbo].[_Inventory] Set ItemID = 0 Where Slot = 7 and CharID = @CharID
      Update [SRO_VT_SHARD].[dbo].[_Inventory] Set ItemID = @ShieldID Where Slot = @Slot and CharID = @CharID
     End
   End
  End
End