function onUse(cid, item, fromPosition, itemEx, toPosition) if not canPlayerWearOutfitId(cid, 23) then doPlayerAddOutfitId(cid, 23, 0) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED) doCreatureSay(cid, 'You\'ve been granted access to the abandoned king\'s castle.', TALKTYPE_ORANGE_1) else doPlayerSendCancel(cid, 'You have already completed this quest.') end return true end