about _RefPackitem table

Results 1 to 1 of 1
  1. #1
    Sorcerer Supreme egsro is offline
    Member +Rank
    Aug 2010 Join Date
    277Posts

    about _RefPackitem table

    well i'm writing my own query which it will help me to add custom items to the npc with the codename only !
    so all works as far as i can feel it now
    but i have a wired error shows if i tried to add another item ( the error cased by the Identity in _RefPackageitem)

    my codes
    Code:
    if not exists ( select ID from _RefPackageItem where ID = 1 )
    	SET @ID = '1'
    if exists ( select ID from _RefPackageItem where ID = 1 )
    	SET @ID = (SELECT TOP 1 ID FROM _RefObjCommon ORDER BY ID DESC )+1
    it works fine for the first item !
    but if i tried to add 2nd item it works fine but with a hecka high ID ! =
    but if i tried to add the 3rd item i get this error !

    so i wonder which part made this error ?

    ----------------------Edit
    already solved :D
    Code:
    if not exists ( select ID from _RefPackageItem where ID = 1 )
    	SET @ID = '1'
    if exists ( select ID from _RefPackageItem where ID = 1 )
    	SET @ID = (SELECT TOP 1 ID FROM _RefObjCommon ORDER BY ID DESC )+1
    it should be _RefPackageitem Not _RefObjCommon my bad sorry
    Last edited by egsro; 30-07-12 at 02:11 AM.




Advertisement