local idx = item . get_socket ( 0 ) if idx == 0 then idx = number ( 3 , 9 ) item . set_socket ( 0 , idx ) end if idx > table . getn ( special . questscroll ) or idx <= 0 then item . remove ( ) elseif table . getn ( special . questscroll [ idx ] ) ~= 5 then else local table = special . questscroll [ idx ] local rt = special . questscroll_reward [ idx ] local t = table [ 1 ] if t == QUEST_SCROLL_TYPE_KILL_MOB then say ( table [ 2 ] ) say ( color ( 1 , 1 , 0 ) , rt [ 2 ] , locale . gold , " " , locale . exp , rt [ 3 ] , " " , ( rt [ 4 ] ~= 0 ) and item_name ( rt [ 4 ] ) or "" , " " , ( rt [ 5 ] ~= 0 ) and item_name ( rt [ 5 ] ) or "" , " " , ( rt [ 6 ] ~= 0 ) and item_name ( rt [ 6 ] ) or "" , color ( 1 , 1 , 1 ) ) pc . setqf ( "idx" , idx ) pc . setqf ( "count" , table [ 5 ] ) pc . setqf ( "target" , mob_vnum ( table [ 4 ] ) ) q . set_title ( table [ 3 ] ) q . set_counter ( table [ 4 ] , table [ 5 ] ) q . start ( ) pc . setqf ( "timer" , 24 * 60 * 60 ) setstate ( "kill_mob" ) item . remove ( ) char_log ( 0 , "QUEST" , "questscroll2 start" ) ; elseif t == QUEST_SCROLL_TYPE_KILL_ANOTHER_EMPIRE then say ( table [ 2 ] ) pc . setqf ( "idx" , idx ) pc . setqf ( "count" , table [ 5 ] ) q . set_title ( table [ 3 ] ) q . set_counter ( table [ 4 ] , table [ 5 ] ) q . start ( ) pc . setqf ( "timer" , 24 * 60 * 60 ) setstate ( "kill_another_empire" ) item . remove ( ) else item . remove ( ) end end