0'; // always rebuild this table from scratch // or how would i know what to fetch specifically DB::Aowow()->query('TRUNCATE TABLE ?_quests_startend'); foreach ($query as $q) { $data = DB::World()->select($q); foreach ($data as $d) DB::Aowow()->query('INSERT INTO ?_quests_startend (?#) VALUES (?a) ON DUPLICATE KEY UPDATE method = method | VALUES(method), eventId = IF(eventId = 0, VALUES(eventId), eventId)', array_keys($d), array_values($d)); } // update quests without start as unavailable Db::Aowow()->query('UPDATE ?_quests q LEFT JOIN ?_quests_startend qse ON qse.questId = q.id AND qse.method & 1 SET q.cuFlags = q.cuFlags | ?d WHERE qse.questId IS NULL', CUSTOM_UNAVAILABLE); return true; } }); ?>